
<?php
include './connection_sql.php';
?>
<!-- Main content -->
<section class="content">

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

                <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-primary">
                            <span class="fa fa-save"></span> &nbsp; Save
                        </a>
                          <a onclick="NewWindow('expense_search.php', 'mywin', '800', '700', 'yes', 'center');
                                return false" class="btn btn-default">
                            <span class="fa fa-search"></span> &nbsp; Find
                        </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>

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

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="firstname_hidden">Ref No</label>
                    <div class="col-sm-2">
                        <input type="text"  id="invno" disabled class="form-control">
                    </div> 
                    
  <label class="col-sm-2 control-label" for="firstname_hidden">DATE</label>
                    <div class="col-sm-2">
                        <input type="text"  id="sdate" value="<?php echo date('Y-m-d');?>"  class="form-control dt">
                    </div> 
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="firstname_hidden">Category</label>
                    <div class="col-sm-2">
                         <select id="cat" class="form-control input-sm" >

                            <?php
                             						 						
                    $sql="select * from category  ";
                    foreach ($conn->query($sql) as $row) {
                        echo "<option value='".$row["name"]."'>".$row["name"]." </option>";
                    }
			 
                            
                            
                            
                            ?>
                        </select>
                    </div> 

                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="firstname_hidden">Description</label>
                    <div class="col-sm-4">
                        <input type="text"  id="name"   class="form-control">
                    </div> 

                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="firstname_hidden">Department</label>
                    <div class="col-sm-2">
                       <select id="dep" class="form-control input-sm" >

                            <?php
                            
                            
                             if (!is_numeric($_SESSION["CURRENT_DEP"]))  {							 						
                    $sql="select * from s_stomas  order by CODE";
                    foreach ($conn->query($sql) as $row) {
                        echo "<option value='".$row["CODE"]."'>  ".$row["DESCRIPTION"]."</option>";
                    }
				} else {
                    $sql="select * from s_stomas  where CODE = '" . $_SESSION["CURRENT_DEP"] ."' order by CODE";
					foreach ($conn->query($sql) as $row) {
                    echo "<option value='".$row["CODE"]."'>  ".$row["DESCRIPTION"]."</option>";
                    }
                }
                            
                            
                            
                            ?>
                        </select>
                    </div> 

                </div>
                 
                 <div class="form-group">
                    <label class="col-sm-2 control-label" for="firstname_hidden">AMOUNT</label>
                    <div class="col-sm-2">
                        <input type="number"  id="amount"   class="form-control">
                    </div> 

                </div>
                
                 

                
    </div>

    <div  class='space' >
        <br>&nbsp;
        <br>&nbsp;
        <br>&nbsp;

    </div>

</form>
</div>

</section>

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

<script>
     new_inv();
</script>

    