<div class="clearfix"></div>
  <div class="content-wrapper">
    <div class="container-fluid">

      <div class="row mt-4">

        <div class="col-12 col-lg-6 col-xl-3">

          <div class="card gradient-purpink">

            <div class="card-body">

              <div class="media">

              <a href="<?php echo base_url().'admin/products_list';?>" class="media-body text-left">

                <h4 class="text-white"><?php echo $this->db->get("products")->num_rows();?></h4>

                <span class="text-white">Products Listed</span>

              </a>

			  <div class="align-self-center"><i class="fa fa-cubes fa-3x"></i></div>

            </div>

            </div>

          </div>

        </div>

		<div class="col-12 col-lg-6 col-xl-3">

          <div class="card gradient-scooter">

            <div class="card-body">

              <div class="media">

              <a href="<?php echo base_url().'secureadmin/ContactEnquiries';?>" class="media-body text-left">

                <h4 class="text-white"><?php echo $this->db->get("contact")->num_rows();?></h4>

                <span class="text-white">Enquiries</span>

              </a>

			  <div class="align-self-center"><i class="fa fa-users fa-3x"></i></div>

            </div>

            </div>

          </div>

        </div>

        <div class="col-12 col-lg-6 col-xl-3">

          <div class="card gradient-ibiza">

            <div class="card-body">

              <div class="media">

			  <a href="<?php echo base_url().'secureadmin/orders/Confirmed';?>" class="media-body text-left">

                <h4 class="text-white"><?php echo $this->db->get_where("orders",array("ostatus"=>"Confirmed"))->num_rows();?></h4>

                <span class="text-white">New Orders</span>

              </a>

               <div class="align-self-center"><i class="fa fa-shopping-cart fa-3x"></i></div>

            </div>

            </div>

          </div>

        </div>
        
        <div class="col-12 col-lg-6 col-xl-3">

          <div class="card gradient-purpink">

            <div class="card-body">

              <div class="media">

             

			  <a href="<?php echo base_url().'secureadmin/orders/Completed';?>" class="media-body text-left">

                <h4 class="text-white"><?php echo $this->db->get_where("orders",array("ostatus"=>"Completed"))->num_rows();?></h4>

                <span class="text-white">Completed Orders</span>

              </a>

			  <div class="align-self-center"><i class="fa fa-users fa-3x"></i></div>

            </div>

            </div>

          </div>

        </div>

      </div><!--End Row-->
	  
      
      
	  <div class="row">

			<div class="col-lg-4">

			   <?php //if($this->session->flashdata("msg")){echo $this->session->flashdata("msg"); }?>

               <div class="card">

               		<div class="card-header">Add/Edit Home Page Banners</div>

                    <div class="card-body">

                    	<?php if($_GET['banner_id']){

								 $edit=$this->db->get_where("banner",array("banner_id"=>$_GET['banner_id']))->row();?>

								 <form action="<?php echo base_url();?>admin/update_banner" method="post" enctype="multipart/form-data">

                                    <input type="hidden" name="bid" value="<?php echo $edit->banner_id;?>" />

                                            	



                            



                                                <div class="form-group">



                                                    <label class="control-label">Banner</label>



                                                    <input type="file"  name="img" class="form-control">



                                                    <input type="hidden" name="oldimg" value="<?php echo $edit->banner_img;?>" />



                                                     <img width="100%" src="<?php echo base_url();?>assets/images/category/<?php echo $edit->banner_img;?>" class="img img-responsive">



                                                </div>
                                                
                                                <div class="form-group">
                                                	<label>Banner Heading</label>
                                                    <input type="text" name="banner_title" value="<?php echo $edit->banner_title;?>" class="form-control" />
                                                </div>
                                                <div class="form-group">
                                                	<label>Banner Text</label>
                                                    <input type="text" name="banner_desc" value="<?php echo $edit->banner_desc;?>" class="form-control" />
                                                </div>
                                                <div class="form-group">
                                                	<label>Banner Link</label>
                                                    <input type="url" name="banner_link" value="<?php echo $edit->banner_link;?>"  class="form-control" />
                                                </div><br/>



                                                <button type="submit" class="btn btn-primary btn-block">Update</button>



                                            </form>

                                 <?php }else{?>

                                 <form action="<?php echo base_url();?>admin/add_banner" method="post" enctype="multipart/form-data">


                                                <div class="form-group">



                                                    <label class="control-label">Banner</label>



                                                    <input type="file"  name="img" class="form-control">

                                                </div>
                                                <div class="form-group">
                                                	<label>Banner Heading</label>
                                                    <input type="text" name="banner_title" class="form-control" />
                                                </div>
                                                <div class="form-group">
                                                	<label>Banner Text</label>
                                                    <input type="text" name="banner_desc" class="form-control" />
                                                </div>
                                                <div class="form-group">
                                                	<label>Banner Link</label>
                                                    <input type="url" name="banner_link" class="form-control" />
                                                </div><br/>



                                                <button type="submit" class="btn btn-primary btn-block">Submit</button>



                                            </form>

                        <?php }?>
