File manager - Edit - /home/autoph/public_html/voc/home/includes/dashboard/check_in_out.php
Back
<html> <head> <!-- JS FOR SHOW/HIDE CHECKIN/OUT DIV --> <script src="script/jquery-3.2.1.min.js"></script> <script type="text/javascript"> $(function () { $('.showClick').click(function () { $('.hidden').show(); $('.shodDiv').hide(); }); $('.hideClick').click(function () { $('.hidden').hide(); $('.show').show(); $('.shodDiv').show(); }); }); </script> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> .hidden { display:none; background: -webkit-linear-gradient(left top,#bbc2c2,#fff ); /* For Safari 5.1 to 6.0 */ background: -o-linear-gradient(bottom right, #bbc2c2,#fff); /* For Opera 11.1 to 12.0 */ background: -moz-linear-gradient(bottom top, #bbc2c2,#fff); /* For Firefox 3.6 to 15 */ background: linear-gradient(to bottom right, #bbc2c2,#fff ); /* Standard syntax */ } .shodDiv { display:block; background: -webkit-linear-gradient(left top,#bbc2c2,#fff ); /* For Safari 5.1 to 6.0 */ background: -o-linear-gradient(bottom right, #bbc2c2,#fff); /* For Opera 11.1 to 12.0 */ background: -moz-linear-gradient(bottom top, #bbc2c2,#fff); /* For Firefox 3.6 to 15 */ background: linear-gradient(to bottom right, #bbc2c2,#fff ); /* Standard syntax */ } a{ text-decoration:none; } .loader { border: 16px solid #f3f3f3; border-radius: 50%; border-top: 16px solid blue; border-bottom: 16px solid blue; width: 120px; height: 120px; -webkit-animation: spin 2s linear infinite; animation: spin 2s linear infinite; } @-webkit-keyframes spin { 0% { -webkit-transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); } } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } </style> <title></title> <style type="text/css"> body{ background:#fafcfc; } #wrapper{ width:50%; height:auto; margin:10px auto; border:1px solid #cbcbcb; background:white; } #comment_input_from li{ list-style-type:none; margin:5px auto; } #comment_input_from{ width:50%; margin:100px auto; background:#fafcfc; padding:20px; } #name, textarea{ width:80%; } .box { position: relative; } .box select { background-color: #fff; color: blue; -webkit-appearance: button; appearance: button; outline: none; top:0px; } .box::before { content: "\f13a"; font-family: FontAwesome; position: absolute; top: 36px; right: 0; width: 20px; height: 50%; text-align: right; padding-right:30px; font-size: 24px; line-height: 40px; color: #f6d566; background-color: rgba(255, 255, 255, 0); pointer-events: none; } .box:hover::before { color: #fe9a0a ; } .box select option { padding: 20px; } </style> </head> <body> <?php $userID=$user_data['u_id']; error_reporting(0); if(isset($_POST['submit'])){ $visibility="block"; }else{ $visibility="none"; } //save checkin record if($_POST['cReason'] && !empty($_POST['cReason'])){ $qError='Invalid Entry. Required information is missing. Please try again!.'; }else{ if(isset($_POST['checkIn'])){ $chkInPlate = $_POST['activePlate']; $cReason = $_POST['cReason']; $chkInKM = $_POST['kmstart']; $chkInDriver = $_POST['driver']; mysql_query("INSERT INTO `vts_IN_OUT_history` (`chk_id`, `chk_plate`, `chk_driver`, `chk_km`, `date`, `time`, `chk_transaction`, `user_id`,`deleted`,`location_code`,`comp_code`,`dealer_code`) VALUES('','$chkInPlate','$chkInDriver','$chkInKM','$toDate','$currentTime','IN','$userID','0','$cReason','$compID','$dealID') "); mysql_query("UPDATE `vts_vehicle_lists` SET `v_in_out`='1',`v_location_id`='$dealID' WHERE `v_plate`='$chkInPlate'"); echo "<script type='text/javascript'>alert('Record has been saved...');</script>"; } if(isset($_POST['checkOut'])){ $chkInPlate = $_POST['activePlate']; $cReason = $_POST['cReason']; $chkInKM = $_POST['kmstart']; $chkInDriver = $_POST['driver']; mysql_query("INSERT INTO `vts_IN_OUT_history` (`chk_id`, `chk_plate`, `chk_driver`, `chk_km`, `date`, `time`, `chk_transaction`, `user_id`,`deleted`,`location_code`,`comp_code`,`dealer_code`) VALUES('','$chkInPlate','$chkInDriver','$chkInKM','$toDate','$currentTime','OUT','$userID','0','$cReason','$compID','$dealID') "); mysql_query("UPDATE `vts_vehicle_lists` SET `v_in_out`='0',`v_location_id`='0' WHERE `v_plate`='$chkInPlate'"); echo "<script type='text/javascript'>alert('Record has been saved...');</script>"; //0 means just checked out and not yet arrive to destination } } ?> <div class='bgColor' style = "position:absolute;top:0px;height:100%;width:100%;padding:50px;border:0px solid red;left:0px;"> <h1 style='margin:0px;font-family:Verdana;font-size:22px;font-weight:normal;padding-left:5px;color:black'>Vehicle Check-In / Check-Out</h1> <i style='font-family:Verdana;font-size:10px;color:gray;padding-left:5px'>Use to record IN and OUT transaction of vehicle regardless if it is for service or not. Ex. Road Test, Parking, Claimed by Owner or Transfer to Stockyard etc.</i> <div style='border:1px solid gray;width:99%;height:95%;min-height:540px;float:left;margin:5px;min-width:600px;background:white'> <div class='bgColor' style='vertical-align:top;height:30px;margin:0px;width:100%;border-bottom:0px solid red;padding:5px;font-family:Verdana;font-size:14px;font-weight:bold;color:#043062'>VEHICLE SEARCH... <div style='float:right'> <a href='mainindex.php?id=1' > ♲ </a> <a href='mainindex.php?id=1'> ✉ </a> <a href='mainindex.php?id=1' style='font-weight:bold'> ✕ </a> </div> </div> <div style='padding:10px;height:100px;min-height:50px;float:left;width:55%;min-width:600px;text-align:left;border:0px solid red'> <form action='' method='POST' name='searchForm' id='searchBox' style='border:0px solid blue;width:100%'> <input type='text' id='vPlate' name='searchPlate' value="<?php if(isset($_POST['searchPlate'])){ echo $_POST['searchPlate'];}?>" placeholder='' style='text-align:center;font-size:30px;min-width:250px;width:60%;padding:10px' onkeyup="this.value = this.value.toUpperCase();"> <input type='submit' id='submit_name' name='submitSearch' placeholder='' value='Search...' style='text-align:center;font-size:30px;min-width:200px;width:39%;padding:10px'> </form> </div> <div style='padding:0px;height:380px;min-height:50px;float:left;width:100%;text-align:left:padding:5px;border:0px solid gray'> <div style='margin:1px;padding:0px;overflow:auto;height:390px;min-height:358px;float:left;width:99.90%;text-align:left:padding:0px;border:0px solid red'> <div id="display_area" style='position:relative;border:0px solid red'> <div class='hidden' style='width:100%;padding:20px;position:relative;min-width:500px;min-height:180px;z-index:99999;border-right:1px solid white'> <div style='padding:5px;padding-top:0px;float:left;min-width:500px;border:0px solid red;background:#edeeee'> <!--surround the select box with a "custom-select" DIV element. Remember to set the width:--> <div class="box" style="width:100%;min-width:500px;background:#edeeee"> <br><b style='margin:15px;border:0px solid gray;font-family:Verdana;color:black;padding-top:30px;font-weight:normal'>Select Destination:</b> <form action='' method='POST'> <select name='cReason' style='margin-left:15px;width:95%'> <option value="0"></option> <?php $myVPlate = $_POST['searchPlate']; $checkVehicleStatus=mysql_result(mysql_query("SELECT `v_in_out` FROM `vts_vehicle_lists` WHERE `v_plate`='$myVPlate'"),0); if($checkVehicleStatus == 1){ // UNIT IS INT $statIN='Disabled'; $statOUT='Enable'; $bgINColor='#c2c2bc '; $optionSQL=mysql_query("SELECT * FROM `vts_check_out_reasons` WHERE `out_status`='1' AND `code`='OUT' ORDER BY `out_description` ASC"); }else{ // UNIT IS OUT $statOUT='Disabled'; $statIN='Enable'; $bgOUTColor='#c2c2bc '; $optionSQL=mysql_query("SELECT * FROM `vts_check_out_reasons` WHERE `out_status`='1' AND `code`='IN' ORDER BY `out_description` ASC"); } while($out=mysql_fetch_array($optionSQL)){ echo "<option value='".$out['out_id']."'>".$out['out_description']."</option>"; } ?> </select> </div> <?php echo "<input type='hidden' name='postPlate' value='".$myVPlate."'>"; //echo "Status=".$checkVehicleStatus; echo "<div style='min-width:500px;padding:10px;float:left;width:100%;height:100px;border:0px solid gray;background:transparent;text-align:left'>"; echo "<div style='margin:2px;float:left;width:25%;min-width:50px;position:relative;border:0px solid gray;color:black'>Km Reading:<br> <input type='text' name='activePlate' value='".$myVPlate."'required style='font-family:Verdana;font-weight:normal;font-size:14px;'></div>"; echo "<div style='margin:2px;float:left;width:22%;min-width:50px;position:relative;border:0px solid gray;color:black'>Km Reading:<br> <input type='text' name='kmstart' value='".$_POST['$myVPlate']."' required style='font-family:Verdana;font-weight:normal;font-size:14px;'></div>"; echo "<div style='margin:2px;float:left;width:50%;min-width:50px;position:relative;border:0px solid gray;color:black'>Driver:<br> <input type='text' name='driver' value='".$_POST['$driver']."' required style='font-family:Verdana;font-weight:normal;font-size:14px;'></div>"; echo"</div>"; ?> </div> <div style='padding-top:2px;float:middle;min-width:500px;border:0px solid red;background:#edeeee'> <center> <input type='submit' name="checkIn" <?php echo $statIN;?> value='Check-In' style='margin:2px;font-family:Verdana;font-size:30px;padding:10px;width:40%;height:80px;background:<?php echo $bgINColor;?>'> <input type='submit' name="checkOut" <?php echo $statOUT;?> value='Check-Out' style='margin:2px;font-family:Verdana;font-size:30px;padding:10px;width:40%;height:80px;background:<?php echo $bgOUTColor;?>'> </form> </center> </div> </div> <?php if(isset($_POST['submitSearch'])){ $getPlate=$_POST['searchPlate']; //echo "Search for...".$getPlate; $sql=mysql_query("SELECT * FROM `vts_vehicle_lists` WHERE `v_plate` = '$getPlate' "); $maxRows=mysql_num_rows($sql); if($maxRows < 1){ $qError = "No Records Found."; }else { if($maxRows > 1){ $qError = $maxRows ." Records Found."; }else{ $qError = $maxRows ." Record Found."; } } echo "<table style='width:99.99%;'>"; echo "<thead> <tr> <th class='bgColor'>ID</th> <th class='bgColor'>PLATE NO</th> <th class='bgColor'>BRAND</th> <th class='bgColor'>MODEL</th> <th class='bgColor'>TYPE</th> <th class='bgColor'>COLOR</th> <th class='bgColor' style='width:80px;'></th> </tr> </thead>"; //echo "Max Rows is ".$maxRows; if($maxRows < 1){ $visibility="none"; } while($row=mysql_fetch_array($sql)){ $curRow = $curRow + 1; if($curRow = $maxRows){ $visibility="none"; }else{ $visibility="block"; } echo "<tr>"; echo "<td>".$row['v_id']."</td>"; echo "<td>".$row['v_plate']."</td>"; echo "<td>".$row['v_brand']."</td>"; echo "<td>".$row['v_model']."</td>"; echo "<td>".$row['v_type']."</td>"; echo "<td>".$row['v_color']."</td>"; echo "<td style='text-align:center'><a href='#' class='showClick show'>UPDATE</a></td>"; echo "</tr>"; } echo "</table>"; }else{ $sql=mysql_query("SELECT * FROM `vts_vehicle_lists` WHERE `v_in_out` = '1' AND `v_status`='1' "); $maxRows=mysql_num_rows($sql); echo "<table style='width:100%;'>"; echo "<thead> <tr> <th class='bgColor'>ID</th> <th class='bgColor'>PLATE NO</th> <th class='bgColor'>BRAND</th> <th class='bgColor'>MODEL</th> <th class='bgColor'>TYPE</th> <th class='bgColor'>COLOR</th> </tr> </thead>"; //echo "Max Rows is ".$maxRows; if($maxRows < 1){ $visibility="none"; } while($row=mysql_fetch_array($sql)){ $curRow = $curRow + 1; if($curRow = $maxRows){ $visibility="none"; }else{ $visibility="block"; } echo "<tr>"; echo "<td>".$row['v_id']."</td>"; echo "<td>".$row['v_plate']."</td>"; echo "<td>".$row['v_brand']."</td>"; echo "<td>".$row['v_model']."</td>"; echo "<td>".$row['v_type']."</td>"; echo "<td>".$row['v_color']."</td>"; echo "</tr>"; } echo "</table>"; } ?> </div> <div id="wait" style="display:<?php echo $visibility;?>;z-index:10000;width:69px;height:89px;border:0px solid red;position:absolute;top:50%;left:55%;padding:2px;"> <img src='images/demo_wait.gif' width="64" height="64" /> <br>Loading.. </div> </div> </div> </div> </div> </body> </html>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings