<?php
ini_set('session.gc_maxlifetime', 30 * 60 * 60 * 60);
session_start(); 
if ($_SESSION["UserName"] == "") {
    echo "Please Login..";
    exit();
}
 
include './connection_sql.php';
?>

<!-- Main content -->
<section class="content">

    <div class="box box-primary">
        <div class="box-header with-border">
            <h3 class="box-title">JOB</h3>
        </div>
        <form name= "form1" role="form" class="form-horizontal">
            <div class="box-body">

                <input type="hidden" id="tmpno" class="form-control">

                <input type="hidden" id="item_count" class="form-control">

                <div class="form-group">

                    <a onclick="location.reload();" class="btn btn-default btn-sm  ">
                        <span class="fa fa-user-plus"></span> &nbsp; New
                    </a>

                    <a onclick="save_inv();" class="btn btn-success btn-sm">
                        <span class="fa fa-save"></span> &nbsp; Save
                    </a>
 
                    <a onclick="cancel_inv();" class="btn btn-danger btn-sm hidden">
                        <span class="fa fa-trash-o"></span> &nbsp; Cancel
                    </a>

                </div>

                <div id="msg_box"  class="span12 text-center"  ></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="invno">Job No</label>
                    <div class="col-sm-2">
                        <input type="text" placeholder="JOB NO" disabled  id="txt_entno" class="form-control  input-sm">
                    </div>
                    <div class="col-sm-1">
                        <a onfocus="this.blur()" onclick="NewWindow('serach_inv_item.php', 'mywin', '800', '700', 'yes', 'center');
                                return false" href="">
                            <input type="button" class="btn btn-default" value="..." id="searchcust" name="searchcust">
                        </a>
                    </div>
                    <label class="col-sm-2 control-label" for="invdate">Date</label>
                    <div class="col-sm-2">
                        <input type="text"  placeholder="Date" id="invdate" value="<?php echo date('Y-m-d'); ?>" class="form-control dt input-sm">
                    </div>
                    <label class="col-sm-1 control-label hidden" for="invno">DA No</label>
                    <div class="col-sm-2 hidden">
                        <input type="text" placeholder="DA NO" id="DANO" class="form-control  input-sm">
                    </div>
                    <div class="col-sm-1 hidden">
                        <a onfocus="this.blur()" onclick="NewWindow('serach_inv_do.php', 'mywin', '800', '700', 'yes', 'center');
                                return false" href="">
                            <input type="button" class="btn btn-default" value="..." id="searchcust" name="searchcust">
                        </a>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-1 control-label" for="c_code">Customer</label>
                    <div class="col-sm-2">
                        <input type="text" placeholder="Code" name="c_code1" disabled id="c_code1" class="form-control  input-sm">
                    </div>
                    <div class="col-sm-3">
                        <input type="text" placeholder="Name" name = "c_name1" disabled id="c_name1" class="form-control input-sm">
                    </div>
                    <div class="col-sm-3 hidden">
                        <input type="text" placeholder="Name" name = "cus_address" disabled id="cus_address" class="form-control input-sm">
                    </div>
                    
                    
                </div>

                <div class="form-group">
                    <label class="col-sm-1 control-label" for="c_code">Supplier</label>
                    <div class="col-sm-2">
                        <input type="text" placeholder="Code" name="c_code" disabled id="c_code" class="form-control  input-sm">
                    </div>
                    <div class="col-sm-3">
                        <input type="text" placeholder="Name" name = "c_name" disabled id="c_name" class="form-control input-sm">
                    </div>
                    <div class="col-sm-1  ">


                        <a onfocus="this.blur()" onclick="NewWindow('serach_customer.php?stname=inv', 'mywin', '800', '700', 'yes', 'center');
                                return false" href="">
                            <input type="button" class="btn btn-default" value="..." id="searchcust" name="searchcust">
                        </a>
                    </div>
                   
                </div>

                <div class="form-group">
                    <label class="col-sm-1 control-label" for="txt_remarks">Remark</label>
                    <div class="col-sm-5">
                        <input type="text" placeholder="Remarks" id="txt_remarks" class="form-control input-sm">
                    </div>

                    <div class="col-sm-1">
                        &nbsp;
                    </div>
                   
                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="txt_remarks">Dag Charge</label>
                    <div class="col-sm-2">
                      <input type="number" placeholder="Dag Charge" id="dcharge" class="form-control input-sm">
                    </div>
                    <label class="col-sm-1 control-label" for="txt_remarks">Company Charge</label>
                    <div class="col-sm-2">
                      <input type="number" placeholder="Company Charge" id="ccharge" class="form-control input-sm">
                    </div>
                   
                </div>
                
                <div class="form-group">
                     
                         <label  class="col-sm-2 control-label" ><input type="radio"   id="st0" name="paymethod" value="collected" checked=""  disabled="">&nbsp;Collected</label>

                        <label  class="col-sm-2 control-label" ><input type="radio"  id="st1" name="paymethod" value="transfer">&nbsp;Transfer</label> 
                        <label  class="col-sm-2 control-label" ><input type="radio"   id="st2" name="paymethod" value="rejected" >&nbsp;Rejected</label>
                        <label  class="col-sm-2 control-label" ><input type="radio"  id="st3" name="paymethod" value="completed">&nbsp;Completed</label>

                
                </div>
                
                

                 <div id="itemdetails" >

                </div>
            </div>
        </form>
    </div>

</section>
<script src="js/invoice_job.js"></script>
<script>
                            //new_inv();
</script>
<?php
include 'login.php';
include './cancell.php';
?>
    