<?php
defined('BASEPATH') OR exit('No direct script access allowed');

?>
      <div class="main my-0">
        <div class="row mt-3 mx-0">
          <div class="col-md-9">
            <h3>Day Close Receipt</h3>
          </div>
          <div class="col-md-3 text-right">
           &nbsp;
          </div>
        </div>
        
        <div class="container_fluid mt-2 px-3">
	<form name="frmsearch" method="get" action="outlet/<?php echo $mgmtname;?>">
         <table class="webforms sttbl bg-light my-0 table-responsive-sm">
          <tr>
           <td class="pr-0" width="40%"><input type="text" name="search" size="20" value="<?php echo $this->input->get("search");?>" placeholder="search cash, cc,upi,amount"></td>
<td class="pr-0" width="20%">
		<select name="billerid" id="billerid" >
		  <option value="">All Biller</option>
						<?php
						if(is_array($billerlist) && count(array_filter($billerlist))>0)
						{

							foreach($billerlist as $billerrow)
							{
								$sel_biller="";
								if(decodeValue($this->input->get("billerid"))==$billerrow->fld_id)
								{
									$sel_biller= 'selected="selected"';
								}				
									?>
											<option value="<?php echo encodeValue($billerrow->fld_id);?>" <?php echo $sel_biller;?>><?php echo $billerrow->fld_name;?></option>
									<?php
								
							}
						}
						?> 
		  </select>
		  </td>  
           <td class="pr-0" width="20%"><input type="text" name="fromdate" id="fromdate" value="<?php echo $fromdate;?>"   placeholder="From Date" class="datepicker" /></td>
           <td class="pr-0" width="20%"><input type="text" name="todate" id="todate"  value="<?php echo $todate;?>" placeholder="To Date" class="datepicker"/></td>
           <td>
           	<button class="btn btn-dark pt-0 pb-1 px-2">Go</button>
           </td>
          </tr>
         </table>
       </form>
         <?php
			if($this->session->flashdata("message")!="" && $this->session->flashdata("alerttype")!="")
			{
         ?>
         <div class="text-center my-4">
			 <span class="alert <?php echo $this->session->flashdata("alerttype");?>"><?php echo $this->session->flashdata("message");?></span>
         </div>
         <?php
			}
         ?>
         
         <table class="table mt-2 table-responsive-sm">
		 <form name="frmlisting" id="frmlisting" action="<?php echo base_url()."outlet/".$mgmtname;?>" method="post" onsubmit=" return checkboxvalidate();">
                <thead>
                	<tr>
                    	<th width="5%">SRNo.</th>
						<th width="15%">Biller</th>
						<th width="10%">Date</th>
                    	<th width="10%">Cash </th>
                    	<th width="10%">CC</th>
                    	<th width="10%">UPI </th>					
						<th width="10%">Name Account </th>
                    	<th width="10%">Total Amount</th>
                    	      
                         <th width="12%" class="text-center">Action</th>
                    </tr>
                    </thead>
                    <tbody>
					<?php
					
					if(is_array($results) && count(array_filter($results))>0)
					{
						$rowindex = 0;
						foreach($results as $row)
						{
							$rowindex++;


					?>
                    <tr>
                    	<td class="text-center"><?php echo $rowindex;?>.</td>
                    	<td><?php echo $row->billername;?></td>              
                    	<td><?php echo dfltdttmFormat($row->fld_datetime);?></td>              
                    	<td><?php echo $row->fld_cash;?></td>              
                    	<td><?php echo $row->fld_cc;?></td>              
                    	<td><?php echo $row->fld_upi;?></td> 
						<td><?php echo $row->fld_nameaccount;?></td>
                    	<td><?php echo $row->fld_amount;?></td>
                        <td align="center">

						<!--<a href="outlet/<?php echo $mgmtname;?>/manage/<?php echo encodeValue($row->fld_id);?>?<?php echo $_SERVER['QUERY_STRING'];?>" class="text-success" title="Edit"><span class="fa fa-edit fa-lg"></span></a>//-->
						<a href="outlet/<?php echo $mgmtname;?>/view/<?php echo encodeValue($row->fld_id);?>" class="fancybox-reloadparent" title="View"><span class="fa fa-eye fa-lg"></span></a>						
							
						</td>
                    	
                    </tr>
                    <?php
						}
							
					}
					else
					{
                    ?>
                    <tr><td colspan="9" style="text-align:center">Record not found!</td></tr>
                    <?php
					}
                    ?>
                    
                    
                    </tbody>
                </table>
                 
	         <div class="clearfix"></div>
          
        </div>
        <div id="paginate" class="row">
			<?php echo $this->ajax_pagination->create_links(); ?>
        </div>
            
        </div>

