<!DOCTYPE html>
<html>
<head>
<!-- TABLES CSS CODE -->
<?php include"comman/code_css_form.php"; ?>
<?php include"comman/code_css_datatable.php"; ?>
<!-- </copy> -->  
</head>

<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

 <?php include"sidebar.php"; ?>
 <?php
	if(!isset($country)){
      $country=$q_id="";
  }
 ?>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        Cash In
        <small>Add/Delete Cash In</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="<?php echo $base_url; ?>dashboard"><i class="fa fa-dashboard"></i> Home</a></li>
        <li><a href="<?php echo $base_url; ?>country">Cash Balance</a></li>
        <li class="active">Cash In</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="row">
        <!-- right column -->
        <div class="col-md-12">
          <!-- Horizontal Form -->
          <div class="box box-info ">
            <div class="box-header with-border">
              <h3 class="box-title">Please Enter Valid Data</h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form class="form-horizontal" id="country-form" onkeypress="return event.keyCode != 13;">
              <input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
              <input type="hidden" id="base_url" value="<?php echo $base_url;; ?>">
              <div class="box-body">

              <div class="row">
                <div class="col-sm-12">
                  
                    <label for="country_name" class="col-sm-2 control-label">Amount<label class="text-danger">*</label></label>
                    <div class="col-sm-4">
                      <input type="text" class="form-control input-sm" id="amount" name="amount" placeholder="" value="<?php print $amount; ?>" autofocus >
                      <span id="country_name_msg" style="display:none" class="text-danger"></span>
                    </div>
                  
                  
                    <label for="formDate" class="col-sm-2 control-label">Date</label>
                      <div class="col-sm-4">
                        <input type="date" class="form-control" id="selectDate" name="selectDate" value="<?php $date = new DateTime("now", new DateTimeZone('Asia/Colombo')); echo $date->format('Y-m-d');?>">
                      </div>
                  
                </div>
              </div>
		
                
                        
              

                      </div>
                      <!-- /.box-body -->
                      <div class="box-footer">
                        <div class="col-sm-8 col-sm-offset-2 text-center">
                          <!-- <div class="col-sm-4"></div> -->
                          <?php
                              if($country!=""){
                                  $btn_name="Update";
                                  $btn_id="update";
                                  ?>
                                    <input type="hidden" name="q_id" id="q_id" value="<?php echo $q_id;?>"/>
                                    <?php
                              }
                                        else{
                                            $btn_name="Save";
                                            $btn_id="save";
                                        }
                              
                                        ?>
                                        
                          <div class="col-md-3 col-md-offset-3">
                              <button type="button" id="<?php echo $btn_id;?>" class=" btn btn-block btn-success" title="Save Data"><?php echo $btn_name;?></button>
                          </div>
                          <div class="col-sm-3">
                            <a href="<?=base_url('dashboard');?>">
                              <button type="button" class="col-sm-3 btn btn-block btn-warning close_btn" title="Go Dashboard">Close</button>
                            </a>
                          </div>
                        </div>
                    </div>
                    <!-- /.box-footer -->
                    </form>
                  </div>
                  <!-- /.box -->

                </div>
        <!--/.col (right) -->
      </div>
      <!-- /.row -->

      <br><br>

      <div class="row">
        <!-- right column -->
        <div class="col-md-12">
          <!-- Horizontal Form -->
          <div class="box box-info ">
              <div class="box-header with-border">
                <h3 class="box-title">Please Enter Valid Data</h3>
              </div>
            <!-- /.box-header -->
            <!-- form start -->

              <div class="box-body">
                <table id="example2" class="table table-bordered table-striped" width="100%">
                  <thead class="bg-primary ">
                    <tr>
                      <th>#</th>
                      <th>Amount</th>
                      <th>Added By</th>
                      <th>Added Date</th>
                      <th>Added Time</th>
                      <th><?= $this->lang->line('action'); ?></th>
                    </tr>
                  </thead>
                  <tbody>
                  </tbody>
                </table>
              </div>

          </div>
                  <!-- /.box -->

        </div>
        <!--/.col (right) -->
      </div>

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

 <?php include"footer.php"; ?>


  <!-- Add the sidebar's background. This div must be placed
       immediately after the control sidebar -->
  <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->
<!-- SOUND CODE -->
<?php include"comman/code_js_sound.php"; ?>
<!-- TABLES CODE -->
<?php include"comman/code_js_form.php"; ?>
<?php include"comman/code_js_datatable.php"; ?>
<script>
    $(function(){
      var dtToday = new Date();

      var month = dtToday.getMonth() + 1;
      var day = dtToday.getDate();
      var year = dtToday.getFullYear();

      if(month < 10)
          month = '0' + month.toString();
      if(day < 10)
          day = '0' + day.toString();

      var maxDate = year + '-' + month + '-' + day;    
      $('#selectDate').attr('max', maxDate);
  });
</script>
<script type="text/javascript">
  var table;
  $(document).ready(function() {
    //datatables
    table = $('#example2').DataTable({ 

        "processing": true, //Feature control the processing indicator.
        "serverSide": true, //Feature control DataTables' server-side processing mode.
        "order": [], //Initial no order.
        "responsive": true,

        // Load data for the table's content from an Ajax source
        "ajax": {
            "url": "<?php echo site_url('cash/ajax_list')?>",
            "type": "POST"
        },

        //Set column definition initialisation properties.
        "columnDefs": [
        { 
            "targets": [ 2 ], //first column / numbering column
            "orderable": false, //set not orderable
        },
        ],
    });
    new $.fn.dataTable.FixedHeader( table );
});
</script>
<script src="<?php echo $theme_link; ?>js/country.js"></script>
<script type="text/javascript">
$(document).ready(function () { setTimeout(function() {$( ".alert-dismissable" ).fadeOut( 1000, function() {});}, 3000); });
</script>
<!-- Make sidebar menu hughlighter/selector -->
<script>$(".<?php echo basename(__FILE__,'.php');?>-active-li").addClass("active");</script>

</body>
</html>
