<?php session_start();?>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Remmitances | <?php include('../dist/includes/title.php');?></title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="../plugins/datatables/dataTables.bootstrap.css">
    <link rel="stylesheet" href="../dist/css/AdminLTE.min.css">
    <link rel="stylesheet" href="../plugins/select2/select2.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="../dist/css/skins/_all-skins.min.css">
    <style>
      
    </style>
 </head>
  <!-- ADD THE CLASS layout-top-nav TO REMOVE THE SIDEBAR. -->
  <body class="hold-transition skin-<?php echo $_SESSION['skin'];?> layout-top-nav">
    <div class="wrapper">
      <?php include('../dist/includes/header.php');
      include('../dist/includes/dbcon.php');
      ?>
      <!-- Full Width Column -->
      <div class="content-wrapper">
        <div class="container">
          <!-- Content Header (Page header) -->
          <section class="content-header">
            <h1>
              <a class="btn btn-lg btn-warning" href="home.php">Back</a>
              
            </h1>
            <ol class="breadcrumb">
              <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
              <li class="active">Remmitances</li>
            </ol>
          </section>

          <!-- Main content -->
          <section class="content">
            <div class="row">
            
			
            <div class="col-xs-9">
              <div class="box box-primary">
    
                <div class="box-header">
                  <h3 class="box-title">Remmitances List</h3>
                </div><!-- /.box-header -->
                <div class="box-body">
                  <table id="example1" class="table table-bordered table-striped">
                    <thead>
                      <tr>
                        <th>Remmitances Name</th>
						 <th>Amount</th>
                        <th>Breakdown/Cashier</th>
						<th>Date</th>
                     	<th>Action</th>
                      </tr>
                    </thead>
                    <tbody>
