Пример #1
0
<?php

require_once "../include/Validation.php";
// deconnection already included in Validation
$dbobj = new dbconnection();
$vobj = new Validation();
session_start();
if (!isset($_POST['username'])) {
    echo "please back and enter the user name";
    exit;
}
$_SESSION['username'] = $_POST['username'];
$arr = $dbobj->SelectColumn("email", "user", "uname", $_POST['username']);
if (count($arr) == 0) {
    echo "User Name is not exist";
    exit;
}
$email = $arr[0];
echo $email;
$seed = str_split('abcdefghijklmnopqrstuvwxyz' . 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' . '0123456789');
$rand = '';
foreach (array_rand($seed, 5) as $k) {
    $rand .= $seed[$k];
}
$check = mail($email, "Confirmation Code is here", $rand, '*****@*****.**');
echo $check;
echo $rand;
if (!$check) {
    echo "lol";
    exit;
} else {
Пример #2
0
// $res = $dbobj->SelectColumn("content","comment","UID",1);
// foreach($res as $row)
// 	echo $row."<br>";
require_once "Validation.php";
// deconnection already included in Validation
$vobj = new Validation();
$dbobj = new dbconnection();
echo "sdasd";
// $susersid = $this->dbobj->SelectColumn('uid','user','admin','true');
$arr = array();
$arr['0'] = 1;
$arr['1'] = 2;
$arr['2'] = 3;
echo $arr[0];
print_r($arr);
$uid = 14;
$susersid = $dbobj->SelectColumn('uid', 'user', 'admin', 1);
print_r($susersid);
if ($flag = $vobj->ifSuperUserId(14)) {
    echo "true";
}
if ($flag = $vobj->ifSuperUserId(20)) {
    echo "true<br>";
}
echo "sdfsdf" . $flag . "<br>";
$flag = $vobj->ifSuperUser("doubleo");
echo "sdfsdf" . $flag . "<br>";
echo "<br>";
$susersid = $dbobj->SelectColumn('uid', 'user', 'admin', true);
print_r($susersid);
echo "<br>";
Пример #3
0
$_orders = "../layout/orders.php";
require_once "../include/Validation.php";
// deconnection already included in Validation
$dbobj = new dbconnection();
$vobj = new Validation();
session_start();
if (!isset($_SESSION['uid'])) {
    echo "You are not authoriezed to enter this page. You have to login first";
    exit;
}
$uid = $_SESSION['uid'];
// if(!$vobj->ifSuperUserId($uid)){
//   echo "You are not authoriezed to enter this page. Only for admins.";
//   exit;
// }
$procOrds = $dbobj->SelectColumn('oid', 'orders', 'processing', 1);
$flag = true;
do {
    foreach ($procOrds as $outoid) {
        $outOrds = $dbobj->Select("SELECT `oid` FROM `orders` WHERE `processing`=0 AND `oid`='{$outoid}'");
        if (isset($outOrds[0])) {
            $flag = false;
            $oid = $outOrds[0];
            break;
        }
        // sleep(1);
    }
    clearstatcache();
    sleep(1);
} while ($flag);
// // do{
Пример #4
0
//$uid = $_GET['uid'];
if (!isset($_SESSION['uid'])) {
    echo "You are not authoriezed to enter this page. You have to login first";
    exit;
}
$uid = $_SESSION['uid'];
// $_SESSION['uid'] = $uid;
$activeusersArr = $dbobj->Select('select * from user,room where user.rid=room.rid');
$users = array();
foreach ($activeusersArr as $row) {
    if (!$row['admin']) {
        array_push($users, $row['uname']);
    }
}
// $users = $dbobj->SelectColumn('uname','user',null,null);
$rooms = $dbobj->SelectColumn('rname', 'room', null, null);
$uname = $dbobj->SelectColumn('uname', 'user', 'uid', $uid);
$uname = $uname[0];
$imgname = $dbobj->SelectColumn('imgname', 'user', 'uid', $uid);
$imgname = $imgname[0];
$img = "../images/user/" . $imgname;
include "common/header.php";
?>
<html>
	
	<head>
		<meta charset="UTF-8">
		<title>Checks</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" href="css/bootstrap.min.css">
		<script src="js/jquery-1.11.2.js"></script>
Пример #5
0
$dbobj = new dbconnection();
$vobj = new Validation();
if (!isset($_SESSION['uid'])) {
    echo "You are not authoriezed to enter this page. You have to login first";
    exit;
}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
    echo "You are not authoriezed to enter this page. Only for admins.";
    exit;
}
$_product = "../layout/products.php";
$pname = $_POST['pname'];
$price = $_POST['price'];
$category = trim($_POST['category']);
$cid = $dbobj->SelectColumn('cid', 'category', 'cname', $category);
$cid = $cid[0];
$products = $dbobj->SelectColumn('pname', 'product', null, null);
foreach ($products as $product) {
    if ($pname == $product) {
        echo "product already exists";
        exit;
    }
}
// upload image
$target_dir = "../images/product/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
// print_r($_FILES["fileToUpload"]);
$uploadOk = 1;
$imageFileType = pathinfo($target_file, PATHINFO_EXTENSION);
$imgname = $pname . "." . $imageFileType;
Пример #6
0
}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
    echo "You are not authoriezed to enter this page. Only for admins.";
    exit;
}
$_users_img = "../images/user/";
$_products_img = "../images/product/";
$activeusersArr = $dbobj->Select('select * from user,room where user.rid=room.rid');
$usersArr = array();
foreach ($activeusersArr as $row) {
    if (!$row['admin']) {
        array_push($usersArr, $row);
    }
}
$uname = $dbobj->SelectColumn('uname', 'user', 'uid', $uid);
$uname = $uname[0];
$imgname = $dbobj->SelectColumn('imgname', 'user', 'uid', $uid);
$imgname = $imgname[0];
$_controller = "../controller";
$_layout = "../layout";
$_add_user = "******";
$img = $_users_img . $imgname;
$processingOrders = $dbobj->Select('select uname,rname,odate,ext,otime,user.uid,orders.oid,user.imgname from user,room,orders where user.uid=orders.uid AND user.rid=room.rid AND orders.processing=true;');
include "common/header.php";
?>
<html>
<head>
	<title></title>
	
