<?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"><b>Change Password</b></h3>
        </div>
        <form name= "form1" role="form" class="form-horizontal">

            <div class="box-body">

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

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


                <div class="form-group">

                    <a onclick="newent();" 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; Update
                    </a>

                </div>

                <div id="msg_box"  class="span12 text-center"  >
                </div>
                <input type="hidden"  id="tmpno" >

                <div class="form-group">
                    <label class="col-sm-2 control-label">User Name</label>
                    <div class="col-sm-2">
                        <select id="user_name"  class="form-control input-sm" >
                        
                        <?php
                            if(strtolower($_SESSION['CURRENT_USER'])=="admin"){
                                 $sql="select * from a_user_mast_acc  ";
                            }else{
                                 $sql="select * from a_user_mast_acc where  user_name='".$_SESSION['CURRENT_USER']."'  ";
                            }
                        
                           
                            foreach ($conn->query($sql) as $row) {
                                echo "<option value='".$row["user_name"]."'>".$row["user_name"]."  </option>";
                            }
                        
                        
                        ?>
                    </select>
                    
                        
                    </div>
                </div>
                
                 <div class="form-group">
                    <label class="col-sm-2 control-label" for="txt_password">New Password</label>
                    <div class="col-sm-2">
                        <input type="text" placeholder="Password" id="user_pass" class="form-control">

                    </div>
                </div>

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

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

