<?php 
	$header_file=APPPATH.'views/include/header.php';
	require($header_file);
	
	?>

    <!-- BEGIN: Content-->
    <div class="app-content content">
      <div class="content-overlay"></div>
      <div class="content-wrapper">
        <div class="content-header row">
          <div class="content-header-left col-md-12 col-12 mb-2 breadcrumb-new">
            <h3 class="content-header-title mb-0 d-inline-block">Receipt List</h3>
            <div class="row breadcrumbs-top d-inline-block">
              <div class="breadcrumb-wrapper col-12">
                <ol class="breadcrumb">
                  <li class="breadcrumb-item"><a href="#">Home</a>
                  </li>
                  <li class="breadcrumb-item"><a href="#">Material Request</a>
                  </li>
                  <li class="breadcrumb-item active">PRide Receipt List
                  </li>
                </ol>
              </div>
            </div>
          </div>
        
        </div>
        <div class="content-body"><!-- Zero configuration table -->
<section id="configuration">
    <div class="row">
        <div class="col-md-12">
            <div class="card">
                <!--<div class="card-header">
                    <h4 class="card-title">Receipt List</h4>
                    <a class="heading-elements-toggle"><i class="la la-ellipsis-v font-medium-3"></i></a>
                    <div class="heading-elements">
                        <ul class="list-inline mb-0">
                            <li><a data-action="collapse"><i class="ft-minus"></i></a></li>
                            <li><a data-action="reload"><i class="ft-rotate-cw"></i></a></li>
                            <li><a data-action="expand"><i class="ft-maximize"></i></a></li>
                            <li><a data-action="close"><i class="ft-x"></i></a></li>
                        </ul>
                    </div>
                </div>-->
                <div class="card-content collapse show">
                    <div class="card-body card-dashboard">
                        <form method="post" autocomplete="off" action="<?php echo site_url('MaterialRequest/searchcw4ReceiptList/');?>" method="POST">
                          <div class="row justify-content-md-center">
              
                <div class="col-md-3">
                  <div class="form-group">
                    <input class="form-control pickadate datepicker picker__input picker__input--active" type="text" name="from_date"  id="uk_dp_1" required data-uk-datepicker="{format:'DD-MM-YYYY'}" placeholder="From Date">
                  </div>
                </div>
                
                <div class="col-md-3">
                  <div class="form-group">
                    <input class="form-control pickadate datepicker picker__input picker__input--active" type="text" name="to_date"  id="uk_dp_1" required data-uk-datepicker="{format:'DD-MM-YYYY'}" placeholder="To Date">
                    <input class="form-control" type="hidden" name="submod_id"  id="submod_id"   value="<?php  if(isset($_POST['submod_id'])) { echo $_POST['submod_id']; }else { echo $submod_id; }?>">
                  </div>
                </div>  
                <div class="col-md-3">
                  <div class="form-group">
                    <select id="outlet_name" name="outlet_name" class="form-control select2" >
                      <option value="">Branch</option>
                      <?php  foreach($branch as $row)
                        {
                      ?>
                        <option value="<?php echo $row->branch_name; ?>"><?php echo $row->username; ?></option>
                      <?php
                        } 
                      ?>
                    </select>
                  </div>
                </div>
                <div class="col-md-3">
                  <div class="form-group">
                    <input type="submit" name="submit" class="btn btn-primary" value="Receipt Report">
                  </div>
                </div>
              
            </div>
            </form>
                        <div class="table-responsive">
						    <?php 
          if(isset($_POST['submit'])) {
            
            if($_POST['from_date']!="" && $_POST['to_date']!="" && $_POST['outlet_name']!=""){
            ?>
                <div class="row justify-content-md-left">
					<div class="col-md-2">
						<div class="form-group">
					        <input class="form-control" type="text" name="from_date"  id="uk_dp_1" value="<?php echo $_POST['from_date']; ?>" readonly >
				        </div>
				    </div>
				    <div class="col-md-2">
						<div class="form-group">
				        	<input class="form-control" type="text" name="from_date"  id="uk_dp_1" value="<?php echo $_POST['to_date']; ?>" readonly >
            				</div>
				    </div>
				    <div class="col-md-2">
						<div class="form-group">
        					<?php 
        						if($_POST['outlet_name'] == 'All')
        						{
        					?>
        						<input class="form-control" type="text" name="outlet"  id="outlet" value="<?php echo $_POST['outlet_name']; ?>" readonly >
        					<?php } else {
        						 ?>
        						<input class="form-control" type="text" name="outlet"  id="outlet" value="<?php echo $_POST['outlet_name']; ?>" readonly >
        					<?php } ?>
        				</div>
        			</div>
        			<div class="col-md-2">
        			    <form method="post" action="<?php echo site_url('MaterialRequest/export_prideIssue/');?>" >
						<div class="uk-width-medium-1-4">
							<div class="uk-input-group">
								<input class="form-control" type="hidden" name="from_date1" value="<?php echo $_POST['from_date']; ?>">
								<input class="form-control" type="hidden" name="to_date1" value="<?php echo $_POST['to_date']; ?>">
								<input class="form-control" type="hidden" name="outlet_name1" value="<?php echo $_POST['outlet_name']; ?>">
								<input class="form-control" type="hidden" name="branchname" value="<?php echo $_SESSION['branch_name']; ?>">
								<input type="submit" name="export_stock" class="btn btn-primary" value="Export">
							</div>
						</div>
					</form>	
        			</div>
        		</div>
						<table class="table table-striped table-bordered dataex-html5-export">
							<thead>
								<tr>
									<th>Receipt No</th>
									<th>Receipt Date</th>
									<th>Status</th>
									<th>Approved Date</th>
									<th>Outlet Name</th>
									<th>Total</th>
									<th>View</th>
									
								</tr>
							</thead>
							<tbody>
								 <?php if(isset($result_display) && is_array($result_display) && count($result_display)) : $i=1;
                                    foreach($result_display as $data){ ?>
										<tr>
									<td><?php echo $data->req_rec_no; ?></td>
									<td><?php echo $data->receipt_date; ?></td>
									<?php
										if($data->receipt_approval == 'Pending') {
										?>
										<td class="pending_data"><?php echo $data->receipt_approval; ?></td>
										<?php
											} else {
										?>	
										<td class="success_data"><?php echo $data->receipt_approval; ?></td>
										<?php
										}
									?>
									<td><?php echo $data->approval_date; ?></td>
									<?php $branch = $data->branchname;
                        			$q1 = $this->db->query("select * from user where branch_name='$branch'");
                        			$row = $q1->row_array();
                        			$outlet = $row['username'];
                        			?>
									<td><?php echo $outlet; ?></td>
									<td><?php echo $data->total; ?></td>
									<td class="uk-text-nowrap">
										<a href="<?php echo site_url('MaterialRequest/prdinView/'. $data->req_rec_id); ?>" class="btn btn-sm btn-info"> View</a>
									</td>
								</tr>
										<?php
                                        }
                                      
                                    ?>
                                    <?php else:
                                ?>
                                <tr>
                                  <td colspan="3" align="center" >No Records Found..</td>
                                </tr>
                                <?php
                                  endif;
                                ?>
								</tbody>
							</table>
						</div>
					</div>
					<br/>
					
            
            <?php 
            }
            else{
              echo "Please Enter the Data";
            }
          }
          else
          {
          ?>
						    <table  id="myTable" class="table table-striped table-bordered ">
                                <thead>
                                    <tr>
                                        <th>Sl No</th>
                                        <th>RCP No</th>
										<th>RCP Date</th>
										<th>Status</th>
										<th>Approved Date</th>
										<th>Outlet</th>
										<th>Total</th>
										<th>View</th>
									</tr>
                                </thead>
                               <!-- <tbody>
								 <?php
								/*	$count =1;
									foreach($rec_list as $rclist)
									{
								?>
                                <tr>
									<td><?php echo $rclist->req_rec_no; ?></td>
									<td><?php echo $rclist->receipt_date; ?></td>
									<?php
										if($rclist->receipt_approval == 'Pending') {
										?>
										<td class="pending_data"><?php echo $rclist->receipt_approval; ?></td>
										<?php
											} else {
										?>	
										<td class="success_data"><?php echo $rclist->receipt_approval; ?></td>
										<?php
										}
									?>
									<td><?php echo $rclist->approval_date; ?></td>
									<?php $branch = $rclist->branchname;
                        			$q1 = $this->db->query("select * from user where branch_name='$branch'");
                        			$row = $q1->row_array();
                        			$outlet = $row['username'];
                        			?>
									<td><?php echo $outlet; ?></td>
									<td><?php echo $rclist->total; ?></td>
									<td class="uk-text-nowrap">
										<a href="<?php echo site_url('MaterialRequest/prdinView/'. $rclist->req_rec_id); ?>" class="btn btn-sm btn-info"> View</a>
									</td>
								</tr>
                                    
                                   <?php
								  $count++;
								}*/
							  
							?>
							</tbody>-->
                            </table>
                <?php } ?>
						</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<!--/ Zero configuration table -->