</head>
Пример #7
0
$_orders = "../layout/orders.php";
require_once "../include/Validation.php";
// deconnection already included in Validation
$dbobj = new dbconnection();
$vobj = new Validation();
session_start();
if (!isset($_SESSION['uid'])) {
    echo "You are not authoriezed to enter this page. You have to login first";
    exit;
}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
    echo "You are not authoriezed to enter this page. Only for admins.";
    exit;
}
$aliveOrds = $dbobj->SelectColumn('oid', 'orders', 'alive', 1);
$flag = true;
do {
    foreach ($aliveOrds as $aoid) {
        $deadOrds = $dbobj->Select("SELECT `oid` FROM `orders` WHERE `alive`=0 AND `oid`='{$aoid}'");
        if (isset($deadOrds[0])) {
            $flag = false;
            $oid = $deadOrds[0];
            break;
        }
        // sleep(1);
    }
    clearstatcache();
    sleep(1);
} while ($flag);
// // do{
Пример #8
0
<?php

error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once "../include/Validation.php";
// deconnection already included in Validation
$dbobj = new dbconnection();
$vobj = new Validation();
$_product = "../../layout/products.php";
session_start();
if (!isset($_SESSION['uid'])) {
    echo "You are not authoriezed to enter this page. You have to login first";
    exit;
}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
    echo "You are not authoriezed to enter this page. Only for admins.";
    exit;
}
$pid = $_GET['pid'];
$avb = $dbobj->SelectColumn('available', 'product', 'pid', $pid);
$avb = $avb[0];
$avb = !$avb;
$dbobj->Update("update product set `available`='{$avb}' where `pid`='{$pid}'");
header("location:" . $_product . "?uid=" . $uid);
Пример #9
0
require_once "../include/Validation.php";
// deconnection already included in Validation
$dbobj = new dbconnection();
$vobj = new Validation();
session_start();
//$uid = $_GET['uid'];
if (!isset($_SESSION['uid'])) {
    echo "You are not authoriezed to enter this page. You have to login first";
    exit;
}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
    echo "You are not authoriezed to enter this page. Only for admins.";
    exit;
}
$categories = $dbobj->SelectColumn('cname', 'category', null, null);
$uname = $dbobj->SelectColumn('uname', 'user', 'uid', $uid);
$uname = $uname[0];
$img = "img/users/" . $uname . ".jpeg";
include "common/header.php";
?>
<html>
<head>
	<title></title>
	
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="col-md-12 well">
				<h1 class="col-md-4">Add Category</h1>
Пример #10
0
// deconnection already included in Validation
$dbobj = new dbconnection();
$vobj = new Validation();
session_start();
//$uid = $_GET['uid'];
if (!isset($_SESSION['uid'])) {
    echo "You are not authoriezed to enter this page. You have to login first";
    exit;
}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
    echo "You are not authoriezed to enter this page. Only for admins.";
    exit;
}
$pid = $_GET['pid'];
$categories = $dbobj->SelectColumn('cname', 'category', null, null);
$pro_rec = $dbobj->Select("select `pname`,`price`,`cid`,`imgname` from product where `pid`='{$pid}'");
$pro_rec = $pro_rec[0];
$pname = $pro_rec['pname'];
$price = $pro_rec['price'];
$cid = $pro_rec['cid'];
$imgname = $pro_rec['imgname'];
$cname = $dbobj->SelectColumn("cname", "category", "cid", $cid);
$cname = $cname[0];
$_edit_product = "../../controller/edit_product.php";
?>
<html>
<head>
	<title></title>
	
</head>
Пример #11
0
}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
    echo "You are not authoriezed to enter this page. Only for admins.";
    exit;
}
$edtuid = $_GET['uid'];
$edt_rec = $dbobj->Select("select `uname`,`email`,`rid`,`ext`,`fname`,`lname` from user where `uid`='{$edtuid}'");
$edt_rec = $edt_rec[0];
$uname = $edt_rec['uname'];
$email = $edt_rec['email'];
$rid = $edt_rec['rid'];
$ext = $edt_rec['ext'];
$fname = $edt_rec['fname'];
$lname = $edt_rec['lname'];
$rname = $dbobj->SelectColumn('rname', 'room', 'rid', $rid);
$rname = $rname[0];
$_edit_user = "******";
?>
<html>
<head>
	<title></title>
	
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="col-md-12 well">
				<h1 class="col-md-4">Edit User</h1>
					<div class="col-md-6"></div>
			</div>