<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
	<title>Add Event Image | Admin Panel</title>

	<!-- Favicons -->
<link rel="shortcut icon" type="image/x-icon" href="../UserProfile/images/logo/logo.png">

	<!-- Bootstrap CSS -->
	<link rel="stylesheet" href="assets/plugins/bootstrap/css/bootstrap.min.css">

	<!-- Fontawesome CSS -->
	<link rel="stylesheet" href="assets/plugins/fontawesome/css/fontawesome.min.css">
	<link rel="stylesheet" href="assets/plugins/fontawesome/css/all.min.css">
	 
	<!-- Animate CSS -->
	<link rel="stylesheet" href="assets/css/animate.min.css">

	<!-- Main CSS -->
	<link rel="stylesheet" href="assets/css/admin.css">
		<!-- Datatables CSS -->
	<link rel="stylesheet" href="assets/plugins/datatables/datatables.min.css">

</head>

<body>
<div class="main-wrapper">
	
		<!-- Header -->
	<?php include 'include/header.php'; ?>
		<!-- /Header -->
		
		<!-- Sidebar -->
		<?php include 'include/leftmenu.php'; ?>
		<!-- /Sidebar -->
	<div class="page-wrapper">
                <div class="content container-fluid">
				
					<div class="row">
						<div class="col-lg-12">
							<div class="card">
								<div class="card-header">
									<h4 class="card-title">Add Event Image</h4>
								</div>
								<div class="card-body">
									<form action="Apk/AddEventImage" method="post" enctype="multipart/form-data" id="frm">
								
								       
										<div class="form-group row">
											<label class="col-form-label col-md-4">Select Event</label>
											<div class="col-md-8">
											<select name="event_name" id="event_name" class="form-control" required>
											    <?php $resE=mysqli_query($connection,"Select * from tbl_event_master");
											    while($rowE=mysqli_fetch_array($resE))
											    {
											    ?>
											    <option value="<?php echo $rowE['event_idn']; ?>"><?php echo $rowE['event_name']; ?></option>
											    <?php } ?>
											</select>
											</div>
										</div>
									
								    	<div class="form-group row">
											<label class="col-form-label col-md-4">Event Image</label>
											<div class="col-md-8">
											<input type="file" name="upload[]" id="upload" accept="image/*" class="form-control btn btn-info" multiple required>
											</div>
										</div>
							
							
								<input type="submit" name="submit" value="Submit" class="btn btn-primary" style="margin:10px 0 0 146px">
									</form>
								</div>
							
							</div>
						</div>
				    	</div>
				
				    <div class="row">
						<div class="col-sm-12">
							<div class="card">
								<div class="card-header">
									<h4 class="card-title">Event Media</h4>
								
								</div>
								<div class="card-body">

									<div class="table-responsive">
										<table class="datatable table table-stripped">
											<thead>
												<tr>
													<th>#</th>
													<th>Event Name</th>
													<th>Total File</th>

												</tr>
											</thead>
											<tbody>
											    <?php
											    $cnt=1;
											     $chk="SELECT event_name,count(record_no) as imagecnt FROM `tbl_event_galary` GROUP by event_name; ";
                                        $reschk=mysqli_query($connection,$chk);
                                        while($row=mysqli_fetch_array($reschk))
                                        {
											    ?>
												<tr>
													<td><?php echo $cnt++ ?></td>
												
													<td><?php echo $row['event_name'] ?></td>
													<td><?php echo $row['imagecnt'] ?></td>
									
												</tr>
											<?php } ?>
											</tbody>
										</table>
									</div>
								</div>
							</div>
						</div>
					</div>
				
				</div>			
	</div>
</div>

	<!-- jQuery -->
	<script src="assets/js/jquery-3.5.0.min.js"></script>

	<!-- Bootstrap Core JS -->
	<script src="assets/js/popper.min.js"></script>
	<script src="assets/plugins/bootstrap/js/bootstrap.min.js"></script>

	<!-- Slimscroll JS -->
	<script src="assets/plugins/slimscroll/jquery.slimscroll.min.js"></script>
		<script src="assets/plugins/datatables/jquery.dataTables.min.js"></script>
	<script src="assets/plugins/datatables/datatables.min.js"></script> 

	<!-- Custom JS -->
	<script src="assets/js/admin.js"></script>

</body>

</html>