<?php
ini_set('session.gc_maxlifetime', 30 * 60 * 60 * 60);
session_start();
$_SESSION["brand"] = "";
if ($_SESSION["CURRENT_USER"] == "") {
    echo "Please Loging Again !!!";
    exit();
}
?>
 
<!-- Main content -->
<section class="content">

    <div class="box box-primary">
        <div class="box-header with-border">
            <h3 class="box-title">Labour Master</h3>
            <b style="margin-top: -10px;"><p style="float: right; color: black" id="time"></p></b> 
        </div>

        <form role="form" name ="form1" class="form-horizontal">
            <div class="box-body">
                <br>               
                <div class="form-group">
                    <a onclick="new_inv();" class="btn btn-default">
                        <span class="fa fa-user-plus"></span> &nbsp; New

                    </a>
                    <a onclick="save_inv();" class="btn btn-success">
                        <span class="fa fa-save"></span> &nbsp; Save
                    </a>
                     <a onclick="update_inv();" class="btn btn-primary">
                        <span class="fa fa-save"></span> &nbsp; Update
                    </a>
                    <a onclick="cancel_inv();" class="btn btn-danger">
                            <span class="fa fa-print"></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 talign" for="invno">Ref No</label>
                    <div class="col-sm-2">
                        <input type="text"  class="form-control input-sm"  disabled="" id="refno">
                    </div>
                    <div class="col-sm-1">
                        <a href=""  class="btn btn-primary btn-sm" onClick="NewWindow('labour_search.php', 'mywin', '800', '700', 'yes', 'center');
                                return false" onFocus="this.blur()">
                            ...
                        </a>
                    </div>

                    <label class="col-sm-1 control-label" for="sdate">Date</label>
                    <div class="col-sm-2">
                        <input type="text" name="sdate" disabled=""   id="sdate" value="<?php echo date('yy-m-d')?>"  class="form-control dt input-sm">    
                    </div>
                </div>   

                <div class="form-group">  
                    <label class="col-sm-1 control-label talign" for="invno">Name</label>
                    <div class="col-sm-4">
                        <input type="text"  class="form-control input-sm"     id="name">
                    </div>
                    
                 </div> 
                 <div class="form-group">  
                    <label class="col-sm-1 control-label talign" for="invno">Company</label>
                    <div class="col-sm-4">
                       <select id="company" name="company" class="form-control input-sm" >

                    <?php
                 
                    
                         $sql="select * from invpara  ";
                         
                         
                        $result = mysqli_query($GLOBALS['dbinv'], $sql);
                        while ($row = mysqli_fetch_array($result)) {
                            echo "<option value='" . $row["flag"] . "'>" . $row["flag"] . " - " . $row["COMPANY"] . " - " . $row["COMPANY1"] . "</option>";
                        }
                    // }
                    ?>
                </select>
                    </div> 
                 </div> 
                

                 

        </form>
    </div>

</section>

<script src="js/labour.js"></script>


<script> 
         new_inv();
                            
</script> 