File manager - Edit - /home/autoph/public_html/connect/home/check_in_out.php
Back
<?php include 'core/init.php'; protected_page(); $userID=$user_data['u_id']; $myCurTime=$currentTime; $dealID= $user_data['dealer']; $compID= $user_data['company']; $toDate = date_create() ->format("Y/m/d"); ?> <!---============================================================================================================================---> <!---LOADING NEWLY ENCODED APPOINTMENT LIST FOR UPDATING---> <!---============================================================================================================================---> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="css/style_menu.css"> <link rel="stylesheet" href="css/style.css"> <style> .body{ background:lightgray; } </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" 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"); $("#updateApptRecord").click(function(){ var Mileage= $("#Mileage").val(); var para= $("#para").val(); var updateApptPlate= $("#updateApptPlate").val(); var checkInOutSelect= $("#checkInOutSelect").val(); var MydealID= $("#MydealID").val(); var MycompID= $("#MycompID").val(); var addDate= $("#addDate").val(); var addTime= $("#addTime").val(); var addBy= $("#addBy").val(); if (updateApptPlate == "") { alert("Invalid Input. Please input plate number"); return false; } if (checkInOutSelect == "--Select--") { alert("Invalid Input. Please check your entry and try again"); return false; } if (checkInOutSelect == "") { alert("Invalid Input. Please check your entry and try again"); return false; } if (para == "") { alert("Invalid Input. Please check your entry and try again"); return false; } $.ajax({ url: "check_in_out_save.php", type: "POST", async: false, data: { "done": 1, "Mileage" :Mileage, "para": para, "updateApptPlate": updateApptPlate, "checkInOutSelect": checkInOutSelect, "MydealID": MydealID, "MycompID": MycompID, "addDate": addDate, "addTime": addTime, "addBy": addBy }, success: function(data){ //showActiveService(); alert("New Record Saved."); displayFromDatabase(); $('#updateApptPlate').val(''); $('#Mileage').val(''); } }) }); }); //retrieve and display function displayFromDatabase(){ $.ajax({ url: "check_in_out_save.php", type: "POST", async: false, data: { "display": 1 }, success: function(d){ $("#display_area").html(d); } }); } </script> <script> function showUser(str) { if (str == "") { document.getElementById("para").innerHTML = ""; return; } else { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById("para").innerHTML = xmlhttp.responseText; } } xmlhttp.open("GET","check_in_out_load_options.php?q="+str,true); xmlhttp.send(); } } </script> <!-- CODE FOR MODEL DROPDOWN AUTO Loading --> <!---============================================================================================================================---> <!---END OF SCRIPT---> <!---============================================================================================================================---> <!---============================================================================================================================---> <div id="showNewAppt" style='border:1px solid blue;width:99%;height:90%;min-height:300px;float:left;margin:5px;min-width:400px;background:lightgray;position:absolute;top:5px;left:5px;z-index:99999'> <h2 style='margin:0px;font-family:Verdana;font-size:22px;font-weight:normal;padding:5px;padding-bottom:-5px;color:black;border:0px solid red;'>☶ Check-In / Check-Out Vehicle</h2> <i style='font-family:Verdana;font-size:10px;color:black;padding-left:30px'>List of newly received service appointment </i> <div style='border:1px solid gray;width:99.3%;height:90%;min-height:250px;float:left;margin:5px;min-width:400px;background:lightgray;top:-10px;padding:0px'> <div class='bgColor' style='vertical-align:top;height:30px;margin:0px;width:99.5%;border-bottom:1px solid gray;padding:4px;font-family:Verdana;font-weight:normal;font-size:16px;color:#043062;padding-right:5px'> ☶ Daily Service Appointment Summary <div style='float:right;font-family:Verdana;font-size:15px;width:20px;background:lightgray;border:1px solid gray;text-align:center'> <a href='mainindex.php?id=1#' style='text-decoration:none;font-weight:bold;background:none'> ✕ </a> </div> </div> <div style='font-family:Vehicle;color:black;width:20%; padding:15px;border-right:0px solid gray; min-height:100px;float:left;margin:0px;min-width:250px;background:transparent'> <input type="hidden" id="addBy" value="<?php echo $userID;?>"> <input type="hidden" id="addDate" value="<?php echo $toDate;?>"> <input type="hidden" id="addTime" value="<?php echo $myCurTime;?>"> <input type="hidden" id="MycompID" value="<?php echo $compID;?>"> <input type="hidden" id="MydealID" value="<?php echo $dealID;?>"> <div style='text-align:left;float:rigaht;width:100%;border:0px solid red;margin:1px;padding-left:0px;'> <b style='font-family:Verdana;font-size:12px;color:blue;margin-left:0px;font-weight:normal;background:yellow;padding:1px'>VEHICLE PLATE: </b> <input type='text' id='updateApptPlate' onkeyup="this.value = this.value.toUpperCase()"; style="margin-top:-0px;width:100%;text-align:center;font-weight:normal;border:1px solid black;min-width:100px;padding:10px;font-size:40px;"> </div> <div style='text-align:left;float:right;width:100%;border:0px solid red;margin:1px;padding-left:0px;'> <b style='font-family:Verdana;font-size:12px;color:blue;margin-left:0px;font-weight:normal;background:yellow;padding:1px'>SELECT ACTION</b> <select id='checkInOutSelect' onchange="showUser(this.value)" style='margin-top:-0px;width:100%;border:1px solid black;font-family:Verdana;font-size:14px;color:red; font-weight:normal'> <option value="">--Select--</option> <option value="IN">CHECK-IN</option> <option value="OUT">CHECK-OUT</option> </select> </div> <div style='text-align:left;float:right;width:100%;border:0px solid red;margin:1px;padding-left:0px;'> <b style='font-family:Verdana;font-size:12px;color:blue;margin-left:0px;font-weight:normal;background:yellow;padding:1px'>SELECT REASON:</b><br> <select id='para' style='margin-top:-0px;width:100%;font-family:Verdana;font-size:14px;color:red;border:1px solid black;font-weight:normal'> </select> </div> <div style='text-align:left;float:right;width:100%;border:0px solid red;margin:1px;padding-left:0px;'> <b style='font-family:Verdana;font-size:12px;color:blue;margin-left:0px;font-weight:normal;background:yellow;padding:1px'>Mileage: </b><br> <input type='text' id='Mileage' style="margin-top:-0px;width:100%;text-align:center;color:red;font-weight:normal;border:1px solid black;min-width:100px;padding:10px;font-size:18px;"> </div> <div style='float:right;width:100%;border:0px solid red;margin:1px;text-align:right;padding-right:3px'> <input type='submit' id='updateApptRecord' value="Update Record" style="width:100%;text-align:center;font-weight:normal;min-width:60px;padding:8px;font-family:Verdana;font-size:18px;border-radius:0px;padding:20px"> </div> </div> <div id="display_area" style='float:center;overflow:auto;border:1px solid gray; height:90%;min-height:100px;margin:0px;min-width:400px;background: #edeceb ;padding:10px'> <div class='bgColor' style='vertical-align:top;height:30px;margin:0px;width:99.3%;border-bottom:1px solid gray;padding:4px;font-family:Verdana;font-weight:normal;font-size:16px;color:#043062;padding-right:5px'> ☶ Daily Appointment List <div style='float:right;font-family:Verdana;font-size:15px;width:20px;background:lightgray;border:1px solid gray;text-align:center'> <a href='mainindex.php?id=1#' style='text-decoration:none;font-weight:bold;background:none'> ✕ </a> </div> </div> <?php $getApptSum = mysql_query("SELECT * FROM `vts_service_transaction` WHERE `appt_date` = '$toDate' AND `s_deal_code`='$dealID' AND `date_closed`='' || `transferred_to`='$dealID' AND `transfer_date`='$toDate' AND `date_closed`='' ORDER BY `time_slot_code` ASC"); echo "<table id='apptSummary' style='width:100%;background:white;border:1px solid black'>"; echo "<thead>"; echo "<tr class='tablehead'> <th class='bgBlue;font-color:black;width:15%'>REC.NOX</th> <th class='bgBlue;font-color:black;width:15%'>V. Plate</th> <th class='bgBlue;font-color:black;width:15%'>RO #</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%'>Appt. Date </th> <th class='bgBlue;font-color:black;width:10%'>Arrived Time </th> <th class='bgBlue;font-color:black;width:10%'>Current Status </th> </tr> </thead>"; while($row=mysql_fetch_array($getApptSum)){ if($row['s_ro_no']===''){ $tColor="red"; }else{ $tColor="black"; } if($row['s_arrived_time']==''){ if($row['transferred_to']=='NA'){ $status="Waiting"; }else{ $status="Transferred: Waiting"; } }else{ if($row['transferred_to']!='NA'){ $status="Transferred: Arrived"; }else{ $status="Arrived"; } } $brandName=mysql_result(mysql_query("SELECT `v_brand` FROM `vts_vehicle_lists` WHERE `v_plate`='".$row['s_v_plate']."'"),0); $modelName=mysql_result(mysql_query("SELECT `v_model` FROM `vts_vehicle_lists` WHERE `v_plate`='".$row['s_v_plate']."'"),0); //$brandName = mysql_result(mysql_query("SELECT `b_name` FROM `vts_brands` WHERE `b_id`='$brandID'"),0); //$modelName = mysql_result(mysql_query("SELECT `m_name` FROM `vts_model` WHERE `m_id`='$brandID'"),0); if($status==='Arrived' || $status='Transferred: Arrived'){ ?><tr><?php }else{ ?><tr onclick="javascript:showApptInfo(this);"><?php } echo "<td style='font-size:12px;color:$tColor'>".$row['s_id']."</td>"; echo "<td style='font-size:12px;color:$tColor'>".$row['s_v_plate']."</td>"; echo "<td style='font-size:12px;color:$tColor'>".$row['s_ro_no']."</td>"; echo "<td style='font-size:12px;color:$tColor'>".$brandName."</td>"; echo "<td style='font-size:12px;color:$tColor'>".$modelName."</td>"; echo "<td style='font-size:12px;color:$tColor'>".$row['s_appt_type']."</td>"; echo "<td style='font-size:12px;color:$tColor'>".$row['appt_date']."</td>"; echo "<td style='font-size:12px;color:$tColor'>".$row['s_arrived_time']."</td>"; echo "<td style='font-size:12px;color:$tColor'>".$status."</td>"; echo "</tr>"; } echo "</table>"; ?> </div> </div> </div> <script type="text/javascript"> $(document).ready(function() { $('.tablecell').click(function() { return false; }).dblclick(function() { window.open("your_url"); return false; }); }); </script> <script language="javascript" type="text/javascript"> function showApptInfo(row) { var x=row.cells; document.getElementById("updateApptPlate").value = x[1].innerHTML; } </script> <!---============================================================================================================================---> <!---END CODE LOAD NEW SERVICE APPT---> <!---============================================================================================================================--->
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings