<?php
session_start();
if(!isset($_SESSION['LOGIN_STATUS']))
{
header('location:../index.php');
}
require "../model/configuration.php";
$rn=rand(100,115000);
$_SESSION['prms']=$rn;
$_SESSION['estimate']="Estimate";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title><?php echo $_SESSION['title'];?></title>
    <link rel='stylesheet' type='text/css' href='../css/fonts.googleapis.com/css_cd14c140.css' />
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" type="text/css" href="../vendor/bootstrap/css/bootstrap.min.css" />
    <!-- Theme CSS -->
    <link rel="stylesheet" type="text/css" href="../css/vendor.css" />
    <link rel="stylesheet" type="text/css" href="../css/theme.css" />
    <link rel="stylesheet" type="text/css" href="../css/utility.css" />
    <link rel="stylesheet" type="text/css" href="../css/custom.css" />
  </head>
  <body class="dashboard-page">
    <script> var boxtest = localStorage.getItem('boxed'); if (boxtest === 'true') {document.body.className+=' boxed-layout';} </script>
    <!-- Start: Theme Preview Pane -->
    <!-- Start: Header -->
    <header class="navbar navbar-fixed-top">
      
      <?php include_once("../include/top_menu.php");?>
    </header>
    <!-- Start: Main -->
    <div id="main">
      
      <!-- Start: Sidebar -->
      <?php include_once("../include/left_menu.php");?>
      <!-- Start: Content -->
      <section id="content_wrapper">
        <div id="topbar">
          <div class="topbar-left">
            <ol class="breadcrumb">
              <li class="crumb-icon"><a href="#"><span class="glyphicon glyphicon-home"></span></a></li>
              <li class="crumb-link"><a href="#">Salary</a></li>
              <li class="crumb-trail">Manage Salary</li>
            </ol>
          </div>
          
        </div>
        
        
        <div id="content">
          <div class="row">
            <div class="col-md-12">
              <div class="panel">
                <div class="panel-heading"> <span class="panel-title"> <span class="glyphicon glyphicon-lock"></span> Settings </span> </div>
                <div class="panel-body">
                  
                  <table class="table table-striped table-bordered table-hover">
                    <thead>
                      <tr>
                        <th>#</th>
                        <th>Name</th>
                        <th>Phone</th>
                        <th>Address</th>
                        <th>Daily Vages</th>
                        <th>Basic Salary</th>
                        
                        <th class="text-center hidden-xs">Actions</th>
                      </tr>
                    </thead>
                    <tbody>
                      <?php
                              $c=0;
                      $sqry=$db->execute("select * from staff_salary where delet='0'");
                              while($row=$sqry->fetch_assoc())
                              {
                                $c++;
                      $stff_qry=$db->execute("select * from staff where staff_id='".$row['staff_id']."' and delet='0'");
                      $stf_dtl=$stff_qry->fetch_assoc();
                      ?>
                      <form action="../controler/update_salary.php" method="POST">
                        <input type="hidden" name="sal_id" value="<?php echo $row['id']; ?>">
                        
                        <tr>
                          <td><?php echo $c ?></td>
                          <td><?php echo $stf_dtl['staff_name']; ?></td>
                          <td class="hidden-xs"><?php echo $stf_dtl['phone']; ?></td>
                          
                          <td class="hidden-xs"><?php echo $stf_dtl['stfaddress']; ?></td>
                          
                          <td class="hidden-xs"><input type="text" class="form-control" name="stff_vage" value="<?php echo $row['amount'];?>" /></td>
                          <td class="hidden-xs"><input type="text" class="form-control" name="stff_sal" value="<?php echo $row['basic_salary'];?>" /></td>
                          
                          
                          <td class="hidden-xs text-center"><input type="submit" name="update" value="Set Salary" /></td>
                        </tr>
                      </form>
                      <?php
                              }
                      ?>
                    </tbody>
                  </table>
                  
                </div>
              </div>
            </div>
            
            
          </div>
          
          <?php
          // $querycat=$db->execute("select * from category_table where id='".$row['cata_id']."' and machine_id='".$row['machine_id']."' and delet='0'");
          // $catresult=$querycat->fetch_assoc();
          //  echo $catresult['category'];?>
          
          
          
          
          
          
          
          
          <?php //include_once("dashboard_content.php");?>
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
        </div>
        
      </section>
      
      <!-- Start: Right Sidebar -->
      
    </div>
    <!-- End #Main -->
    <!-- jQuery -->
    <script type="text/javascript" src="../vendor/jquery/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="../vendor/jquery/jquery_ui/jquery-ui.min.js"></script> <!-- Bootstrap -->
    <script type="text/javascript" src="../vendor/bootstrap/js/bootstrap.min.js"></script>
    <!-- Page Plugins -->
    <script type="text/javascript" src="../vendor/plugins/validate/jquery.validate.js"></script>
    <script type="text/javascript" src="../vendor/plugins/morris/morris.js"></script>
    <script type="text/javascript" src="../vendor/plugins/datatables/js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="../vendor/plugins/datatables/js/datatables.js"></script>
    <script type="text/javascript" src="../vendor/plugins/multiselect/bootstrap-multiselect.js"></script>
    <script type="text/javascript" src="../vendor/plugins/jvectormap/jquery-jvectormap.min.js"></script>
    <script type="text/javascript" src="../vendor/plugins/jvectormap/assets/jquery-jvectormap-us-lcc-en.js"></script>
    <script type="text/javascript" src="../vendor/plugins/clndr/clndr.js"></script>
    <script type="text/javascript" src="../vendor/plugins/clndr/moment.js"></script>
    <script type="text/javascript" src="../vendor/plugins/datepicker/bootstrap-datepicker.js"></script>
    <script type="text/javascript" src="../vendor/plugins/jquerymask/jquery.maskedinput.min.js"></script>
    <!-- Flot Plugins -->
    <script type="text/javascript" src="../vendor/plugins/jqueryflot/jquery.flot.min.js"></script>
    <!-- Theme Javascript -->
    <script type="text/javascript" src="../js/utility/spin.min.js"></script>
    <script type="text/javascript" src="../js/utility/underscore-min.js"></script>
    <script type="text/javascript" src="../js/main.js"></script>
    <script type="text/javascript" src="../js/ajax.js"></script>
    <script type="text/javascript" src="../js/custom.js"></script>
  </body>
</html>