<?php
session_name("AUTHENUSER");
session_start();
$USERNAME = $_SESSION['SES_USERNAME'];
if(!session_name("AUTHENUSER"))
	{
?>
						<script language="javascript">
						 alert("Waktu Login telah habis.Silahkan Login Kembali");
						document.location="index.php";
						</script>
<?php
	}
if(!$USERNAME)
	{
?>
						<script language="javascript">
						 alert("Harap Login Dahulu.");
						document.location="index.php";
						</script>
<?php
	}
	?>
	<?php 
	include "common/config.php";
	include "include/head.php";
	?>
<?php
	$act  = $_REQUEST['act'];
	$id_returnsales  = $_REQUEST['id_returnsales'];
	$fetch  = mysql_fetch_array(mysql_query("select * from return_sales where id_returnsales = '$id_returnsales'"));
	$kode_returnsales = $fetch['kode_returnsales'];
	$inventory = $fetch['inventory'];
	list($y, $m, $d)=split ("[-]",$fetch['date_returnsales']);
	$date_returnsales=$d."-".$m."-".$y;
	$inventory = $fetch['inventory'];
	$kode_stock = $fetch['kode_stock'];
	$status_sales = $fetch['status_sales'];
	$id_customer = $fetch['id_customer'];
	$hargaterima = $fetch['hargaterima'];
	?>
<body>
<?php include "include/head2.php"; ?>
<?php include "include/leftmenu.php"; ?>
<?php include "include/top.php"; ?>
  <h1><i class="icon-bar-chart"></i> View Return Sales</h1>
</div>

<!--<ol class="breadcrumb">
  <li><a href="#">Home</a></li>
  <li><a href="#">Bread</a></li>
  <li><a href="#">Crumbs</a></li>
  <li class="active">Example</li>
</ol>-->
          <div class="main-content">
            <div class="row">
                <div class="widget">
                  <div class="widget-content-white glossed">
                    <div class="padded">
                      <form method="post" action="" role="form" class="form-horizontal">
                        <div class="form-group">
                          <label class="col-md-4 control-label">Kode Return Sales</label>
                          <div class="col-md-8">
                            <input type="text" class="form-control" name="kode" id="kode" value="<?php echo $kode_returnsales; ?>"  readonly="readonly" >
                          </div>
                        </div>
                         <div class="form-group">
                          <label class="col-md-4 control-label">Return Sales Date</label>
                          <div class="col-md-8">
                            <input type="text" class="inputDate" name="inputDate" id="inputDate" value="<?php echo $date_returnsales; ?>" readonly="readonly" >
                          </div>
                        </div>
                         <div class="form-group">
                          <label class="col-md-4 control-label">Inventory</label>
                          <div class="col-md-8">
                            <select name="inventory" id="inventory"  class="form-control">
                              <option value="Diamond" <?php if($inventory == "Diamond") { ?> selected="selected" <?php } ?>>Diamond</option>
                              <option value="Gold" <?php if($inventory == "Gold") { ?> selected="selected" <?php } ?>>Gold</option>
                              <option value="LogamMulia" <?php if($inventory == "LogamMulia") { ?> selected="selected" <?php } ?>>LogamMulia</option>
                               <option value="ReadyItem" <?php if($inventory == "ReadyItem") { ?> selected="selected" <?php } ?>>ReadyItem</option>
                              <option value="Services" <?php if($inventory == "Services") { ?> selected="selected" <?php } ?>>Services</option>
                               <option value="Cincin" <?php if($inventory == "Cincin") { ?> selected="selected" <?php } ?>>Cincin</option>
                           <option value="Mastura" <?php if($inventory == "Mastura") { ?> selected="selected" <?php } ?>>Mastura</option>
                           <option value="Liontin" <?php if($inventory == "Liontin") { ?> selected="selected" <?php } ?>>Liontin</option>
                            <option value="Kerabu" <?php if($inventory == "Kerabu") { ?> selected="selected" <?php } ?>>Kerabu</option>
                           <option value="GKGR" <?php if($inventory == "GKGR") { ?> selected="selected" <?php } ?>>Gelang Kaku Gelang Rantai</option>
                           <option value="Rangka" <?php if($inventory == "Rangka") { ?> selected="selected" <?php } ?>>Rangka</option>
                            </select>
                          </div>
                        </div>
                    <div class="form-group">
                          <label class="col-md-4 control-label">Kode Customer - Nama Customer</label>
                          <div class="col-md-8">
                            <select class="form-control"  name="customer" id="customer">
                             <?php
                                              $sql3 = "select * from tbl_customer where status_customer=1 and id_customer = '$id_customer'  order by nama_customer";
                                              $rs3 = mysql_query($sql3);
                                              while($fetch3 = mysql_fetch_array($rs3))
                                              {
                                               ?>
                                        <option value="<?php echo $fetch3['id_customer']; ?>"><?php echo  $fetch3['kode_customer'];  ?> - <?php echo  $fetch3['nama_customer'];  ?></option>
                                                      <?php
                                              }
                                             ?>
                            </select>
                          </div>
                        </div>
                          <div class="form-group">
                          <label class="col-md-4 control-label">Kode Stock</label>
                          <div class="col-md-8">
                          <input type="text" class="form-control" name="kode" id="kode" value="<?php echo $kode_stock; ?>"  readonly="readonly" >
                          </div>
                        </div>
                         <div class="form-group">
                          <label class="col-md-4 control-label">Harga Return Sales</label>
                          <div class="col-md-8">
                            <input type="text" class="form-control" name="harga" id="harga" value="<?php  echo number_format($hargaterima, 0, ',', ','); ?>"  readonly="readonly" >
                          </div>
                        </div>
                        <div class="form-group">
                          <div class="col-md-offset-4 col-md-8">
                             <button type="reset" class="btn btn-default" onClick="document.location='return_sales.php'" >Back</button>
                          </div>
                        </div>
                      </form>
                    </div>
                    </div>
                    </div>
                    </div>
                    </div>
                   

<?php include "include/foot.php"; ?>
<script src='assets/js/for_pages/dashboard.js'></script>
</body>
</html>