<?php include_once 'config.php'; include_once '../checkAdminPagePermissions.php'; $dbBean = new DatabaseBean(); $general = new General($dbBean); $menu_id = empty($_REQUEST['menu_id']) ? $_SESSION['menu_id'] : $_REQUEST['menu_id']; $heading = $general->getPageHeading($menu_id); $Booking = new Booking($dbBean); $rows = $Booking->getBookingById($_REQUEST['id']); ?> <!DOCTYPE html> <!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]--> <!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]--> <!--[if !IE]><!--> <html lang="en"> <!--<![endif]--> <!-- BEGIN HEAD --> <head> <?php include '../common.php'; ?> <!-- BEGIN PAGE LEVEL STYLES --> <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_URL; ?> /assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css"/> <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_URL; ?>
if ($resource[5] == 'UserId') { if (isset($resource[6]) && $resource[6] != "" && is_numeric($resource[6])) { //[6] => user id if (isset($resource[7]) && $resource[7] != "" && $resource[7] == 'pending') { $results['booking'] = Booking::getBookingByUserIdPending($resource[6]); } else { $results['booking'] = Booking::getBookingByUserId($resource[6]); } //if given is id } //else echo json_encode(array('error'=>'true', 'error_message'=>'Invalid User ID.')); } else { if ($resource[5] == 'BookingId') { if (isset($resource[6]) && $resource[6] != "" && is_numeric($resource[6])) { //[6] => booking id $results['booking'] = Booking::getBookingById($resource[6]); //if given is id and pending } //else echo json_encode(array('error'=>'true', 'error_message'=>'Invalid Booking ID.')); } else { if ($resource[5] == 'EventSchedId') { if (isset($resource[6]) && $resource[6] != "" && is_numeric($resource[6])) { //[6] => event id $results['booking'] = Booking::getBookingByEventSchedId($resource[6]); //if given is id and pending } } else { if ($resource[5] == 'BookSched') { if (isset($resource[6]) && $resource[6] != "" && isset($resource[7]) && $resource[7] != "" && is_numeric($resource[7]) && isset($resource[8]) && $resource[8] != "" && is_numeric($resource[8])) { //[6] => entry/exit [7] => book id [8] => sched id if ($resource[6] == "entry") {
if ($_REQUEST['status'] == '4') { $totprice = $_REQUEST['totalprice'] * 50 / 100; $field_values = array('customerid' => $_REQUEST['customer'], 'bookingid' => $updated, 'credit' => -$totprice, 'credittype' => '1', 'date_added' => date('Y-m-d H:i:s')); $add = $Booking->addcreditmanagement($field_values); if ($add) { $data = $Booking->getCustomerById($_REQUEST['customer']); $usercredit = $data->credit; $newcredit = $usercredit - $totprice; $fieldvalues1 = array('credit' => $newcredit); $cond = array('id' => $_REQUEST['customer']); $Booking->updateCustomer($fieldvalues1, $cond); } } } } $details = $Booking->getBookingById($updated); $user = $details->customername; $servicenm = $details->servicename; if ($updated) { $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "smtp.gmail.com"; // SMTP server $mail->SMTPDebug = 1; $mail->SMTPAuth = true; $mail->Port = 587; $mail->SMTPSecure = 'tls'; $mail->Username = SMPT_EMAIL; // SMTP account username $mail->Password = SMPT_PASS;