<?php

session_start();
include 'connectionclass/connect.php';
include 'connectionclass/function.php';
include 'connectionclass/metencrypt.php';
$db = new MyConnection();
$db->connect();
mysql_query("SET NAMES 'UTF8'");
$error = "";
$localIP = getHostByName(getHostName());
if (isset($_POST['btnsave'])) {
    $txtusername = $_POST['txtusername'];
    $password = $_POST['txtpassword'];
    $cboLanguage = post('cboLanguage');
    $encrypted_txt = encrypt_decrypt('encrypt', $password);
    $select = $db->query("CALL spUserAccSelete('" . $txtusername . "','" . $encrypted_txt . "');");
    $numrow = $db->dbCountRows($select);
    if ($numrow > 0) {
        $row = $db->fetch($select);
        $UserID = $row->UserID;
        $Level = $row->UserLever;
        $BranchID = $row->BranchID;
        $BranchName = $row->BranchName;
        $_SESSION['UserID'] = $UserID;
        $_SESSION['user'] = $txtusername;
        $_SESSION['Level'] = $Level;
        $_SESSION['BranchID'] = $BranchID;
        $_SESSION['BranchName'] = $BranchName;
        $_SESSION['startDate'] = date("Y-m-d H:i:s");
        $_SESSION['cboLanguage'] = $cboLanguage;
Example #2
0
 protected function DoOpen()
 {
     $this->queryResult = mysql_query($this->GetSQL(), $this->myConnection->GetConnectionHandle());
     if ($this->queryResult) {
         return true;
     } else {
         return false;
     }
 }
<?php

include 'header.php';
include 'menu.php';
$db = new MyConnection();
$db->connect();
$id = get('id');
$delete = $db->query("Call sp_Branch_Delete('" . $id . "')");
if ($delete) {
    cRedirect('Branch.php');
} else {
    echo mysql_error();
}
include 'footer.php';
/*
echo "<td>
        <a href='DeleteImage.php?ID=".$row[0]."&IMAGE=".$row[1]."&PATH=".$path." ' onclick=\"return confirm('Do you want to delete this group?');\"><img src='IMAGES/deletegroup.png' /></a> 
        
       </td>";*/
?>


<?php

session_start();
include 'connectionclass/connect.php';
include 'connectionclass/function.php';
$db = new MyConnection();
$db->connect();
mysql_query("SET NAMES 'UTF8'");
$LoginDate = $_SESSION['startDate'];
$UserID = $_SESSION['UserID'];
$date = new DateTime('now', new DateTimeZone('ICT'));
$_SESSION['LogoutNow'] = $date->format('d-m-Y H:i:s');
$LogoutDate = $_SESSION['LogoutNow'];
/*echo $UserID . '<br>';
echo $LoginDate.'<br>';
echo $LogoutDate;*/
$Insert = $db->query("INSERT INTO tbluserhistory (UserID,UserHistoryStartDate,UserHistoryEndDate) VALUES ('" . $UserID . "','" . $LoginDate . "',Now())");
session_destroy();
cRedirect('login.php');
<?php

session_start();
if (!$_SESSION['user']) {
    //if(!$_SESSION['user'] || $_SESSION['ComID'] != 1){
    header('location:login.php');
}
include 'connectionclass/connect.php';
include 'connectionclass/function.php';
include 'connectionclass/metencrypt.php';
$db = new MyConnection();
$db->connect();
mysql_query("SET NAMES 'UTF8'");
$U_id = $_SESSION['UserID'];
$U_Acc = $_SESSION['user'];
$U_Brandid = $_SESSION['BranchID'];
$U_Branchname = $_SESSION['BranchName'];
$ip = $_SERVER['REMOTE_ADDR'];
$txtSearch = get('txtSearch');
$txtFrom = get('txtFrom');
$txtTo = get('txtTo');
$gettxtuser = get('txtuser');
$cboTransaction = get('cboTransaction');
$searchBranch = get('searchBranch');
// Call Date Location
date_default_timezone_set('Asia/Bangkok');
$date_now = date("Y-m-d H:i:s");
$date = date("Y-m-d");
$datetomorow = date("Y-m-d", date(strtotime("+1 day", strtotime($date))));
/*$db->disconnect();
	$db->connect();*/
<?php

include 'header.php';
include 'menu.php';
$db = new MyConnection();
$db->connect();
mysql_query("SET NAMES 'UTF8'");
$id = get('id');
$delete = $db->query("Call spUserAccDelete('" . $id . "')");
if ($delete) {
    cRedirect('userAccount.php');
}
include 'footer.php';
<?php

session_start();
include 'connectionclass/connect.php';
include 'connectionclass/function.php';
include 'connectionclass/metencrypt.php';
$db = new MyConnection();
$db->connect();
mysql_query("SET NAMES 'UTF8'");
$error = "";
if (isset($_POST['btnsave'])) {
    $txtusername = $_POST['txtusername'];
    $password = $_POST['txtpassword'];
    $encrypted_txt = encrypt_decrypt('encrypt', $password);
    $select = $db->query("CALL spUserAccClearData('" . $txtusername . "','" . $encrypted_txt . "');");
    $numrow = $db->dbCountRows($select);
    if ($numrow > 0) {
        $db->disconnect();
        $db->connect();
        //$delete=$db->query("DELETE FROM `tblproductsbranch`");
        $delete1 = $db->query("DELETE FROM `tblprdsaletem`;");
        $delete2 = $db->query("DELETE FROM tbl_customerorder;");
        $delete3 = $db->query("DELETE FROM tbl_customerorderdetail;");
        $delete4 = $db->query("DELETE FROM `tblproductsbranch`;");
        $delete5 = $db->query("DELETE FROM `tblproducts_buy`;");
        $delete6 = $db->query("DELETE FROM `tblproducts_buydetail`;");
        $delete7 = $db->query("DELETE FROM `tblproducts`;");
        $delete8 = $db->query("DELETE FROM tblproductcategory;");
        $delete9 = $db->query("DELETE FROM `tblbranch` WHERE BranchID != '123';");
        if ($delete1) {
            //cRedirect('index.php');