<?php
ini_set('session.gc_maxlifetime', 30 * 60 * 60 * 60);
session_start();
$_SESSION["brand"] = "";
if ($_SESSION["dev"] == "") {
    echo "Invalid User Session";
    exit();
}
?>

<link rel="stylesheet" href="css/themes/redmond/jquery-ui-1.10.3.custom.css" />

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

    <div class="box box-primary">
        <div class="box-header with-border">
            <h3 class="box-title">INVOICE UPDATE</h3>
        </div>

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

                        </a>
                        <a onclick="uprep();" class="btn btn-primary">
                            <span class="fa fa-edit"></span> &nbsp; UPDATE INVOICE

                        </a>
                      
                         

                       
 

                </div>
                <div id="msg_box"  class="span12 text-center"  ></div>
                <input type="hidden"  class="form-control input-sm  " disabled=""  name="mcount" id="mcount">
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="invno">INVOICE NO</label>
                    <div class="col-sm-3">
                        <input type="text"  class="form-control input-sm  " disabled=""  name="invno" id="invno">
                    </div>

                    
                    
                    <div class="col-sm-1">
                        <a href=""  class="btn btn-danger btn-sm " onClick="NewWindow('search_invoice1.php', 'mywin', '800', '700', 'yes', 'center');
                                return false" onFocus="this.blur()">
                            ...
                        </a>
                    </div>
              
                

                    
                     

                </div> 
                   <div class="form-group">
                     <label class="col-sm-1 control-label" for="invno">Department From</label>
                  <div class="col-sm-3">
                     
                <select id="repfrom"  name="repfrom" disabled="" class="form-control input-sm"  >

                    <?php
                      $sql = "select * from s_stomas where   act='1' order by CODE";
                    
                    $result = mysqli_query($GLOBALS['dbinv'], $sql);
                    while ($row = mysqli_fetch_array($result)) {
                        echo "<option value='" . $row["CODE"] . "'>" . $row["DESCRIPTION"]."</option>";
                    }
                    ?>
                </select>

            </div> 
            <div class="form-group">
                     <label class="col-sm-1 control-label" for="invno">Department To</label>
                  <div class="col-sm-3">
                     
                <select id="repto"  name="repto" disabled class="form-control input-sm"  >

                    <?php
                    
                        $sql = "select * from s_stomas where   act='1' order by CODE";
                    
                    $result = mysqli_query($GLOBALS['dbinv'], $sql);
                    while ($row = mysqli_fetch_array($result)) {
                        echo "<option value='" . $row["CODE"] . "'>" . $row["DESCRIPTION"]."</option>";
                    }
                    ?>
                </select>
                
            </div> 
             </div> 
             
             <div class="form-group">
                <label class="col-sm-1 control-label" for="invno">Date From</label>
                <div class="col-sm-3"> 
                    <input type="date"  class="form-control input-sm  " disabled=""  name="sdate" id="sdate"> 
                </div> 
                 <label class="col-sm-1 control-label" for="invno">Date To</label>
                <div class="col-sm-3"> 
                    <input type="date"  class="form-control input-sm  "   name="sdate1" id="sdate1"> 
                </div> 
             </div> 
             
             <div class="form-group">
                <label class="col-sm-1 control-label" for="invno">Customer From</label>
                <div class="col-sm-3"> 
                    <input type="text"  class="form-control input-sm  " disabled=""  name="cuscode" id="cuscode"> 
                </div> 
                 <label class="col-sm-1 control-label" for="invno">Customer To</label>
                <div class="col-sm-3"> 
                    <input type="text"  class="form-control input-sm  " placeholder='Customer Code'  name="cuscode1" id="cuscode1"> 
                </div> 
                <div class="col-sm-3">
                        <input type="text" class="form-control input-sm  " placeholder='Customer Name' id="cusname" name="cusname" />
                    </div>
             </div> 
             
             <div class="form-group">
                <label class="col-sm-1 control-label" for="invno">Contact From</label>
                <div class="col-sm-3"> 
                    <input type="text"  class="form-control input-sm  " disabled=""  name="con" id="con"> 
                </div> 
                 <label class="col-sm-1 control-label" for="invno">Contact To</label>
                <div class="col-sm-3"> 
                    <input type="text"  class="form-control input-sm  "   name="con1" id="con1"> 
                </div> 
             </div> 
             
                <div class="form-group">
                <label class="col-sm-1 control-label" for="invno">Job No From</label>
                <div class="col-sm-3"> 
                    <input type="text"  class="form-control input-sm  " disabled=""  name="jobno" id="jobno"> 
                </div> 
                 <label class="col-sm-1 control-label" for="invno">Job No To</label>
                <div class="col-sm-3"> 
                    <input type="text"  class="form-control input-sm  "   name="jobno1" id="jobno1"> 
                </div> 
             </div> 
             
              <div class="form-group">
                     <label class="col-sm-1 control-label" for="invno">Pay Type From</label>
                      <div class="col-sm-3">
                         <select id="paytypefrom"  name="paytypefrom" disabled="" class="form-control input-sm"  >
        
                            <option value='NORMAL'>NORMAL</option>
                            <option value='CARD PAYMENT'>CARD PAYMENT</option>
                        </select>

                 </div> 
                 <label class="col-sm-1 control-label" for="invno">Pay Type To</label>
                      <div class="col-sm-3">
                         <select id="paytypeto"  name="paytypeto"  class="form-control input-sm"  >
        
                            <option value='NORMAL'>NORMAL</option>
                            <option value='CARD PAYMENT'>CARD PAYMENT</option>
                        </select>

                 </div> 
            
            </div> 
             
             
             <div id='itemdetails'></div>

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

</section>
 
<script src="js/invrepchange.js"></script>
 