Ejemplo n.º 1
0
 public static function Start($db_obj)
 {
     self::$db_obj = $db_obj;
     //similar to this.db_obj = db_obj
     if (isset($db_obj)) {
         if ($db_obj->isConnected()) {
             self::$pdo = $db_obj->get_db_connect();
         }
     }
 }
Ejemplo n.º 2
0
    } else {
        if ($_POST['l1_content_1'] == 2) {
            $_SESSION['l1'] = 2;
            $_SESSION['l2'] = $_POST['l2_content_2'];
            $_SESSION['l3'] = "";
            $_SESSION['l4'] = "";
        } else {
            if ($_POST['l1_content_1'] == 4) {
                $_SESSION['l1'] = 4;
                $_SESSION['l2'] = "";
                $_SESSION['l3'] = "";
                $_SESSION['l4'] = $_POST['l1_content_4_other'];
            } else {
                $_SESSION['l1'] = 3;
                $_SESSION['l2'] = "";
                $_SESSION['l3'] = "";
                $_SESSION['l4'] = "";
            }
        }
    }
}
if (isset($_SESSION['l1']) && isset($_SESSION['l2']) && isset($_SESSION['l3']) && isset($_SESSION['l4'])) {
    $applicant_id = dbhelper::addApplicant($_SESSION['s2_car_owner_fname'], $_SESSION['s2_gender'], $_SESSION['s2_car_owner_birthdate'], $_SESSION['s2_car_owner_complexion'], $_SESSION['s2_car_owner_height'], $_SESSION['s2_car_owner_built'], $_SESSION['dname_1'], $_SESSION['dtel_1'], $_SESSION['dname_2'], $_SESSION['dtel_2']);
    $status_id = dbhelper::addStatus($_SESSION['l1'], $_SESSION['l2'], $_SESSION['l3'], $_SESSION['l4']);
    $ud_id = dbhelper::addUserDetails($_SESSION['s1_car_owner'], $_SESSION['s1_owner_address'], $_SESSION['s1_owner_tel1'], $_SESSION['s1_owner_province'], $_SESSION['s1_owner_tel2'], $_SESSION['s1_d1_name'], $_SESSION['s1_d1_rel'], $_SESSION['s1_d1_address'], $_SESSION['s1_d1_tel'], $applicant_id, $status_id);
    $car_id = dbhelper::addVehicleDetails($_SESSION['s1_car_make'], $_SESSION['s1_car_model'], $_SESSION['s1_car_plate'], $_SESSION['s1_car_color'], $_SESSOPM['s1_vehicle_type']);
    dbhelper::linkApplicantCar($applicant_id, $car_id);
    dbhelper::linkStatusApplicantUD($applicant_id, $ud_id, $status_id);
    header('location:../confirmation.php');
}
//session_destroy(); //destroy session after insert. do not use while debugging
Ejemplo n.º 3
0
								<table class="table table-striped" id="pendingTable">
									<thead class="text-center">
										<tr>
											<th>Pending for Approval</th>
										</tr>
										<tr>
											<th>ID</th>
											<th>Name</th>
											<th>Status</th>
											<th>Approve</th>
											<th>Delete</th>
										</tr>
									</thead>
									<!--<tbody>
										<?php 
dbhelper::getPendingApplicants();
?>
									</tbody>-->
								</table>
							</div>
						</div>
					</div>
				</li>
				
			</ul>
			</div>
			<!--End of main content-->
		</div>
		<a href="#" class="scrollToTop text-center"><span class="glyphicon glyphicon-menu-up text-center" style="margin-top: 30%;"></span></a>
	</body>
	
Ejemplo n.º 4
0
<!DOCTYPE html>
<?php 
session_start();
$_SESSION['SESSION_ID'] = -1;
include "php/dbfunctions.php";
if (isset($_POST['control_password']) && isset($_POST['control_username'])) {
    $id = dbhelper::authenticateContentLogin($_POST['control_username'], $_POST['control_password']);
    if ($id > 0) {
        $_SESSION['SESSION_ID'] = $id;
        header('location: php/content_control_dashboard.php');
    } else {
        echo "<script>\n\t\t\t\t\talert('Invalid Credentials. Please make sure that the username and password is correct and try again')\n\t\t\t\t  </script>";
    }
}
?>
<html>
	<head>
		<title>UPark: USLS Parking Content Control</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
		<link rel="stylesheet" type="text/css" href="css/style.css">
		<script src="js/jquery.js"></script>
		<script src="js/bootstrap.min.js"></script>
	</head>
	<body>
		<div class="container">
			<!--Main Content-->
			<div>
			<ul class="page-content">
				<li>
Ejemplo n.º 5
0
						<li class="link"><a href="content_control_approval.php" ><span class="glyphicon glyphicon-ok"></span> Approve Users</a></li>
						<li class="link"><a href="content_control_users.php" ><span class="glyphicon glyphicon-user"></span> Users</a></li>
						<li class="link"><a href="../content_control_login.php" ><span class="glyphicon glyphicon-log-out"></span> Logout</a></li>
					</ul>
				</div>
				
			</div>
			<!--Main Content-->
			<div>
			<ul class="page-content">
				<li>
					<div class="whitebg text-center">
						<div class="row">
							<div class="col-md-4" style="padding: 20px; background-color: #ebebeb; margin-right: 1px; margin-left:-2px;">
								<span class="glyphicon glyphicon-dashboard"></span> Number of Users: <?php 
dbhelper::getActiveUserCount();
?>
							</div>
							<div class="col-md-4"  style="padding: 20px; background-color: #ebebeb; margin-right: 1px;">
								<span class="glyphicon glyphicon-screenshot"></span> Number of Occupied Space: <div id="occupiedSpace"></div>
							</div>
							<div class="col-md-4"  style="padding: 20px; background-color: #ebebeb;">
								<span class="glyphicon glyphicon-circle-arrow-down"></span> Number of Available Space: <div id="availableSpace"></div>
							</div>
						</div>
					</div>
				</li>
				<li>
					<div class="row userTopButtonAdjustment">
						<button id="aPost" class="btn btn btn-primary" style="margin-right: 5px;"><span class="glyphicon glyphicon-user"></span> Add New User </button>
						<button id="aPost" class="btn btn btn-primary" style="margin-right: 5px;"><span class="glyphicon glyphicon-duplicate"></span> Print PDF </button>
Ejemplo n.º 6
0
<?php

include_once "../dbfunctions.php";
header('Content-type: application/json');
$method = $_SERVER['REQUEST_METHOD'];
if ($method == "GET") {
    $action = $_GET['action'];
    if ($action == "getPendingUser") {
        return dbhelper::getPendingApplicants();
    }
    if ($action == "getActiveUser") {
        return dbhelper::returnAllUsers();
    }
}
if ($method == "POST") {
    $action = $_POST['action'];
    if ($action == "updatePendingUser") {
        $ADS_ID = $_POST['ADS_ID'];
        return dbhelper::approveUser($ADS_ID);
    }
    if ($action == "deletePendingUser" || $action == "deleteActiveUser") {
        $ADS_ID = $_POST['ADS_ID'];
        return dbhelper::deleteUser($ADS_ID);
    }
}