<!DOCTYPE html>
<html>
<head>
	<?php include('include/head.php'); ?>
	<link rel="stylesheet" type="text/css" href="src/plugins/datatables/media/css/jquery.dataTables.css">
	<link rel="stylesheet" type="text/css" href="src/plugins/datatables/media/css/dataTables.bootstrap4.css">
	<link rel="stylesheet" type="text/css" href="src/plugins/datatables/media/css/responsive.dataTables.css">
</head>
<body>
	<?php include('include/header.php'); ?>
	<?php include('include/sidebar.php'); ?>
	<div class="main-container">
		<div class="pd-ltr-20 customscroll customscroll-10-p height-100-p xs-pd-20-10">
			<div class="min-height-200px">
				<div class="page-header">
					<div class="row">
						<div class="col-md-6 col-sm-12">
							<div class="title">
								<h4>View Student Registration</h4>
							</div>
							<nav aria-label="breadcrumb" role="navigation">
								<ol class="breadcrumb">
									<li class="breadcrumb-item"><a href="dashboard.php">Dashboard</a></li>
									<!-- <li class="breadcrumb-item"><a href="view_city.php">City</a></li> -->
									<li class="breadcrumb-item active" aria-current="page">Student Registration</li>
									<li class="breadcrumb-item active" aria-current="page">View Student Registration</li>
								</ol>
							</nav>
						</div>
						<div class="col-md-6 col-sm-12 text-right">
							<div class="dropdown">
								<a class="btn btn-primary" href="add_student_reg.php" role="button">
									Add Student Registration
								</a>
							</div>
						</div>
					</div>
				</div>
				<!-- Export Datatable start -->
				<div class="pd-20 bg-white border-radius-4 box-shadow mb-30">
					<div class="clearfix mb-20">
						<div class="pull-left">
							<!-- <h5 class="text-blue">Data Table with Export Buttons</h5> -->
						</div>
					</div>
					<div class="row">
						<table class="stripe hover data-table-export nowrap">
							<thead>
								<tr>
									<th class="table-plus datatable-nosort">Sr No</th>
									<th class="datatable-nosort">Action</th>
									<th>Registration No</th>
									<th>First Name</th>
									<th>Middle Name</th>
									<th>Last Name </th>
									<th>Date of Birth</th>
									<th>Email</th>
									<th>Mobile</th>
									<th>State</th>
									<th>City</th>
									<th>Taluka</th>
									<th>Aadhar Card Number</th>
									<th>Student Qualification</th>
									<th>Student Occupation</th>
									<th>Course</th>
									<th>Batch Time From</th>
									<th>Batch Time To</th>
									<th>Sassion Date</th>
									<th>Course Fees</th>
									<th>Discount</th>
									<th>Final Fees</th>
									<th>Media(reference)</th>
									<th>Registration Date</th>
									<th>Created Date</th>
								</tr>
							</thead>
							<tbody>
								<?php 
                                $count=0; 
                                 $query="select s.*,ct.*,t.*,c.*,cd.*,m.*,so.*,sq.*,sr.* from tbl_state s, tbl_city ct, tbl_taluka t, tbl_course c, tbl_course_details cd, tbl_media m, tbl_student_occupation so, tbl_student_qualification sq, tbl_student_reg sr where s.fld_state_id=ct.fld_state_id and s.fld_state_id=t.fld_state_id and ct.fld_state_id=t.fld_state_id and ct.fld_city_id=t.fld_city_id and c.fld_course_id=cd.fld_course_id and s.fld_state_id=sr.fld_state_id and t.fld_state_id=sr.fld_state_id and ct.fld_state_id=sr.fld_state_id and ct.fld_city_id=sr.fld_city_id and t.fld_city_id=sr.fld_city_id and t.fld_taluka_id=sr.fld_taluka_id and sq.fld_stud_id=sr.fld_stud_id and so.fld_occ_id=sr.fld_occ_id and c.fld_course_id=sr.fld_course_id and cd.fld_course_id=sr.fld_course_id and m.fld_media_id=sr.fld_media_id and cd.fld_batch_time_from=sr.fld_batch_time_from and cd.fld_batch_time_to=sr.fld_batch_time_to and cd.fld_session_date=sr.fld_session_date and cd.fld_fee_of_course=sr.fld_fee_of_course and
                                	 sr.fld_stud_reg_delete='0' order by sr.fld_stud_reg_id desc";

                                // $query="select * from tbl_student_reg where fld_stud_reg_delete='0' order by fld_stud_reg_id desc";
                                $row=mysqli_query($connect,$query) or die(mysqli_error($connect));
                                
                                while($fetch=mysqli_fetch_array($row)) {

                                extract($fetch);
                            
                            	?>  
                                <tr>
                                    <td><?php echo ++$count; ?></td>
									<td>
										<a href="view_invoice_history.php?fld_reg_no=<?php echo $fetch['fld_reg_no'] ?>&fld_status=<?php echo $fetch['fld_status'];?>" class="fa fa-list text-info" style="font-size: 20px; " title="Invoice History">
                                   	    </a>

										<a href="update_student_reg.php?fld_stud_reg_id=<?php echo $fetch['fld_stud_reg_id'] ?>"  class="fa fa-edit" style="font-size: 20px; color: green;">
										</a>
                                                    
                                        <a href="delete_student_reg.php?fld_stud_reg_id=<?php echo $fetch['fld_stud_reg_id'] ?>" onclick="return confirm('Are you sure to Delete Record')" class="fa fa-trash-o"  style="color: red;font-size: 20px;">
                                        </a>
									</td>
									<td><?php echo $fetch['fld_reg_no']; ?></td>
									<td><?php echo $fetch['fld_first_name']; ?></td>
									<td><?php echo $fetch['fld_middle_name']; ?></td>
									<td><?php echo $fetch['fld_last_name']; ?></td>
									<td><?php echo $fetch['fld_dob']; ?></td>
									<td><?php echo $fetch['fld_email']; ?></td>
									<td><?php echo $fetch['fld_mobile']; ?></td>
									<td><?php echo $fetch['fld_state_name']; ?></td>
									<td><?php echo $fetch['fld_city_name']; ?></td>
									<td><?php echo $fetch['fld_taluka_name']; ?></td>
									<td><?php echo $fetch['fld_aadhar_no']; ?></td>
									<td><?php echo $fetch['fld_stud_qualification']; ?></td>
									<td><?php echo $fetch['fld_occupation']; ?></td>
									<td><?php echo $fetch['fld_course_name']; ?></td>
									<td><?php echo $fetch['fld_batch_time_from']; ?></td>
									<td><?php echo $fetch['fld_batch_time_to']; ?></td>
									<td><?php echo $fetch['fld_session_date']; ?></td>
									<td><?php echo $fetch['fld_fee_of_course']; ?></td>
									<td><?php echo $fetch['fld_discount']; ?></td>
									<td><?php echo $fetch['fld_final_fees']; ?></td>
									<td><?php echo $fetch['fld_media_name']; ?></td>
									<td><?php echo $fetch['fld_reg_date']; ?></td>
                                    <td><?php echo $fetch['fld_created_date'];?></td>   
                                </tr>
                                            <?php } ?>
							</tbody>
						</table>
					</div>
				</div>
				
				
			</div>
			<?php include('include/footer.php'); ?>
		</div>
	</div>
	<?php include('include/script.php'); ?>
	<script src="src/plugins/datatables/media/js/jquery.dataTables.min.js"></script>
	<script src="src/plugins/datatables/media/js/dataTables.bootstrap4.js"></script>
	<script src="src/plugins/datatables/media/js/dataTables.responsive.js"></script>
	<script src="src/plugins/datatables/media/js/responsive.bootstrap4.js"></script>
	<!-- buttons for Export datatable -->
	<script src="src/plugins/datatables/media/js/button/dataTables.buttons.js"></script>
	<script src="src/plugins/datatables/media/js/button/buttons.bootstrap4.js"></script>
	<script src="src/plugins/datatables/media/js/button/buttons.print.js"></script>
	<script src="src/plugins/datatables/media/js/button/buttons.html5.js"></script>
	<script src="src/plugins/datatables/media/js/button/buttons.flash.js"></script>
	<script src="src/plugins/datatables/media/js/button/pdfmake.min.js"></script>
	<script src="src/plugins/datatables/media/js/button/vfs_fonts.js"></script>
	<script>
		$('document').ready(function(){
			$('.data-table').DataTable({
				scrollCollapse: true,
				autoWidth: false,
				responsive: true,
				columnDefs: [{
					targets: "datatable-nosort",
					orderable: false,
				}],
				"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
				"language": {
					"info": "_START_-_END_ of _TOTAL_ entries",
					searchPlaceholder: "Search"
				},
			});
			$('.data-table-export').DataTable({
				scrollCollapse: true,
				autoWidth: false,
				responsive: true,
				columnDefs: [{
					targets: "datatable-nosort",
					orderable: false,
				}],
				"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
				"language": {
					"info": "_START_-_END_ of _TOTAL_ entries",
					searchPlaceholder: "Search"
				},
				dom: 'Bfrtip',
				buttons: [
				'copy', 'csv', 'pdf', 'print'
				]
			});
			var table = $('.select-row').DataTable();
			$('.select-row tbody').on('click', 'tr', function () {
				if ($(this).hasClass('selected')) {
					$(this).removeClass('selected');
				}
				else {
					table.$('tr.selected').removeClass('selected');
					$(this).addClass('selected');
				}
			});
			var multipletable = $('.multiple-select-row').DataTable();
			$('.multiple-select-row tbody').on('click', 'tr', function () {
				$(this).toggleClass('selected');
			});
		});
	</script>
</body>
</html>