Shell File Manager

Current Path : /home/camscanae/public_html/admin/pages/
Upload File :
Current File : /home/camscanae/public_html/admin/pages/add_admin.php

<?php
session_start();
//if (isset($_SESSION['ID'])) {
//    header("Location:index.php");
//    exit();
//}
// Include database connectivity

include_once('../../include/config.php');
$admin_id = $_GET['admin_id'];
$role = $_GET['role'];

$url_session = $_GET['session'];
// print_r($url_session);

if ($url_session == $_SESSION['session']) {




	if (isset($_POST['submit'])) {
		$username = $_POST['username'];
		$email = $_POST['email'];
		$password = md5($_POST['password']);
		$cpassword = md5($_POST['cpassword']);
		$role_add = $_POST['role_add'];
		$image = $_POST['image'];

		if ($password == $cpassword) {




			$query_admin = "INSERT INTO admins(username, email, password , role , image , session_key )VALUES ( '$username', '$email', '$password' , '$role_add' , '$image' , '$password' )";
			$result_query_admin = mysqli_query($connection, $query_admin);
			// print_r($query_details );
			if ($query_admin) {

				$_SESSION['status'] = " Admin Added Successfully ";
				$_SESSION['status_code'] = "success";
				$_SESSION['body'] = "";
				$_SESSION['button'] = "Ok";
				header("Location:admins.php?admin_id=$admin_id&role=$role&session=$url_session");
			} else {
				$_SESSION['status'] = "Something Wrong!!";
				$_SESSION['status_code'] = "error";
				$_SESSION['body'] = "You Not Added This Admin Account";
				$_SESSION['button'] = "Try Again ";
				header("Location:admins.php?admin_id=$admin_id&role=$role&session=$url_session");
			}
		} else {

			$_SESSION['status'] = "Something Wrong!!";
			$_SESSION['status_code'] = "error";
			$_SESSION['body'] = "Password Not Matched";
			$_SESSION['button'] = "Try Again ";
			header("Location:admins.php?admin_id=$admin_id&role=$role&session=$url_session");
		}
	}

?>

	<!DOCTYPE html>
	<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">

		<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

		<link rel="stylesheet" type="text/css" href="../assets/css/log.css">
		<title> CamScan FZCO Admin</title>
		<link rel="shortcut icon" type="image/x-icon" href="../../assets/img/website/camsan_icon.png">
	</head>

	<body>
		<div class="container">
			<form action="" method="POST" class="login-email">
				<p class="login-text" style="font-size: 2rem; font-weight: 800;"><img src="../../assets/img/website/CamScan FZCO.png" height=50px ; width=200px></p>

				<div class="input-group">
					<center> <img id="output" src="" width="100" height="100"></center>

					<input name="image" type="file" accept="image/*" onchange="document.getElementById('output').src = window.URL.createObjectURL(this.files[0])" required>
				</div>
				<br>
				<br><br>
				<br>


				<div class="input-group">
					<input type="text" placeholder="Username" name="username" value="" required>
				</div>
				<div class="input-group">
					<input type="email" placeholder="Email" name="email" value="" required>
				</div>
				<div class="input-group">
					<input type="password" placeholder="Password" name="password" value="" required>
				</div>
				<div class="input-group">
					<input type="password" placeholder="Confirm Password" name="cpassword" value="" required>
				</div>
				<div class="input-group">
					<select name="role_add" placeholder="Select Role" class="input-group" style="display: block;
    width: 100%;
    height: 100%;
    border: 2px solid #e7e7e7;
    padding: 15px 20px;
    font-size: 1rem;
    border-radius: 30px;
    background: transparent;
    outline: none;
	font-size: 13px;
    transition: .3s;
	border-color: #015d62;
	
	">
						<option value="" style="font-size: 14px;">Select Role</option>
						<option value="Administration" style="font-size: 14px;">Administration</option>
						<option value="Data Entery" style="font-size: 14px;">Data Entery</option>

					</select>


				</div>

				<div class="input-group">
					<button name="submit" class="btn" style="font-size: 16px;">Add New Account </button>
				</div>
				<!-- <p class="login-register-text">Have an account? <a href="login.php">Login Here</a>.</p> -->
			</form>
		</div>
	</body>

	</html>

<?php
} else {
	include 'login_error.php';
}

?>

Shell File Manager Version 1.1, Coded By Shell
Email: [email protected]