File manager - Edit - /home/autoph/public_html/voc/home/search_load_found_users.php
Back
<?php include 'core/init.php'; //$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(1); ?> <script language="javascript" type="text/javascript"> function showCustDetails(row) { var x=row.cells; document.getElementById("loadUName").value = x[0].innerHTML; document.getElementById("loadFname").value = x[1].innerHTML; document.getElementById("loadLName").value = x[2].innerHTML; document.getElementById("loadMobile").value = x[3].innerHTML; document.getElementById("loadUserType").value = x[9].innerHTML; document.getElementById("loadCompany").value = x[4].innerHTML; document.getElementById("para").value = x[5].innerHTML; document.getElementById("loadPosition").value = x[6].innerHTML; document.getElementById("loadEmail").value = x[7].innerHTML; document.getElementById("loadRole").value = x[8].innerHTML; } function viewCustTable() { var div = document.getElementById("custMoreInfo"); if (div.style.display == 'none') { div.style.display = ''; } else { div.style.display = ''; } } function viewCustTableHide() { var div = document.getElementById("custMoreInfo"); if (div.style.display == 'none') { div.style.display = 'none'; } else { div.style.display = 'none'; } } function viewPicLoader() { var div = document.getElementById("picLoader"); if (div.style.display == '') { div.style.display = 'none'; } else { div.style.display = ''; } } </script> <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"); }); //UPDATE USER'S INFORMATION $("#saveUserUpdate").click(function(){ var uRights = $("#uRights").val(); var uPassA = $("#uPassA").val(); var uPassB = $("#uPassB").val(); var loadUName = $("#loadUName").val(); var loadFname = $("#loadFname").val(); var loadLName = $("#loadLName").val(); var loadCompany = $("#loadCompany").val(); var para = $("#para").val(); var loadPosition = $("#loadPosition").val(); var loadEmail = $("#loadEmail").val(); var loadMobile = $("#loadMobile").val(); //var loadUserType = $("#loadUserType").val(); if (uPassA != uPassB) { alert("Error: Your password didn't match. Please check your entry and try again."); return false; } if (loadCompany == "") { alert("Error: Please select assigned company"); return false; } if (para == "") { alert("Error: Please select assigned dealership"); return false; } if (uPassA == "") { alert("Error: Your password didn't match. Please check your entry and try again."); return false; } if (uPassB == "") { alert("Error: Your password didn't match. Please check your entry and try again."); return false; } $.ajax({ url: "sub_user_update_info.php", type: "POST", async: false, data: { "done": 1, "uRights" : uRights, "uPassA" : uPassA, "uPassB" : uPassB, "loadFname" : loadFname, "loadLName" : loadLName, "loadCompany" : loadCompany, "para" : para, "loadPosition" : loadPosition, "loadEmail" : loadEmail, "loadMobile" : loadMobile, //"loadUserType" : loadUserType, "loadUName" : loadUName }, success: function(data){ alert("Record has been updated."); } }) }); //START OF FUNCTION=========Saving IMAGE============================================================================ $('#pic').on('change', function() { var customerID = $("#customerID").val(); var file_data = $('#pic').prop('files')[0]; var form_data = new FormData(); // Create a FormData object form_data.append('file', file_data); // Append all element in FormData object form_data.append('customerID', customerID); $.ajax({ url : 'upload_profile_picture.php', // point to server-side PHP script dataType : 'text', // what to expect back from the PHP script, if anything cache : false, contentType : false, processData : false, data : form_data, type : 'post', success : function(output){ alert("New Picture has been Uploaded."); //alert(output); // display response from the PHP script, if any viewNewAddedPicture(); } }); $('#pic').val(''); /* Clear the file container */ }); function viewNewAddedPicture(){ var customerID = $("#customerID").val(); var file_data = $('#pic').prop('files')[0]; var form_data = new FormData(); // Create a FormData object form_data.append('file', file_data); // Append all element in FormData object form_data.append('customerID', customerID); $.ajax({ url : 'upload_profile_picture_view.php', // point to server-side PHP script dataType : 'text', // what to expect back from the PHP script, if anything cache : false, contentType : false, async : false, processData : false, data : form_data, type : 'post', success : function(output){ //alert("New Picture has been Uploaded."); //alert(output); // display response from the PHP script, if any $("#loadProPic").html(d); } }); } //START OF FUNCTION=========Saving IMAGE============================================================================ //START OF FUNCTION=========btLoadSelData btLoadSelData======== SAVING NEW RECORD $("#btLoadSelData").click(function(){ var loadCustData = $("#loadCustData").val(); if (loadCustData == "") { alert("Error: Required information is Missing..."); return false; } $.ajax({ url: "sub_add_new_customer_load_view_data.php", type: "POST", async: false, data: { "done": 1, "loadCustData" : loadCustData }, success: function(data){ //alert("New Record Saved."); viewSearchSelCustInfo(); } }) }); //END OF FUNCTION================= function viewSearchSelCustInfo(){ var loadCustData = $("#loadCustData").val(); $.ajax({ url: "sub_add_new_customer_load_view_data.php", type: "POST", async: false, data: { "loadCustData": loadCustData, "display": 1 }, success: function(d){ $("#display_personal_cust_info_history").html(d); viewLoadPicture(); } }); } function viewLoadPicture(){ var loadCustData = $("#loadCustData").val(); $.ajax({ url: "sub_add_new_customer_load_view_data.php", type: "POST", async: false, data: { "loadCustData": loadCustData, "picture": 1 }, success: function(d){ $("#loadProPic").html(d); } }); } }); </script> <SCRIPT LANGUAGE="JavaScript"> <!-- myPopup = ''; function openPopup(url) { myPopup = window.open('upload_profile_pic.php?cid=','popupWindow','width=550,height=320','menubar=no, toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, dependent, width=550, height=320, left=0, top=0'); if (!myPopup.opener) myPopup.opener = self; } //--></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","load_dealer_based_on_sel_company.php?q="+str,true); xmlhttp.send(); } } </script> <div id="custMoreInfo" class="menu" style='display:none;position:absolute;width:40%;min-width:400px;height:700px;background:white;border:1px solid black;top:10px;left:10px;z-index:99999'> <!--------------------------PICTURE LOADER----------------------------> <!--------------------------PICTURE LOADER----------------------------> <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;font-size:12px;color:#043062'>☳ USER'S INFORMATION: <div style='float:right;font-family:Verdana;font-size:12px;margin-top:-3px'> <a href='#' onclick="viewCustTableHide()" style='font-weight:bold;background:transparent'> ✕ </a> </div> </div> <div style='padding:5px;width:100%;float:left;border:0px solid lightgray;border-right:1px solid lightgray;;background:#eef1f1;height:95.5%;padding-top:20px'> <div style='float:left;border:0px solid red; background:transparent;width:25%;padding:3px;text-align:right;font-family:Verdana;color:blue;padding-right:10px'></div> <div style='float:left;border:0px solid red; background:transparent;width:70%;padding:0px;text-align:right'> </div> <div id="display_personal_cust_info" style='padding:5px;width:100%;float:left;border:1px solid lightgray;background:#fff;height:98%;margin-top:0px'> <div style='float:left;border:0px solid red; background:transparent;width:25%;padding:3px;text-align:left;font-family:Verdana;color:blue;font-size:11px;padding-right:10px;margin:2px;'>USER NAME:</div> <div style='float:left;border:0px solid red; background:transparent;width:70%;padding:0px;text-align:left'> <input type='text' id='loadUName' style='width:100%;float:left;font-family:Calibri;font-size:12px;margin:2px;padding:3px;color:black'> </div> <div style='float:left;border:0px solid red; background:transparent;width:25%;padding:3px;text-align:left;font-family:Verdana;color:blue;font-size:11px;padding-right:10px;margin:2px;'>FIRST NAME:</div> <div style='float:left;border:0px solid red; background:transparent;width:70%;padding:0px;text-align:left'> <input type='text' id='loadFname' style='width:100%;float:left;font-family:Calibri;font-size:12px;margin:2px;padding:3px;color:black' onkeyup="this.value = this.value.toUpperCase();"> </div> <div style='float:left;border:0px solid red; background:transparent;width:25%;padding:3px;text-align:left;font-family:Verdana;color:blue;font-size:11px;padding-right:10px;margin:2px;'>LAST NAME:</div> <div style='float:left;border:0px solid red; background:transparent;width:70%;padding:0px;text-align:left'> <input type='text' id='loadLName' style='width:100%;float:left;font-family:Calibri;font-size:12px;margin:2px;padding:3px;color:black' onkeyup="this.value = this.value.toUpperCase();"> </div> <div style='float:left;border:0px solid red; background:transparent;width:25%;padding:3px;text-align:left;font-family:Verdana;color:blue;font-size:11px;padding-right:10px;margin:2px;'>COMPANY:</div> <div style='float:left;border:0px solid red; background:transparent;width:70%;padding:0px;text-align:left'> <input type='text' id='loadCompany' style='width:100%;float:left;font-family:Calibri;font-size:12px;margin:2px;padding:3px;color:black' disabled"> </div> <div style='float:left;border:0px solid red; background:transparent;width:25%;padding:3px;text-align:left;font-family:Verdana;color:blue;font-size:11px;padding-right:10px;margin:2px;'>DEALERSHIP:</div> <div style='float:left;border:0px solid red; background:transparent;width:70%;padding:0px;text-align:left'> <input type='text' id='para' style='width:100%;float:left;font-family:Calibri;font-size:12px;margin:2px;padding:3px;color:black' disabled"> </div> <div style='float:left;border:0px solid red; background:transparent;width:25%;padding:3px;text-align:left;font-family:Verdana;color:blue;font-size:11px;padding-right:10px;margin:2px;'>POSITION:</div> <div style='float:left;border:0px solid red; background:transparent;width:70%;padding:0px;text-align:left'> <input type='text' id='loadPosition' style='width:100%;float:left;font-family:Calibri;font-size:12px;margin:2px;padding:3px;color:black'onkeyup="this.value = this.value.toUpperCase();"> </div> <div style='float:left;border:0px solid red; background:transparent;width:25%;padding:3px;text-align:left;font-family:Verdana;color:blue;font-size:11px;padding-right:10px;margin:2px;'>E-MAIL ADDRESS:</div> <div style='float:left;border:0px solid red; background:transparent;width:70%;padding:0px;text-align:left'> <input type='text' id='loadEmail' style='width:100%;float:left;font-family:Calibri;font-size:12px;margin:2px;padding:3px;color:black'> </div> <div style='float:left;border:0px solid red; background:transparent;width:25%;padding:3px;text-align:left;font-family:Verdana;color:blue;font-size:11px;padding-right:10px;margin:2px;'>MOBILE NUMBER:</div> <div style='float:left;border:0px solid red; background:transparent;width:70%;padding:0px;text-align:left'> <input type='text' id='loadMobile' style='width:100%;float:left;font-family:Calibri;font-size:12px;margin:2px;padding:3px;color:black'> </div> <div style='float:left;border:0px solid red; background:transparent;width:25%;padding:3px;text-align:left;font-family:Verdana;color:blue;font-size:11px;padding-right:10px;margin:2px;'> </div> <div style='float:left;border:0px solid red; background:transparent;width:70%;padding:0px;text-align:left'> </div> <div style='float:left;border:0px solid red; background:transparent;width:25%;padding:3px;text-align:left;font-family:Verdana;color:blue;font-size:11px;padding-right:10px;margin:2px;'> </div> <div style='float:left;border:1px solid gray; background:transparent;width:70%;padding:0px;text-align:left;margin-left:2px'> <div style='float:left;border:0px solid red; background:transparent;width:100%;height:300px;padding:0px;text-align:left;font-family:Verdana;color:blue;font-size:11px;margin:0px;'> <div class='bgColor' style='vertical-align:top;height:25px;margin:0px;width:100%;border-bottom:1px solid gray;padding:3px;font-family:Verdana;font-weight:normal;font-size:12px;color:#043062'>☳ UPDATE USER'S ACCESS</div> <div style='border:0px solid gray;width:100%;margin:10px;float:left;min-width:100px'> <b style='font-family:Verdana;font-size:12px;color:#727373;margin-right:5px;font-weight:normal;margin-left:5px'>Password:</b> <input type="password" id="uPassA" placeholder="" style="text-align:center;width:93.8%;margin:3px;padding:10px;font-size:14px"> </div> <div style='border:0px solid red;width:100%;margin:10px;float:left;min-width:100px'> <b style='font-family:Verdana;font-size:12px;color:#727373;margin-right:5px;font-weight:normal;margin-left:5px'>Confirm Password:</b> <input type="password" id="uPassB" placeholder="" style='text-align:center;width:93.8%;margin:3px;padding:10px;font-size:14px'> </div> <div style='border:0px solid red;width:96%;margin:10px;float:left;min-width:100px'> <b style='font-family:Verdana;font-size:12px;color:#727373;margin-right:5px;font-weight:normal;margin-left:5px'>Access Privilege:</b> <select id='uRights' style='width:98%;margin:3px;padding:10px;font-size:14px'> <?php $getRight=mysql_query("SELECT * FROM `vts_access_privilege` WHERE `a_status`='1' order by `a_desc` ASC "); while($aRow=mysql_fetch_array($getRight)){ echo "<option value=".$aRow['a_id'].">".$aRow['a_desc']."</option>"; } ?> </select> </div> </div> <div style='text-align:center;border:0px solid red;width:100%;margin:10px;float:left;min-width:100px'> <input type="submit" id="saveUserUpdate" value="Update" style='text-align:center;width:50%;margin:3px;padding:10px;font-size:14px'> </div> </div> </div> </div> </div> <?php //if submit/ save to databasevar if(isset($_POST['done'])){ $searchString = mysql_escape_string($_POST['searchString']); exit(); } //display from database if(isset($_POST['display'])){ $searchString = mysql_escape_string($_POST['searchString']); $result = mysql_query("SELECT * FROM `vts_users` WHERE `u_name` LIKE '%$searchString%' || `u_lname` LIKE '%$searchString%' || `usr_mobile` LIKE '%$searchString%' || `email` LIKE '%$searchString%' ORDER BY `u_lname` ASC"); if(mysql_num_rows($result) > 1){ $textMsg = "Search Results"; }else{ $textMsg = "Search Result"; } echo "<div class='bgColor' style='background:lightgray;vertical-align:top;height:30px;margin:0px;width:100%;border-bottom:1px solid gray;padding:5px;font-family:Verdana;font-weight:normal;font-size:14px;color:#043062'> ✛ ".$textMsg." (".mysql_num_rows($result).") <div style='float:right;font-family:Verdana;font-size:15px;'> <a href='mainindex.php?id=23&d=4' class='hideClick hidden' > ♲ </a><!--REFRESH/RELOAD WINDOW--> <a href='#' onclick='showAdd()' style='font-weight:bold'> ✕ </a> </div> </div>"; echo "<table style='width:100%;'>"; echo "<thead> <tr> <th>USER ID</th> <th>FIRST NAME</th> <th>LAST NAME</th> <th>MOBILE NUMBER</th> <th>COMPANY</th> <th>DEALERSHIP</th> <th>POSITION</th> <th>E-MAIL</th> <th>ROLE</th> <th style='width:5px;'></th> <th></th> <th></th> </tr> </thead>"; while($row=mysql_fetch_array($result)){ ?><tr onclick="javascript:showCustDetails(this);"><?php echo "<td>".$row['u_name']."</td>"; echo "<td>".$row['u_fname']."</td>"; echo "<td>".$row['u_lname']."</td>"; echo "<td>".$row['usr_mobile']."</td>"; echo "<td>"; $cID = mysql_result(mysql_query("SELECT `comp_name` FROM `vts_company` WHERE `comp_id`='".$row['company']."'"),0); $dID = mysql_result(mysql_query("SELECT `deal_name` FROM `vts_dealerships` WHERE `deal_id`='".$row['dealer']."'"),0); echo $cID; echo"</td>"; echo "<td>".$dID."</td>"; echo "<td>".$row['u_position']."</td>"; echo "<td>".$row['email']."</td>"; echo "<td>".$row['access_right']."</td>"; echo "<td>".$row['account_type']."</td>"; echo "<td>".$row['u_status']."</td>"; echo "<td style='padding:0px;'> <a href='#' onclick='viewCustTable()'><b style='padding:0px;border:1px solid gray;background: #defbfc;margin:0px;'>✎</b></a></td>"; echo "</tr>"; } echo "</table>"; exit(); } ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings