* User: Prashanth * Date: 11/21/2015 * Time: 9:17 PM */ session_start(); if (!isset($_SESSION['user'])) { header("Location: index.php"); exit; } require_once '../controller/SqliteRepository.php'; require_once '../model/Customer.php'; require_once '../model/Employee.php'; require_once '../model/Payment.php'; $repo = new \pnaika\finals\SqliteRepository(); $customerId = isset($_GET['id']) ? $_GET['id'] : ''; $customer = $repo->getCustomerById($customerId); $parkingHours = isset($_POST['timeofParking']) ? input($_POST['timeofParking']) : ''; $formIsValid = true; $hoursFieldErr = ''; $time = date("d M Y - h:i:s A"); if (empty($parkingHours)) { $formIsValid = false; $hoursFieldErr = '<span style="color: #f00;">REQUIRED FIELD!</span>'; } function input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; }
<table class="table table-hover"> <tr> <th>DATE OF TRANSACTION</th> <th>PAYMENT ID</th> <th>AMOUNT</th> <th>CUSTOMER NAME</th> <th>CUSTOMER PHONE</th> <th>CUSTOMER EMAIL</th> <th>CUSTOMER ADDRESS</th> <th>LAST UPDATED</th> <th>ACTION</th> </tr> <?php foreach ($payments as $payment) { $customer = $repo->getCustomerById($payment->getCustomerId()); print '<tr>'; print '<td>' . $payment->getPaymentDate() . '</td>'; print '<td>' . $payment->getPaymentId() . '</td>'; print '<td>' . $payment->getPaymentAmount() . '</td>'; print '<td>' . $customer->getCustomerName() . '</td>'; print '<td>' . $customer->getPhoneNumber() . '</td>'; print '<td>' . $customer->getEmail() . '</td>'; print '<td>' . $customer->getAddress() . '</td>'; print '<td>' . $customer->getLastUpdate() . '</td>'; print '<td><form action="confirmation.php" method="POST"> <input type="hidden" name="payId" value="' . $payment->getPaymentId() . '"> <input type="hidden" name="empId" value="' . $employee->getEmpId() . '"> <button type="submit" class="btn btn-primary">DELETE</button> </form></td>'; // print '<td><a href="deletePayment.php?&empId=' . $employee->getEmpId() . '&payId='.$payment->getPaymentId().'&ROLE=Emp"> DELETE </a></td>';
session_start(); if (!isset($_SESSION['user'])) { header("Location: index.php"); exit; } require_once '../controller/SqliteRepository.php'; require_once '../model/Customer.php'; require_once '../model/Employee.php'; require_once '../model/Payment.php'; $repo = new \pnaika\finals\SqliteRepository(); $time = date("d M Y - h:i:s A"); $customerId = isset($_GET['custId']) ? $_GET['custId'] : ''; $employeeId = isset($_GET['empId']) ? $_GET['empId'] : ''; $paymentId = isset($_GET['payId']) ? $_GET['payId'] : ''; if ($_GET['ROLE'] === 'Cust') { $customer = $repo->getCustomerById($customerId); $paymentDetails = $repo->getPaymentById($paymentId); } elseif ($_GET['ROLE'] === 'Emp') { $employee = $repo->getEmployeeById($employeeId); $paymentDetails = $repo->getPaymentById($paymentId); $customer = $repo->getCustomerById($paymentDetails->getCustomerId()); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>SHOW ALL</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="stylesheet" href="../style/style.css">
exit; } require_once '../controller/SqliteRepository.php'; require_once '../model/Customer.php'; $repo = new \pnaika\finals\SqliteRepository(); function input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } if ($_SERVER['REQUEST_METHOD'] == 'POST' && !empty($_POST['id'])) { ?> <?php $customer = $repo->getCustomerById($_POST['id']); ?> <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>CUSTOMER PROFILE</title> <link rel="stylesheet" href="../style/style.css"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link href='http://fonts.googleapis.com/css?family=Lora:400,700' rel='stylesheet' type='text/css'/> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"/> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css"/> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"/> </head> <body> <a href="#"><img class="logo" src="../images/logo/gpsLogo.jpg" alt="CCS" title="GLOBAL PARKING SYSTEM"></a>