function processPayOnArrival() { global $bookprs; global $bsiCore; $bsiMail = new bsiMail(); $emailContent = $bsiMail->loadEmailContent(); $subject = $emailContent['subject']; mysql_query("UPDATE bsi_bookings SET payment_success=true WHERE booking_id = " . $bookprs->bookingId); mysql_query("UPDATE bsi_clients SET existing_client = 1 WHERE email = '" . $bookprs->clientEmail . "'"); $emailBody = "Dear " . $bookprs->clientName . ",<br><br>"; $emailBody .= $emailContent['body'] . "<br><br>"; $emailBody .= $bookprs->invoiceHtml; $emailBody .= '<br><br>' . mysql_real_escape_string(PP_REGARDS) . ',<br>' . $bsiCore->config['conf_hotel_name'] . '<br>' . $bsiCore->config['conf_hotel_phone']; $emailBody .= '<br><br><font style=\\"color:#F00; font-size:10px;\\">[ ' . mysql_real_escape_string(PP_CARRY) . ' ]</font>'; $returnMsg = $bsiMail->sendEMail($bookprs->clientEmail, $subject, $emailBody); if ($returnMsg == true) { $notifyEmailSubject = "Booking no." . $bookprs->bookingId . " - Notification of Room Booking by " . $bookprs->clientName; $notifynMsg = $bsiMail->sendEMail($bsiCore->config['conf_hotel_email'], $notifyEmailSubject, $bookprs->invoiceHtml); header('Location: booking-confirm.php?success_code=1'); die; } else { header('Location: booking-failure.php?error_code=25'); die; } //header('Location: booking-confirm.php?success_code=1'); }
<?php session_start(); include "includes/db.conn.php"; include "includes/conf.class.php"; include "includes/mail.class.php"; $row_default_lang = mysql_fetch_assoc(mysql_query("select * from bsi_language where `lang_default`=true")); include "languages/" . $row_default_lang['lang_file']; $paymentGatewayDetails = $bsiCore->loadPaymentGateways(); $bsiMail = new bsiMail(); $emailContent = $bsiMail->loadEmailContent(); require_once 'paypal.class.php'; // include the class file $invoice = time(); $p = new paypal_class(); // initiate an instance of the class //$p->paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; // testing paypal url $p->paypal_url = 'https://www.paypal.com/cgi-bin/webscr'; // paypal url // setup a variable for this script (ie: 'http://www.micahcarrick.com/paypal.php') $this_script = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; // if there is not action variable, set the default action of 'process' if (empty($_GET['action'])) { $_GET['action'] = 'process'; } switch ($_GET['action']) { case 'process': // Process and order... $p->add_field('business', $paymentGatewayDetails['pp']['account']); $p->add_field('return', $this_script . '?action=success'); $p->add_field('cancel_return', $this_script . '?action=cancel');
public function booking_cencel_delete($type) { global $bsiCore; global $bsiMail; switch ($type) { case 1: $bsiMail = new bsiMail(); $is_cancel = mysql_query("update bsi_bookings set is_deleted=true where booking_id=" . $bsiCore->ClearInput($_GET['cancel'])); if ($is_cancel) { $cust_details = mysql_fetch_assoc(mysql_query("select * from bsi_invoice where booking_id=" . $bsiCore->ClearInput($_GET['cancel']))); $email_details = mysql_fetch_assoc(mysql_query("select * from bsi_email_contents where id=2")); $cancel_emailBody = "Dear " . $cust_details['client_name'] . "<br>"; $cancel_emailBody .= html_entity_decode($email_details['email_text']) . "<br>"; $cancel_emailBody .= "<b>Your Booking Details:</b><br>" . $cust_details['invoice'] . "<br>"; $cancel_emailBody .= "<b>Regards</b><br>" . $bsiCore->config['conf_hotel_name'] . "<BR>" . $bsiCore->config['conf_hotel_phone'] . "<br>"; $bsiMail->sendEMail($cust_details['client_email'], $email_details['email_subject'], $cancel_emailBody); } break; case 2: mysql_query("delete from bsi_bookings where booking_id=" . $bsiCore->ClearInput($_REQUEST['delete'])); mysql_query("delete from bsi_reservation where bookings_id=" . $bsiCore->ClearInput($_REQUEST['delete'])); mysql_query("delete from bsi_invoice where booking_id=" . $bsiCore->ClearInput($_REQUEST['delete'])); break; } }
$pos2 = strpos($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME']); if (!$pos2) { header('Location: booking-failure.php?error_code=9'); } session_start(); include "includes/db.conn.php"; include "includes/conf.class.php"; $row_default_lang = mysql_fetch_assoc(mysql_query("select * from bsi_language where `lang_default`=true")); include "languages/" . $row_default_lang['lang_file']; include "includes/mail.class.php"; $booking_id = mysql_real_escape_string($_POST['bookingid']); $emailBody = ''; $invoiceROWS = mysql_fetch_assoc(mysql_query("SELECT client_name, client_email, invoice FROM bsi_invoice WHERE booking_id='" . $booking_id . "'")); $ccArray = array(); $bsiMail = new bsiMail(); $emailContent = $bsiMail->loadEmailContent(); $subject = $emailContent['subject']; $emailBody .= "Dear " . $invoiceROWS['client_name'] . ",<br><br>"; $emailBody .= $emailContent['body']; $emailBody .= $invoiceROWS['invoice']; $cardnum = $_POST['CardNumber']; $cc_holder_name = $_POST['cc_holder_name']; $CardType = $_POST['CardType']; $cc_exp_dt = $_POST['cc_exp_dt']; $cc_ccv = $_POST['cc_ccv']; $cardnum_enc = $bsiCore->encryptCard(mysql_real_escape_string($_POST['CardNumber'])); $cardno_len = strlen($cardnum) - 4; $creditcard_no = substr($cardnum, $cardno_len); $star = ''; for ($i = 0; $i < $cardno_len; $i++) {