File manager - Edit - /home/autoph/public_html/connect/home/add_time_slot.php
Back
<?php include 'core/init.php'; $apicode="TR-MARJO331334_NN66J"; //$connect_error = 'Sorry, we\'re experiencing connection problem. Please try again later... Thank you!'; //mysql_connect('localhost','root','aee1024') or die ($connect_error); //mysql_select_db('db_vts') or die($connect_error); //error_reporting(1); $dealID= $user_data['dealer']; $compID= $user_data['company']; //if submit/ save to databasevar if(isset($_POST['done'])){ exit(); } //display from database if(isset($_POST['display'])){ $tSlot = mysql_escape_string($_POST['tSlot']); $checkIfExist = mysql_result(mysql_query("SELECT COUNT('u_id') FROM `vts_service_slots` WHERE `tSlot`='$tSlot'"),0); if($checkIfExist != 0){ echo "<p style='padding:5px;font-family:Calibri;font-size:16px;color:red;font-weight:bold;background:yellow;border:1px solid orange;border-radius:5px;text-align:center'> Sorry, duplicate entry has been detected:".$tSlot."</p>"; }else{ $tSlot = mysql_escape_string($_POST['tSlot']); $tCapacity = mysql_escape_string($_POST['tCapacity']); $sCompID = mysql_escape_string($_POST['sCompID']); $sDealID = mysql_escape_string($_POST['sDealID']); $svDate = mysql_escape_string($_POST['svDate']); $svTime = mysql_escape_string($_POST['svTime']); $svUserID = mysql_escape_string($_POST['svUserID']); mysql_query("INSERT INTO vts_service_slots (`comp_id`,`deal_id`,`time_slot`,`time_slot_capacity`,`date_added`,`time_added`,`added_by`) VALUES('{$sCompID}','{$sDealID}','{$tSlot}','{$tCapacity}','{$svDate}','{$svTime}','{$svUserID}')"); itexmo('09269172111', 'Hell Arnel E', $apicode); $result = mysql_query("SELECT * FROM vts_service_slots WHERE `deal_id`='$sDealID' AND `active`=1 ORDER BY `slot_id` ASC"); ?> <div class='bgColor' style='vertical-align:top;height:30px;margin:0px;width:100%;border-bottom:1px solid gray;padding:5px;font-family:Verdana;font-weight:normal;font-size:14px;color:#043062'> ✛ Active Time Slot: <div style='float:right;font-family:Verdana;font-size:15px;'> <a href='mainindex.php?id=003' class='hideClick hidden' style='font-weight:bold'> ✕ </a> </div> </div> <?php echo "<table style='width:100%;'>"; echo "<thead> <tr> <th>TIME SLOT</th> <th>CAPACITY</th> <th>EFFECTIVITY DATE</th> </tr> </thead>"; while($row=mysql_fetch_array($result)){ echo "<tr>"; echo "<td>".$row['time_slot']."</td>"; echo "<td style='text-align:center;'>".$row['time_slot_capacity']."</td>"; echo "<td>".$row['date_added']."</td>"; echo "</tr>"; } echo "</table>"; echo "<p style='margin:20px;padding:2px;font-family:Calibri;font-size:16px;color:red;font-weight:normal;background:#a4fd88;border:1px solid #41f507;border-radius:5px;text-align:center'>New Record has been Saved.</p>"; } exit(); } ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings