include_once "login_check.inc.php"; include_once "functions.php"; access("admin"); //check if user is allowed to access this page if (isset($_GET["search"])) { find($_GET["search"]); } if (isset($_POST['Submit'])) { $action = $_POST['Submit']; switch ($action) { case 'Add User': //|| 'Update User'): // instantiate form validator object $fv = new formValidator(); //from functions.php $fv->validateEmpty('fname', 'Enter users First name'); $fv->validateEmpty('sname', 'Enter users Second name'); $fv->validateEmpty('loginname', 'Enter users loginname'); $fv->validateEmpty('pass', 'Please enter a password'); if ($fv->checkErrors()) { // display errors echo "<div align=\"center\">"; echo '<h2>Resubmit the form after correcting the following errors:</h2>'; echo $fv->displayErrors(); echo "</div>"; } else { $fname = $_POST["fname"]; $sname = $_POST["sname"]; $loginname = $_POST["loginname"]; $pass = md5($_POST["pass"]); $phone = !empty($_POST["phone"]) ? $_POST["phone"] : 'NULL';
$logofile = Get_LogoFile(); if (isset($_GET["search"])) { $agentid = $_GET['search']; } if (isset($_GET['id'])) { $agentid = $_GET['id']; } if (isset($_POST['Submit'])) { $action = $_POST['Submit']; switch ($action) { case $_L['AGT_addagent']: case $_L['BTN_update']: // instantiate form validator object $fv = new formValidator(); //from functions.php $fv->validateEmpty('iata', $_L['AGT_iata_err']); $fv->validateEmpty('name', $_L['AGT_name_err']); $fv->validateEmpty('phone', $_L['AGT_phone_err']); $fv->validateEmpty('town', $_L['AGT_town_err']); $fv->validateEmpty('billing', $_L['AGT_billing_err']); if ($fv->checkErrors()) { // display errors $validationMsgs = "<div align=\"left\"><h2>" . $_L['PR_formerr'] . "</h2>" . $fv->displayErrors() . "</div>"; } else { $agentid = !empty($_POST["agentid"]) ? $_POST["agentid"] : 0; $country = $_POST['country']; $ebridgeID = $_POST['ebridgeID']; $IM = $_POST['IM']; $name = $_POST["name"]; $iata = $_POST["iata"]; $contact = $_POST["contact"];
//consider having this as a function in the functions.php if (isset($_POST['Navigate'])) { //echo $_SESSION["strOffSet"]; $nRecords = num_rows(mkr_query("select * from guests", $conn), $conn); paginate($nRecords); free_result($results); find($_SESSION["strOffSet"]); } if (isset($_POST['Submit'])) { $action = $_POST['Submit']; switch ($action) { case 'Add Guest': // instantiate form validator object $fv = new formValidator(); //from functions.php $fv->validateEmpty('lastname', 'Please enter Guests First Name'); $fv->validateEmpty('firstname', 'Please enter Guests Last Name'); $fv->validateEmpty('pp_id_no', 'Passport No. or ID. No. must be entered.'); $fv->validateEmpty('countrycode', 'Please select country'); //if (!empty($_POST["email"])) $fv->validateEmail('email','Please enter a valid email address'); if ($fv->checkErrors()) { // display errors echo "<div align=\"center\">"; echo '<h2>Resubmit the form after correcting the following errors:</h2>'; echo $fv->displayErrors(); echo "</div>"; } else { $firstname = $_POST["firstname"]; $middlename = $_POST["middlename"]; $lastname = $_POST["lastname"]; $countrycode = $_POST["countrycode"];
$trans_type = !empty($_POST["trans_type"]) ? "'" . $_POST["trans_type"] . "'" : 'NULL'; $remarks = !empty($_POST["remarks"]) ? "'" . $_POST["remarks"] . "'" : 'NULL'; $accounts = !empty($_POST["accounts"]) ? $_POST["accounts"] : 'NULL'; $cooperative = !empty($_POST["cooperative"]) ? $_POST["cooperative"] : 'NULL'; $payroll = !empty($_POST["payroll"]) ? $_POST["payroll"] : 'NULL'; $sql = "INSERT INTO transtype (trans_code,trans_type,remarks,accounts,cooperative,payroll)\n\t\t\t\t VALUES({$trans_code},{$trans_type},{$remarks},{$accounts},{$cooperative},{$payroll})"; $results = mkr_query($sql, $conn); $msg[0] = "Sorry transaction type not added"; $msg[1] = "Transaction type successfull added"; AddSuccess($results, $conn, $msg); } break; case 'Add Payment Mode': $fv = new formValidator(); //from functions.php $fv->validateEmpty('payment_option', 'Please enter payment option.'); if ($fv->checkErrors()) { // display errors echo "<div align=\"center\">"; echo '<h2>Resubmit the form after correcting the following errors:</h2>'; echo $fv->displayErrors(); echo "</div>"; } else { $payment_option = !empty($_POST["payment_option"]) ? "'" . $_POST["payment_option"] . "'" : 'NULL'; $sql = "INSERT INTO payment_mode (payment_option) VALUES({$payment_option})"; $results = mkr_query($sql, $conn); $msg[0] = "Sorry payment mode not added"; $msg[1] = "Payment mode successfull added"; AddSuccess($results, $conn, $msg); } break;
* @{ * @defgroup ADMIN_MANAGEMENT Hotel setup and management page * @{ */ error_reporting(0); include_once dirname(__FILE__) . '/../functions.php'; include_once dirname(__FILE__) . "/../lang/lang_en.php"; $logofile = Get_LogoFile(); $showPost = 0; if ($_POST['submit']) { $action = $_POST['submit']; switch ($action) { case $_L['RM_addroom']: $fv = new formValidator(); //from functions.php $fv->validateEmpty('ROOMTYPE', $_L['RMT_normtyp']); $fv->validateEmpty('ROOMCOUNT', "Please enter the number of rooms"); $fv->validateNumber('ROOMCOUNT', "Please enter valid number of rooms"); $fv->validateEmpty('ROOMCOST', "Please enter the pricing for the room", 1, 6); $fv->validateEmpty('CURRENCY', $_L['CUR_currency_error2'], 3, 3); if ($fv->checkErrors()) { $showPost = 1; // display errors $validationMsgs = "<div align=\"left\"><h2>" . $_L['PR_formerr'] . "</h2>" . $fv->displayErrors() . "</div>"; } else { $roomtype = trim($_POST['ROOMTYPE']); $roomcount = trim($_POST['ROOMCOUNT']); $roomcost = trim($_POST['ROOMCOST']); $currency = trim($_POST['CURRENCY']); $ratecode = "DEF_" . $roomtype; $date_started = date("d/m/Y");
break; case 'search': $search = $_GET["search"]; find($search); break; } } if (isset($_POST['Submit'])) { $conn = db_connect(HOST, USER, PASS, DB, PORT); $action = $_POST['Submit']; switch ($action) { case 'Update': // instantiate form validator object $fv = new formValidator(); //from functions.php $fv->validateEmpty('doc_no', 'Please enter document number.'); $fv->validateEmpty('doc_date', 'Please enter date'); $fv->validateEmpty('doc_date', 'Please enter details'); if ($fv->checkErrors()) { // display errors echo "<div align=\"center\">"; echo '<h2>Resubmit the form after correcting the following errors:</h2>'; echo $fv->displayErrors(); echo "</div>"; //search current record } else { $billno = $_POST["billno"]; $doc_type = $_POST["doc_type"]; $doc_no = $_POST["doc_no"]; $doc_date = $_POST["doc_date"]; $details = $_POST["details"];
include_once "queryfunctions.php"; include_once "login_check.inc.php"; include_once "functions.php"; access("agents"); //check if user is allowed to access this page if (isset($_GET["search"])) { find($_GET["search"]); } if (isset($_POST['Submit'])) { $action = $_POST['Submit']; switch ($action) { case 'Update': // instantiate form validator object $fv = new formValidator(); //from functions.php $fv->validateEmpty('agents_ac_no', 'Agents A/C No. must be entered'); $fv->validateEmpty('agentname', 'Agents name must be entered'); $fv->validateEmpty('telephone', 'Agents phone is required'); $fv->validateEmpty('town', 'Town is required'); $fv->validateEmpty('billing_address', 'Agents billing address is required'); if ($fv->checkErrors()) { // display errors echo "<div align=\"center\">"; echo '<h2>Resubmit the form after correcting the following errors:</h2>'; echo $fv->displayErrors(); echo "</div>"; } else { $agentname = $_POST["agentname"]; $agents_ac_no = $_POST["agents_ac_no"]; $contact_person = $_POST["contact_person"]; $telephone = $_POST["telephone"];
paginate($nRecords); find($_SESSION["strOffSet"]); } $guestid = $_POST['guestid']; //forgotten what this does if (isset($_POST['Submit'])) { $action = $_POST['Submit']; switch ($action) { case 'Book Guest': //if guest has not been selected exit // instantiate form validator object $fv = new formValidator(); //from functions.php if (empty($_POST["guestid"])) { //if no guest has been selected no point in displaying other errors $fv->validateEmpty('guestid', 'Sorry no guest information is available for booking'); } else { $fv->validateEmpty('no_adults', 'Please indicate number of people booking'); $fv->validateEmpty('booking_type', 'Please indicate if it\'s a Direct booking or Agent booking.'); $fv->validateEmpty('meal_plan', 'Please select Meal Plan'); $fv->validateEmpty('roomid', 'Please indicate room being booked'); } if ($fv->checkErrors()) { // display errors echo "<div align=\"center\">"; echo '<h2>Resubmit the form after correcting the following errors:</h2>'; echo $fv->displayErrors(); echo "</div>"; } else { $booking_type = $_POST["booking_type"]; $meal_plan = $_POST["meal_plan"];
$uri = ""; if ($guestid) { $uri = "?id=" . $guestid; } header("Location:advanced_profile.php" . $uri); return 1; } if (isset($_POST['Submit'])) { $action = $_POST['Submit']; switch ($action) { case $_L['GST_addguest']: case $_L['GST_updguest']: // instantiate form validator object $fv = new formValidator(); //from functions.php $fv->validateEmpty('lastname', $_L['GST_ferr1']); $fv->validateEmpty('firstname', $_L['GST_ferr2']); $fv->validateEmpty('pp_id_no', $_L['GST_ferr3']); $fv->validateEmpty('countrycode', $_L['GST_ferr4']); //if (!empty($_POST["email"])) $fv->validateEmail('email','Please enter a valid email address'); if ($fv->checkErrors()) { // display errors // display errors $validationMsgs = "<div align=\"left\"><h2>" . $_L['PR_formerr'] . "</h2>" . $fv->displayErrors() . "</div>"; } else { if (!$guestid && $_POST['guestid']) { $guestid = $_POST['guestid']; } $firstname = $_POST["firstname"]; $middlename = $_POST["middlename"]; $lastname = $_POST["lastname"];
if (isset($_POST['roomtypecount']) && $_POST['roomtypecount'] > 0) { for ($i = 1; $i <= $_POST['roomtypecount']; $i++) { if (isset($_POST['idx_' . $i])) { modify_roomtype($_POST['idx_' . $i], $_POST['roomtype_' . $i], $_POST['description_' . $i], $_POST['rateid_' . $i], $_POST['url_' . $i]); if (is_ebridgeCustomer()) { include_once dirname(__FILE__) . "/OTA/advancedFeatures/adv_functions.php"; CustomPagesFormRead(HTL_ROOM_TYPE, $_POST['idx_' . $i]); } } } } if ($_POST['newroomtype'] || $_POST['newdescription']) { // instantiate form validator object $fv = new formValidator(); //from functions.php $fv->validateEmpty('newroomtype', $_L['RMT_normtyp']); $fv->validateEmpty('newdescription', $_L['RMT_noitmdes']); if ($fv->checkErrors()) { // display errors echo "<div align=\"center\">"; echo "<h2>" . $_L['PR_formerr'] . "</h2>"; echo $fv->displayErrors(); echo "</div>"; } else { modify_roomtype(0, $_POST['newroomtype'], $_POST['newdescription'], $_POST['newrateid'], $_POST['newurl']); } } break; case $_L['BTN_delete']: delete_roomtype($_POST['idx_' . $i]); break;
$today = date("d/m/Y"); $tomorrow = date("d/m/Y", time() + 24 * 60 * 60); $validationMsgs = ""; if (isset($_POST['Submit'])) { $action = $_POST['Submit']; switch ($action) { case $_L['REG_register']: case $_L['BTN_update']: case $_L['REG_checkinbox']: case $_L['REG_checkoutbox']: case $_L['REG_Rcheckout']: //if guest has not been selected exit // instantiate form validator object $fv = new formValidator(); //from functions.php $fv->validateEmpty('no_adults', $_L['REG_noperson_err']); $fv->validateEmpty('roomid', $_L['REG_noroom_err']); if ($fv->checkErrors()) { // display errors $validationMsgs = "<div align=\"left\"><h2>" . $_L['PR_formerr'] . "</h2>" . $fv->displayErrors() . "</div>"; } else { $userid = $_SESSION["userid"]; $book_id = $_POST["book_id"]; $res_id = $_POST["reservation_id"]; $bill_id = $_POST["bill_id"]; $guestid = $_POST["guestid"]; $guestname = $_POST["guestname"]; $address = $_POST["address"]; $email = $_POST["email"]; $phone = $_POST["phone"]; $postal_code = $_POST['postal_code'];
if (isset($_POST['itemcount']) && $_POST['itemcount'] > 0) { for ($i = 1; $i <= $_POST['itemcount']; $i++) { $sale = 0; if (isset($_POST['sale_' . $i])) { $sale = 1; } if (isset($_POST['idx_' . $i])) { modify_item($_POST['idx_' . $i], $_POST['item_' . $i], $_POST['description_' . $i], $sale, $_POST['expense_' . $i], $_POST['itype_' . $i]); } } } if ($_POST['newitem'] || $_POST['newdescription']) { // instantiate form validator object $fv = new formValidator(); //from functions.php $fv->validateEmpty('newitem', $_L['ITM_noitm_err']); $fv->validateEmpty('newdescription', $_L['ITM_noitmdesc_err']); if ($fv->checkErrors()) { // display errors echo "<div align=\"center\">"; echo "<h2>" . $_L['PR_formerr'] . "</h2>"; echo $fv->displayErrors(); echo "</div>"; } else { modify_item(0, $_POST['newitem'], $_POST['newdescription'], $_POST['newsale'], $_POST['newexpense'], $_POST['newitype']); } } break; case $_L['BTN_delete']: case $_L['BTN_list']: //link ("self","agents_list.php");
$temprateType = get_ratetype_by_rateID($ratesid); if ($temprateType == DEFAULTRATE && $_POST['ratetype'] != DEFAULTRATE) { $isDefaultRateUsed = isRateUsed($ratesid); if ($isDefaultRateUsed == 1) { $allowChangeRate = 0; } } } if (isset($_POST['Submit'])) { $action = $_POST['Submit']; switch ($action) { case $_L['BTN_update']: case $_L['RTS_addrate']: $fv = new formValidator(); //from functions.php $fv->validateEmpty('code', $_L['RTS_noratecode_err']); // $fv->validateEmpty('description','Please enter rate description.'); $fv->validateEmpty('occupancy', $_L['RTS_nooccup_err']); $fv->validateEmpty('date_started', $_L['RTS_nostrtdate_err']); $fv->validateEmpty('date_stopped', $_L['RTS_noenddate_err']); $fv->validateEmpty('currencycode', $_L['RTS_nocurcode_err']); $fv->validateEmpty('minpax', $_L['RTS_nominprson_err']); $fv->validateNumber('minpax', $_L['RTS_minprson_nmric_err']); $fv->validateEmpty('maxpax', $_L['RTS_nomaxprson_err']); $fv->validateNumber('maxpax', $_L['RTS_maxprson_nmric_err']); $fv->validateEmpty('minstay', $_L['RTS_nominnghts_err']); $fv->validateNumber('minstay', $_L['RTS_minstay_nmric_err']); $fv->validateEmpty('maxstay', $_L['RTS_nomaxstay_err']); $fv->validateNumber('maxstay', $_L['RTS_maxstay_nmric_err']); $fv->validateEmpty('minbook', $_L['RTS_nominadv_err']); $fv->validateNumber('minbook', $_L['RTS_minadv_nmric_err']);
include_once dirname(__FILE__) . "/lang/lang_en.php"; access("rooms"); //check if user is allowed to access this page $logofile = Get_LogoFile(); $lang = get_language(); load_language($lang); //get the list of all the room number in the system $rmNoList = get_roomnolist(); if (isset($_POST['Submit'])) { $action = $_POST['Submit']; switch ($action) { case $_L['RM_addroom']: case $_L['BTN_update']: $fv = new formValidator(); //from functions.php $fv->validateEmpty('roomno', $_L['RMT_noroom']); if ($fv->checkErrors()) { // display errors $validationMsgs = "<div align=\"left\"><h2>" . $_L['PR_formerr'] . "</h2>" . $fv->displayErrors() . "</div>"; } else { /** * When the Room is to be added or updated the form data will be retrieved. * This includes the phone, room number etc which is then * submitted to the database. <br/> */ //gets photo. if (isset($_REQUEST['form_submit']) && 'form_uploader' == $_REQUEST['form_submit']) { if (is_uploaded_file($_FILES['photo']['tmp_name'])) { $filename = $_FILES['photo']['name']; $filetype = $_FILES['photo']['type']; $file_temp = $_FILES['photo']['tmp_name'];
$tt = 0; if ($_GET['optFind'] == "Name") { $tt = 1; } find_user($_GET["id"], $tt, $myuser); $id = $_GET['id']; } if (isset($_POST['Submit'])) { $action = $_POST['Submit']; switch ($action) { case $_L['USR_adduser']: case $_L['BTN_update']: // instantiate form validator object $fv = new formValidator(); //from functions.php $fv->validateEmpty('fname', $_L['ADM_nameerr']); $fv->validateEmpty('sname', $_L['ADM_famerr']); $fv->validateEmpty('loginname', $_L['ADM_loginerr']); $fv->validateEmpty('pass', $_L['ADM_passerr']); if ($fv->checkErrors()) { // display errors $validationMsgs = "<div align=\"left\"><h2>" . $_L['PR_formerr'] . "</h2>" . $fv->displayErrors() . "</div>"; } else { $userid = $_POST["userid"]; $fname = $_POST["fname"]; $sname = $_POST["sname"]; $loginname = $_POST["loginname"]; $pass = md5($_POST["pass"]); $phone = !empty($_POST["phone"]) ? $_POST["phone"] : ''; $mobile = !empty($_POST["mobile"]) ? $_POST["mobile"] : ''; $fax = !empty($_POST["fax"]) ? $_POST["fax"] : '';
Or for snail mail. P. O. Box 938, Kilifi-80108, East Africa-Kenya. /*****************************************************************************/ error_reporting(E_ALL & ~E_NOTICE); include_once "login_check.inc.php"; include_once "queryfunctions.php"; include_once "functions.php"; access("rooms"); //check if user is allowed to access this page if (isset($_POST['Submit'])) { $conn = db_connect(HOST, USER, PASS, DB, PORT); $action = $_POST['Submit']; switch ($action) { case 'Add Rooms Detail': $fv = new formValidator(); //from functions.php $fv->validateEmpty('roomno', 'Please enter room no.'); if ($fv->checkErrors()) { // display errors echo "<div align=\"center\">"; echo '<h2>Resubmit the form after correcting the following errors:</h2>'; echo $fv->displayErrors(); echo "</div>"; } else { //gets photo. if (isset($_REQUEST['form_submit']) && 'form_uploader' == $_REQUEST['form_submit']) { if (is_uploaded_file($_FILES['photo']['tmp_name'])) { $filename = $_FILES['photo']['name']; $filetype = $_FILES['photo']['type']; $file_temp = $_FILES['photo']['tmp_name']; } $filesize = filesize($file_temp);
include_once "login_check.inc.php"; include_once "queryfunctions.php"; include_once "functions.php"; $conn = db_connect(HOST, USER, PASS, DB, PORT); if (isset($_GET["search"])) { find($_GET["search"]); } $guestid = $_POST['guestid']; if (isset($_POST['Submit'])) { $action = $_POST['Submit']; switch ($action) { case 'Update': // instantiate form validator object $fv = new formValidator(); //from functions.php $fv->validateEmpty('booking_type', 'Please indicate if it\'s a Direct booking or Agent booking.'); $fv->validateEmpty('meal_plan', 'Please select Meal Plan'); //$fv->validateEmpty('countrycode','Please select country'); //$fv->validateEmpty('pp_no','Agents name must be entered'); if ($fv->checkErrors()) { // display errors echo "<div align=\"center\">"; echo '<h2>Resubmit the form after correcting the following errors:</h2>'; echo $fv->displayErrors(); echo "</div>"; } else { $booking_type = $_POST["booking_type"]; $meal_plan = $_POST["meal_plan"]; $no_adults = $_POST["no_adults"]; $no_child = $_POST["no_child"]; $checkin_date = "'" . $_POST["checkin_date"] . "'";
paginate($nRecords); free_result($results); find($_SESSION["strOffSet"]); } $guestid = $_POST['guestid']; if (isset($_POST['Submit'])) { $action = $_POST['Submit']; switch ($action) { case 'Guest Reservation': //if guest has not been selected exit // instantiate form validator object $fv = new formValidator(); //from functions.php if (empty($_POST["guestid"])) { //if no guest has been selected no point in displaying other errors $fv->validateEmpty('guestid', 'No guest has been selected for reservation.'); } else { $fv->validateEmpty('reservation_type', 'Please indicate if it\'s a Direct booking or Agent booking.'); $fv->validateEmpty('meal_plan', 'Please select Meal Plan'); $fv->validateEmpty('reserve_checkindate', 'Please enter checkin date for reservation'); $fv->validateEmpty('roomid', 'Please indicate room being booked'); } if ($fv->checkErrors()) { // display errors echo "<div align=\"center\">"; echo '<h2>Resubmit the form after correcting the following errors:</h2>'; echo $fv->displayErrors(); echo "</div>"; } else { $reserved_through = !empty($_POST["reservation_type"]) ? "'" . $_POST["reservation_type"] . "'" : 'NULL'; $guestid = $_POST["guestid"];
access("admin"); //check if user is allowed to access this page $logofile = Get_LogoFile(); // If the POST forms are set, override the retrieved settings $currency = ""; $countrycode = ""; if ($_POST['currencycode']) { $currency = $_POST['currencycode']; } if ($_POST['countrycode']) { $countrycode = $_POST['countrycode']; } if ($_POST['Save']) { $fv = new formValidator(); //from functions.php $fv->validateEmpty('countrycode', $_L['CUR_country_error']); $fv->validateEmpty('currencycode', $_L['CUR_currency_error1']); if (!empty($_POST['currencycode'])) { $fv->validateAlphabetic('currencycode', $_L['CUR_currency_error2']); } if ($fv->checkErrors()) { //display errors $validationMsgs = "<div align=\"left\"><h2>" . $_L['PR_formerr'] . "</h2>" . $fv->displayErrors() . "</div>"; } else { Save_Currency($countrycode, $currency); } } // Retrieve the currency for the country code currently set. $currency = Get_Currency_by_Countrycode($countrycode); ?>