Пример #1
0
 public static function Save()
 {
     $site = new Site();
     $site = $site->getSession();
     $log_user = Tool::getLoginUser();
     if (isset($_POST["language"]) && !empty($_POST["language"])) {
         $site->setlanguage($_POST["language"]);
     }
     $site->UpdateDatabase($log_user);
     $site->setSession();
     header("Location:../?menu=" . PAGE_SITE_CONFIGURE);
     die;
 }
Пример #2
0
 public static function Page($array)
 {
     $log_user = Tool::getLoginUser();
     if ($array[0] == CREATE) {
         header("Location:../?menu=" . PAGE_FOOD . "&" . VIEW . "=" . CREATE);
     } elseif ($array[0] == EDIT) {
         $food = new Food();
         $food->setId($_GET['id']);
         $food->readDatabase();
         SessionHandlers::saveSession($user, 'edit_food');
         header("Location:../?menu=" . PAGE_FOOD . "&" . VIEW . "=" . EDIT);
     } elseif ($array[0] == SHOWHIDE) {
         header("Location:../?menu=" . PAGE_FOOD . "&cache=" . $_GET['cache']);
     } elseif ($array[0] == REFRESH) {
         header("Location:../?menu=" . PAGE_FOOD);
     } elseif ($array[0] == FRAME) {
         $food = new Food();
         //print_r($food->readDatabaseAll ());
         SessionHandlers::saveSession($food->readDatabaseAll(), 'foodList');
         header("Location:../?menu=" . PAGE_FOOD . "&" . VIEW . "=" . FRAME);
     } else {
         echo "page not found";
     }
     exit;
 }
Пример #3
0
<!--
===========================================================
BEGIN PAGE
===========================================================
-->
<?php 
Tool::getLoginUser();
?>
<div class="login-header text-center">
	<img src="assets/img/logo-login.png" class="logo" alt="Logo">
</div>
<div class="login-wrapper">
	<form role="form" method="post" action="controls/UserControl.php?<?php 
echo CREATE;
?>
">
		<div class="form-group has-feedback lg left-feedback no-label">
		  <input name="name" type="text" class="form-control no-border input-lg rounded" placeholder="<?php 
i18n::getLabel("message.user.register.fullname");
?>
" autofocus>
		  <span class="fa fa-male form-control-feedback"></span>
		</div>
		<div class="form-group has-feedback lg left-feedback no-label">
		  <input  name="username" type="text" class="form-control no-border input-lg rounded" placeholder="<?php 
i18n::getLabel("message.user.register.username");
?>
">
		  <span class="fa fa-user form-control-feedback"></span>
		</div>
		<div class="form-group has-feedback lg left-feedback no-label">
Пример #4
0
 public static function UserNameValidate()
 {
     $log_user = Tool::getLoginUser();
     header('Content-type: application/json');
     echo json_encode(array('valid' => true));
     return true;
 }
Пример #5
0
$site = new Site();
if (!$site->isSetSession()) {
    $site->setlanguage("en");
    $site->setSession();
} else {
    $site = $site->getSession();
}
// check language to show
SessionHandlers::checkSession();
$_SESSION["locale"] = $site->getlanguage();
if ($_SESSION["locale"] == "kh") {
    echo "<style> * { font-family: 'Khmer OS System','Khmer OS','Khmer OS Muol','Khmer OS Battambang'; !important }</style>";
}
$user1 = new User();
if ($user1->isLogin()) {
    $log_user = Tool::getLoginUser();
    if (!$site->isExist($log_user)) {
        $site->setrefUser($log_user->getId());
        $site->insertDatabase($log_user);
    } else {
        $site->setrefUser($log_user->getId());
        $site->setSessionByUser();
    }
    // HTML HEAD
    require_once 'public/masterPages/head.php';
    // BODY
    $frame = false;
    $clearMargin = "style='margin: 0px; padding: 0px;'";
    if (!isset($_GET[VIEW]) || $_GET[VIEW] != FRAME) {
        $frame = true;
        $clearMargin = '';