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


     .talign{
        text-align: left !important; 

    }
    .text{
        font-weight: 600; 
        color: black;
    }
    .form-horizontal .form-group{
        margin-top:-10px !important;
}
</style>
<script language="JavaScript" src="js/category_mas.js?v1"></script>
<!-- Main content -->
<section class="content">

    <div class="box box-primary">
        <div class="box-header with-border">
            <h3 class="box-title">Category Master</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 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="update_inv();" class="btn btn-warning btn-sm">-->
                    <!--    <span class="fa fa-edit"></span> &nbsp; Update-->
                    <!--</a> -->
                   
                     <a onclick="cancel_inv();" class="btn btn-danger btn-sm">
                        <span class="fa fa-trash"></span> &nbsp; Cancel
                    </a>  
                
                </div>

          <!-- Hidden Items -->
<div hidden>
    
</div>
           
                <div id="msg_box"  class="span12 text-center"  ></div>
                <div class="col-sm-1">
                    <input type="text" placeholder="Uniq"  id="uniq" class="form-control hidden input-sm">
                </div>
                   

                <div class="form-group"></div>
                

                <div class="form-group">
                        <label class="col-sm-1 control-label" for="invno">Ref No</label>
                    <div class="col-sm-1">
                        <input type="text"  name="refno" id="refno" disabled class="form-control   input-sm"> 
                    </div>
                        <label class="col-sm-2 control-label" for="invno">Category Name</label>
                    <div class="col-sm-3"> 
                        <input type="text" id="category" name="category" class="form-control   input-sm" placeholder='Category Name'> 
                    </div>
                </div>

                <div class="form-group">
                    
                    <div class="col-sm-1"></div>
                    
                </div>

    <div id="itemdetails" >
        <div id="bank_table">
            <table class="table table-bordered" style='width:75%'>
                <tr class='info'>
                    <td width="12%">Category Code</td>
                    <td width="41%">Category Name</td>
                </tr>
                    <?php
                        $sql="select * from s_mas_category where CANCELL='0' order by ID DESC";  
                        foreach ($conn->query($sql) as $row) {
                           
                                echo "<tr>
                                    <td align=\"left\" onclick=\"stono('".$row['REFNO']."', '".$row['name']."');\">".$row["REFNO"]."</td>
                                    <td align=\"left\" onclick=\"stono('".$row['REFNO']."', '".$row['name']."');\">".$row["name"]."</td>
                                    ";
                            
                        }                 
                    ?>                            
            </table>
        </div>
    </div>


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

<script>new_inv();</script>