File manager - Edit - /home/autoph/public_html/voc/home/add_new_vehicle.php
Back
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> .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> <!-- CODE FOR MODEL DROPDOWN AUTO Loading --> <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","add_new_vehicle_load_model_on_brand_change.php?q="+str,true); xmlhttp.send(); } } </script> <!-- CODE FOR MODEL DROPDOWN AUTO Loading --> <title></title> <style type="text/css"> body{ background:#fafcfc; } a{ text-decoration:none; } } #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:100%; margin:0px; background: #dde2e4 ; padding:10px; } #display_area{ width:100%; margin:00px auto; background:#fafcfc; padding:2px; height:255px; overflow:auto; border:0px solid gray; } #submit_name{ width:30%; min-width:150px; margin:20px; padding:20px; } #name, textarea{ width:100%; } </style> </head> <?php if(isset($_GET['action'])=='import'){ echo "<div style='width:500px;padding:0px;border:1px solid gray;height:250px;position:absolute;top:10px;left:10px;z-index:99999;background:white'>"; ?> <div class='bgColor' style='vertical-align:top;height:25px;margin:0px;width:100%;border-bottom:1px solid gray;padding:5px;font-family:Verdana;font-weight:normal;color:#043062'>Import Vehicle List (CSV Format): <div style='float:right;font-family:Verdana;font-size:15px;'> <a href='mainindex.php?id=20' class='hideClick hidden' style='font-weight:bold'> ✕ </a> </div> <?php include 'file_import_csv.php';?> </div> <?php echo "</div>"; } ?> <body> <h1 style='margin:0px;font-family:Verdana;font-size:22px;font-weight:normal;padding-left:5px;color:black'>Add New Vehicle</h1> <i style='font-family:Verdana;font-size:10px;color:gray;padding-left:5px'>This module will allow you to add new vehicle or import list of vehicles from excel file. You can also update, edit or delete vehicle record using this module. All deleted records will be marked as inactive instead of deleted.</i> <div style='border:1px solid gray;width:99%;height:95%;min-height:540px;float:left;margin:5px;background:white'> <div class='bgColor' style='vertical-align:top;height:25px;margin:0px;width:100%;border-bottom:1px solid gray;padding:5px;font-family:Verdana;font-weight:normal;color:#043062'>Vehicle Information: <div style='float:right;font-family:Verdana;font-size:15px;'> <a href='mainindex.php?id=20&action=refresh' class='hideClick hidden' > ↺ </a><!--REFRESH/RELOAD WINDOW--> <a href='mainindex.php?id=20&action=import' class='hideClick hidden' > ↩ </a><!--IMPORT--> <a href='mainindex.php?id=20&action=export' class='hideClick hidden' > ↪ </a><!--E--> <a href='mainindex.php?id=20&action=view' class='hideClick hidden' > ⇶ </a> <!--EXTRACT LIST OF COMPANY AND EXPORT TO EXCEL--> <a href='mainindex.php?id=1' class='hideClick hidden' style='font-weight:bold'> ✕ </a> </div> </div> <div id="comment_input_from" style='border-bottom:0px solid gray;width:100%'> <div style='float:left;border-bottom:0px solid gray;width:100%'> <input type="hidden" id="addBy" value="<?php echo $userID;?>"> <input type="hidden" id="addDate" value="<?php echo $toDate;?>"> <input type="hidden" id="MycompID" value="<?php echo $compID;?>"> <input type="hidden" id="MydealID" value="<?php echo $dealID;?>"> <div style='border:0px solid red;width:15%;margin:5px;float:left;min-width:100px'> <b style='font-family:Verdana;font-size:12px;color:#727373;margin-left:5px;font-weight:normal'>V. Plate #:</b><br> <input type="text" id="vPlate" placeholder="Ex. ABC1234" value="<?php echo $_GET['edit'];?>" style='text-align:center;width:98%;margin:5px' onkeyup="this.value = this.value.toUpperCase();"> </div> <div style='border:0px solid red;width:20%;margin:5px;float:left;min-width:100px'> <b style='font-family:Verdana;font-size:12px;color:#727373;margin-left:5px;font-weight:normal'>Select Brand:</b><br> <select id='brandSelected' name='brandSelected' onchange="showUser(this.value)" style='width:100%;margin:5px'> <option>--Select Brand--</option> <?php $optionSQL=mysql_query("SELECT * FROM `vts_brands` WHERE `b_status`='1' ORDER BY `b_name` ASC"); while($out=mysql_fetch_array($optionSQL)){ echo "<option value='".$out['b_id']."'>".$out['b_name']."</option>"; } ?> </select> </div> <div style='border:0px solid red;width:25%;margin:5px;float:left;min-width:100px'> <b style='font-family:Verdana;font-size:12px;color:#727373;margin-left:5px;font-weight:normal'>Vehicle Model:</b><br> <select id='para' style='width:100%;margin:5px'> </select> </div> <div style='border:0px solid red;width:20%;margin:5px;float:left;min-width:100px'> <b style='font-family:Verdana;font-size:12px;color:#727373;margin-left:5px;font-weight:normal'>Vehicle Color:</b><br> <select id='vehicleColor' style='width:100%;margin:5px'> <option value=""></option> <?php $optionSQL=mysql_query("SELECT * FROM `vts_colors` WHERE `c_status`='1' ORDER BY `c_name` ASC"); while($out=mysql_fetch_array($optionSQL)){ echo "<option value='".$out['c_id']."'>".$out['c_name']."</option>"; } ?> </select> </div> <div style='border:0px solid red;width:15%;margin:5px;float:left;min-width:100px'> <b style='font-family:Verdana;font-size:12px;color:#727373;margin-left:5px;font-weight:normal'>Type:</b><br> <select id='vType' style='width:100%;margin:5px'> <option>--Select Type--</option> <option value="AUTOMATIC">AUV</option> <option value="SUV">SUV</option> <option value="SEDAN">SEDAN</option> <option value="TRUCK">TRUCK</option> </select> </div> <div style='border:0px solid red;width:10%;margin:5px;float:left;min-width:100px'> <b style='font-family:Verdana;font-size:12px;color:#727373;margin-left:5px;font-weight:normal'>Make:</b><br> <input type="text" id="vehicleMake" placeholder="" style='width:98%;margin:5px' onkeyup="this.value = this.value.toUpperCase();"> </div> <div style='border:0px solid red;width:10%;margin:5px;float:left;min-width:100px'> <b style='font-family:Verdana;font-size:12px;color:#727373;margin-left:5px;font-weight:normal'>Conduction#:</b><br> <input type="text" id="vehicleConduction" placeholder="" style='width:98%;margin:5px' onkeyup="this.value = this.value.toUpperCase();"> </div> <div style='border:0px solid red;width:20%;margin:5px;float:left;min-width:100px'> <b style='font-family:Verdana;font-size:12px;color:#727373;margin-left:5px;font-weight:normal'>Transmission:</b><br> <select id='vehicleTransmission' style='width:100%;margin:5px'> <option value="AUTOMATIC">AUTOMATIC</option> <option value="MANUAL">MANUAL</option> </select> </div> <div style='border:0px solid red;width:35%;margin:5px;float:left;min-width:100px'> <b style='font-family:Verdana;font-size:12px;color:#727373;margin-left:5px;font-weight:normal'>Fleet Account / Company / Organization:</b><br> <select id='fleetOwner' style='width:100%;margin:5px'> <option value=""></option> <?php $optionSQL=mysql_query("SELECT * FROM `businesses_names` WHERE `status`='1' ORDER BY `business_name` ASC"); while($out=mysql_fetch_array($optionSQL)){ echo "<option value='".$out['bid']."'>".$out['business_name']."</option>"; } ?> </select> </div> <div style='border:0px solid red;width:20%;margin:5px;float:left;min-width:100px'> <b style='font-family:Verdana;font-size:12px;color:#727373;margin-right:5px;font-weight:normal'>Assigned Sales Agent:</b><br> <input type="text" id="vehicleNotes" placeholder="" style='width:90%;margin:5px' onkeyup="this.value = this.value.toUpperCase();" style="float:left"> </div> </div> <div style='border-bottom:0px solid gray;width:100%'> <input type="submit" id="submit_name" value="SAVE RECORD" style='margin:5px;margin-left:10px;font-size:14px;font-weight:bold;font-family:Verdana'> </div> </div> <div id="display_area"> <?php $result = mysql_query("SELECT * FROM vts_vehicle_lists WHERE `sold_by_dealer`='$dealID' ORDER BY `date_added` DESC LIMIT 50"); echo "<table style='width:100%;'>"; echo "<thead> <tr> <th>PLATE</th> <th>BRAND</th> <th>MODEL</th> <th>MAKE</th> <th>COLOR</th> <th></th> </tr> </thead>"; while($row=mysql_fetch_array($result)){ echo "<tr>"; echo "<td>".$row['v_plate']."</td>"; echo "<td>".$row['v_brand']."</td>"; echo "<td>".$row['v_model']."</td>"; echo "<td>".$row['v_make']."</td>"; echo "<td>".$row['v_color']."</td>"; echo "<td>»</td>"; echo "</tr>"; } echo "</table>"; ?> </div> </div> </body> </html> <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> <!-- jQuery <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> --> <!-- jQuery UI <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.css" />--> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script> <script type="text/javascript"> $(function() { $( "#vehicleNotes" ).autocomplete({ source: 'ajax_autocomplete_party.php', }); }); </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"); model-para brandSelected vehicleColor vehicleMake vehicleTransmission vehicleNotes $("#submit_name").click(function(){ var fleetOwner = $("#fleetOwner").val(); var brandSelected = $("#brandSelected").val(); var para = $("#para").val(); var vehicleColor= $("#vehicleColor").val(); var vPlate = $("#vPlate").val(); var vehicleColor = $("#vehicleColor").val(); var vehicleMake = $("#vehicleMake").val(); var vehicleTransmission = $("#vehicleTransmission").val(); var vehicleNotes = $("#vehicleNotes").val(); var vehicleConduction = $("#vehicleConduction").val(); var addBy = $("#addBy").val(); var addDate = $("#addDate").val(); var MydealID = $("#MydealID").val(); var vType = $("#vType").val(); var MycompID = $("#MycompID").val(); if (vPlate =="") { alert("Please input the vehicle plate number"); return false; } if (brandSelected == "") { alert("Invalid Brand Name"); return false; } if (para =="--Select Brand--") { alert("Invalid Model"); return false; } if (vType == "--Select Type--") { alert("Invalid Vehicle Type"); return false; } $.ajax({ url: "add_new_vehicle_save_new_record.php", type: "POST", async: false, data: { "done": 1, "para": para, "vPlate": vPlate, "vType": vType, "vPlate": vPlate, "vehicleColor":vehicleColor, "vehicleMake":vehicleMake, "vehicleTransmission":vehicleTransmission, "vehicleConduction": vehicleConduction, "vehicleNotes":vehicleNotes, "addBy":addBy, "addDate":addDate, "MycompID":MycompID, "fleetOwner":fleetOwner, "MydealID":MydealID, "brandSelected": brandSelected }, success: function(data){ //alert("New Record Saved."); displayFromDatabase(); $('#brandSelected').val(''); $('#vPlate').val(''); $('#vehicleColor').val(''); $('#vehicleMake').val(''); $('#vehicleConduction').val(''); $('#vehicleTransmission').val(''); $('#vehicleNotes').val(''); } }) }); }); //retrieve and display function displayFromDatabase(){ $.ajax({ url: "add_new_vehicle_save_new_record.php", type: "POST", async: false, data: { "display": 1 }, success: function(d){ $("#display_area").html(d); } }); } </script>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings