<?php
session_start();
include './connection_sql.php';
if ($_SESSION["CURRENT_USER"] == "") { 
    exit('Please Logging Again..');
} 
if ($_SESSION['company'] == "") { 
    exit('Please Logging Again..');
} 
?>
<section class="content">

    <div class="box box-primary">
        <div class="box-header with-border">
            <h3 class="box-title">New User</h3>
        </div>
        <form role="form" class="form-horizontal">
            <div class="box-body">

                <div class="form-group">
                    <a onclick="location.reload();" 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>
                     
                </div>
                
                <div id="msg_box"  class="span12 text-center"  >

                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="txt_usernm">User Name</label>
                    <div class="col-sm-3">
                        <input type="text" placeholder="Name" id="user_name" class="form-control">
                    </div>
                </div>
                
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="txt_usernm">User Level</label>
                    <div class="col-sm-3">
                        <select id="user_level"  class="form-control input-sm" >
                            <option value='0'>User</option> 
                            <option value='1'>Admin</option>
                    </select>
                    </div>
                </div>
                
                  
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="txt_usernm">User Company</label>
                    <div class="col-sm-3">
                        <select id="user_company"  class="form-control input-sm" >
                        
                        <?php
                            
                             $sql="select * from a_dep_mas "; 
                            foreach ($conn->query($sql) as $row) {
                                echo "<option value='".$row["COMCODE"]."'>".$row["COMCODE"]."-".$row["COMPANY"]."  </option>";
                            }
                        
                        
                        ?>
                    </select>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="txt_password">Password</label>
                    <div class="col-sm-3">
                        <input type="password" placeholder="Password" id="pass1" class="form-control">

                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="txt_password1">Confirm Password</label>
                    <div class="col-sm-3">
                        <input type="password" placeholder="Password" id="pass2" class="form-control">
                    </div>
                </div>			

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

</section>

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