  <?php
    $this->load->view('templates/header');
  ?>
    <script>
        var link = "invoice";
        var sub_link = "";
    </script>
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1 class="content_top">ADD INVOICE<?php //echo empty($cm_data) ? 'ADD INVOICE' : 'UPDATE INVOICE'; ?></h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li><a href="#">Invoice</a></li>
        <li class="active">Add<?php //echo empty($cm_data) ? 'Add' : 'Update' ?></li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row"><!-- left column -->
            <div class="col-md-12">
                <div class="box box-primary">
                    <div class="box-body">
                        <div class="alert_msg"></div>
                        <form class="form-horizontal" id="challan_form">
                            <div class="box-body remove-bottom"><!-- box-body -->
                                <div class="form-group floating-form">
                                    <!-- issue no -->
                                    <div class="col-md-2 floating-label">
                                        <input type="number" class="form-control floating-input" id="inv_no" name="inv_no" value="<?php echo $entry_no; ?>" placeholder=" " autocomplete="off" readonly />
                                        <label>INVOICE NO</label>
                                    </div>
                                    <!-- issue no -->

                                    <!-- issue date -->
                                    <div class="col-md-2 floating-label">
                                        <input type="text" class="form-control floating-input" id="inv_entry_date" name="inv_entry_date" value="<?php echo date('d-m-Y');?>"
                                        placeholder=" " autocomplete="off" readonly/>
                                        <label>INVOICE DATE</label>
                                    </div>
                                    <!-- issue date -->

                                    <!-- party -->
                                    <div class="col-md-2 floating-label">
                                        <?php echo form_dropdown('', $user, 0,'id="cm_cust_id" name="cm_cust_id" class="form-control flexselect floating-select" onchange="get_customer_data(this.value)" placeholder=" " autocomplete="off" tabindex="2" ');  ?>
                                        <label>CUSTOMER</label>
                                    </div>
                                    <!-- party -->
                                    
                                    <div class="col-md-1 col-md-offset-3">
                                        <?php //$display_btn = !empty($cm_data) ? '' : 'style="display:none;"'; ?>
                                        <button type="button" class="btn btn-primary" id="sbt_btn" <?php //echo $display_btn; ?> onclick="add_invoice(0)" tabindex="10">Submit</button>
                                        
                                    </div>
                                    <div class="col-md-1">
                                        <a href="<?php //echo base_url('challan/challanctrl/challan_master?action=view');?>" type="button" class="btn btn-danger" id="cnl_btn" tabindex="11">Cancel</a>
                                    </div>
                                </div>
                                <div class="form-group floating-form">
                                    
                                </div>
                            </div>
                            <div class="box box-primary">
                                <div class="box-header with-border"><!-- /.box-header -->
                                    <h3 class="box-title">Add Product</h3>
                                    <div class="box-tools pull-right">
                                        <button type="button" class="btn btn-box-tool" data-widget="collapse">
                                            <i class="fa fa-minus"></i>
                                        </button>
                                    </div>
                                </div><!-- /.box-header -->
                                
                            </div><!-- /.box -->
                            <div class="box box-primary">
                            <div class="box-header with-border">
                                <h3 class="box-title">Product Details</h3>
                                <div class="box-tools pull-right">
                                    <button type="button" class="btn btn-box-tool" data-widget="collapse">
                                        <i class="fa fa-minus"></i></button>
                                </div>
                            </div><!-- /.box-header -->
                            
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- /.content -->


<?php
    $this->load->view('templates/footer');
?>
<script src="<?php echo assets('js/invoice.js')?>"></script>
<?php
    // if(!empty($cm_data))
    // {
    //     echo "<script>";
    //     echo "inv_cnt = $cnt;";
    //     echo "</script>";
    // }
?>
</body>
</html>