<?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'];
	$kode = $_REQUEST['kode'];
	
	?>
<body>
<?php include "include/head2.php"; ?>
<?php include "include/leftmenu.php"; ?>
<?php include "include/top.php"; ?>
  <h1><i class="icon-bar-chart"></i> Reprint Barcode</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="reprint_barcode.php" role="form" class="form-horizontal">
                        <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" >
                          </div>
                        </div>
                      
                        <div class="form-group">
                          <div class="col-md-offset-4 col-md-8">
                            <button type="submit" class="btn btn-default">Submit</button>
                            <button type="reset" class="btn btn-default">Reset</button>
                          </div>
                        </div>
                      </form>
                      <?php if($kode <> "") { ?>
                        <table class="table table-striped table-bordered table-hover">
                  <thead>
                    <tr>
                      	<th>Kode Stock</th>
                            <th>Barcode No.</th>
                            <th>Details</th>
                    </tr>
                  </thead>
                  <tbody>
                  <?php
						
						$sql = mysql_query("select * from (select kode_stock,barcodeno,description,weight,rapprice as cbprice,lbprice from inventory_diamond where status_stock=1
						union all
						select kode_stock,barcodeno,description,weight,cbprice,'0' as lbprice from inventory_gold where status_stock=1 
						union all
						select kode_stock,barcodeno,description,weight,cbprice,'0' as lbprice from inventory_logam where status_stock=1 
						union all
						select kode_stock,barcodeno,description,weight,cbprice,lbprice from inventory_readyitem where status_stock=1 
						 union all
									  select kode_stock,barcodeno,description,weight,cbprice,lbprice from  inventory_cincin  where status_stock=1 							
									  union all
									  select kode_stock,barcodeno,description,weight,cbprice,lbprice from  inventory_mastura  where status_stock=1
									   union all
									  select kode_stock,barcodeno,description,weight,cbprice,lbprice from  inventory_liontin  where  status_stock=1
									  union all
									  select kode_stock,barcodeno,description,weight,cbprice,lbprice from  inventory_kerabu  where status_stock=1
									  union all
										select kode_stock,barcodeno,description,weight,cbprice,lbprice from  inventory_gkgr  where status_stock=1
									  union all
									  select kode_stock,barcodeno,description,weight,cbprice,lbprice from  inventory_rangka  where status_stock=1) a where kode_stock like '%$kode%' order by kode_stock");
						while($fetch = mysql_fetch_array($sql))
						{
								$kode_stock = $fetch['kode_stock'];
								$barcodeno = $fetch['barcodeno'];
								$cbprice = $fetch['cbprice'];
								$lbprice = $fetch['lbprice'];
								$weight = $fetch['weight'];
								$description = $fetch['description'];
					?>
                        <tr class="gradeX">
                          <td><?php echo $kode_stock; ?></td>
                          <td align="left"><?php echo $barcodeno; ?></td>
                         <td align="center"><a href="printfont.php?barcodeno=<?php echo $barcodeno; ?>&cbprice=<?php echo $cbprice; ?>&lbprice=<?php echo $lbprice; ?>&weight=<?php echo $weight; ?>&description=<?php echo $description; ?>" class="edit">Print</a>                        
</td>
                       </tr>
                       <?php
						}
						
						?>
                  </tbody>
                </table>
                <?php
					  }
					  ?>
                    </div>
                    </div>
                    </div>
                    </div>
                    </div>
                   

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

</html>