<!--/ Language - Comma decimal place table -->

        </div>
      </div>
    </div>
    <!-- END: Content-->

   <?php //require('include/theme_customizer.php');?>
 <?php 
  $footer_file=APPPATH.'views/include/footer.php';
	require($footer_file);
	?>
<script>
	$('.param_check').each(function() { $(this).on( {'click contextmenu': function() {
		//contextmenu
		var i = $(this).data('value');
		var anchor = $("a");
		var anchorTarget = $(this).parent().find('.parmetre').val();
		var submodid = $(this).parent().find('.submod_id').val();
		var link = $(this).attr('href');
		$(this).attr("href", link + submodid +'/'+anchorTarget);

		location.reload();
	}
	})
	})
</script> 
<script type='text/javascript'>
    $(document).ready(function() {
        $("#myTable").DataTable({
           "ajax": '<?php echo base_url();?>index.php/MaterialRequest/get_PrideRecCw4List',
            dom: "Bfrtip",
             displayLength: 25,
            buttons: ["copyHtml5", "excelHtml5", "csvHtml5", "pdfHtml5"]
    }) 
   });
</script>
  </body>
  <!-- END: Body-->

<!-- Mirrored from pixinvent.com/modern-admin-clean-bootstrap-4-dashboard-html-template/html/ltr/vertical-modern-menu-template/form-layout-basic.html by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Apr 2020 09:38:02 GMT -->
</html>