Server IP : 162.241.126.129 / Your IP : 3.147.82.22 Web Server : Apache System : Linux 162-241-126-129.cprapid.com 4.18.0-477.27.2.el8_8.x86_64 #1 SMP Fri Sep 29 08:21:01 EDT 2023 x86_64 User : rvway5nu4 ( 1018) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/rvway5nu4/www/ |
Upload File : |
<?php //require_once('./setting.php'); //echo ABSPATH; exit; // F:\xampp\htdocs\carivon/ include("./config/data.config.php"); include("$LIB_DIR/functions.lib.php"); include("$LIB_DIR/db.php"); include("$LIB_DIR/db/mysqli.php"); include("$LIB_DIR/data.constant.php"); include("$LIB_DIR/sitemsgs.php"); include("$LIB_DIR/class.paging.php"); include("$LIB_DIR/functions.mailer.php"); $error=''; $msg=''; if( !isset( $_SESSION['SESS_id'] ) && ( $_SESSION['SESS_type'] == 'AD' ) ){ $_SESSION['msg'] = '<div class="alert alert-warning" >There is no login.</div>'; header('Location: '.SUB_DIR_PROJECT.'/index.php'); exit; } global $SITE_URL, $IMG_DIR; $db = new Db( $DB_HOST, $DB_USERNAME, $DB_PASSWORD, $DB_NAME, $DB_REPORT_ERROR, $DB_PERSISTENT_CONN); // data: 'rent_startDate=' + rent_startDate + '&rent_endDate=' + rent_endDate + '&i_itemID=' + rent_rv_i_itemID + '¶=' + rent_rv_para + '&SESS_cust_i_customerID='+SESS_cust_i_customerID, $rent_startDate = $_REQUEST['rent_startDate']; $rent_endDate = $_REQUEST['rent_endDate']; $i_itemID = $_REQUEST['i_itemID']; $para = $_REQUEST['para']; $SESS_cust_i_customerID = $_REQUEST['SESS_cust_i_customerID']; //echo "<BR/>"; $SQL = "SELECT * FROM tbl_item_rent WHERE i_itemID = '".$i_itemID."' AND (rent_startDate BETWEEN '".$rent_startDate."' AND '".$rent_endDate."' ) OR (rent_endDate BETWEEN '".$rent_startDate."' AND '".$rent_endDate."' )"; //echo "<BR/>"; $rent_result=$db->query($SQL); if ($rent_result->num_rows) { $PROMPT ='<div class="alert alert-warning alert-dismissable"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">X</button> <strong><i class="fa fa-check-circle"></i> Success :</strong>Sorry, there following date are booked, so please try another date.<BR/>'.$booked_date_range.' </div>'; echo $_SESSION['msg'] = $PROMPT; //header('Location: '.SUB_DIR_PROJECT.'/item_detail.php?i_itemID='.$_REQUEST['i_itemID'].'¶='.$_REQUEST['para']); //exit; }else{ echo "<BR/>"; $sqlins = "INSERT INTO tbl_item_rent SET i_itemID = '".$i_itemID."' , rent_startDate = '".$rent_startDate."' , rent_endDate = '".$rent_endDate."', dt_addedDate = NOW(), i_addedByUserID = '".$SESS_cust_i_customerID."' "; echo "<BR/>"; //exit; $rent_result=$db->query($sqlins); $new_i_orderID = $db->getLastId(); if( $new_i_orderID > 0 ){ $PROMPT ='<div class="alert alert-success alert-dismissable"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">X</button> <strong><i class="fa fa-check-circle"></i> Success :</strong>Your order sumit successfully, Thanks we will contact soon.</div>'; $UserDetail = "select * from tbl_register where i_customerID='".$_REQUEST['SESS_cust_i_customerID']."'"; $Userresult = $db->query($UserDetail); foreach($Userresult->rows AS $key=>$valuser); $email = $valuser['email']; $UserName = $valuser['first_name']." ".$valuser['last_name']; $itemDetail = "select * from tbl_items where i_itemID='".$i_itemID."'"; $Itemresult = $db->query($itemDetail); foreach($Itemresult->rows AS $key=>$valitem); $ItemName = $valitem['v_title']; $to = "info@rvway.net"; $subject = "New Rent Booking"; $messageb = "<img src='http://rvway.net/project_rvway/img/logo-light.png' style='width:200px; height: 90px;' alt='http://rvway.net'/><br><br>" ; $messageb .= "<table style='width:675px;'><tr><td style='width:20px;border:1px solid #ccc;padding:10px;'><strong>Name:</strong></td><td style='width:200px;border:1px solid #ccc;padding:10px;'>". $UserName ."</td></tr>"; $messageb .= "<tr><td style='width:20px;border:1px solid #ccc;padding:10px;'><strong>Email Id:</strong></td><td style='width:200px;border:1px solid #ccc;padding:10px;'>" . $email . "</td></tr>"; $messageb .= "<tr><td style='width:20px;border:1px solid #ccc;padding:10px;'><strong>Start Date:</strong></td><td style='width:200px;border:1px solid #ccc;padding:10px;'>" . $rent_startDate . "</td></tr>"; $messageb .= "<tr><td style='width:20px;border:1px solid #ccc;padding:10px;'><strong>End Date:</strong></td><td style='width:200px;border:1px solid #ccc;padding:10px;'>" . $rent_endDate . "</td></tr>"; $messageb .= "<tr><td style='width:20px;border:1px solid #ccc;padding:10px;'><strong>Item:</strong></td><td style='width:200px;border:1px solid #ccc;padding:10px;'>" . $ItemName . "</td></tr>"; $messageb .= "</table>"; $headers = "From: New Rent Booking<info@rvway.net>\r\nReply-To: $email\r\nX-Mailer: PHP/" . phpversion() . "\r\n" ."MIME-Version: 1.0\r\n" ."Content-type: text/html; charset: utf8\r\n"; $repsub = "Rent Booking Item Detail"; $repmsg = "<img src='http://rvway.net/project_rvway/img/logo-light.png' style='width:200px; height: 90px;' alt='http://rvway.net'/><br><br>" ; $repmsg .= "<table style='width:675px;'><tr><td style='width:20px;border:1px solid #ccc;padding:10px;'><strong>Name:</strong></td><td style='width:200px;border:1px solid #ccc;padding:10px;'>". $UserName ."</td></tr>"; $repmsg .= "<tr><td style='width:20px;border:1px solid #ccc;padding:10px;'><strong>Email Id:</strong></td><td style='width:200px;border:1px solid #ccc;padding:10px;'>" . $email . "</td></tr>"; $repmsg .= "<tr><td style='width:20px;border:1px solid #ccc;padding:10px;'><strong>Start Date:</strong></td><td style='width:200px;border:1px solid #ccc;padding:10px;'>" . $rent_startDate . "</td></tr>"; $repmsg .= "<tr><td style='width:20px;border:1px solid #ccc;padding:10px;'><strong>End Date:</strong></td><td style='width:200px;border:1px solid #ccc;padding:10px;'>" . $rent_endDate . "</td></tr>"; $repmsg .= "<tr><td style='width:20px;border:1px solid #ccc;padding:10px;'><strong>Item:</strong></td><td style='width:200px;border:1px solid #ccc;padding:10px;'>" . $ItemName . "</td></tr>"; $repmsg .= "</table>"; $repmsg .= "Regards, Team Group<br>" ; $repmsg .= "www.rvway.net"; $repheaders = "From: Sales<no-reply@rvway.net>\r\nReply-To: $email\r\nX-Mailer: PHP/" . phpversion() . "\r\n" ."MIME-Version: 1.0\r\n" ."Content-type: text/html; charset: utf8\r\n"; if(mail($to, $subject, $messageb, $headers)){ mail($email, $repsub, $repmsg, $repheaders); } echo $_SESSION['msg'] = $PROMPT; //header('Location: '.SUB_DIR_PROJECT.'/item_detail.php?i_itemID='.$_REQUEST['i_itemID'].'¶='.$_REQUEST['para']); //exit; }else{ $PROMPT ='<div class="alert alert-warning alert-dismissable"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">X</button> <strong><i class="fa fa-check-circle"></i> Success :</strong>Sorry, could not submit,please try latter. </div>'; echo $_SESSION['msg'] = $PROMPT; //header('Location: '.SUB_DIR_PROJECT.'/item_detail.php?i_itemID='.$_REQUEST['i_itemID'].'¶='.$_REQUEST['para']); //exit; } } $booked_date_history = ''; $todate = date('Y-m-d'); $SQL1 = "SELECT * FROM tbl_item_rent WHERE i_itemID = '".$_REQUEST['i_itemID']."' AND rent_startDate > '".$todate."' ORDER BY rent_endDate DESC "; $rent1_result=$db->query($SQL1); if ($rent1_result->num_rows) { $count= 0; foreach($rent1_result->rows AS $key=>$val1 ) { $count++; $rent_startDate = date(DATE_FORMAT_FANCY, strtotime($val1['rent_startDate'])); $rent_endDate = date(DATE_FORMAT_FANCY, strtotime($val1['rent_endDate'])); $booked_date_history .= '<div class="alert alert-warning alert-dismissable" style="margin:5px;padding-bottom: 29px !important;height:50px;width:100%;" >'; //$booked_date_history .= '<strong>'.$rent_startDate.'</strong> : :<strong>'.$rent_endDate.'</strong><BR/>'; $booked_date_history .= '<div class="row" ><div class="col-lg-6 col-sm-16 col-xs-12" ><strong>'.$count.' : </strong>Booked Start Date '.$rent_startDate.'</div>'; $booked_date_history .= '<div class="col-lg-6 col-sm-12 col-xs-12" >Booked Ended Date '.$rent_endDate.'</div></div>'; $booked_date_history .= '</div>'; $histry_flag = 1; } } //echo $booked_date_history; ?>