Example #1
0
 <?php 
require_once 'scripts/database.php';
$db = new Database();
if (!$db->checkLoginStatus()) {
    header('Location: login.php');
} else {
    session_destroy();
    header('Location: login.php');
}
Example #2
0
<?php

ini_set('display_errors', 1);
error_reporting(E_ALL);
if (!isset($_SESSION)) {
    session_start();
}
require_once 'scripts/database.php';
$db = new Database();
$db->connectToDB();
$message = '';
if ($db->checkLoginStatus() == false) {
    header('Location: login.php');
}
if ($_POST) {
    $repairbrand = $_POST['repairbrand'];
    $repairmodel = $_POST['repairmodel'];
    $repairtech = $_POST['repairtech'];
    $repairIMEI = $_POST['repairIMEI'];
    $cusname = $_POST['cusname'];
    $cusphone = $_POST['cusphone'];
    $cusemail = $_POST['cusemail'];
    $repairloc = $_POST['repairloc'];
    $message = $db->createRepair($repairbrand, $repairmodel, $repairtech, $repairIMEI, $cusname, $cusphone, $cusemail, $repairloc);
}
?>

 <!DOCTYPE html>

 <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Example #3
0
<?php

ini_set('display_errors', 1);
error_reporting(E_ALL);
if (!isset($_SESSION)) {
    session_start();
}
require_once 'scripts/database.php';
$db = new Database();
$db->connectToDB();
if ($db->checkLoginStatus() == true) {
    header('Location: repairs.php');
}
if ($_POST) {
    $username = $_POST['username'];
    $password = $_POST['password'];
    $db->createSession($username, $password);
}
?>


<!DOCTYPE html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Login for Celtel Employee</title>
    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
    <script type="text/javascript" src="js/jquery-1.11.3-jquery.min.js"></script>
    <script type="text/javascript" src="js/validation.min.js"></script>
    <link href="css/style.css" rel="stylesheet" type="text/css" media="screen">
    <script type="text/javascript" src="js/script.js"></script>