<?php
		date_default_timezone_set("Asia/Manila"); 
	$date = date("Y-m-d");
		$query=mysqli_query($con,"select * from remit where date='$date'")or die(mysqli_error());
		while($row=mysqli_fetch_array($query)){
		$myuser=$_SESSION['id'];
		$query33=mysqli_query($con,"select * from user where user_id='$myuser'")or die(mysqli_error());
		$row33=mysqli_fetch_array($query33);
		
		
		
		
		
?>
                      <tr>
                        <td><?php echo $row['name']?? null;?></td>
                        <td style="font-weight:bold;"><?php echo $row['amount']?? null;?></td>
                        <td> <a href="#updateordinance<?php echo $row['id'];?>" data-target="#updateordinance<?php echo $row['id'];?>" data-toggle="modal" style="color:#fff;" class="small-box-footer"><i class="glyphicon glyphicon-eye-open text-blue"></i></a>
			&nbsp &nbsp <?php echo $row33['name']; ?>
			</td>
			
			    <td><?php echo $row['date']?? null;?></td>
                            <td> <a href="#updateordinance1<?php echo $row['id'];?>" data-target="#updateordinance1<?php echo $row['id'];?>" data-toggle="modal" style="color:black;" class="small-box-footer"><i class="glyphicon glyphicon-trash text-green"></i>DELETE</a>
			 
			</td>
                      </tr>
					  
					  
					  
				<div id="updateordinance<?php echo $row['id'];?>" class="modal fade in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
	<div class="modal-dialog" style="width:200px;height:auto">
	  <div class="modal-content" style="height:auto">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">×</span></button>
                <h4 class="modal-title">View Remmitances </h4>
              </div>
              <div class="modal-body">
			
                
				<div class="form-group">
					

                 <div style="display: flex;">
					    <h6>Money</h6> &nbsp &nbsp
                        <h6>QTY</h6> &nbsp &nbsp
                        <h6>Total</h6>
                      </div>
                 
                   <?php 
					$myid=$row['id'];
		$query3=mysqli_query($con,"select * from remit where id='$myid'")or die(mysqli_error($con));
        $row3=mysqli_fetch_array($query3);
		?>
		
		 <div style="display: flex;">
					    <h5>1000</h5> &nbsp &nbsp
                        <h5>X &nbsp <?php echo $row3['aa'];?></h5> &nbsp &nbsp
                        <h5>₱ <?php echo $love1=$row3['aa'] * 1000;?></h5>
                      </div>
					  
					   <div style="display: flex;">
					    <h5>500</h5> &nbsp &nbsp
                        <h5>X &nbsp <?php echo $row3['bb'];?></h5> &nbsp &nbsp
                        <h5>₱ <?php echo $love1=$row3['bb'] * 500;?></h5>
                      </div>
					 
			<div style="display: flex;">
					    <h5>200</h5> &nbsp &nbsp
                        <h5>X &nbsp <?php echo $row3['cc'];?></h5> &nbsp &nbsp
                        <h5>₱ <?php echo $love1=$row3['cc'] * 200;?></h65>
                      </div>
					  
					  <div style="display: flex;">
					    <h5>100</h5> &nbsp &nbsp
                        <h5>X &nbsp <?php echo $row3['dd'];?></h5> &nbsp &nbsp
                        <h5>₱ <?php echo $love1=$row3['dd'] * 100;?></h65>
                      </div>
					  
					   <div style="display: flex;">
					    <h5>50</h5> &nbsp &nbsp
                        <h5>X &nbsp <?php echo $row3['ee'];?></h5> &nbsp &nbsp
                        <h5>₱ <?php echo $love1=$row3['ee'] * 50;?></h65>
                      </div>
					  
					   <div style="display: flex;">
					    <h5>20</h5> &nbsp &nbsp
                        <h5>X &nbsp <?php echo $row3['ff'];?></h5> &nbsp &nbsp
                        <h5>₱ <?php echo $love1=$row3['ff'] * 20;?></h65>
                      </div>
			
			
			 <div style="display: flex;">
					    <h5>10</h5> &nbsp &nbsp
                        <h5>X &nbsp <?php echo $row3['gg'];?></h5> &nbsp &nbsp
                        <h5>₱ <?php echo $love1=$row3['gg'] * 10;?></h65>
                      </div>
					  
					  
					   <div style="display: flex;">
					    <h5>5</h5> &nbsp &nbsp
                        <h5>X &nbsp <?php echo $row3['hh'];?></h5> &nbsp &nbsp
                        <h5>₱ <?php echo $love1=$row3['hh'] * 5;?></h65>
                      </div>
					  
					  <div style="display: flex;">
					    <h5>1</h5> &nbsp &nbsp
                        <h5>X &nbsp <?php echo $row3['ii'];?></h5> &nbsp &nbsp
                        <h5>₱ <?php echo $love1=$row3['ii'] * 1;?></h65>
                      </div>
	
	
	<div style="display: flex;">
					    <h5>Total</h5> &nbsp &nbsp
                        <h5></h5> &nbsp &nbsp
                        <h5>₱ <?php echo $love1=$row3['amount'];?></h65>
                      </div>
	
					</div>
		
       
              </div><hr>
              <div class="modal-footer">
	
              </div>
		
            </div>
			
        </div><!--end of modal-dialog-->
 </div>
 <!--end of modal-->  



<div id="updateordinance1<?php echo $row['id'];?>" class="modal fade in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
	<div class="modal-dialog" style="width:200px;height:auto">
	  <div class="modal-content" style="height:auto">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">×</span></button>
                <h4 class="modal-title">Delete </h4>
              </div>
              <div class="modal-body">
			  <form action="deleteremit.php" method="POST">
	<label>Enter Passcode</label>
				<div class="form-group">
					<input name="adminpasscode" type="password" />
<input name="remitid" type="hidden" value="<?php echo $row['id'];?>"/>
 <button class="btn btn-primary" id="daterange-btn" name="">
							Submit
						  </button>
              </div><hr>
			  </form>
              <div class="modal-footer">
	
              </div>
		
            </div>
			
        </div><!--end of modal-dialog-->
 </div>
 <!--end of modal-->  



                 
<?php } ?>					  
                    </tbody>
                    <tfoot>
                      <tr>
                       <th>Remmitances Name</th>
						 <th>Amount</th>
                        <th>Breakdown</th>
						<th>Date</th>
                     <th>Action</th>
                      </tr>					  
                    </tfoot>
                  </table>
                </div><!-- /.box-body -->
 
            </div><!-- /.col -->
			
			
          </div><!-- /.row -->
	  <div class="col-md-3">
              <div class="box box-primary">
                <div class="box-header">
                  <h3 class="box-title">Add New Remmitances</h3>
                </div>
                <div class="box-body">
                  <!-- Date range -->
                  <form method="post" action="add_remit.php" enctype="multipart/form-data">
  
					  <div class="form-group">
						<label for="date">Remmitance Name</label>
						<div class="input-group col-md-12">
						  <textarea type="text" class="form-control pull-right" id="date" name="name" placeholder="Enter Remmitances name" required> </textarea>
						</div><!-- /.input group -->
					  </div><!-- /.form group -->
		         <div class="form-group" style="margin-top:-10px;">
                    <label for="date">1000 X ??</label>
                    <div class="input-group col-md-12">
                      <input class="form-control pull-right" id="date" name="aa" value="0" placeholder="Enter pcs of 1000" ></input>
                    </div><!-- /.input group -->
                  </div><!-- /.form group -->
              
				 <div class="form-group" style="margin-top:-10px;">
                    <label for="date">500 X ??</label>
                    <div class="input-group col-md-12">
                      <input class="form-control pull-right" id="date" name="bb" value="0" placeholder="Enter pcs of 500" ></input>
                    </div><!-- /.input group -->
                  </div><!-- /.form group -->
				  
				   <div class="form-group" style="margin-top:-10px;">
                    <label for="date">200 X ??</label>
                    <div class="input-group col-md-12">
                      <input class="form-control pull-right" id="date" name="cc" value="0" placeholder="Enter pcs of 200" ></input>
                    </div><!-- /.input group -->
                  </div><!-- /.form group -->
				  
				   <div class="form-group" style="margin-top:-10px;">
                    <label for="date">100 X ??</label>
                    <div class="input-group col-md-12">
                      <input class="form-control pull-right" id="date" name="dd" value="0" placeholder="Enter pcs of 100" ></input>
                    </div><!-- /.input group -->
                  </div><!-- /.form group -->
				  
				   <div class="form-group" style="margin-top:-10px;">
                    <label for="date">50 X ??</label>
                    <div class="input-group col-md-12">
                      <input class="form-control pull-right" id="date" name="ee" value="0" placeholder="Enter pcs of 50" ></input>
                    </div><!-- /.input group -->
                  </div><!-- /.form group -->
				  
				   <div class="form-group" style="margin-top:-10px;">
                    <label for="date">20 X ??</label>
                    <div class="input-group col-md-12">
                      <input class="form-control pull-right" id="date" name="ff" value="0" placeholder="Enter pcs of 20" ></input>
                    </div><!-- /.input group -->
                  </div><!-- /.form group -->
				  
				   <div class="form-group" style="margin-top:-10px;">
                    <label for="date">10 X ??</label>
                    <div class="input-group col-md-12">
                      <input class="form-control pull-right" id="date" name="gg" value="0" placeholder="Enter pcs of 10" ></input>
                    </div><!-- /.input group -->
                  </div><!-- /.form group -->
				  
				   <div class="form-group" style="margin-top:-10px;">
                    <label for="date">5 X ??</label>
                    <div class="input-group col-md-12">
                      <input class="form-control pull-right" id="date" name="hh" value="0" placeholder="Enter pcs of 5" ></input>
                    </div><!-- /.input group -->
                  </div><!-- /.form group -->
				  
				   <div class="form-group" style="margin-top:-10px;">
                    <label for="date">1 X ??</label>
                    <div class="input-group col-md-12">
                      <input class="form-control pull-right" id="date" name="ii" value="0" placeholder="Enter pcs of 1" ></input>
                    </div><!-- /.input group -->
                  </div><!-- /.form group -->
				  
				  
					  <div class="form-group">
						<div class="input-group">
						  <button class="btn btn-primary" id="daterange-btn" name="">
							Remit
						  </button>
						  <button class="btn" id="daterange-btn">
							Clear
						  </button>
						</div>
					  </div><!-- /.form group -->
				  </form>	
                </div><!-- /.box-body -->
              </div><!-- /.box -->
            </div><!-- /.col (right) -->
            
          </section><!-- /.content -->
        </div><!-- /.container -->
      </div><!-- /.content-wrapper -->
      <?php include('../dist/includes/footer.php');?>
    </div><!-- ./wrapper -->

    <!-- jQuery 2.1.4 -->
    <script src="../plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <!-- Bootstrap 3.3.5 -->
    <script src="../bootstrap/js/bootstrap.min.js"></script>
    <script src="../plugins/select2/select2.full.min.js"></script>
    <!-- SlimScroll -->
    <script src="../plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <!-- FastClick -->
    <script src="../plugins/fastclick/fastclick.min.js"></script>
    <!-- AdminLTE App -->
    <script src="../dist/js/app.min.js"></script>
    <!-- AdminLTE for demo purposes -->
    <script src="../dist/js/demo.js"></script>
    <script src="../plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="../plugins/datatables/dataTables.bootstrap.min.js"></script>
    
    <script>
      $(function () {
        $("#example1").DataTable();
        $('#example2').DataTable({
          "paging": true,
          "lengthChange": false,
          "searching": false,
          "ordering": true,
          "info": true,
          "autoWidth": false
        });
      });
    </script>
     <script>
      $(function () {
        //Initialize Select2 Elements
        $(".select2").select2();

        //Datemask dd/mm/yyyy
        $("#datemask").inputmask("dd/mm/yyyy", {"placeholder": "dd/mm/yyyy"});
        //Datemask2 mm/dd/yyyy
        $("#datemask2").inputmask("mm/dd/yyyy", {"placeholder": "mm/dd/yyyy"});
        //Money Euro
        $("[data-mask]").inputmask();

        //Date range picker
        $('#reservation').daterangepicker();
        //Date range picker with time picker
        $('#reservationtime').daterangepicker({timePicker: true, timePickerIncrement: 30, format: 'MM/DD/YYYY h:mm A'});
        //Date range as a button
        $('#daterange-btn').daterangepicker(
            {
              ranges: {
                'Today': [moment(), moment()],
                'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
                'Last 7 Days': [moment().subtract(6, 'days'), moment()],
                'Last 30 Days': [moment().subtract(29, 'days'), moment()],
                'This Month': [moment().startOf('month'), moment().endOf('month')],
                'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
              },
              startDate: moment().subtract(29, 'days'),
              endDate: moment()
            },
        function (start, end) {
          $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
        }
        );

        //iCheck for checkbox and radio inputs
        $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
          checkboxClass: 'icheckbox_minimal-blue',
          radioClass: 'iradio_minimal-blue'
        });
        //Red color scheme for iCheck
        $('input[type="checkbox"].minimal-red, input[type="radio"].minimal-red').iCheck({
          checkboxClass: 'icheckbox_minimal-red',
          radioClass: 'iradio_minimal-red'
        });
        //Flat red color scheme for iCheck
        $('input[type="checkbox"].flat-red, input[type="radio"].flat-red').iCheck({
          checkboxClass: 'icheckbox_flat-green',
          radioClass: 'iradio_flat-green'
        });

        //Colorpicker
        $(".my-colorpicker1").colorpicker();
        //color picker with addon
        $(".my-colorpicker2").colorpicker();

        //Timepicker
        $(".timepicker").timepicker({
          showInputs: false
        });
      });
    </script>
  </body>
</html>
