File manager - Edit - /home/autoph/public_html/connect/home/access_control_management.php
Back
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> * {box-sizing: border-box} body {font-family: "Lato", sans-serif;} /* Style the tab */ .tab { float: left; border: 1px solid #ccc; background-color: #f1f1f1; width: 20%; min-height: 550px; } /* Style the buttons inside the tab */ .tab button { display: block; background-color: inherit; color: black; padding: 5px 5px; width: 100%; border: none; outline: none; text-align: left; cursor: pointer; font-size: 12px; } /* Change background color of buttons on hover */ .tab button:hover { background-color: #ddd; } /* Create an active/current "tab button" class */ .tab button.active { background-color: #ccc; } .contentTitle{ margin:0px; margin-bottom:3px; background:lightgray; width:100%; font-family:Verdana; font-size:14px; font-weight:normal; color:black; padding:5px; } .labelData{ border:0px solid gray; padding:3px; width:100%; margin:15px; font-family:Verdana; color:black; font-size:11px; } .SubContentTitle{ margin:0px; margin-bottom:3px; background: #fcc38d ; width:100%; font-family:Verdana; font-size:11px; font-weight:normal; color:red; padding:2px; } /* Style the tab content */ .tabcontent { float: left; padding: 3px 3px; border: 1px solid #ccc; width: 80%; border-left: none; min-height: 550px; display: none; background:white; } /* Clear floats after the tab */ .clearfix::after { content: ""; clear: both; display: table; } </style> <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:200px; overflow:auto; border:0px solid gray; } #submit_name{ width:30%; min-width:150px; margin:20px; padding:20px; } #name, textarea{ width:100%; } </style> </head> <!----==============================================================-----> <!----==============================================================-----> <body> <div style='border:0px solid gray;width:100%;height:100%;float:left;margin:0px;min-width:400px;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-weight:normal;font-size:18px;color:#043062'> Access Control Management: <div style='float:right;font-family:Verdana;font-size:15px;'> <a href='mainindex.php?id=14&ex=refresh' class='hideClick hidden' > ♲ </a><!--REFRESH/RELOAD WINDOW--> <a href='mainindex.php?id=14&ex=true' 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="display_area" style='height:500px;display:none;border:0px solid blue'> </div> <!-- ============================================================================ --> <!-- ============================================================================ --> <div id="addForm" style='display:block;z-index:9999;margin-top:0px;height:500px;border:0px solid red;width:100%'> <input type="hidden" id="sCompID" value="<?php echo $compID;?>" style="width:200px;padding:5px;font-family:Verdana;font-size:14px"> <input type="hidden" id="sDealID" value="<?php echo $dealID;?>" style="width:200px;padding:5px;font-family:Verdana;font-size:14px"> <input type="hidden" id="svDate" value="<?php echo $toDate;?>" style="width:200px;padding:5px;font-family:Verdana;font-size:14px"> <input type="hidden" id="svTime" value="<?php echo $myCurTime;?>" style="width:200px;padding:5px;font-family:Verdana;font-size:14px"> <input type="hidden" id="svUserID" value="<?php echo $userID;?>" style="width:200px;padding:5px;font-family:Verdana;font-size:14px"> <div class="subBody" style='background:white;border:1px solid gray; width:40%;margin:5px;float:left;min-width:400px;height:97%'> <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'> ✛ Create Access Role <div style='float:right;font-family:Verdana;font-size:15px;'> <a href='mainindex.php?id=002&d=10' class='hideClick hidden' > ♲ </a><!--REFRESH/RELOAD WINDOW--> <a href='#' onclick="showAdd()" style='font-weight:bold'> ✕ </a> </div> </div> <div style='border:0px solid red;width:97%;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'>Name of New Role:</b><br> <input type="text" id="newRole" placeholder="Name of New Role" style='width:98%;margin:5px' onkeyup="this.value = this.value.toUpperCase();"> </div> <div style='border:0px solid red;width:30%;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'>Capacity:</b><br> <select id='roleStatus' style='width:98%;margin:5px' > <option value='1'>Active</option> <option value='0'>InActive</option> </select> </div> <div style='border:0px solid red;width:60%;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 Category:</b><br> <select id='roleCategory' style='width:98%;margin:5px' > <option value='4'>Users</option> <option value='3'>Officers</option> <option value='2'>Supervisors</option> <option value='1'>Managers</option> <option value='0'>Executive</option> </select> </div> <div style='border:0px solid red;width:95%;margin:10px;float:left;min-width:100px'> <hr> </div> <br> <div style='border:0px solid red;width:30%;margin:10px;float:left;min-width:100px;background:transparent'> <input type='submit' id='SaveNewUser' value="Save Record" style="width:150px"> </div> </div> <div id="viewIfExist" class="subBody" style='background:white;border:1px solid gray; width:58%;margin:5px;float:left;min-width:400px;height:98%;overflow:auto'> <div class='bgColor' style='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'> ✛ Active Roles: <div style='float:right;font-family:Verdana;font-size:15px;'> <a href='mainindex.php?id=002' class='hideClick hidden' style='font-weight:bold'> ✕ </a> </div> </div> <?php echo "<div id='custMoreInfo' style='display:none;position:absolute;top:10px;left:10px;width:70%;height:100%;z-index:99999;background:#ccc;border:1px solid gray;z-index:999'>"; ?> <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="viewCustTable()" style='font-size:12px;color:red'> ✕ </a> </div> </div> <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////// --> <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////// --> <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////// --> <div style="width:100%;padding:15px;border:0px solid gray;height:95%;background:#ccc;overflow:auto"> <!-- BODY GOES HERE..--> <script language="javascript" type="text/javascript"> function showCustDetails(row) { var x=row.cells; document.getElementById("roleID").value = x[0].innerHTML; document.getElementById("roleName").value = x[1].innerHTML; } function viewCustTable() { var div = document.getElementById("custMoreInfo"); if (div.style.display == 'none') { div.style.display = 'block'; } else { div.style.display = 'none'; } } </script> <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////// --> <div style="width:99%;height:70px;border:0px solid red;padding:0px;margin:5px;margin-bottom:1px;font-family:Verdana;color:black"> <input type="hidden" id="roleID" style='width:10%'> <input type="hidden" id="moduleID" value="8" style='width:10%'> <div style='width:40%;float:left;border:0px solid red;padding:5px;'> Role Description:<br> <input type="text" readonly id="roleName" style='height:40px;width:100%;font-family:Helvetica;font-size:16px;color:black'> </div> <div style='width:60%;float:left;border:0px solid red;padding:5px;'> <br> <input type="submit" id="viewUserAccess" Value ="View Access" style='padding:10px;width:30%;font-family:Helvetica;font-size:16px;color:black'> </div> </div> <div id="displayAccessMain" style="width:100%;height:600px;border:1px solid gray;padding:0px;margin:5px;background:white"> <div class='bgColor' style='border:1px solid lightgray;vertical-align:top;height:25px;margin:0px;width:100%;border-bottom:0px solid gray;padding:5px;font-family:Verdana;font-weight:normal;font-size:12px;color:#043062'>☳ User's Access Configuration: </div> <div id="displayAccess" style="width:100%;height:95.6%;border:0px solid blue;padding:0px;margin:0px;overflow:auto;background:white "> </div> </div> <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////// --> <script> function openCity(evt, cityName) { var i, tabcontent, tablinks; tabcontent = document.getElementsByClassName("tabcontent"); for (i = 0; i < tabcontent.length; i++) { tabcontent[i].style.display = "none"; } tablinks = document.getElementsByClassName("tablinks"); for (i = 0; i < tablinks.length; i++) { tablinks[i].className = tablinks[i].className.replace(" active", ""); } document.getElementById(cityName).style.display = "block"; evt.currentTarget.className += " active"; } </script> <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////// --> </div> <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////// --> <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////// --> <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////// --> <?php echo "</div>"; $result = mysql_query("SELECT * FROM vts_access_privilege WHERE `a_status`=1 ORDER BY `a_desc` ASC"); echo "<table style='width:100%;border:0px solid red;border-collapse:collapse'>"; echo "<thead> <tr> <th>NO</th> <th>ROLE DESCRIPTION</th> <th>STATUS</th> <th>DATE CREATED</th> <th style='text-align:center'>-</th> </tr> </thead>"; while($row=mysql_fetch_array($result)){ $no=$no + 1 ; ?><tr onclick="javascript:showCustDetails(this);"><?php echo "<td style='padding-left:15px'>".$no."</td>"; echo "<td style='padding-left:10px'>".$row['a_desc']."</td>"; echo "<td style='text-align:center;'>"; if($row['a_status']==1){ echo 'Active'; }else{ echo 'InActive'; } echo"</td>"; echo "<td style='padding-left:10px'>".$row['date_created']."</td>"; echo "<td style='text-align:center;'>"; ?> <a href='#' onclick="viewCustTable()" style='font-size:12px;color:red'>⚏</a></td> <?php echo "</tr>"; } echo "</table>"; ?> </div> </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> <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"); }); //====================//CHECK IF USER ALREADY EXIST IN THE DATABASE============================================================================ //START OF FUNCTION================= SAVING NEW RECORD $("#viewUserAccess").click(function(){ var roleID = $("#roleID").val(); var roleName= $("#roleName").val(); var moduleID= $("#moduleID").val(); if (roleID == "") { alert("Error: Invalid Input or missing reference ID Number."); return false; } $.ajax({ url: "load_user_assigned_access.php", type: "POST", async: false, data: { "done": 1, "roleID" : roleID, "moduleID" : moduleID, "roleName": roleName }, success: function(data){ //alert("New Record Saved."); displayFromDatabase(); } }) }); function displayFromDatabase(){ var roleID = $("#roleID").val(); var roleName= $("#roleName").val(); var moduleID= $("#moduleID").val(); $.ajax({ url: "load_user_assigned_access.php", type: "POST", async: false, data: { "roleID" : roleID, "roleName": roleName, "moduleID" : moduleID, "display": 1 }, success: function(d){ $("#displayAccess").html(d); } }); } //====================//CHECK IF USER ALREADY EXIST IN THE DATABASE========roleStatus ==================================================================== tCapacity tSlot sCompID sDealID svDate svTime svUserID $("#SaveNewUser").click(function(){ var newRole = $("#newRole").val(); var sCompID = $("#sCompID").val(); var sDealID = $("#sDealID").val(); var svDate = $("#svDate").val(); var svTime = $("#svTime").val(); var svUserID = $("#svUserID").val(); var roleStatus = $("#roleStatus").val(); var roleCategory = $("#roleCategory").val(); if (newRole == "") { alert("Invalid Input. Please check your entry and try again!"); return false; } $.ajax({ url: "save_new_role.php", type: "POST", async: false, data: { "done": 1, "newRole" : newRole }, success: function(data){ //alert("New Record Saved."); displayCheckMsg(); } }) }); //DISPLAY MESSAGE IF USER EXIST================= function displayCheckMsg(){ var newRole = $("#newRole").val(); var sCompID = $("#sCompID").val(); var sDealID = $("#sDealID").val(); var svDate = $("#svDate").val(); var svTime = $("#svTime").val(); var svUserID = $("#svUserID").val(); var roleStatus = $("#roleStatus").val(); var roleCategory = $("#roleCategory").val(); $.ajax({ url: "save_new_role.php", type: "POST", async: false, data: { "svDate": svDate, "roleCategory": roleCategory, "roleStatus": roleStatus, "newRole" : newRole, "display" : 1 }, success: function(d){ $("#viewIfExist").html(d); $('#newRole').val(''); alert("New Record has been Saved."); } }); } //====================//CHECK IF USER ALREADY EXIST IN THE DATABASE============================================================================ }); </script>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings