<?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";

$act  = $_REQUEST['act'];
	$id_orderform  = $_REQUEST['id_orderform'];
	$fetch = mysql_fetch_array(mysql_query("select * from orderform where id_orderform='$id_orderform'"));
	$id_orderform = $fetch['id_orderform'];
	$kode_orderform = $fetch['kode_orderform'];
	$details = $fetch['details'];
	$others_gold  = $fetch['others_gold'];
	$others_choice  = $fetch['others_choice'];
	$status = $fetch['status'];
	list($y, $m, $d)=split ("[-]",$fetch['orderform_date']);
	$orderform_date=$d."-".$m."-".$y;
	$description  = $fetch['description'];
	$id_branch  = $fetch['id_branch'];
	$picture = $fetch['picture'];
	$nama  = $fetch['nama'];
	$manufacture  = $fetch['manufacture'];
	$loc = "ORF/";
	$all = $loc.$picture; 
	?>
<body>
<?php include "include/head2.php"; ?>
<?php include "include/leftmenu.php"; ?>
<?php include "include/top.php"; ?>
  <h1><i class="icon-bar-chart"></i>Edit Order Form Progress</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=""  enctype="multipart/form-data" role="form" class="form-horizontal">
                        <div class="form-group">
                          <label class="col-md-4 control-label">Order Form ID</label>
                          <div class="col-md-8">
                            <input type="text" class="form-control" name="kode" id="kode"  value="<?php echo $kode_orderform; ?>"  readonly="readonly"  >
                          </div>
                        </div>
                         <div class="form-group">
                          <label class="col-md-4 control-label">Customer Name</label>
                          <div class="col-md-8">
                            <input type="text" class="form-control" name="nama" id="nama" value="<?php echo $nama; ?>" readonly  >
                          </div>
                        </div>
                   
                    <div class="form-group">
                          <label class="col-md-4 control-label">Order Form Date</label>
                          <div class="col-md-8">
                            <input type="text" class="inputDate" name="inputDate" id="inputDate" value="<?php echo $orderform_date; ?>" readonly>
                          </div>
                        </div>
                        
                        
                    <div class="form-group">
                          <label class="col-md-4 control-label">Manufacture</label>
                          <div class="col-md-8">
                           <input type="radio" name="manufacture" id="optionsRadios1" value="local" <?php if($manufacture == "local") {?> checked="checked" <?php } ?>>Local&nbsp;&nbsp;
                           <input type="radio" name="manufacture" id="optionsRadios1" value="overseas" <?php if($manufacture == "overseas") {?> checked="checked" <?php } ?>>Overseas
                          </div>
                        </div>
                          <div class="form-group">
                          <label class="col-md-4 control-label">Gold</label>
                          <div class="col-md-8">
                             <label class="checkbox-inline">
                            <?php $sss = mysql_query("select * from orderform_gold where kode_orderform='$kode_orderform' and gold='750 White Gold'"); 
							?> <input type="checkbox" name="gold[]" id="gold[]" value="750 White Gold"  <?php if(mysql_num_rows($sss) > 0) {?> checked="checked" <?php } ?> />750 White Gold
                             </label>
                             <label class="checkbox-inline">
                        <?php $sss1 = mysql_query("select * from orderform_gold where kode_orderform='$kode_orderform' and gold='750 Yellow Gold'"); ?>
                             <input type="checkbox" name="gold[]" id="gold[]" value="750 Yellow Gold" <?php if(mysql_num_rows($sss1) > 0) {?> checked="checked" <?php } ?> />750 Yellow Gold
                             </label>
                              <label class="checkbox-inline">
                              <?php $sss2 = mysql_query("select * from orderform_gold where kode_orderform='$kode_orderform' and gold='750 Rose Gold'");  ?>
                             <input type="checkbox" name="gold[]" id="gold[]" value="750 Rose Gold" <?php if(mysql_num_rows($sss2) > 0) {?> checked="checked" <?php } ?> />750 Rose Gold
                             </label>
                             </br> </br>
                              <label class="checkbox-inline">
                               <?php $sss3 = mysql_query("select * from orderform_gold where kode_orderform='$kode_orderform' and gold='others'"); ?>
                              <input type="checkbox" name="gold[]" id="gold[]" value="others" <?php if(mysql_num_rows($sss3) > 0) {?> checked="checked" <?php } ?>/>Others</label> <input type="text" name="others_gold" id="others_gold"  class="form-control"  value="<?php echo $others_gold; ?>" />
                              
                         
                          </div>
                        </div>
                          <div class="form-group">
                          <label class="col-md-4 control-label">Choice of order</label>
                          <div class="col-md-8">
                          <label class="checkbox-inline">
                          <?php $sss = mysql_query("select * from orderform_choice where kode_orderform='$kode_orderform' and choice='Ring'"); ?>
                          <input type="checkbox" name="choice[]" id="choice[]" value="Ring" <?php if(mysql_num_rows($sss) > 0) {?> checked="checked" <?php } ?> />Ring</label>
                           <label class="checkbox-inline"> <?php $sss1 = mysql_query("select * from orderform_choice where kode_orderform='$kode_orderform' and choice='Bracelet'"); ?>
                           <input type="checkbox" name="choice[]" id="choice[][]" value="Bracelet" <?php if(mysql_num_rows($sss1) > 0) {?> checked="checked" <?php } ?> />Bracelet</label>
                             <label class="checkbox-inline">
                             <?php $sss2 = mysql_query("select * from orderform_choice where kode_orderform='$kode_orderform' and choice='Bangle'"); ?>
                     <input type="checkbox" name="choice[]" id="choice[]" value="Bangle" <?php if(mysql_num_rows($sss2) > 0) {?> checked="checked" <?php } ?> />Bangle</label>
                            <label class="checkbox-inline"> 
                             <?php $sss3 = mysql_query("select * from orderform_choice where kode_orderform='$kode_orderform' and choice='Pendant'"); ?>
                 <input type="checkbox" name="choice[]" id="choice[]" value="Pendant" <?php if(mysql_num_rows($sss3) > 0) {?> checked="checked" <?php } ?> />Pendant</label>
                           <label class="checkbox-inline"> <?php $sss4 = mysql_query("select * from orderform_choice where kode_orderform='$kode_orderform' and choice='Earing'"); ?>
                           <input type="checkbox" name="choice[]" id="choice[]" value="Earing"  <?php if(mysql_num_rows($sss4) > 0) {?> checked="checked" <?php } ?> />Earing</label>
                             <label class="checkbox-inline">
                              <?php $sss5 = mysql_query("select * from orderform_choice where kode_orderform='$kode_orderform' and choice='Necklace'"); ?>
                             <input type="checkbox" name="choice[]" id="choice[]" value="Necklace"  <?php if(mysql_num_rows($sss5) > 0) {?> checked="checked" <?php } ?>/>Necklace</label>
                             </br> </br>
                             <label class="checkbox-inline"> 
                              <?php $sss6 = mysql_query("select * from orderform_choice where kode_orderform='$kode_orderform' and choice='others'"); ?>
                             <input type="checkbox" name="choice[]" id="choice[]" value="others" <?php if(mysql_num_rows($sss6) > 0) {?> checked="checked" <?php } ?>/>Measurement (Ring, Size, Cm for Necklace/Bangle/Bracelet) </label><input type="text" name="others_choice" id="others_choice" class="form-control" value="<?php echo $others_choice; ?>"  />
                          </div>
                          </div>
                          <div class="form-group">
                          <label class="col-md-4 control-label">Engraving Details</label>
                          <div class="col-md-8">
                           <textarea cols="80" rows="5" name="details" id="details" class="form-control" readonly><?php echo $details; ?></textarea>
                          </div>
                        </div>
                         <div class="form-group">
                          <label class="col-md-4 control-label">Description</label>
                          <div class="col-md-8">
                           <textarea cols="80" rows="5" name="description" id="description" class="form-control" readonly><?php echo $description; ?></textarea>
                          </div>
                        </div>
                        <div class="form-group">
                          <label class="col-md-4 control-label">Picture</label>
                          <div class="col-md-8">
                          <a class="image" href="ORF/<?php echo $picture; ?>">
							<img src="<?php echo $all; ?>" alt="" height="69" width="117"/></a>
                          </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='history_orderform.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>