D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
shubmkcj
/
urbane.createerp.com
/
Filename :
insert-new-user.php
back
Copy
<?php ob_start(); session_start(); include 'config.php'; $email = addslashes(stripslashes($_POST['email'])); $name = addslashes(stripslashes($_POST['name'])); $password = md5(addslashes(stripslashes($_POST['password']))); $sourceId = $_POST["sourceId"] ; $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 = "INSERT INTO login_admin(email, password, name, data_delete, source_id) VALUES ('$email','$password','$name','no', '$sourceId')"; $result = $conn->query($sql); if ($result === TRUE) { $sqlInsertPermission = "INSERT INTO user_permission(user_email, source_id, contact_view, contact_add, contact_edit, contact_delete, inventory_view, inventory_add, inventory_edit, inventory_delete, finance_view, finance_add, finance_edit, finance_delete, general_view, general_add, general_edit, general_delete, user_view, user_add, user_edit, user_delete) VALUES ('$email','$sourceId', '$contactView', '$contactAdd', '$contactEdit', '$contactDelete', '$inventoryView', '$inventoryAdd', '$inventoryEdit', '$inventoryDelete', '$financeView', '$financeAdd', '$financeEdit', '$financeDelete', '$generalView', '$generalAdd', '$generalEdit', '$generalDelete', '$userView', '$userAdd', '$userEdit', '$userDelete')"; $conn->query($sqlInsertPermission); echo '<script>localStorage.setItem("UserInserted", "true");</script>' ; echo '<script>location.replace("user.php")</script>' ; } else { echo "Error: " . $sql . "<br>" . $conn->error; } ?>