<?php include("includes/css.php");

if(isset($_POST['update']))
{
extract($_POST);
date_default_timezone_set('Asia/Kolkata');
 $date = date('Y-m-d H:i:s');
$product=$_POST["payment_status"];
$id=$_POST["a_id"];
$sql1 ="UPDATE user_profile SET payment_status='$product' WHERE id='$id'"; 
$res_sql=mysqli_query($conn,$sql1) or die(mysqli_error($conn));
if($res_sql)
{
}
}
?>

<body class="hold-transition skin-blue sidebar-mini">
	<div class="wrapper">
		<?php include("includes/header.php")?>
		<?php include("includes/sidebar.php")?>
		<!-- Content Wrapper. Contains page content -->
		<div class="content-wrapper">
			<!-- Content Header (Page header) -->
			<!-- Main content -->
			<section class="content">
				<div class="row">
					<div class="col-md-12">
						<div class="box box-primary">
							<div class="box-header with-border">
								<div class="col-md-12">
									<h3 class="box-title">Hammal & Transfort Workers Union Details :</h3>
								</div>
							</div>

							<!-- /.box-header -->
							<div class="box-body">  
								<div class="table-responsive mt-20">
									<table class="table table-bordered table-striped example3">
										<thead>
											<tr>
												<th>S. No</th>
												<th>Name</th> 
												<th>Contact No.</th>
												<th>Date Of Birth</th> 
											    <th>Designation</th> 
												<th>Organizations</th> 
												<th>Image</th> 
												<th>Signature</th> 
												<th>Created Date</th> 
												<th>View</th> 
												<th>Status</th> 
												<th>Delete</th> 
											</tr>
										</thead>
										<tbody> 
									        <?php $orgz="TS Hammal & Transport Workers Union";
											$sql1=mysqli_query($conn, "select * from user_profile where organizations='".$orgz."'");
											$j=1;
											while($res=mysqli_fetch_array($sql1)){ ?>
											<tr>
											<td><?php echo $j; $j++; ?></td>
											<td><?php echo $res['name']; ?></td> 
											<td><?php echo $res['contact_no']; ?></td> 
											<td><?php echo $res['dob']; ?></td> 
											<td><?php echo $res['designation']; ?></td> 
											<td><?php echo $res['organizations']; ?></td> 
											 <td><img src="images/<?php echo $res['image']; ?>" style="width:80px;"></td> 
											 <td><img src="images/<?php echo $res['signature']; ?>" style="width:80px;"></td> 
											<td>
                                                 <form method="post" action="">
													<select class="form-control" name="payment_status">
														<option value="<?php echo $res['payment_status']; ?>"><?php echo $res['payment_status']; ?></option>
														<option value="Accept">Accept</option>
														<option value="Processing">Processing</option>
														<option value="Delivered">Delivered</option>
														<option value="Reject">Reject</option>
													</select>
													<input type="hidden" name="a_id" value="<?php echo $res['id']; ?>" class="form-control-sm">
												<button type="submit" name="update" class="btn btn-success" >Update</button> 
												</form>
												</td> 
											<td><?php echo $res['created_date']; ?></td> 
											<td><a href="view-member-details.php?id=<?= $res['id']; ?>"><i class="fa fa-eye"></i></a></td> 
											<td><a href="javascript:delete_con_ID('<?php echo $res['id'] ?>');" class="ask"><i class="fa fa-trash-o"></i></a></td>
											</tr>  
										<?php } ?>
										</tbody>
									</table>
								</div>
								<!-- /.box-body -->
							</div>
						</div>
					</div>
				</div>
			</section>
		</div>
		<?php include("includes/footer.php")?>
	</div>
	<?php include("includes/js.php")?>
</body>
<script type="text/javascript">
	function delete_con_ID(id)
{
	if (confirm('Do You Want to Deleting This \nContinue anyway?')) {
		window.location.href = 'delete_member.php?id=' + id;
	}
}
</script>
</html>