Пример #1
0
<?php

require_once "administrator/process/class/class.Feedback.php";
require_once "administrator/includes/injection.php";
require_once "deny/connector.php";
$title = sqlInjection($_POST['title']);
$name = sqlInjection($_POST['fullname']);
$email = sqlInjection($_POST['email']);
$content = sqlInjection($_POST['content']);
$error = "";
$_SESSION['FBERROR'] = "";
if (isset($_POST['submit'])) {
    if ($_POST['captcha'] == $_SESSION['CODE']) {
        $fb = new Feedback();
        $fb->insert($title, $name, $email, $content);
        $_SESSION['FBERROR'] = 'Bạn đã gửi thành công.';
    } else {
        $_SESSION['FBERROR'] = '- Sai mã xác nhận !';
    }
}
?>
<script language="javascript">
var error="";

function changeImage(){
	document.getElementById('imgcaptcha').src="captcha/captcha.php";
}

function checkEmpty(elementId,errorMessage)
{
	x1 = document.getElementById(elementId);
Пример #2
0
<?php

include 'feedback.php';
$feedback = new Feedback();
$feedback['name'] = $_POST['name'];
$feedback['email'] = $_POST['email'];
$feedback['subject'] = $_POST['subject'];
$feedback['msg'] = $_POST['msg'];
$res = $feedback->insert();
echo "{$res}";
Пример #3
0
<?php

require_once '/../modal/core/setup.php';
if (Input::exist() && $user->isLoggedIn()) {
    $feedback = new Feedback();
    try {
        $feedback->insert($user->data()->userID, Input::get('type'), Input::get('feedback'));
    } catch (Exception $e) {
        die($e->getMessage());
    }
    //force refresh
    header('Location: /TCS/feedback');
}
exit;
 public static function submitFeedback()
 {
     $captcha = Core::validate(self::getVar('captcha'));
     $right_code = Session::getSessionVariable('security_code');
     Session::unsetSessionVariable('security_code');
     if ($captcha != $right_code) {
         Core::printErrorJson('Incorrect captcha');
         exit;
     }
     $usr = self::getCurrentUser(1);
     if (!isset($usr)) {
         header('Location: /');
         exit;
     }
     $feedback = array();
     $feedback['type'] = Core::validate(self::getVar('trouble-type'));
     $feedback['message'] = Core::validate(self::getVar('trouble'));
     $feedback['email'] = Core::validate(self::getVar('email'));
     $fbModel = new Feedback();
     $fbModel->setUID($usr->getId());
     $fbModel->setType($feedback['type']);
     $fbModel->setMessage($feedback['message']);
     $fbModel->setEmail($feedback['email']);
     $fbModel->insert();
     Core::printSuccessJson('Your ticket is active now!');
 }