D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
proc
/
thread-self
/
root
/
home
/
shubmkcj
/
urbane.createerp.com
/
Filename :
update-user.php
back
Copy
<?php ob_start(); session_start(); $id = $_GET['id']; include 'config.php'; if(isset($_SESSION["source_id"])){ $source_id = $_SESSION['source_id']; } $email = addslashes(stripslashes($_POST['email'])); $name = addslashes(stripslashes($_POST['name'])); // $password = addslashes(stripslashes($_POST['password'])); $contactView = isset($_POST["contactView"]) ? $_POST["contactView"] : ""; $contactAdd = isset($_POST["contactAdd"]) ? $_POST["contactAdd"] : ""; $contactEdit = isset($_POST["contactEdit"]) ? $_POST["contactEdit"] : ""; $contactDelete = isset($_POST["contactDelete"]) ? $_POST["contactDelete"] : ""; $inventoryView = isset($_POST["inventoryView"]) ? $_POST["inventoryView"] : ""; $inventoryAdd = isset($_POST["inventoryAdd"]) ? $_POST["inventoryAdd"] : ""; $inventoryEdit = isset($_POST["inventoryEdit"]) ? $_POST["inventoryEdit"] : ""; $inventoryDelete = isset($_POST["inventoryDelete"]) ? $_POST["inventoryDelete"] : ""; $financeView = isset($_POST["financeView"]) ? $_POST["financeView"] : ""; $financeAdd = isset($_POST["financeAdd"]) ? $_POST["financeAdd"] : ""; $financeEdit = isset($_POST["financeEdit"]) ? $_POST["financeEdit"] : ""; $financeDelete = isset($_POST["financeDelete"]) ? $_POST["financeDelete"] : ""; $generalView = isset($_POST["generalView"]) ? $_POST["generalView"] : ""; $generalAdd = isset($_POST["generalAdd"]) ? $_POST["generalAdd"] : ""; $generalEdit = isset($_POST["generalEdit"]) ? $_POST["generalEdit"] : ""; $generalDelete = isset($_POST["generalDelete"]) ? $_POST["generalDelete"] : ""; $userView = isset($_POST["userView"]) ? $_POST["userView"] : ""; $userAdd = isset($_POST["userAdd"]) ? $_POST["userAdd"] : ""; $userEdit = isset($_POST["userEdit"]) ? $_POST["userEdit"] : ""; $userDelete = isset($_POST["userDelete"]) ? $_POST["userDelete"] : ""; $sql = "UPDATE login_admin SET email='$email', name='$name' WHERE id='$id'"; if ($conn->query($sql) === TRUE) { $sqlInsertPermission = "UPDATE user_permission SET contact_view = '$contactView', contact_add = '$contactAdd', contact_edit = '$contactEdit', contact_delete = '$contactDelete', inventory_view = '$inventoryView', inventory_add = '$inventoryAdd', inventory_edit = '$inventoryEdit', inventory_delete = '$inventoryDelete', finance_view = '$financeView', finance_add = '$financeAdd', finance_edit = '$financeEdit', finance_delete = '$financeDelete', general_view = '$generalView', general_add = '$generalAdd', general_edit = '$generalEdit', general_delete = '$generalDelete', user_view = '$userView', user_add = '$userAdd', user_edit = '$userEdit', user_delete = '$userDelete' WHERE user_email = '$email' AND source_id = '$source_id'"; $conn->query($sqlInsertPermission); echo '<script>localStorage.setItem("UserUpdate", "true");</script>' ; echo '<script>location.replace("user.php")</script>' ; } else { echo "Error: " . $sql . "<br>" . $conn->error; } ?>