function setRentRequest($item_id, $owner, $picdate, $dropdate) { $date1 = itemClass::ChangeDate($picdate); $date2 = itemClass::ChangeDate($dropdate); $message = $_POST['comment']; $sql = "insert into user_reservations set issue_date='" . $date1 . "',end_date='" . $date2 . "',item_id='" . $item_id . "', user_id='" . $_SESSION['user']['id'] . "',item_status='0',owner_id='" . $owner . "' "; $result = mysql_query($sql) or die(mysql_error()); $requestid = mysql_insert_id(); $sql = "insert into inbox set receiver_id='" . $owner . "',subject='rent request',content='" . $message . "',item_id='" . $item_id . "',sender_id='" . @$_SESSION['user']['id'] . "',date=now(),reservation_id='" . $requestid . "',read_status='0'"; $result = mysql_query($sql) or die(mysql_error()); return $result; }
<?php include '../include/alertHeader.php'; ini_set("display_errors", "2"); ERROR_REPORTING(E_ALL); if (isset($_POST['changeproposedDate'])) { $startdate = itemClass::ChangeDate($_POST['pickup']); $enddate = itemClass::ChangeDate($_POST['dropoff']); $reserveitem = $_POST['reserveid']; // reservation id $item_id = $_POST['item_id']; // item id $renter = $_POST['renter']; // user who is renting $status = user::changeitemStatus($reserveitem, 'post'); // change status of an item $subject = "Unmatched date"; $msg = "Please choose from given date.click here..."; $result = user::insertMessage($item_id, $renter, $reserveitem, $subject, $msg); // inserting $changeproposedDate = user::newProposaldate($startdate, $enddate, $reserveitem); //to send mails $receivename = $_SESSION['user']['user_fname']; $receivermail = $_SESSION['user']['user_email']; $fromname = $from_name; $fromemail = $from_email; $server_address = 'http://electricitynoida.com/spark'; $mailbody = '<div style=" width:738px; height:auto; overflow:hidden; margin:auto;"> <!--Listing Email--> <div style=" width:auto; height:auto; overflow:hidden; padding:0px; background:none;">