File manager - Edit - /home/autoph/public_html/pms_v1/config/importASAUsers.php
Back
<?php include_once("../../../cfg/conn.php"); include_once("../../../cfg/connasa.php"); error_reporting(0); if(isset($_POST['usr'])){ include ("../functions/users.php"); $myUserID = $_POST['myUserID']; $roleID = userProfileID($myUserID); //============================================================================================================== //VALIDATE ACCESS ============================================================================================== //============================================================================================================== $roleID = userProfileID($userID); $roleID = userProfileID($myUserID); $moduleID = 2; $add =checkViewAccessM1024($roleID, $moduleID)[1]; $edit =checkViewAccessM1024($roleID, $moduleID)[2]; $delete =checkViewAccessM1024($roleID, $moduleID)[3]; $print =checkViewAccessM1024($roleID, $moduleID)[4]; $download =checkViewAccessM1024($roleID, $moduleID)[5]; echo "<input type='hidden' id='addAccess' value='$add'>"; echo "<input type='hidden' id='editAccess' value='$edit'>"; echo "<input type='hidden' id='deleteAccess' value='$delete'>"; echo "<input type='hidden' id='printAccess' value='$print'>"; echo "<input type='hidden' id='downloadAccess' value='$download'>"; if($add == 1){$addButton = '';}else{$addButton='Disabled';} if($edit == 1){$editButton = '';}else{$editButton='Disabled';} if($delete == 1){$deletButton = '';}else{$deletButton='Disabled';} if($print == 1){$printButton = '';}else{$printButton='Disabled';} if($download == 1){$downloadButton = '';}else{$downloadButton='Disabled';} if(checkViewAccessM1024($roleID, $moduleID)[0] == 0){ echo " <center><img src='./images/locked_out_icon.png' width='100' style='margin-top:100px'><img></center> "; echo "<h4 class='text-center text-danger align-middle pt-5'> Access Denied </h4>"; echo "<p class='display-5 text-center text-danger'> Sorry, you are not authorized to access this page. <br>Please contact your system support for assistance. <br><br>Thank you! <br><br> </p>"; exit(); } //============================================================================================================== //VALIDATE ACCESS ============================================================================================== //============================================================================================================== ?> <input type='hidden' id='searchID' placeholder='searchID'> <h5>PMS Active Employees</h5> <div id='selectedRecord' class='content w-100' style='height:600px;overflow:auto;border:1px solid lightgray'> <?php echo "<center><table class='col-lg-12 col-md-12' style='width:150%'>"; echo "<thead>"; echo "<th>ID</th>"; echo "<th>EMP NO</th>"; echo "<th>EMPLOYEE NAME</th>"; echo "<th>COMPANY</th>"; echo "<th>DEALER</th>"; echo "<th>TITLE</th>"; echo "</thead>"; $getVTSUsers = "SELECT * FROM `vts_users` WHERE `deleted`=0 ORDER BY u_lname ASC"; $qEmp = mysqli_query($connasa,$getVTSUsers); $eCount = mysqli_num_rows($qEmp); while($row=mysqli_fetch_array($qEmp)){ echo "<tr>"; echo "<td>".$row['u_id']."</td>"; echo "<td>".$row['employee_id']."</td>"; echo "<td>".$row['u_lname'].", ".$row['u_fname']."</td>"; echo "<td>".$row['company']."</td>"; echo "<td>".$row['dealer']."</td>"; echo "<td>".$row['u_position']."</td>"; echo "</tr>"; } echo "</table>"; ?> </div> <button id='loadReport' <?php echo $addButton;?> type="button" class="btn btn-info pl-4 pr-4 m-0 float-right m-5" data-toggle="modal" data-target="#vewRPTPage" style="height:40px"> <span class="btn-label"><i class="fa fa-cloud-upload" aria-hidden="true"> IMPORT ASA USERS</i></button> <?php } $getPMSUsers = "SELECT * FROM `pms_employee_data` WHERE `deleted`=0"; $qPms = mysqli_query($conn,$getPMSUsers); $pCount = mysqli_num_rows($qPms); echo "<h6>ASA Users: $eCount. | PMS Users: $pCount</h6>"; $conn->close(); ?> <script> $("#loadReport").click(function(){ var activeUserID =$("#activeUserID").val(); var addAccess = $("#addAccess").val(); if(addAccess==0){ Swal.fire({ icon: 'Error', title: 'Access Denied', text: 'Sorry, you are not authorized to import users from ASA.' }) return false; } Swal.fire({ title: 'Are you sure you want to import all user\'s data from ASA?', text: "If you continue you wont be able to revert this.", icon: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Confirm Import' }).then((result) => { if (result.isConfirmed) { ShowUploadBar(); $.ajax({ url: "./config/import.php", type: "POST", async: true, data: { "activeUserID":activeUserID, "imp": 1 }, success: function(a){ $("#selectedRecord").html(a); ShowUploadBar(); } }) } }) }); </script> <script type="text/javascript" src="https://canvasjs.com/assets/script/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="https://cdn.canvasjs.com/jquery.canvasjs.min.js"></script>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings