<?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 "../../img/logo/favicon.ico";

	

     

}else{

    echo "../../img/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">

	<script src="../assets/angular/angular.min.js"></script> 



</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">Product Master</h4>

						 

					</div>

					<div class="row">

						<div class="col-md-12">

							<div class="card">

								

								<div class="card-body">

								<center> <a href="Add_product.php" class="btn btn-success" >

                                    <i class="fas fa-plus"></i>   Add New Product

</a></center>

									<div class="table-responsive">

										<table id="basic-datatables" class="display table table-striped table-hover" >

											<thead>

												<tr>

													<th>S.No</th>

													<th> Image</th>

													<th>Product Name</th>

													

												

													<th> Active Status</th>

												 

													<th>Action</th>

												</tr>

											</thead>

											 

											<tbody>

											<?php 

											$sub=1;

											$sub_cate=mysqli_query($config,"select * from product_master order by Product_id desc");

											while($subcate=mysqli_fetch_object($sub_cate))

											{

											?>

												

												

												<tr>

													<td><?php echo $sub;?></td>

													<td><img src="../../photos/Product/<?php echo $subcate->Product_image;?>"  style="width: 100px;"></td>

													<td><?php echo $subcate->Product_Name;?></td>



				

	

													

													

													

													

													<td><?php 



													$enablestatus=$subcate->Product_Active_Status;

													

													if($enablestatus== 1)

													{ ?>

												<label class="btn btn-success">Active</label>

<?php														

													}else{

														?>

														<label class="btn btn-danger">In-Active</label>

														<?php

													}

													

													

													?></td>



													

													

													

													

													

													

													<td>

<a href="pro_edit.php?id=<?php echo $subcate->Product_id;?>" class="btn btn-primary" > <i class="fas fa-pencil-alt"></i>  </a>

<!-- <a href="product_image_master.php?id=<?php echo $subcate->Product_id;?>" class="btn btn-warning" > <i class="far fa-file-image"></i> </a> -->





<a href="Function/product_master_delete.php?delproid=<?php echo $subcate->Product_id;?>&delprocat=900" class="btn btn-danger" onclick="return confirm('Are you confirm to delete this Product?');"> <i class="fas fa-trash"></i>  </a>



 



</td>



<!-- Modal -->

<div class="modal fade" id="<?php echo $sub;?>" 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"> </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/Edit_pro_Master.php" method="post" enctype="multipart/form-data">

		  <div class="form-group">

		  <label for="email2">Product Master Image (size 247px X 300 px )</label>

		<img src="../../img/Product/<?php echo $subcate->Product_image;?>"  style="width: 100px;">

		<input type="file" class="form-control" id="email2" name="Add_product_master_image"    >



		  </div>

        <div class="form-group">

			<label for="email2">Product Name</label>

			<input type="hidden" class="form-control" id="email2" name="Edit_pro_id"  value="<?php echo $subcate->Product_id;?>">

			<input type="text" class="form-control" id="email2" name="Edit_pro_name"  value="<?php echo $subcate->Product_Name;?>">

				

			</div>     

			

			  <div class="form-group" style="display: none;">

			<label for="email2">Painting Sizes</label>

 			<input type="text" class="form-control" id="email2" name="Edit_pro_video"  value="<?php echo $subcate->product_video_link;?>">

				

			</div>   <div class="form-group" style="display: none;">

			<label for="email2">Header Name</label>

 			<input type="text" class="form-control" id="email2" name="Edit_pro_developer"  value="<?php echo $subcate->product_developer;?>">

				

			</div> 

			<div class="form-group">

			<label for="email2">short description</label>

 			<input type="text" class="form-control" id="email2" name="Edit_pro_publiser"  value="<?php echo $subcate->product_publisher;?>">

				

			</div> <div class="form-group" style="display: none;">

			<label for="email2">Product Release Date</label>

 			<input type="date" class="form-control" id="email2" name="Edit_pro_release"  value="<?php echo $subcate->Releasing_on;?>">

				

			</div>  

			

			

			<div class="form-group" style="display: none;">

			<label for="email2">Product Brand</label>

 		

			<input type="text" class="form-control" id="email2" name="Edit_pro_brand" value="	<?php  echo $bran_id=$subcate->product_brand;	?>"  >

	</div>



		 <div class="form-group" style="display: none;">

			<label for="email2">Product Dispaly Category</label>

 		

			

				<?php   $prodis_id = $subcate->product_display_cate;	?>

			<select class="form-control" name="Edit_pro_dispaly_cate" >

		

		<?php

		if ($prodis_id == "Console" )

		

		{

		

		?>

			<option value="Console" selected>Console</option>

		<option value="Accessories">Accessories</option>

		<option value="Games">Games</option>

		<option value="Digital">Digital</option>

		<?php }else if($prodis_id == "Accessories"){?>

		

			<option value="Console" >Console</option>

		<option value="Accessories" selected>Accessories</option>

		<option value="Games">Games</option>

		<option value="Digital">Digital</option>

		

				<?php }else if($prodis_id == "Games"){?>

		

			<option value="Console" >Console</option>

		<option value="Accessories" >Accessories</option>

		<option value="Games" selected>Games</option>

		<option value="Digital">Digital</option>

		

	<?php }else if($prodis_id == "Digital"){?>

		

			<option value="Console" >Console</option>

		<option value="Accessories" >Accessories</option>

		<option value="Games" >Games</option>

		<option value="Digital" selected>Digital</option>

			

			

			

		<?php }else{ ?>

			

			<option value="Console" >Console</option>

		<option value="Accessories" >Accessories</option>

		<option value="Games" >Games</option>

		<option value="Digital" >Digital</option>

		<?php } ?>

			</select>

			</div>

			 

			 <div class="form-group" style="display: none;">

			<label for="email2">Product Dispaly </label>

 		

			

				<?php  $prodisas_id = $subcate->product_display;	?>

			<select class="form-control" name="Edit_pro_dispaly_as" >

			

				<?php

		if ($prodisas_id == "New" )

		

		{

		

		?>

			<option value="New" selected>New</option>

		<option value="Feature">Feature</option>

		<option value="Preorder">Pre-order</option>

		<option value="CommingSoon">Comming Soon</option>

		<?php }else if($prodisas_id == "Feature"){?>

			<option value="New" >New</option>

		<option value="Feature"selected >Feature</option>

		<option value="Preorder" >Pre-order</option>

		<option value="CommingSoon">Comming Soon</option>

	

		

				<?php }

				else if($prodisas_id == "Preorder"){?>

	<option value="New" >New</option>

		<option value="Feature" >Feature</option>

		<option value="Preorder" selected>Pre-order</option>

		<option value="CommingSoon">Comming Soon</option>

	<?php }else if($prodisas_id == "CommingSoon"){?>

		

			<option value="New" >New</option>

		<option value="Feature" >Feature</option>

		<option value="Preorder" >Pre-order</option>

		<option value="CommingSoon" selected>Comming Soon</option>

			

			

			

		<?php }else{ ?>

			

			<option value="New" >New</option>

		<option value="Feature" >Feature</option>

		<option value="Preorder" >Pre-order</option>

		<option value="CommingSoon" >Comming Soon</option>

		<?php } ?>

			

		

			

			

			

			</select>

			</div> 

			 

			 

			 

			 

				<div class="form-group" style="display: none;">

			<label for="email2">Authenticity </label>

			

				<select class="form-control" id="exampleFormControlSelect1" name="Edit_pro_cate_offer">

												<?php 



													$enablestatus=$subcate->Product_offer;

													

													if($enablestatus == 1)

													{ ?>

												

													<option value="1" selected>Yes</option>

													<option value="0">No</option>

													<?php }else if($enablestatus == 0){?>



														<option value="1" >Yes</option>

													<option value="0" selected>No</option>

													<?php }else{ ?>

													<option value="1" >Yes</option>

													<option value="0" >No</option>

													

													

													<?php } ?>

												

												</select>

			

			

			

 			</div>

			   <div class="form-group" style="display: none;">

												<label for="exampleFormControlSelect1">Return policy</label>

												<select class="form-control" id="exampleFormControlSelect1" name="return">

												<?php 



													$cate_enablestatus=$subcate->refundpolicy;

													

													if($cate_enablestatus == 'Refund')

													{ ?>

												

													<option value="Refund" selected>Refund</option>

													<option value="Non Refund">Non Refund</option>

													<?php }else if($cate_enablestatus == 0){?>



														<option value="Refund" >Refund</option>

													<option value="Non Refund" selected>Non Refund</option>

													<?php }else{ ?>

													<option value="Refund" >Refund</option>

													<option value="Non Refund" >Non Refund</option>

													

													

													<?php } ?>

												

												</select>

											</div>			

											<div class="form-group" style="display: none;">

												<label for="exampleFormControlSelect1">Product Active Status</label>

												<select class="form-control" id="exampleFormControlSelect1" name="pro_status">

												<?php 



													$cate_enablestatus=$subcate->Product_Active_Status;

													

													if($cate_enablestatus == 1)

													{ ?>

												

													<option value="1" selected>Active</option>

													<option value="0">In-Active</option>

													<?php }else if($cate_enablestatus == 0){?>



														<option value="1" >Active</option>

													<option value="0" selected>In-Active</option>

													<?php }else{ ?>

													<option value="1" >Active</option>

													<option value="0" >In-Active</option>

													

													

													<?php } ?>

												

												</select>

											</div>			

		

		<div class="form-group">

			<label for="email2">Product Description  </label>

			

			<textarea name="pro_desc" style="width:450%;" > <?php echo $subcate->Product_description;?>     

</textarea>





			

			

							

			</div>

			

			<div class="form-group" style="display: none;">

                <label for="inputStatus">Product Listing </label>

              



			 <div class="form-check">

  <input class="form-check-input" <?php if($subcate->pro_list == 1){ echo 'checked';} ?>  name="p_list" type="checkbox" value="1" id="defaultCheck1">

  <label class="form-check-label" for="defaultCheck1">

  Our Products

  </label>

</div>

<div class="form-check">

  <input class="form-check-input" <?php if($subcate->pro_list2 == 2){ echo 'checked';} ?> name="p_list2" type="checkbox" value="2" id="defaultCheck1">

  <label class="form-check-label" for="defaultCheck1">

  Speial Products

  </label>

</div>



              </div>

 

		

		

		

		

		

		

		

		

		     <div class="form-group">

									<button class="btn btn-success" type="submit" name="product_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 $sub++;} ?>

												

											</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 New Product</h5>

        <button type="button" class="close" data-dismiss="modal" aria-label="Close">

          <span aria-hidden="true">&times;</span>

        </button>

      </div>

      <div class="modal-body" >

	  <div ng-app="myproduct" ng-controller="productcontroller" ng-init="loadid()">

        <form action="Function/Add_product.php " method="post" enctype="multipart/form-data">

         	

			 <div class="form-group">

                <label for="inputStatus"> Category </label>

                <select class="form-control" ng-model="ctid" name="product_cate" ng-change="loadsub()"  >

              <option>Select Product Category</option>

               <option ng-repeat="ca in cateid" value="{{ca.Main_Category_id}}">{{ca.Main_Category_Name}}</option>

                </select>

              </div> 

			  

			  

				 <div class="form-group">

                <label for="inputStatus"> Sub Category </label>

                <select class="form-control"  name="product_sub_cate"  >

                <option>Select Product Sub Category</option>

               <option ng-repeat="su in subna" value="{{su.Sub_Category_id}}">{{su.Sub_Category_Name}}</option>

                </select>

              </div> 

			

			

			

			

			  



<div class="form-group">

	<label for="email2">Product Name</label>

<input type="text" class="form-control" id="email2" name="Add_pro_name" placeholder="Enter Product Name"  >



			</div> 

			

 

			

			  



 

	<div class="form-group">

			<label for="email2">  Avalible Stocks</label>

			<input type="number" class="form-control" id="email2" name="Add_pro_stocks" placeholder="Product Avalible Stocks"  >

			</div>

			

	<div class="form-group">

			<label for="email2">Product tax</label>

			

			<select class="form-control" name="Add_pro_tax">

			<?php

			

			$pro_name_=mysqli_query($config,"select * from tax_master where Tax_status=1");

											while($add_pro=mysqli_fetch_object($pro_name_))

											{

			

			

			?>

			

			<option value="<?php echo $add_pro->Tax;?>"><?php echo $add_pro->Tax;?>%</option>

			

			

			

			

											<?php } ?>

			

			</select>	

			

			

			

			

			</div>

			

			

			

			

			

			

			

       

			<div class="form-group">

			<label for="email2">Product Description ( Avoid this symbol(') )</label>

		

<textarea class="form-control" rows="3" cols="30" name="Add_pro_desc"></textarea>





		</div>

       

	   

	   

	   	<div class="form-group">

			<label for="email2">Product Have Any Offer</label>

 			<select class="form-control" id="exampleFormControlSelect1" name="Add_pro_offer">

		<option value="1">Yes</option>

		<option value="0">No</option>

		

		</select>

			

			

			

			</div>

       

	   

		 <div class="form-group">

		<label for="exampleFormControlSelect1">Product Active Status</label>

		<select class="form-control" id="exampleFormControlSelect1" name="Add_pro_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="product_add">Add New</button>

 								</div>	</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>

		

		<script type="text/javascript" src="richtext.js"></script> 

  <script type="text/javascript">

 

        bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });

  </script>

		<!-- 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>

	<script>

var app = angular.module("myproduct",[]);  





 app.controller("productcontroller", function($scope, $http){  

$scope.loadid = function()

{

  $http.get("Function/Product_catergory.php")  

           .success(function(data){  

                $scope.cateid = data;  

           }); 

 

 }  



 $scope.loadsub = function(){  

           $http.post("Function/Product_sub_category.php", {'cate_id':$scope.ctid})  

           .success(function(data){  

                $scope.subna = data;  

           });   

		   

     









	 }  

	   

    





 });  </script>

</body>

</html>



<style>

		.form-check [type=checkbox]:checked, .form-check [type=checkbox]:not(:checked) {

    position: absolute;

    left: 13px;

}

</style>