<table class="table table-condensed table-bordered">



                                    	<thead><tr><th>Banner</th><th>Title/Text</th><th>Action</th></tr></thead>



                                        <tbody>



                                        <?php $this->db->select("*");



									$this->db->from("banner");



							//$this->db->join("mcategory","mcategory.mid=banner.banner_cat","left");



									$ban=$this->db->get()->result();



									foreach($ban as $b){?>



                                    <tr><td width="150px">

                                    <img width="100%" src="<?php echo base_url();?>assets/images/category/<?php echo $b->banner_img;?>" class="img img-responsive"></td>



                                    

<td><h6 class="text-danger"><?php echo $b->banner_title;?></h6><p><?php echo $b->banner_desc;?></p></td>

                                    <td>


							 <a  href="<?php echo base_url().'admin?banner_id='.$b->banner_id;?>" class="btn btn-sm btn-warning"><i class="fa fa-edit"></i></a>
							 <a href="<?php echo $b->banner_link;?>" target="_blank" class="btn btn-sm btn-success"><i class="fa fa-share"></i></a>
                             <a href="#" id="<?php echo $b->banner_id;?>" class="btn btn-sm btn-danger banner_delete"><i class="fa fa-trash-o"></i></a></td></tr><?php }?>



                                        </tbody>



                                    </table>
                        

                    </div>

               </div>

            </div>

            <div class="col-lg-8">
               <div class="card">
               		<div class="card-header">Backps</div>
                    <div class="card-body">
                        <a href="<?php echo base_url().'admin/db_backup';?>" class="btn btn-primary"><i class="fa fa-download"></i> Database Backup</a><hr/>
                        
                        <a href="<?php echo base_url().'admin/site_backup';?>" class="btn btn-info"><i class="fa fa-download"></i> Site Backup</a>
                    </div>
               </div>
           </div>

            

    </div>

    <!-- End container-fluid-->

    

    </div><!--End content-wrapper-->

   <!--Start Back To Top Button-->

    <a href="#" class="back-to-top"><i class="fa fa-angle-double-up"></i> </a>

    <!--End Back To Top Button-->

	

	<!--Start footer-->

	<footer class="footer">

      <div class="container">

        <div class="text-center">

          Copyright © 2024

        </div>

      </div>

    </footer>

	<!--End footer-->

   

  </div><!--End wrapper-->



  <!-- Bootstrap core JavaScript-->

  <script>



		$(document).ready(function(){

		$(".test_delete").click(function(e){e.preventDefault();

				if(!confirm("Sure you want to delete?")){

					  return false;

				}

				var id=$(this).attr("id");$(this).closest("tr").remove();

				$.ajax({

					 type: "POST",

					 url: '<?php echo base_url();?>admin/ajax_app_delete',

					 data: {id:id},

					 success: function(response){

						 //alert(response);

					 }

				});

			});


			$(".banner_delete").click(function(e){e.preventDefault();



				if (!confirm("Sure you want to delete?")){



				  return false;



				}



				var id=$(this).attr("id");



				$(this).closest("tr").remove();



				$.ajax({



					 type: "POST",



					 url: '<?php echo base_url();?>admin/delete_banner',



					 data: {id:id},



					 success: function(response){



						 //alert(response);



					 }



				});



			});

			

			$(".dt_delete").click(function(e){e.preventDefault();



				if (!confirm("Sure you want to delete?")){



				  return false;



				}



				var id=$(this).attr("id");



				$(this).closest("tr").remove();



				$.ajax({



					 type: "POST",



					 url: '<?php echo base_url();?>admin/dt_delete',



					 data: {id:id},



					 success: function(response){



						 //alert(response);



					 }



				});



			});



		});



		</script>

  <!-- sidebar-menu js -->

  <script src="<?php echo base_url();?>adminassets/js/sidebar-menu.js"></script>

  <!-- Custom scripts -->

  <script src="<?php echo base_url();?>adminassets/js/app-script.js"></script>

  

  <!-- Vector map JavaScript -->

  <!-- Index js -->

  <script src="<?php echo base_url();?>adminassets/js/index.js"></script>

  

</body>

</html>

