<!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
                <div class="title_left">
                    <h3>Journal</h3>
                </div>
            </div>
            <div class="clearfix"></div>

            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>View</h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  
                  <div class="x_content">
                  <div class="col-md-5">
                   <form class="form-group" style="margin-top:10px;" method="post" action="<?php echo  base_url(); ?>account/datewise_journal/">
                        <label class="control-label col-md-2 col-sm-2 col-xs-12" for="name">Date To:<span class="required">*</span>
                        </label>
                        <div class="col-md-10 col-sm-10 col-xs-10">
                        <input name="date1"  id="date1" value="" class="form-control date" maxlength="20" required>                    
                        </div>
                      </div> 
                      <div class="col-md-5" style="margin-top:10px;">
                        <label class="control-label col-md-2 col-sm-2 col-xs-12" for="name">Date From:<span class="required">*</span>
                        </label>
                        <div class="col-md-10 col-sm-10 col-xs-10">
                        <input name="date2"  id="date2" value="" class="form-control date" maxlength="20" required>                    
                        </div>
                      </div> 
                      <div class="col-md-2" style="margin-top:10px">
                      <button type="submit" id="srch" class="btn btn-success">Search</button>
                      </div>
                      </form>
                      </div>
                      
                  <div class="row"><div class="col-md-12 text-right"><button class="btn btn-default"><a href="<?php echo base_url(); ?>account/print_journal"><i class="fa fa-print"></i></a></button></div></div>
                  <table class="table table-bordered table-striped text-center" style="width:80%;margin:0 auto;">
                  <thead>
                  <tr>
                  <th class="text-center">#</th>
                  <th class="text-center">Voucher #</th>
                  <th class="text-center">Date</th>
                  <th class="text-center" style="width:30%">Head</th>
                  <th class="text-center" >Debit</th>
                  <th class="text-center" >Credit</th>
                  </tr>
                  </thead>
                  <?php //var_dump("<pre>",$journal);die(); ?>
                  <tbody>
                  <?php $title=""; $drtotal=0; $crtotal=0; foreach ($journal as $key => $value) {
                    
                     ?>
                  <tr>
                  <td><?php echo ++$key; ?></td>
                  <td><?php echo $value['voucher#']; ?></td>
                  <td><?php echo $value['date']; ?></td>
                  <td><div class="row"><div class="col-md-12 text-left">
                    <?php foreach ($value['detail'] as $key => $v) {
                      if($v['dr']!=null){
                        echo $v['dr']."<br>";
                      }
                    } ?>
                  </div><div class="col-md-12 text-right">
                  <?php foreach ($value['detail'] as $key => $v) {
                      if($v['cr']!=null){
                        echo $v['cr']."<br>";
                      }
                    } ?>
                  </div></div></td>
                   <!-- Ammount show here -->
                   <td>
                   <div class="row"><div class="col-md-12 text-left">
                  <?php foreach ($value['detail'] as $key => $v) {
                       
                       if($v['dr']!=Null){
                         $drtotal=$v['ammount']+$drtotal;
                         echo $v['ammount']."<br>";
                       }
                       
                     } 
                     
                   
                    ?>
                  </div><div class="col-md-12 text-right">
                  &nbsp;
                  </div></div>
                   </td>
                   <td>
                   <div class="row"><div class="col-md-12 text-left">
                   &nbsp;
                  </div><div class="col-md-12 text-right">
                  <?php  foreach ($value['detail'] as $key => $v) {
                       
                       if($v['cr']!=Null){
                         $crtotal=$v['ammount']+$crtotal;
                         echo $v['ammount']."<br>";
                       }
                       
                     } 
                     
                   
                    ?>
                  
                  </div></div>
                   </td>
                  </tr>
                    <?php  } ?>
                  <tbody>
                  <tr><td colspan="4" class="text-center">Total</td><td><?php echo $drtotal; ?></td><td ><?php echo $crtotal; ?></td></tr>
                  </table>
                       <br>
                     <?php echo $page_links; ?>
                  </div>
                </div>
             
              </div>
               
             
              </div>
            
            </div>
          </div>
                  <!-- /page content -->
        <script src="<?php echo base_url(); ?>assets/vendors/jquery/dist/jquery.min.js"></script>
        