<?php include('../config/setup.php');?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<title><?php 
            
            $leename=mysqli_query($config,"select Name,Name_status from lee_master");
            while($lee=mysqli_fetch_array($leename))
            {
                 $namestatus=$lee[1];
if($namestatus == 1)
{
    echo  $lee[0];
}else{
    echo "Need Name";

}

            }
            
            ?> </title>
	<meta content='width=device-width, initial-scale=1.0, shrink-to-fit=no' name='viewport' />
	<link rel="icon" href="<?php 
            
            $inro_logo=mysqli_query($config,"select Logo_Path,logo_status from lee_master");
            while($logo=mysqli_fetch_array($inro_logo))
            {
                 $logstatus=$logo[1];
if($logstatus == 1)
{
	
	 $ms=substr($logo[0],3);
	 echo "../../photos/logo/favicon.ico";
	
     
}else{
    echo "../../photos/logo/no_logo.png";

}

            }
            
            ?>" type="image/x-icon"/>
	
	<!-- Fonts and icons -->
	<script src="../assets/js/plugin/webfont/webfont.min.js"></script>
	<script>
		WebFont.load({
			google: {"families":["Lato:300,400,700,900"]},
			custom: {"families":["Flaticon", "Font Awesome 5 Solid", "Font Awesome 5 Regular", "Font Awesome 5 Brands", "simple-line-icons"], urls: ['../assets/css/fonts.min.css']},
			active: function() {
				sessionStorage.fonts = true;
			}
		});
	</script>

	<!-- CSS Files -->
	<link rel="stylesheet" href="../assets/css/bootstrap.min.css">
	<link rel="stylesheet" href="../assets/css/atlantis.min.css">
	<!-- CSS Just for demo purpose, don't include it in your project -->
	<link rel="stylesheet" href="../assets/css/demo.css">
