<?php
session_start();
error_reporting(0);
header("Access-Control-Allow-Origin: *");
$servername = "localhost";
$username = "torsuric_maker";
$password = "jesusislord";
$dbname = "torsuric_schoolrobot";
$servername = "localhost";
$username = "erp";
$password = "JesusChristisLord";
$dbname = "aurarich_erp";
// Create connection
$business_conn = mysqli_connect($servername, $username, $password, $dbname);

if(!empty(isset($_POST['UniqueId']))){
    $uniqueid = isset($_POST['UniqueId']) ? $_POST['UniqueId'] : '';
    $_SESSION['UniqueId'] = $uniqueid;
} else if (!empty(isset($_GET['id']))) {
    $uniqueid = isset($_GET['id']) ? $_GET['id'] : '';
} else if (!empty(isset($_GET['UniqueId']))) {
    $uniqueid = isset($_GET['UniqueId']) ? $_GET['UniqueId'] : '';
    $_SESSION['UniqueId'] = $uniqueid;
}else if (!empty(isset($_GET['AdminLogin']))) {
    $uniqueid = isset($_GET['AdminLogin']) ? $_GET['AdminLogin'] : '';
    $_SESSION['UniqueId'] = $uniqueid;
}else{
    $uniqueid = isset($_SESSION['UniqueId']) ? $_SESSION['UniqueId'] : '';
}

// SQL Query To Fetch Complete Information Of User
$query=mysqli_query($business_conn, "SELECT * FROM businesses_account WHERE UniqueId= '$uniqueid'");
while($row=mysqli_fetch_assoc($query)){
    $id = $row['id'];
    $newbusinessornot =$row['NewBusinessOrNot'];
    $uniqueid =$row['UniqueId'];
    $businessid =$row['Businessid'];
    $_SESSION["BusinessImage"] = $row['Image'];    
    $image =$_SESSION["BusinessImage"];
    $msgg = $row['Image'];   
    $user_package = $row['Package'];  
    $staffid_card_front_template = $row['StaffId_Card_Front_Image'];
    $staffid_card_back_template = $row['StaffId_Card_Back_Image'];
    $studentid_card_text_color_code = $row['StaffId_Colour_Code'];
    $noofmonthsrem = $row['MonthsRemainingToPayForSubscription'];
    $terminalreportgradingchoice = $row['TerminalReportGradingChoice'];
    $businessname =$row['BusinessName'];
    $businessini =$row['Business_Initials'];
    $address =$row['Address'];
    $tin_number = $row['TinNumber'];
    $er_number = $row['ERNumber'];
    $location = $row['Location'];
    $email =$row['Email'];
    $telephone =$row['Telephone'];
    $mobile =$row['Mobile'];
    $mobile2 =$row['Mobile2'];
    $phone = "".$telephone." / ".$mobile." / ".$mobile2."";
    $server_username = $row['Server_Username'];
    $server_password = $row['Server_Password'];
    $db_name = $row['Database_Name'];
    $sms_sender_id = $row['SMSSenderID'];
    $sms_characters_for_1_segment = 160;
    $sms_credit = $row['SMSCredit'];
    $sms_credit_used = $row['SMSCreditUsed'];
    $sms_credit_remaining = $row['SMSCreditRemaining'];
    $strictornot = $row['StrictOrNot'];
    $server_username = $row['Server_Username'];
    $server_password = $row['Server_Password'];
    $databasename = $row['Database_Name'];
}
//$website_name = $_SESSION['$website_name'];
$timezone = 'Africa/Accra';
date_default_timezone_set($timezone);
?>
