Esempio n. 1
0
if (strtoupper($orderBy) == "ASC") {
    $orderBy = "ASC";
} else {
    $orderBy = "DESC";
}
$sortBy = "time";
if (isset($_GET["sortBy"])) {
    $sortBy = $_GET["sortBy"];
} else {
    if (isset($_POST["sortBy"])) {
        $sortBy = $_POST["sortBy"];
    }
}
$SQL = "SELECT * FROM " . TBL_GAME_USER_FEEDBACK . " ORDER BY " . $sortBy . " " . $orderBy . " LIMIT " . ($page - 1) * $pageCount . "," . $pageCount;
$feedBackList = GameUserFeeedback::findBySql(DBUtils::getConnection(), $SQL);
$total_feedback = GameUserFeeedback::getTotalCount();
$max_page = intval($total_feedback / $pageCount);
if ($total_feedback % $pageCount > 0) {
    $max_page++;
}
$queryString = "";
if (isset($_GET) && sizeof($_GET) > 0) {
    foreach ($_GET as $key => $value) {
        if ($key != "page") {
            $queryString = $queryString . "&" . $key . "=" . $value;
        }
    }
}
if (strtoupper($orderBy) == "ASC") {
    $orderBy = "DESC";
} else {
 /**
  * get single GameUserFeeedback instance from a DOMElement
  *
  * @param DOMElement $node
  * @return GameUserFeeedback
  */
 public static function fromDOMElement(DOMElement $node)
 {
     $o = new GameUserFeeedback();
     $o->assignByHash(self::domNodeToHash($node, self::$FIELD_NAMES, self::$DEFAULT_VALUES, self::$FIELD_TYPES));
     $o->notifyPristine();
     return $o;
 }
if (isset($_GET['userId'])) {
    $userId = $_GET['userId'];
} else {
    if (isset($_POST['userId'])) {
        $userId = $_POST['userId'];
    }
}
$email = "";
if (isset($_GET['email'])) {
    $email = $_GET['email'];
} else {
    if (isset($_POST['email'])) {
        $email = $_POST['email'];
    }
}
$message = "";
if (isset($_GET['message'])) {
    $message = $_GET['message'];
} else {
    if (isset($_POST['message'])) {
        $message = $_POST['message'];
    }
}
$feedback = new GameUserFeeedback();
$feedback->setUserId($userId);
$feedback->setMessage($message);
$feedback->setEmail(strtolower($email));
$feedback->setTime(time());
$feedback->insertIntoDatabase(DBUtils::getConnection());
//$html = "<body><h2>User Id : " . $userId . "</h2><h3>Email : " . $email . "</h3><h4>" . $message . "</h4></body>";
//MailUtil::sendSESFromHtml($html, AWS_SES_API_TO_ADMIN, "TavlaMania FeedBack");