File manager - Edit - /home/autoph/public_html/connect/home/reload_admin_user_access.php
Back
<?php include 'core/init.php'; //if submit/ save to databasevar if(isset($_POST['done'])){ $selUserID = mysql_escape_string($_POST['selUserID']); $brandID = mysql_escape_string($_POST['brandID']); $result = mysql_query("SELECT * FROM brand_access WHERE `user_id` = '$selUserID' ORDER BY `brand_name` ASC"); echo "<table style='width:100%;'>"; echo "<thead> <tr> <th width='10%'>RECORD ID</th> <th width='70%'>BRAND NAME</th> <th width='20%'>ACTION</th> </tr> </thead>"; while($row=mysql_fetch_array($result)){ ?><tr onclick="javascript:DeleteSelectedAccess(this);"><?php echo "<td>".$row['id']."</td>"; echo "<td>".$row['brand_name']."</td>"; echo"</td>"; ?><td><button id="delAccess" onclick="LoadDeleteForm()" style='background:transparent;font-family:Arial;font-size:14px;font-weight:bold;color:red'>Remove</a></td><?php echo "</tr>"; } echo "</table>"; exit(); } if(isset($_POST['AddNew'])){ $selUserID = mysql_escape_string($_POST['selUserID']); $brandID = mysql_escape_string($_POST['brandID']); $brandName = mysql_result(mysql_query("SELECT `b_name` FROM `vts_brands` WHERE `b_id`='$brandID'"),0); $getIFexist = mysql_result(mysql_query("SELECT COUNT(brand_id) FROM `brand_access` WHERE `user_id`='$selUserID' AND `brand_id`='$brandID'"),0); if($getIFexist==0){ mysql_query("INSERT INTO brand_access (id, user_id, brand_name, brand_id) VALUES('','{$selUserID}','{$brandName}','{$brandID}')"); } $result = mysql_query("SELECT * FROM brand_access WHERE `user_id` = '$selUserID' ORDER BY `brand_name` ASC"); echo "<table style='width:100%;'>"; echo "<thead> <tr> <th width='15%'>RECORD ID</th> <th width='65%'>BRAND NAME</th> <th width='20%'>ACTION</th> </tr> </thead>"; while($row=mysql_fetch_array($result)){ ?><tr onclick="javascript:DeleteSelectedAccess(this);"><?php echo "<td>".$row['id']."</td>"; echo "<td>".$row['brand_name']."</td>"; echo"</td>"; ?><td><button id="delAccess" onclick="LoadDeleteForm()" style='background:transparent;font-family:Arial;font-size:14px;font-weight:bold;color:red'>Remove</a></td><?php echo "</tr>"; } echo "</table>"; exit(); } if(isset($_POST['deleteNow'])){ $deleteAccessID = mysql_escape_string($_POST['deleteAccessID']); mysql_query("DELETE FROM `brand_access` WHERE `id` = '$deleteAccessID'"); echo "<p style='background:yellow;font-family:Arial;font-size:14px;text-align:center'>Recordd has been deleted.</p>"; exit(); } ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings