<?php
include 'header.php';

$err = "";
$msg = "";

$subject = $Department = $massage = "";

if ($status == "Unverified") {
    echo customAlert('error', 'Please Verify Your KYC To Get full Access to the website');
    echo pageRedirect('4', 'status.php');
}


	if (isset($_POST['send_support'])) {
		// Department 
		$Department = trim($_POST['dept']);

		// To get the user 
		$userid = trim($_POST['userid']);

		// Subject
		if (empty($_POST['subject'])) {
			$err = 'Enter your subject';
		}else{
			$subject = text_input($_POST['subject']);
		}

		// Message
		if (empty($_POST['message'])) {
			$err = 'Enter your message';
		}else{
			$message = text_input($_POST['message']);
		}

		$date = date('d-m-Y h:i:sa');

		$insert = mysqli_query($link, "INSERT INTO  support  (userid, department, subject, message, date) VALUES ('$userid', '$Department', '$subject', '$message', '$date' ) ");

		$msg = "Message Sent Successfully ";
	}
?>


<?php

	if($err != ""){
		echo customAlert('error', $err);
		echo pageRedirect('4', 'status.php');
	}

	if ($msg != "") {
		echo customAlert('success', $msg);
		// echo pageRedirect('3', '../wallet/index.html');
	}

?>

    
	<div class="appHeader" style="background-color:#161129">
        <div class="left">
            <a href="#" class="headerButton" data-bs-toggle="modal" data-bs-target="#sidebarPanel"> <i class="fas fa-bars text-white"></i> </a>
        </div>
        <div class="pageTitle text-white">
            support
        </div>
        <div class="right">
				<a href="Notifications.php" class="headerButton"> <i class="fas fa-bell text-white"></i> <span class="badge badge-danger">0</span> </a>
				<a href="logout.php?url=https://quantumfinancialvault.com/wallet/support.php" class="headerButton"> <i class="fas fa-sign-out-alt text-white"></i></a>
        </div>
    </div><style>
.wallet-card-section:before {
   
    background: #000000 !important;}
body.dark-mode .appHeader {
    border-bottom-color: #000000 !important;
}
path {
    color: #f8f9fa;
}

.appBottomMenu .item.active .icon, .appBottomMenu .item.active ion-icon, .appBottomMenu .item.active strong {
color:white !important;}

.appHeader {
    background-color: #000000 !important;
}
div#appCapsule {
    background-color: white;
    color: black;
}
ul.listview.image-listview.text.inset {
    background: #f8f9fa;
    box-shadow: 0 1px 19px 0 #dcdce9;
}
.in {
    color: black;
}
body.dark-mode {
    background: white;
    color: black;
}
.card {
    background-color: white !important;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 9%);
}
label.label {
    color: black !important;
}
select.form-control {
    color: #000000 !important;
}
input.form-control {
    color: #000000 !important;
}
textarea.form-control {
    color: #000000 !important;
}
select.form-control {
    background: white !important;
    border: 1px solid #DCDCE9 !important;
}input.form-control {
    background: white !important;
    border: 1px solid #DCDCE9 !important;
}textarea.form-control {
    background: white !important;
    border: 1px solid #DCDCE9 !important;
}



</style>


<div id="appCapsule">
	<div class="container">
	<div class="card-body p-2">
		<form method="post" style="width: 100%" action="support.php">
			<div class="form-group basic">
				<div class="input-wrapper">
					<label class="label" for="account1">Department</label>
					<select name="dept" class="form-control" required>
						<option value=""></option>
						<option value="Account Status">Account Status</option>
						<option value="Send & Receive">Send & Receive</option>
						<option value="Wallets">Wallets</option>
						<option value="Buy">Buy</option>
						<option value="Others">Others</option>
					</select>
				</div>
			</div>
			<div class="form-group basic">
				<label class="label">Subject</label>
				<div class="input-group mb-2">
					<input type="text" name="subject" class="form-control" required>
				</div>
			</div>
			<div class="form-group basic">
				<div class="input-group mb-2">
					<label class="label">Message</label>
					<textarea class="form-control" name="message" rows="5" required></textarea>
				</div>
			</div>
			<input type="hidden" name="userid" id="" value="<?php echo $userid ?>">

			<div class="form-group basic">
				<button type="reset" class="btn btn-danger">Reset</button>

				<input type="submit" name="send_support" value="Send" class="btn btn-success">
			</div>
		</form>
	</div>
	</div>

</div>
<style>
.sidebar-balance {
    background: #000000;
}.action-group {
    background: #000000;
}.modal-body.p-0 {
    background: white;
}ul.listview.flush.transparent.image-listview {
    background: white;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 9%);
}body.dark-mode .image-listview>li a.item {
    color: #000000 !important;
}.icon-box.bg-primary {
    background: #000000 !important;
}span.badge.badge-primary {
    background: #000000 !important;
}



</style>

<?php
    include 'footer.php';
?>