<?php
date_default_timezone_set('Asia/Kolkata'); 
//echo $date = date("Y-m-d", time());
include ('../config.php');
@session_start();
@$user_id1=$_SESSION['user_id1'];
@$idvfied1=$_SESSION['idverified1'];
@$namevfied1=$_SESSION['namevfied1'];
if(!isset($_SESSION['user_id1'])){
	header("Location: index.php");
}

$timeout = 60 * 60 * 24 * 365;
$s_name = session_name();
if(isset( $_COOKIE[ $s_name ] )) {
  setcookie( $s_name, $_COOKIE[ $s_name ], time() + $timeout, '/' );
}

$sel1=mysqli_query($conn,"select * from hr_dump where empid='".@$user_id1."'");
$fetch1=mysqli_fetch_array($sel1);

$queryFR=mysqli_query($conn,"select * from tracker where Functional_Reporting='$fetch1[Employee_Number]'");
$dataFR=mysqli_fetch_array($queryFR);

$queryFR=mysqli_query($conn,"select * from emp_leave where Functional_Reporting='$fetch1[Employee_Number]'");
$dataFR=mysqli_fetch_array($queryFR);
?>

<!doctype html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, viewport-fit=cover" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <title>Rejected VC</title>
	
	<?php	include ('header.php');	?>
	
	<div id="appCapsule">
        <div class="section wallet-card-section pt-1">
            <div class="wallet-card">
				
				<?php	include ('include/wallet-balance.php');	?>
				
				<div class="wallet-footer">
                    <div class="row text-center">
						<div class="col-4"><a href="vc-admin.php" class="btn btn-primary btn-sm">Pending</a></div>
						<div class="col-4"><a href="vc-approved.php" class="btn btn-success btn-sm">Approved</a></div>
						<div class="col-4"><a href="vc-rejected.php" class="btn btn-danger btn-sm">Rejected</a></div>
					</div>
                </div>
				<div class="row stat-box py-1 mt-4">
					<h6 class="text-center alert alert-warning">Rejected VC Details</h6>
					<div class="table">
						<table id=" " class="table table-striped table-bordered">
						<thead>
						<tr class="small">
							<th>ID</th>
							<th>Employee Code/Name</th>
							<th>Client Name</th>
							<th>Project Name</th>
							<th>Client Mobile</th>
							<th>Client Email</th>
							<th>Client Location</th>
							<th>Status</th>
							<th>Date</th>
						</thead>
						<tbody>
						<?php
						
						function mask_mobile($mobile) {
							return '******' . substr($mobile, -4);
						}
						function mask_email($email) {
							$parts = explode('@', $email);
							return substr($parts[0], 0, 2) . '*****@' . $parts[1];
						}

						$query="select * from vc_client_details where ProjCreatedBy='$fetch1[empid]' AND status = 'Rejected' ORDER BY cid DESC";
						$result=mysqli_query($connpe,$query);
						while($data=mysqli_fetch_assoc($result))
						{
						@$sn++;
						?>
						<tr class="small">
							<td><?php echo $data['cid'] ?></td>
							<td><?php echo $data['empid'] ?>-<?php echo $data['Employee_Full_Name'] ?></td>
							<td><?php echo $data['client_name'] ?></td>
							<td><?php echo $data['project_name'] ?></td>
							<td><?php echo mask_mobile($data['client_mobile']) ?></td>
							<td><?php echo mask_email($data['client_email']) ?></td>
							<td><?php echo $data['client_location'] ?></td>
							<td><?php echo $data['status'] ?></td>
							<td><?php echo $data['created_date'] ?></td>
						</tr>
						<?php    }    ?> 
						</tbody>
						</table>		
					</div>
				</div>
				
            </div>
        </div>
	
	<?php	include ('include/copyright.php');	?>
	</div>
	
	<?php	include ('footer.php');	?>