Пример #1
0
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;
        if ($Level == 2) {
<?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

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';
Пример #4
0
<?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();
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');