</head>
<body>
	<div class="wrapper">
		<div class="main-header">
			<!-- Logo Header -->
		 <?php include('logo.php');?>
			<!-- End Logo Header -->

			<!-- Navbar Header -->
			<?php include('topbar.php');?>
			 <!-- End Navbar -->
		</div>
		<!-- Sidebar -->
		<?php include('sidebar.php');?>
		
		
		<div class="main-panel">
			<div class="content">
				<div class="page-inner">
					<div class="page-header">
						<h4 class="page-title">Classroom </h4>
						 
					</div>
					<div class="row">
						<div class="col-md-12">
							<div class="card">
								
								<div class="card-body">
							 
									<div class="table-responsive">
										<table id="basic-datatables" class="display table table-striped table-hover" >
											<thead>
												<tr>
													<th>S.No</th>
													<th>Date </th>
													<th> First Name</th>
                                                    <th> Last Name</th>
                                                    <th> Phone </th>
                                                    <th> Email </th>
                                                    <th> Age</th>
                                                    <th> City</th>
                                                    <th> Address</th>
                                                    <th> occupation</th>
                                                    <th> Type</th>
                                                    <th> Pic name</th>
                                                    <th> Pic Size</th>
                                                    <th>  Customised Pic</th>
                                                    <th>  Customised Size</th>
                                                    <th> Ref Picture</th>
													<th>Action</th>
												</tr>
											</thead>
											 
											<tbody>
											<?php 
											$mc=1;
											$main_cate=mysqli_query($config,"select * from online_class order by created_at DESC");
											while($macate=mysqli_fetch_object($main_cate))
											{
											?>
												
												
												<tr>
													<td><?php echo $mc;?></td>
                                                    <td><?php $edon= $macate->created_at;
													
													$main_cate_date = strtotime($edon);
			  echo  date('d-m-Y',$main_cate_date);
													
													?>
													</td>
													<td><?php echo $macate->s_name;?></td>
													<td><?php echo $macate->s_last_name;?></td>
                                                    <td><?php echo $macate->s_phone;?></td>
                                                    <td><?php echo $macate->s_email;?></td>
                                                    <td><?php  $macate->s_age;
													   $dob=$macate->s_age;
													   $diff = (date('Y') - date('Y',strtotime($dob)));
													   echo $diff;?> Years</td>
                                                    <td><?php echo $macate->s_city;?></td>
                                                    <td><?php echo $macate->s_address;?></td>
                                                    <td><?php echo $macate->s_occ;?></td>
                                                    <td>
                                                    <?php if($macate->s_type == 2){
                                                        echo '<span style="color:red">Customised</span>';
                                                     }else{ echo '<span style="color:green">Choice Name</span>';
                                                        }?></td>
                                                    <td><?php echo $macate->s_pic_name;?></td>
                                                    <td><?php echo $macate->s_size;?></td>
                                                    <td><?php echo $macate->s_tpic_name;?></td>
                                                    <td><?php echo $macate->s_tsize;?></td>

                                                    <td>
                                                       <?php if($macate->s_type == 2){ ?>
                                                         <img style="width: 100px;" src="../../photos/ref_pic/<?php echo $macate->s_tref_pic;?>">
                                                        <?php }?>
                                                        </td>
													
													<td>
<a href="" class="btn btn-primary" data-toggle="modal" data-target="#<?php echo $mc;?>"> <i class="fas fa-pencil-alt"></i>  </a>
<a href="Function/customer_delete_1.php?delcuteid=<?php echo $macate->online_class_id;?>&delcat=100" class="btn btn-danger" onclick="return confirm('Are you confirm to delete this Customer?');"> <i class="fas fa-trash"></i>  </a>

 

</td>

<!-- Modal -->
<div class="modal fade" id="<?php echo $mc;?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">View</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
	  <form action="Function/customer_edit.php" method="post">
        <div class="form-group">
			<label for="email2"> Name</label>
		
			<input type="text" class="form-control"  readonly  value="<?php echo $macate->s_name;?>">
			</div>
            <div class="form-group">
			<label for="email2">Last Name</label>
		
			<input type="text" class="form-control"  readonly  value="<?php echo $macate->s_last_name;?>">
			</div>
            <div class="form-group">
			<label for="email2">Phone</label>
		
			<input type="text" class="form-control"  readonly  value="<?php echo $macate->s_phone;?>">
			</div>
            <div class="form-group">
			<label for="email2">Email</label>
		
			<input type="text" class="form-control"  readonly  value="<?php echo $macate->s_email;?>">
			</div>
            <div class="form-group">
			<label for="email2">Age</label>
		
			<input type="date" class="form-control"  readonly  value="<?php echo $macate->s_age;?>">
			</div>
            <div class="form-group">
			<label for="email2">City</label>
		
			<input type="text" class="form-control"  readonly  value="<?php echo $macate->s_city;?>">
			</div>
            <div class="form-group">
			<label for="email2">Address</label>
		
			<textarea  class="form-control"  readonly  ><?php echo $macate->s_city;?></textarea>
			</div>	
            <div class="form-group">
			<label for="email2">Occupation</label>
		
			<input type="text" class="form-control"  readonly  value="<?php echo $macate->s_occ;?>">
			</div>
            <div class="form-group">
			<label for="email2">Type</label><br>
            <?php if($macate->s_type == 2){
                                                        echo '<span style="color:red">Customised</span>';
                                                     }else{ echo '<span style="color:green">Choice Name</span>';
                                                        }?>
			
			</div>
            <div class="form-group">
            <label for="email2">Picture Name</label>
		
			<input type="text" class="form-control"  readonly  value="<?php echo $macate->s_pic_name;?>">
			</div>
			<div class="form-group">
            <label for="email2">Picture Size</label>
		
			<input type="text" class="form-control"  readonly  value="<?php echo $macate->s_size;?>">
			</div>
			<div class="form-group">
            <label for="email2">  Customised Pic</label>
		
			<input type="text" class="form-control"  readonly  value="<?php echo $macate->s_tpic_name;?>">
			</div>
			<div class="form-group">
            <label for="email2">  Customised Size</label>
		
			<input type="text" class="form-control"  readonly  value="<?php echo $macate->s_tsize;?>">
			</div>
			<div class="form-group">
            <label for="email2"> Reference Pic</label>
		
			<?php if($macate->s_type == 2){ ?>
                                                         <img style="width: 100px;" src="../../photos/ref_pic/<?php echo $macate->s_tref_pic;?>">
                                                     <a href="../../photos/ref_pic/<?php echo $macate->s_tref_pic;?>" download>Download </a>
														 <?php }?>
			</div>
		
		     <div class="form-group">
									<button class="btn btn-success" type="submit" name="customer_edit">Submit</button>
 								</div>
			
			
			</form>
			
			
      </div>
 
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
         
      </div>
    </div>
  </div>
</div>
													
													 
												</tr>
												
											<?php $mc++;} ?>
												
											</tbody>
										</table>
									</div>
								</div>
							</div>
						</div>
	</div>
				</div>
			</div>
			
			<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Add Main Category</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <form action="Function/Add_Main_Category.php" method="post" enctype="multipart/form-data">
        <div class="form-group">
			<label for="email2">Main CategoryName</label>
			<input type="text" class="form-control" id="email2" name="Add_main_cate_name" placeholder="Main CategoryName"  >
			</div>  
			<div class="form-group">
			<label for="email2">Main Category Image</label>
			<input type="file" class="form-control" id="email2" name="Add_main_cate_image" placeholder="Main CategoryName"  >
			</div>
       
		 <div class="form-group">
		<label for="exampleFormControlSelect1">Category Active Status</label>
		<select class="form-control" id="exampleFormControlSelect1" name="Add_main_category_status">
		<option value="1">Active</option>
		<option value="0">In-Active</option>
		
		</select>
											</div>			
		
		     <div class="form-group">
									<button class="btn btn-success" type="submit" name="category_add">Add New</button>
 								</div>
			
			
			</form>
	
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        
      </div>
    </div>
  </div>
</div>
			
			
			
			
			
			
			
			
			
			
			
			
		 <?php include('footer.php');?>
		</div>
		
		 
		<!-- End Custom template -->
	</div>
	<!--   Core JS Files   -->
	<script src="../assets/js/core/jquery.3.2.1.min.js"></script>
	<script src="../assets/js/core/popper.min.js"></script>
	<script src="../assets/js/core/bootstrap.min.js"></script>
	<!-- jQuery UI -->
	<script src="../assets/js/plugin/jquery-ui-1.12.1.custom/jquery-ui.min.js"></script>
	<script src="../assets/js/plugin/jquery-ui-touch-punch/jquery.ui.touch-punch.min.js"></script>
	
	<!-- jQuery Scrollbar -->
	<script src="../assets/js/plugin/jquery-scrollbar/jquery.scrollbar.min.js"></script>
	<!-- Datatables -->
	<script src="../assets/js/plugin/datatables/datatables.min.js"></script>
	<!-- Atlantis JS -->
	<script src="../assets/js/atlantis.min.js"></script>
	<!-- Atlantis DEMO methods, don't include it in your project! -->
	<script src="../assets/js/setting-demo2.js"></script>
	<script >
		$(document).ready(function() {
			$('#basic-datatables').DataTable({
			});

		 
 
			 
		});
	</script>
</body>
</html>