File manager - Edit - /home/autoph/public_html/voc/home/sub_update_ongoing_service.php
Back
<?php include 'core/init.php'; $myCurTime=$currentTime; $dealID= $user_data['dealer']; $compID= $user_data['company']; ?> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script type="text/javascript"> function viewList() { var div = document.getElementById("hidden_div"); if (div.style.display == 'none') { div.style.display = ''; } else { div.style.display = 'none'; } } function closeROForm() { var div = document.getElementById("closeRODialogBox"); if (div.style.display == 'none') { div.style.display = ''; } else { div.style.display = 'none'; } } </script> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> .myCheckbox input { // display: none; // Better than display: none for accessibility reasons position: relative; z-index: -9999; } .myCheckbox span { width: 20px; height: 20px; display: block; background: url("link_to_image"); } .myCheckbox input:checked + span { background: url("link_to_another_image"); } </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div id="wait" style="display:none;width:69px;height:89px;border:0px solid red;position:absolute;top:50%;left:50%;padding:2px;"> <img src='images/demo_wait.gif' width="64" height="64" /><br>Loading..</div> <!-- add jquery --> <script type="text/javascript"> $(document).ready(function(){ $('#serveT').on('change', function() { if ( this.value == '5') { $("#para").show(); $("#stageLabel").show(); } else { $("#para").hide(); $("#stageLabel").hide(); $("#para").val('NA'); } }); }); </script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript"> $(document).ready(function(){ //loading gif animator during query or page load $(document).ajaxStart(function(){ $("#wait").css("display", "block"); }); $(document).ajaxComplete(function(){ $("#wait").css("display", "none"); }); //alert("Its working"); $("#serviceUpdate").click(function(){ var CsDealID = $("#CsDealID").val(); var CsCompID = $("#CsCompID").val(); var CaddBy = $("#CaddBy").val(); var CaddDate = $("#CaddDate").val(); var CaddTime = $("#CaddTime").val(); var serveT = $("#serveT").val(); var para = $("#para").val(); var serviceNotes = $("#serviceNotes").val(); var UpdateMyRO = $("#UpdateMyRO").val(); var uVPlate = $("#uVPlate").val(); var updateEmail = $("#updateEmail").val(); var updateSMS = $("#updateSMS").val(); if (serviceNotes == "") { alert("Invalid Input. Please fill in all required information."); return false; } $.ajax({ url: "sub_update_ongoing_service_save_update.php", type: "POST", async: false, data: { "done": 1, "uVPlate": uVPlate, "updateEmail": updateEmail, "para": para, "updateSMS": updateSMS, "CsDealID": CsDealID, "CsCompID" : CsCompID, "CaddBy": CaddBy, "UpdateMyRO": UpdateMyRO, "serviceNotes": serviceNotes, "CaddTime" : CaddTime, "CaddDate" : CaddDate, "serveT" : serveT }, success: function(data){ alert("New Record Saved."); //displayFromDatabase(); $('#uVPlate').val(''); } }) }); //CLOSING RO $("#ConfirmcloseROForm").click(function(){ var closeThisRO = $("#closeThisRO").val(); var CLaddBy = $("#CLaddBy").val(); var CLaddDate = $("#CLaddDate").val(); var CLaddTime = $("#CLaddTime").val(); var reasonForClosing = $("#reasonForClosing").val(); if (closeThisRO == "") { alert("Error. Missing or Invalid RO#."); return false; } $.ajax({ url: "sub_close_ro_save.php", type: "POST", async: false, data: { "done": 1, "CLaddBy": CLaddBy, "CLaddDate": CLaddDate, "CLaddTime": CLaddTime, "reasonForClosing": reasonForClosing, "closeThisRO" : closeThisRO }, success: function(data){ alert("New Record Saved."); //displayFromDatabase(); //$('#uVPlate').val(''); } }) }); }); </script> <body> <?php date_default_timezone_set('Asia/Singapore'); $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(0); //if submit/ save to databasevar if(isset($_POST['done'])){ $sDealID = mysql_escape_string($_POST['sDealID']); $searchPlate = mysql_escape_string($_POST['searchPlate']); $sCompID = mysql_escape_string($_POST['sCompID']); $addBy = mysql_escape_string($_POST['addBy']); $addDate = mysql_escape_string($_POST['addDate']); $addTime = mysql_escape_string($_POST['addTime']); $SelRONumberA = mysql_escape_string($_POST['SelRONumberA']); //insert //mysql_query("INSERT INTO vts_company (comp_code, comp_name, comp_address,comp_city, comp_remarks,comp_contact, date, add_by) //VALUES('{$compCode}','{$compName}','{$compAddress}','{$compLocation}','{$compRemarks}','{$compContact}','{$addDate}','{$addBy}')"); exit(); } //display from database if(isset($_POST['display'])){ $sDealID = mysql_escape_string($_POST['sDealID']); $searchPlate = mysql_escape_string($_POST['searchPlate']); $sCompID = mysql_escape_string($_POST['sCompID']); $addBy = mysql_escape_string($_POST['addBy']); $addDate = mysql_escape_string($_POST['addDate']); $addTime = mysql_escape_string($_POST['addTime']); $SelRONumberA = mysql_escape_string($_POST['SelRONumberA']); $chkStatus = mysql_result(mysql_query("SELECT `service_status` FROM `vts_service_transaction` WHERE `s_ro_no`='$SelRONumberA'"),0); echo "<table style='width:100%;'>"; echo "<thead> <tr> <th class='bgBlue;font-color:black;width:15%'>R.O Number</th> <th class='bgBlue;font-color:black;width:15%'>V. Plate</th> <th class='bgBlue;font-color:black;width:40%'>V. Brand</th> <th class='bgBlue;font-color:black;width:40%'>V. Model</th> <th class='bgBlue;font-color:black;width:15%'>Type </th> <th class='bgBlue;font-color:black;width:10%'>Date </th> <th class='bgBlue;font-color:black;width:10%'>Time </th> </tr> </thead>"; $result = mysql_query("SELECT * FROM vts_service_transaction WHERE `s_ro_no`='$SelRONumberA'"); // echo "My RO: ". $SelRONumberA; while($row=mysql_fetch_array($result)){ $cBrand = mysql_result(mysql_query("SELECT `b_name` FROM `vts_brands` WHERE `b_id`='".$row['brand_id']."'"),0); $cModel = mysql_result(mysql_query("SELECT `m_name` FROM `vts_model` WHERE `m_id`='".$row['brand_id']."'"),0); $appTime = mysql_result(mysql_query("SELECT `time_slot` FROM `vts_service_slots` WHERE `slot_id`='".$row['time_slot_code']."'"),0); $appDate = $row['appt_date']; $sPlate = $row['s_v_plate']; $arrivedDate = $row['s_arrived_date']; $sRoNumber = $row['s_ro_no']; $arrivedTime = $row['s_arrived_time']; $chkIfTransferred= $row['transferred_to']; $chkIfReturned= $row['transfer_return_date']; echo "<tr>"; echo "<td style='padding:15px;background:#fcfda5;font-size:12px'>".$sRoNumber."</td>"; echo "<td style='padding:15px;background:#fcfda5;font-size:12px'>".$row['s_v_plate']."</td>"; echo "<td style='padding:15px;background:#fcfda5;font-size:12px'>".$cBrand."</td>"; echo "<td style='padding:15px;background:#fcfda5;font-size:12px'>".$cModel."</td>"; echo "<td style='padding:15px;background:#fcfda5;font-size:12px'>".$row['s_appt_type']."</td>"; echo "<td style='padding:15px;background:#fcfda5;font-size:12px'>".$row['appt_date']."</td>"; echo "<td style='padding:15px;background:#fcfda5;font-size:12px'>".$appTime."</td>"; //<input type="submit" id="sendA" value="☶ Update" onclick="viewList()" style='height:30px;width:95px;text-align:center;padding:0px'> echo"</td>"; echo "</tr>"; } echo "<tr>"; echo "<td colspan='4' style='height:300px;padding:0px;border:1px solid white'>"; ?> <div id="hidden_divA" style="min-width:400px;overflow:autoh;position:relative;top:00px;left:00px;width:100%;height:378px;z-index:99999;background: #f0f95f ;border:0px solid red;border-right:1px solid lightgray"> <div id = "closeRODialogBox" style='position:absolute;width:400px;height:200px;background:#e5e3e2;border:1px solid red;display:none;top:50px;left:100px;'> <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;color:#043062;font-size:14px'> CLOSING R.O# <?php echo $SelRONumberA;?><div style='padding-right:5px;float:right;font-family:Verdana;font-size:15px;'> <a href="#" onclick="closeROForm()" style='font-weight:bold'> ✕ </a> </div> <p style="text-align:center;margin-top:5px;padding:10px;font-family:Verdana;font-size:12px;">Are you sure you want to close this R.O # <br><?php echo $SelRONumberA;?>?</p> <center> <input type="text" id="reasonForClosing" placeholder="Reason for closing this R.O" style="width:80%;margin:0px;padding:5px;"> <input type="hidden" id="closeThisRO" value="<?php echo $SelRONumberA; ?>"> <input type="hidden" id="CLaddBy" value="<?php echo $addBy;?>" style="width:200px;padding:5px;font-family:Verdana;font-size:14px"> <input type="hidden" id="CLaddDate" value="<?php echo $addDate;?>" style="width:200px;padding:5px;font-family:Verdana;font-size:14px"> <input type="hidden" id="CLaddTime" value="<?php echo $myCurTime;?>" style="width:200px;padding:5px;font-family:Verdana;font-size:14px"> <br><br> <input type='submit' value='Yes' id="ConfirmcloseROForm" style='width:20%;margin:10px;min-width:50px;padding:5px; font-weight:normal;color:black;border:1px solid lightgray'> <input type='submit' value='Exit' onclick="closeROForm()" style='width:20%;margin:10px;min-width:50px;padding:5px;ont-weight:normal;color:black;border:1px solid lightgray'> </center> </div> </div> <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;color:#043062;font-size:14px'>☶ Service Update: <div style='padding-right:5px;float:right;font-family:Verdana;font-size:15px;'> <a href='mainindex.php?id=22&d=1' style='font-weight:bold'> ✕ </a> </div> </div> <input type="hidden" id="CaddBy" value="<?php echo $addBy;?>" style="width:200px;padding:5px;font-family:Verdana;font-size:14px"> <input type="hidden" id="CaddDate" value="<?php echo $addDate;?>" style="width:200px;padding:5px;font-family:Verdana;font-size:14px"> <input type="hidden" id="CaddTime" value="<?php echo $myCurTime;?>" style="width:200px;padding:5px;font-family:Verdana;font-size:14px"> <input type="hidden" id="CsCompID" value="<?php echo $sCompID;?>" style="width:200px;padding:5px;font-family:Verdana;font-size:14px"> <input type="hidden" id="CsDealID" value="<?php echo $sDealID;?>" style="width:200px;padding:5px;font-family:Verdana;font-size:14px"> <input type="hidden" id="uVPlate" value="<?php echo $sPlate;?>" style="width:200px;padding:5px;font-family:Verdana;font-size:14px"> <?php $getStatData = mysql_query("SELECT * FROM `vts_service_status` WHERE `deal_id`='$sDealID' || `open`='YES' ORDER BY `serv_id` ASC"); ?> <br><b style='font-family:Verdana;font-size:12px;color:blue;margin-left:0px;font-weight:normal;background:yellow;margin-left:10px'>Select Update:</b> <input type="text" id="UpdateMyRO" value = "<?php echo $SelRONumberA;?>" style="display:none;maring-left:100px;padding-right:50px"> <Select name='ServiceType' id='serveT' style='width:95%;margin:10px;min-width:100px;padding:8px;'> <?php while($row=mysql_fetch_array($getStatData)){ $curStat = $row['serv_id']; $checkIfUpdateExist=mysql_result(mysql_query("SELECT COUNT('log_id') FROM `vts_service_status_logs` WHERE `ro_number`='$SelRONumberA' AND `deal_id`='$sDealID' AND `status`='$curStat'"),0); if($checkIfUpdateExist > 0){ } else { echo "<option value='".$row['serv_id']."'>".$row['service_desc']."</option>"; } } echo "</select>"; ?> <b id="stageLabel" style='display:none;font-family:Verdana;font-size:12px;color:blue;margin-left:0px;font-weight:normal;background:yellow;margin-left:10px'>Painting Stage:</b><br> <Select name='para' id='para' style='display:none;width:50%;margin:10px;min-width:100px;padding:8px;'> <option value="NA">--Select--</option> <option value="prep">Paint Preperation</option> <option value="spray">Color Spraying</option> <option value="buff">Polishing/Buffing</option> </select> <?php echo "<textarea id='serviceNotes' rows='2' style='width:95%;margin:10px;min-width:100px;padding:3px;'></textarea>"; echo "<div style='border:0px solid red;padding:5px'> <Select name='ServiceTypeSMS' id='updateSMS' style='width:12%;margin:5px;min-width:70px;padding:4px;'>"; echo "<option value='NO'>NO</option>"; echo "<option value='YES'>YES</option>"; echo "</select><b style='font-family:Verdana;font-size:10px;color:black;font-weight:normal'>Update Client Via SMS</b>"; echo "<Select name='ServiceTypeEmail' id='updateEmail' style='font-size:12px;margin-left:50px;width:12%;margin:5px;min-width:70px;padding:4px;'>"; echo "<option value='NO'>NO</option>"; echo "<option value='YES'>YES</option>"; echo "</select><b style='font-family:Verdana;font-size:10px;color:black;font-weight:normal'>Update Client Via E-mail</b>"; echo "</div>"; if($chkStatus==1){ //CLOSED echo " <input type='submit' id='serviceUpdate' value='UPDATE' $buttonStat style='width:20%;margin:10px;min-width:50px;padding:10px;'> "; ?> <input type='submit' id='closeRepairOrder' value='CLOSE R.O' disabled onclick="closeROForm()" style='font-size:14px;color:gray; background:lightgray;border:1px solid gray; width:30%;margin:10px;min-width:50px;padding:10px;float:right;font-weight:bold;border:1px solid gray'> </div> <?php }else { if($chkIfTransferred == 'NA'){ //if no transfer echo " <input type='submit' id='serviceUpdate' value='UPDATE' $buttonStat style='width:20%;margin:10px;min-width:50px;padding:10px;'> "; ?> <input type='submit' id='closeRepairOrder' value='CLOSE R.O' onclick="closeROForm()" style='width:30%;margin:10px;min-width:50px;padding:10px;float:right;font-weight:bold;color:red;border:1px solid red'> </div> <?php }else{ if($chkIfTransferred == $sDealID){ //if no transfer echo " <input type='submit' id='serviceUpdate' value='UPDATE' $buttonStat style='width:20%;margin:10px;min-width:50px;padding:10px;'> "; ?> <input type='submit' id='closeRepairOrder' value='CLOSE R.O' disabled onclick="closeROForm()" style='font-size:14px;color:gray; background:lightgray;border:1px solid gray; width:30%;margin:10px;min-width:50px;padding:10px;float:right;font-weight:bold;border:1px solid gray'> </div> <?php }else{ echo " <input type='submit' id='serviceUpdate' value='UPDATE' $buttonStat style='font-size:14px;color:gray; background:lightgray;border:1px solid gray; width:20%;margin:10px;min-width:50px;padding:10px;'> "; ?> <input type='submit' id='closeRepairOrder' value='LOSE R.O' disabled onclick="closeROForm()" style='font-size:14px;color:gray; background:lightgray;border:1px solid gray; width:30%;margin:10px;min-width:50px;padding:10px;float:right;font-weight:bold;border:1px solid gray'> </div> <?php } } } echo "</td>"; echo "<td colspan='3' style='height:300px;padding:0px;border:1px solid white'>"; ?> <div id="hidden_divA" style="position:relative;top:00px;left:00px;width:100%;height:378px;z-index:99999;background:white;border:1px solid white;border-right:1px solid lightgray"> <div class='bgColor' style='overflow:auto;vertical-align:top;height:50%;margin:0px;width:100%;border:0px solid red;padding:5px;font-family:Verdana;font-weight:normal;color:#043062;font-size:14px'> <?php $loadInfoA = mysql_query("SELECT * FROM `vts_service_status_logs` WHERE `ro_number`='$sRoNumber' ORDER BY `log_id` DESC"); echo "<table style='width:100%;'>"; echo "<thead> <tr> <th class='bgBlue;font-color:black; font-size:10px'>LAST UPDATE</th> <th class='bgBlue;font-color:black; font-size:10px;width:10%'>DATE</th> <th class='bgBlue;font-color:black; font-size:10px;width:10%'>TIME</th> <th class='bgBlue;font-color:black; font-size:10px'>NOTES</th> </tr> </thead>"; while($lrow=mysql_fetch_array($loadInfoA)){ //$no = $no + 1; $statID = $lrow['status']; $paintStage = $lrow['paint_stage']; if($paintStage!='NA'){ $subStage="/".$paintStage; }else{ $subStage=""; } $lstMove = mysql_result(mysql_query("SELECT `service_desc` FROM `vts_service_status` WHERE `serv_id`='$statID' "),0); echo "<tr>"; // echo "<td style='padding:2px;font-size:10px'>".$no."</td>"; echo "<td style='padding:2px;font-size:10px'>".$lstMove." ".$subStage."</td>"; echo "<td style='padding:2px;font-size:10px'>".$lrow['date']."</td>"; echo "<td style='padding:2px;font-size:10px'>".$lrow['time']."</td>"; echo "<td style='padding:2px;font-size:10px'>".$lrow['notes']."</td>"; echo"</td>"; echo "</tr>"; } echo "</table>"; ?> </div> <div class='bgColor' style='overflow:auto;vertical-align:top;height:50%;margin:0px;width:100%;border:0px solid red;padding:5px;font-family:Verdana;font-weight:normal;color:#043062;font-size:14px'> <?php $loadInfoB = mysql_query("SELECT * FROM vts_in_out_history WHERE `chk_plate`='$sPlate' AND `date` >= '$appDate' AND `deleted`='0' ORDER BY `chk_id` DESC"); echo "<table style='width:100%;'>"; echo "<thead> <tr> <th class='bgBlue;font-color:black; font-size:10px'>Mileage</th> <th class='bgBlue;font-color:black; font-size:10px'>IN / OUT</th> <th class='bgBlue;font-color:black; font-size:10px'>DATE</th> <th class='bgBlue;font-color:black; font-size:10px'>TIME</th> <th class='bgBlue;font-color:black; font-size:10px'>LOCATION</th> <th class='bgBlue;font-color:black; font-size:10px'>NOTES</th> </tr> </thead>"; while($lrow=mysql_fetch_array($loadInfoB)){ $no = $no + 1; echo "<tr>"; echo "<td style='padding:2px;font-size:10px'>".$lrow['chk_km']."</td>"; echo "<td style='padding:2px;font-size:10px'>"; if($lrow['chk_transaction']==='IN'){ echo 'CHECKED-IN'; }else{ echo 'CHECKED-OUT'; } ;"</td>"; echo "<td style='padding:2px;font-size:10px'>".$lrow['date']."</td>"; echo "<td style='padding:2px;font-size:10px'>".$lrow['time']."</td>"; //echo "<td style='padding:2px;font-size:10px'>"; // $getCompName = mysql_result(mysql_query("SELECT `comp_name` FROM `vts_company` WHERE `comp_id`='".$lrow['comp_code']."'"),0); // echo $getCompName; //echo"</td>"; echo "<td style='padding:2px;font-size:10px'>"; $getDealName = mysql_result(mysql_query("SELECT `deal_name` FROM `vts_dealerships` WHERE `deal_id`='".$lrow['dealer_code']."'"),0); echo $getDealName; echo"</td>"; echo "<td style='padding:2px;font-size:10px'>"; $getLocName = mysql_result(mysql_query("SELECT `out_description` FROM `vts_check_out_reasons` WHERE `out_id`='".$lrow['location_code']."'"),0); echo $getLocName; echo"</td>"; echo"</td>"; echo "</tr>"; } echo "</table>"; ?> </div> <?php echo "</td>"; echo "<tr>"; echo "</table>"; exit(); } ?> </body> </html>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings