File manager - Edit - /home/autoph/public_html/voc/home/inventory_body.php
Back
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <?php $userID=$user_data['u_id']; $toDate = date_create() ->format("Y/m/d"); if(isset($_POST['Display'])){ $SelCompName = mysql_real_escape_string($_POST['SelCompName']); $MyUserID = mysql_real_escape_string($_POST['MyUserID']); } ?> <script type="text/javascript"> onload = function() { var t = document.getElementById("mainModel").getElementsByTagName("td"); for ( var i = 0; i < t.length; i++ ) t[i].onclick = getVal; } <!--########################################################################> <!--########################################################################> <!--########################################################################> function getVal(e) { //ARNEL ENDAYA var targ; //var searchV = $("#searchV").val(); if (!e) var e = window.event; if (e.target) targ = e.target; else if (e.srcElement) targ = e.srcElement; if (targ.nodeType == 8) // defeat Safari bug targ = targ.parentNode; var getData = targ.innerHTML; var sDeal = $("#sDeal").val(); var sComp = $("#sComp").val(); var selModel = $("#selModel").val(); var bBrand = $("#bBrand").val(); //alert(sDeal); showLoadBar(); $.ajax({ url: "filter_model.php", type: "POST", async: false, data: { "display": 1, "selModel": selModel, "sDeal": sDeal, "sComp": sComp, "bBrand": bBrand, "getData": getData }, success: function(d){ showLoadBar(); //$("#viewInventoryPerModel").load("viewInventoryPerModel"); $("#viewInventoryPerModel").html(d); } }); } <!--########################################################################> <!--########################################################################> $(function () { $('.showMenu').click(function () { $('.DivToHide').show(); }); $('.showMenu').click(function () { $('.DivToHide').hide(); }); }); function showAddNewForm(){ var diva=document.getElementById("AddNewInventoryForm"); if (diva.style.display == 'none') { diva.style.display = ''; } else { diva.style.display = 'none'; } } function hideAssignMsg(){ $("#saveMessage").fadeOut(3000); }; function showAssignMsg(){ $("#saveMessage").fadeIn(); }; function invHideAssignMsg(){ $("#invMessage").fadeOut(3000); }; function invShowAssignMsg(){ $("#invMessage").fadeIn(); }; function hideBarGlass(){ $("#uploadBar").fadeOut(200); }; function showBarGlass(){ $("#uploadBar").fadeIn(200); }; $("#AddNewIntventoryItem").click(function(){ //alert("test"); //return false; var vDateReceived = $("#vDateReceived").val(); var vStatus = $("#vStatus").val(); var vVINNumber = $("#vVINNumber").val(); var vEngineNo = $("#vEngineNo").val(); var vDescripton = $("#vDescripton").val(); var myBrand = $("#myBrand").val(); var invModel = $("#invModel").val(); var yearModel = $("#yearModel").val(); var vColor = $("#vColor").val(); var vLocation = $("#vLocation").val(); var vCSNumber = $("#vCSNumber").val(); var vAllocation = $("#vAllocation").val(); if (vDescripton == "") { $('#vDescripton').focus(); $('#vDescripton').css({'border-bottom':'1px solid red'}); $('#vDescripton').css({'color':'red'}); $('#vDescripton').attr("placeholder","Required*"); return false; } if (vCSNumber == "") { $('#vCSNumber').focus(); $('#vCSNumber').css({'border-bottom':'1px solid red'}); $('#vCSNumber').css({'color':'red'}); $('#vCSNumber').attr("placeholder","Required*"); return false; } if (vDateReceived == "") { $('#vDateReceived').focus(); $('#vDateReceived').css({'border-bottom':'1px solid red'}); $('#vDateReceived').css({'color':'red'}); $('#vDateReceived').attr("placeholder","Required*"); return false; } $.ajax({ url: "save_new_vehicle_unit.php", type: "POST", async: false, data: { "vLocation":vLocation, "vAllocation":vAllocation, "vDateReceived":vDateReceived, "vCSNumber":vCSNumber, "vStatus":vStatus, "vVINNumber":vVINNumber, "vEngineNo":vEngineNo, "vDescripton":vDescripton, "myBrand":myBrand, "invModel":invModel, "yearModel":yearModel, "vColor":vColor, "done": 1 }, success: function(d){ invShowAssignMsg(); $("#invMessage").html(d); invHideAssignMsg(); $('#vEngineNo').val(''); $('#vCSNumber').val(''); $('#vVINNumber').val(''); $('#vDescripton').val(''); $('#vDateReceived').val(''); } }) }); function showClearanceInfo(row) { var x=row.cells; document.getElementById("selModel").value = x[2].innerHTML; document.getElementById("bBrand").value = x[1].innerHTML; } function hideAssignMsg(){ $("#saveMessage").fadeOut(3000); }; function showAssignMsg(){ $("#saveMessage").fadeIn(); }; function ShowImportForm() { var div = document.getElementById("dataImportForm"); if (div.style.display == 'none') { div.style.display = ''; } else { div.style.display = 'none' } } function showLoadBar() { var div = document.getElementById("loadBaraData"); if (div.style.display == 'none') { div.style.display = ''; } else { div.style.display = 'none' } } </script> <div id="loadBaraData" style="display:none;position:absolute;top:60%;left:40%;width:20%;padding:5px;padding-left:2px;padding-right:2px;height:80px;background:transparent;z-index:9999;border:0px solid gray;z-index:999999999999999999"> <div id="uploadBar" style="font-family:Calibri;font-size:14px;color:red;text-align:center;margin-top:0px;background:white;display:block;width:100%;height:50px;border:0px solid red;position:relative;left:5px;padding:5px;z-index:999999999999999999;border:1px solid orange"> <img src='images/ajaxLoader.gif' width="100%" height="20px" /><br><center>Loading...<center></div> </div> <!-- =======================IMPORT FORM===================================================== --> <div id="dataImportForm" style="display:none;position:absolute;top:5px;left:5px;width:550px;height:300px;background:transparent;z-index:9999;border:0px solid gray;"> <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:35px;margin:0px;width:100%;border-bottom:1px solid gray;padding:5px;font-family:Verdana;font-size:16px;font-weight:normal;color:#043062'>Upload New Service Appointment (CSV Format): <div style='float:right;font-family:Verdana;font-size:15px;'> <a href='autohub.php?id=v&d=i#' onclick="ShowImportForm()" style='font-weight:bold'> ✕ </a> </div> <br><br> <?php include 'import_vehicle_inventory.php';?> </div> </div> </div> <!-- =======================IMPORT FORM===================================================== --> <div onclick="showLoadBar()" class='bodyTitle' style="margin-bottom:5px;margin-top:0px;border:0px solid red;background:yellow">VEHICLE INVENTORY - <?php echo $_GET['company']." / ". $_GET['deal'];?></div> <div class='bodyMenu' style="border:0px solid red;height:auto;width:100%;min-width:420px"> <div class="pageMenuA" style="border:0px solid blue;min-width:400px"> <input type='text' id='searchText' placeholder="Search CS Number / Unit Description / Color" style='margin:0px;height:35px; float:left;;width:68%'><button id="goSearch" style='height:35px; float:left;;width:30%;min-width:100px'>Search...</button> </div> <div class="pageMenuB"style="border:0px solid blue;min-width:400px"> <button style="height:35px; float:right;width:100px;min-width:80px;margin-right:5px;font-family:AriL;font-size:14px;color:black;font-weight:normal;border:1px solid gray" title="Refresh Data" onclick="location.reload()" >↺ Refresh</button> <button style='height:35px; float:right;width:80px;min-width:100px;font-family:AriL;font-size:14px;color:black;font-weight:normal;border:1px solid gray' title="Upload File" onclick="ShowImportForm()" >Upload File...</button> <!--<button style='height:35px; float:right;width:100px;min-width:100px;margin-right:5px;border:1px solid gray' title="Add New" onclick="showAddNewForm()" >✚ New </button> --> </div> <input type="hidden" id="selModel"> <input type="hidden" id="bBrand"> <input type="hidden" id="sDeal" value="<?php echo $_GET['deal'];?>"> <input type="hidden" id="sComp" value="<?php echo $_GET['company'];?>"> </div> </div> <div style="padding:15px;width:100%;margin:0px;background:lightgray;height:250px;overflow:auto;float:left;border:0px solid gray;border-top:1px solid gray"> <div id="viewInventory" style="padding:15px;width:100%;margin:0px;background:white;height:220px;overflow:auto;float:left"> <?php $brd=$_GET['comp']; $getbrdID = mysql_result(mysql_query("SELECT `b_id` FROM `vts_brands` WHERE `b_name`='$brd'"),0); $getBrand=mysql_query("SELECT * FROM `vts_model` WHERE `b_id`= '$getbrdID' ORDER BY m_name ASC"); //VALIDATE ACCESS echo "<table id='mainModel' style='width:100%;margin:00px'>"; echo "<thead>"; echo "<th style='width:5%'>NO</th>"; echo "<th style='width:10%'>BRAND</th>"; echo "<th style='width:15%'>V. MODEL</th>"; echo "<th style='width:20%'>DESCRIPTION</th>"; echo "<th style='width:10%'>AVAILABLE</th>"; echo "<th style='width:10%'>RESERVED</th>"; echo "<th style='width:10%'>INCOMING</th>"; echo "<th style='width:10%'>TOTAL</th>"; echo "</thead>"; while($row=mysql_fetch_array($getBrand)){ $count=$count + 1; $model = $row['m_name']; $brandID = $row['b_id']; $brandName = mysql_result(mysql_query("SELECT `b_name` FROM `vts_brands` WHERE `b_id`='$brandID'"),0); $chkAccess = mysql_result(mysql_query("SELECT COUNT(id) FROM `brand_access` WHERE `brand_name`='$brandName' AND `user_id`='$userID'"),0); if($chkAccess != 0){ ?><tr onclick="javascript:showClearanceInfo(this);" ><?php echo "<td style='text-align:left;padding:5px'>".$count."</td>"; echo "<td style='text-align:left;padding:5px'>".$brd."</td>"; echo "<td style='text-align:left;padding:5px'>".$row['m_name']."</td>"; echo "<td style='text-align:left;padding:5px'>".$row['m_desc']."</td>"; echo "<td style='text-align:left;padding:5px'>"; if(isset($_GET['deal']) && ($_GET['deal']!='')){ //DEALER COUNT ONLY $mySelDeal=$_GET['deal']; $getTotalAvail = mysql_result(mysql_query("SELECT COUNT('id') FROM `db_vehicle_inventory` WHERE `sold` = 0 AND `returned` = 0 AND `reserved` = 0 AND `incoming_unit` = 0 AND `brand_code`='$model' AND `company`='$comName' AND `dealer`='$mySelDeal'"),0); }else{ $getTotalAvail = mysql_result(mysql_query("SELECT COUNT('id') FROM `db_vehicle_inventory` WHERE `sold` = 0 AND `returned` = 0 AND `reserved` = 0 AND `incoming_unit` = 0 AND `brand_code`='$model' AND `company`='$comName'"),0); } echo $getTotalAvail; echo "</td>"; echo "<td style='text-align:left;padding:5px'>"; if(isset($_GET['deal']) && ($_GET['deal']!='')){ //DEALER COUNT ONLY $getTotalRes = mysql_result(mysql_query("SELECT COUNT('id') FROM `db_vehicle_inventory` WHERE `sold` = 0 AND `reserved`= 1 AND `returned` = 0 AND `brand_code`='$model' AND `company`='$comName' AND `dealer`='$mySelDeal'"),0); }else{ $getTotalRes = mysql_result(mysql_query("SELECT COUNT('id') FROM `db_vehicle_inventory` WHERE `sold` = 0 AND `reserved`= 1 AND `returned` = 0 AND `brand_code`='$model' AND `company`='$comName'"),0); } echo $getTotalRes; echo "</td>"; echo "<td style='text-align:left;padding:5px'>"; if(isset($_GET['deal']) && ($_GET['deal']!='')){ //DEALER COUNT ONLY $getTotalINC = mysql_result(mysql_query("SELECT COUNT('id') FROM `db_vehicle_inventory` WHERE `sold` = 0 AND `reserved`= 0 AND `returned` = 0 AND `incoming_unit` = 1 AND `brand_code`='$model' AND `company`='$comName' AND `dealer`='$mySelDeal'"),0); }else{ $getTotalINC = mysql_result(mysql_query("SELECT COUNT('id') FROM `db_vehicle_inventory` WHERE `sold` = 0 AND `reserved`= 0 AND `returned` = 0 AND `incoming_unit` = 1 AND `brand_code`='$model' AND `company`='$comName'"),0); } echo $getTotalINC; echo "</td>"; echo "<td style='text-align:left;padding:5px'>"; if(isset($_GET['deal']) && ($_GET['deal']!='')){ //DEALER COUNT ONLY $getTotal = mysql_result(mysql_query("SELECT COUNT('id') FROM `db_vehicle_inventory` WHERE `sold` = 0 AND `returned` = 0 AND `brand_code`='$model' AND `company`='$comName' AND `dealer`='$mySelDeal'"),0); }else{ $getTotal = mysql_result(mysql_query("SELECT COUNT('id') FROM `db_vehicle_inventory` WHERE `sold` = 0 AND `returned` = 0 AND `brand_code`='$model' AND `company`='$comName'"),0); } echo $getTotal; echo "</td>"; echo "</tr>"; } } echo "</table>"; //OF VALIDATION ?> </div> </div> <div style="padding:10px;width:100%;margin:0px;background:gray;height:492px;overflow:auto;float:left;border:0px solid gray;border-top:1px solid gray"> <div id="viewInventoryPerModel" style="padding:15px;width:100%;margin:0px;background:white;height:455px;overflow:auto;float:left;border:0px solid gray;border-top:1px solid gray"> <p style="font-family:Calibri;font-size:14px;color:gray;font-weight:normal;float:center;margin:40px">Select Vehicle Model...</p> </div> </div> <div id="AddNewInventoryForm" style="float:left;position:absolute;top:10px;left:10px;width:800px;height:600px;border:1px solid gray;background:black;display:none;z-index:999999999"> <div class='bgColor' style='vertical-align:top;height:30px;margin:0px;width:100%;border-bottom:1px solid gray;padding:5px;font-family:Verdana;font-size:16px;font-weight:normal;color:#043062;text-align:left;'> ❑ NEW VEHICLE INVENTORY: <div style='float:right;font-family:Verdana;font-size:15px;'> <a href='#' onclick='showAddNewForm()' style='font-weight:bold'> ✕ </a> </div> </div> <div style="padding:20px;width:100%;height:560px;background:white"> <p style="font-family:Arial;font-weight:bold;font-size:30px;margin:5px;text-align:left;"><?php echo $userBrand;?></p><hr><br><br> <div style="font-family:Arial;color:#0974bf;float:left;width:40%;margin:5px;padding:0px;text-align:left;font-family:Arial;font-size:16px;">MODEL:<br> <input type="hidden" id="myBrand" value="<?php echo $userBrand;?>"> <select id="invModel" style="width:100%;border:0px solid white;border-bottom:1px solid gray;padding:5px"> <?php $bID = mysql_result(mysql_query("SELECT `b_id` FROM `vts_brands` WHERE `b_name`='$userBrand'"),0); $optionSQL=mysql_query("SELECT * FROM `vts_model` WHERE `b_id`='$bID' ORDER BY `m_name` ASC"); while($out=mysql_fetch_array($optionSQL)){ echo "<option value='".$out['m_name']."'>".$out['m_name']."</option>"; } ?> </select> </div> <div style="font-family:Arial;color:#0974bf;float:left;width:20%;padding:5px;text-align:left;font-family:Arial;font-size:16px;">YEAR MODEL:<br> <select id="yearModel" style="width:100%;border:0px solid white;border-bottom:1px solid gray;padding:5px"> <?php $currentYear = date('Y'); $endYear = $currentYear + 10; for($i = 2015 ; $i < $endYear; $i++){ if($i < 2016){ echo "<option>".$currentYear."</option>"; } echo "<option>$i</option>"; } ?> </select> </div> <div style="font-family:Arial;color:#0974bf;float:left;width:30%;padding:5px;text-align:left;font-family:Arial;font-size:16px;">COLOR:<br> <select id="vColor" style="width:100%;border:0px solid white;border-bottom:1px solid gray;padding:5px"> <?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="font-family:Arial;color:#0974bf;float:left;width:70%;padding:5px;text-align:left;font-family:Arial;font-size:16px;">UNIT VARIANT/DESCRIPTION:<br> <input type="text" id="vDescripton" style="width:100%;border:0px solid white;border-bottom:1px solid gray;padding:5px"> </div> <div style="font-family:Arial;color:#0974bf;float:left;width:21%;padding:5px;text-align:left;font-family:Arial;font-size:16px;">STATUS:<br> <select id="vStatus" style="width:100%;border:0px solid white;border-bottom:1px solid gray;padding:5px"> <option value="Available">Available</option> <option value="Incoming">Incoming</option> <option value="Demo">Demo Unit</option> </select> </div> <div style="font-family:Arial;color:#0974bf;float:left;width:30%;padding:5px;text-align:left;font-family:Arial;font-size:16px;">ENGINE NO:<br> <input type="text" id="vEngineNo" placeholder="Optional" style="width:100%;border:0px solid white;border-bottom:1px solid gray;padding:5px"> </div> <div style="font-family:Arial;color:#0974bf;float:left;width:40%;padding:5px;text-align:left;font-family:Arial;font-size:16px;">VIN NUMBER:<br> <input type="text" id="vVINNumber" placeholder="Optional"style="width:100%;border:0px solid white;border-bottom:1px solid gray;padding:5px"> </div> <div style="font-family:Arial;color:#0974bf;float:left;width:20%;padding:5px;text-align:left;font-family:Arial;font-size:16px;">CS NUMBER:<br> <input type="text" id="vCSNumber" style="width:100%;border:0px solid white;border-bottom:1px solid gray;padding:5px"> </div> <div style="font-family:Arial;color:#0974bf;float:left;width:20%;padding:5px;text-align:left;font-family:Arial;font-size:16px;">DATE RECEIVED:<br> <input type="date" id="vDateReceived" style="width:100%;border:0px solid white;border-bottom:1px solid gray;padding:10px"> </div> <div style="font-family:Arial;color:#0974bf;float:left;width:35%;padding:5px;text-align:left;font-family:Arial;font-size:16px;">UNIT LOCATION:<br> <select id="vLocation" style="width:100%;border:0px solid white;border-bottom:1px solid gray;padding:5px"> <?php $optionSQL=mysql_query("SELECT * FROM `vts_check_out_reasons` WHERE `code`='OUT' ORDER BY `out_description` ASC"); while($out=mysql_fetch_array($optionSQL)){ echo "<option value='".$out['out_description']."'>".$out['out_description']."</option>"; } ?> </select> </div> . <div style="font-family:Arial;color:#0974bf;float:left;width:36%;padding:5px;text-align:left;font-family:Arial;font-size:16px;">SELLING DEALER/ALLOCATION:<br> <select id="vAllocation" style="width:100%;border:0px solid white;border-bottom:1px solid gray;padding:5px"> <?php $optionSQL=mysql_query("SELECT * FROM `vts_dealerships` WHERE `comp_id`='$compID' ORDER BY `deal_name` ASC"); while($row=mysql_fetch_array($optionSQL)){ echo "<option value='".$row['deal_name']."'>".$row['deal_name']."</option>"; } ?> </select> </div> <div style="background:white; float:left;width:100%;padding:0px;text-align:center;font-weight:bold;"> <input type="submit" id="AddNewIntventoryItem" value="SUBMIT" style="width:100%;font-family:Arial;font-size:20px;margin:0px;margin-bottom:25px;margin-top:25px"> </div> <div id="invMessage" style" style="display:none;padding:10px;background:yellow;float:left;width:100%;padding:15px;text-align:center;font-family:Arial;font-size:16px;font-weight:bold;">RECORD SAVED.</div> </div> </div>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings