|
Server IP : 82.112.239.40 / Your IP : 216.73.216.81 Web Server : LiteSpeed System : Linux in-mum-web1676.main-hosting.eu 5.14.0-503.38.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 18 08:52:10 EDT 2025 x86_64 User : u641149403 ( 641149403) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/u641149403/domains/uniformindia.co.in/public_html/admin/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
// start session
ob_start();
session_start();
// set time for session timeout
$currentTime = time() + 25200;
$expired = 3600;
// if session not set go to login page
if(!isset($_SESSION['user'])){
header("location:index.php");
}
// if current time is more than session timeout back to login page
if($currentTime > $_SESSION['timeout']){
session_destroy();
header("location:index.php");
}
// destroy previous session timeout and create new one
unset($_SESSION['timeout']);
$_SESSION['timeout'] = $currentTime + $expired;
?>
<?php include"header.php";?>
<html>
<head>
<title>Bardcode Generate | <?=$settings['app_name']?> - Dashboard</title>
</head>
</body>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<?php
include_once('includes/functions.php');
$function = new functions;
?>
<section class="content-header">
<h1>Generate Barcode </h1>
<ol class="breadcrumb">
<li><a href="home.php"><i class="fa fa-home"></i> Home</a></li>
</ol>
<hr />
</section>
<section class="content">
<div class="row">
<div class="col-md-6">
<?php if($permissions['categories']['create']==0) { ?>
<div class="alert alert-danger">You have no permission to create Barcode.</div>
<?php } ?>
<!-- general form elements -->
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Barcode Generate</h3>
</div><!-- /.box-header -->
<!-- form start -->
<form method="post"
enctype="multipart/form-data">
<div class="box-body">
<div class="form-group">
<label for="exampleInputEmail1">Search Barcode</label>
<select class="select form-control" name="barcode">
<option value="">--Search Barcode--</option>
<?php
if($permissions['categories']['read']==1){
$db->select('barcode','*',null);
$barcodes = $db->getResult();
foreach($barcodes as $barcode){
echo "<option value='".$barcode['code']."'>".$barcode['code']."</option>";
}
}
?>
</select>
</div>
<div class="form-group">
<input type="number" name="qty" value="1" class="form-control" required>
</div>
</div><!-- /.box-body -->
<div class="box-footer">
<button type="submit" class="btn btn-primary" name="generate">Generate Barcode</button>
</div>
</form>
</div><!-- /.box -->
<?php echo isset($error['check_permission']) ? $error['check_permission'] : '';?>
</div>
<div class="col-md-6">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Barcodes</h3>
</div>
<div class="row" id="printableArea">
<?php
if (!empty($_POST['barcode'])) {
$qty=$_POST['qty'];
for($i=0;$i<$qty;$i++){
$code=$_POST['barcode'];
?>
<span class="col-md-4">
<img src="barcode.php?codetype=code39&size=40&text=<?=$code;?>&print=true" class="w-100" style="margin-bottom: 20px;">
</span>
<?php } }else{
$qty=$_POST['qty'];
for($i=0;$i<$qty;$i++){
$code=rand();
$sql_query = $db->sql("INSERT INTO barcode (code) VALUES('$code')");
?>
<span class="col-md-4">
<img src="barcode.php?codetype=code39&size=40&text=<?=$code;?>&print=true" class="w-100" style="margin-bottom: 20px;">
</span>
<?php } } ?>
</div>
<?php if (isset($_POST['qty'])) { ?>
<div class="text-center" style="padding-bottom: 20px;">
<input type="button" onclick="printDiv('printableArea')" class="btn btn-primary" value="Print" />
</div>
<?php } ?>
</div>
</div>
</section>
<div class="separator"> </div>
<?php $db->disconnect(); ?>
</div><!-- /.content-wrapper -->
<script>
function printDiv(divName) {
var printContents = document.getElementById(divName).innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
}
</script>
</body>
</html>
<?php include"footer.php";?>