コード例 #1
0
ファイル: facts.php プロジェクト: Andry2/Facts
$content = array('main', 'categor', 'item_fact', 'info');
if (!isset($_SESSION['user'])) {
    $_SESSION['user'] = 1;
    $_SESSION['login'] = "";
    $_SESSION['password'] = "";
}
if (isset($_GET['exit'])) {
    unset($_SESSION['login']);
    unset($_SESSION['password']);
    unset($_SESSION['open']);
    echo "<script>document.location.replace('facts.php?views=categor');</script>";
}
if (isset($_POST['open'])) {
    $_SESSION['login'] = $_POST['login'];
    $_SESSION['password'] = $_POST['password'];
    $acount = new Acount($_SESSION['login'], $_SESSION['password']);
    $open_sesion = $acount->open_acount();
    if ($open_sesion) {
        $_SESSION['open'] = 1;
    } else {
        ?>
    <script>
    alert('Не вірний логін або пароль, повторіть ще раз');
    </script>
    <?php 
    }
}
?>
      

    <div class="jumbotron" >
コード例 #2
0
 public function oderhistoryAction()
 {
     $check_login = new Acount();
     $check_login->checklogin();
     $this->datalayout();
     $session_user = new Container('userlogin');
     $id_Us = $session_user->idus;
     $data = $this->getOderTable()->getoder_user($id_Us);
     foreach ($data as $key => $value) {
         $id_oder = $value['order_Id'];
         $total_product[$id_oder] = $this->getOderdetailTable()->gettoatl_oder_user($id_oder);
         //Lấy hóa đon chi tiết theo id_ hóa đơn
         foreach ($total_product[$id_oder] as $key1 => $value1) {
             // Lây thông tin sản phẩm theo Id sản phaamrtrong hóa dơn chi tiết
             $id_product = $value1['product_Id'];
             $dataproduct[$id_product] = $this->getProductTable()->product_viewcart($id_product);
         }
     }
     return array('data' => $data, 'total_product' => $total_product, 'data_product' => $dataproduct);
 }
コード例 #3
0
 public function updatepass_user($id, Acount $obj)
 {
     $data = $obj->datapass();
     $sqlEx = $this->sql->update();
     $sqlEx->table($this->table);
     $sqlEx->set($data);
     $sqlEx->where(array('ID' => $id));
     $pst = $this->sql->prepareStatementForSqlObject($sqlEx);
     $result = $pst->execute();
     if ($result != null) {
         return TRUE;
     } else {
         return FALSE;
     }
 }