<!DOCTYPE html>

<?php 
	session_start();
	@ob_start();
	include "../../config/koneksi.php";
	include "../../config/fungsi_rupiah.php";
	include "../head.php";

	
	if ($_SESSION['nama'] == ''){
		header('Location:index.php');
	}
	else{
?>
<html>

  <body class="hold-transition skin-blue sidebar-mini layout-boxed">
    <div class="wrapper">
		<?php include "../header.php";?>
      
		<?php include "../menu.php";?>
      

      <!-- Content Wrapper. Contains page content -->
      <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
            Edit User AUTH
          </h1>
          <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
            <li><a href="#">User</a></li>
            <li class="active">Edit User Auth</li>
          </ol>
        </section>

        <!-- Main content -->
        <section class="content">
          <div class="row">
            <div class="col-xs-12">
              
              <div class="box">

                <div class="box-body">
					<div class="col-md-6">
					  <!-- Horizontal Form -->
					  <div class="box box-info">
						<div class="box-header with-border">
						  <h3 class="box-title">
						  <?php
							$id = $_GET[id];
							$auth = $_GET[auth];
							$username = mysql_result(mysql_query("select userid from admins where pk = $id"),0);
							$modul = mysql_result(mysql_query("select modul from modul where pk = $auth"),0);
							echo"	<table>
										<tr>
											<td>User </td><td> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td><b>$username</b></td>
										</tr>
										<tr>
											<td>Modul </td><td> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td><b>$modul</b></td>
										</tr>
									</table>";
						  ?>
						  </h3>
						</div><!-- /.box-header -->
						<!-- form start -->
						<?php echo"
						<form name=form method=POST action='aksicust.php?id=$id&auth=$auth&module=user&act=editauth' class='form-horizontal'>"; ?>
						  <div class="box-body">
													
							
							<div class="form-group">
							  <label>Add</label>									
									<select name="xadd"  class="form-control">
									<?php
										$add = mysql_result(mysql_query("select xadd from admindetail where user = $id and modul = $auth"),0);
										echo"<option value = '$add'>$add</option>";
									?>
									<option value = 'Y'>Y</option>
									<option value = 'N'>N</option>
								</select>
							</div>
							
							<div class="form-group">
							  <label>Edit</label>									
									<select name="xedit"  class="form-control">
									<?php
										$xedit = mysql_result(mysql_query("select xedit from admindetail where user = $id and modul = $auth"),0);
										echo"<option value = '$xedit'>$xedit</option>";
									?>
									<option value = 'Y'>Y</option>
									<option value = 'N'>N</option>
								</select>
							</div>
							
							<div class="form-group">
							  <label>View</label>									
									<select name="xview"  class="form-control">
									<?php
										$xview = mysql_result(mysql_query("select xview from admindetail where user = $id and modul = $auth"),0);
										echo"<option value = '$xview'>$xview</option>";
									?>
									<option value = 'Y'>Y</option>
									<option value = 'N'>N</option>
								</select>
							</div>
							
							<div class="form-group">
							  <label>Delete</label>									
									<select name="xdelete"  class="form-control">
									<?php
										$xdelete = mysql_result(mysql_query("select xdelete from admindetail where user = $id and modul = $auth"),0);
										echo"<option value = '$xdelete'>$xdelete</option>";
									?>
									<option value = 'Y'>Y</option>
									<option value = 'N'>N</option>
								</select>
							</div>
							
							<div class="form-group">
							  <label>Print</label>									
									<select name="xprint"  class="form-control">
									<?php
										$xprint = mysql_result(mysql_query("select xprint from admindetail where user = $id and modul = $auth"),0);
										echo"<option value = '$xprint'>$xprint</option>";
									?>
									<option value = 'Y'>Y</option>
									<option value = 'N'>N</option>
								</select>
							</div>
							
							<div class="form-group">
							  <label>Valid</label>									
									<select name="xvalid"  class="form-control">
									<?php
										$xvalid = mysql_result(mysql_query("select xvalid from admindetail where user = $id and modul = $auth"),0);
										echo"<option value = '$xvalid'>$xvalid</option>";
									?>
									<option value = 'Y'>Y</option>
									<option value = 'N'>N</option>
								</select>
							</div>


							<button type="submit" class="btn btn-info">Update</button>
							
						  </div><!-- /.box-body -->
						<?php echo"  
						</form>";?>
					  </div><!-- /.box -->

					  
					 </div><!-- /.box -->
					</div><!--/.col (right) -->
                </div><!-- /.box-body -->
              </div><!-- /.box -->
            </div><!-- /.col -->
          </div><!-- /.row -->
        </section><!-- /.content -->
      </div><!-- /.content-wrapper -->
		<?php include "../footer.php";?>
		

      <!-- Control Sidebar -->
      <aside class="control-sidebar control-sidebar-dark">

        <!-- Tab panes -->
        <div class="tab-content">
          <!-- Home tab content -->
          <div class="tab-pane" id="control-sidebar-home-tab">

          </div><!-- /.tab-pane -->

        </div>
      </aside><!-- /.control-sidebar -->
      <!-- Add the sidebar's background. This div must be placed
           immediately after the control sidebar -->
      <div class="control-sidebar-bg"></div>
    </div><!-- ./wrapper -->

    <!-- jQuery 2.1.4 -->
    <script src="../../plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <!-- Bootstrap 3.3.5 -->
    <script src="../../bootstrap/js/bootstrap.min.js"></script>
    <!-- DataTables -->
    <script src="../../plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="../../plugins/datatables/dataTables.bootstrap.min.js"></script>
    <!-- SlimScroll -->
    <script src="../../plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <!-- FastClick -->
    <script src="../../plugins/fastclick/fastclick.min.js"></script>
    <!-- AdminLTE App -->
    <script src="../../dist/js/app.min.js"></script>
    <!-- AdminLTE for demo purposes -->
    <script src="../../dist/js/demo.js"></script>
    <!-- page script -->
    <script>
      $(function () {
        $("#example1").DataTable();
        $('#example2').DataTable({
          "paging": true,
          "lengthChange": false,
          "searching": false,
          "ordering": true,
          "info": true,
          "autoWidth": false
        });
      });
    </script>
  </body>
</html>
<?php 
	}
?>