Source Coode
Source Coode
Source Coode
php }
else
<?php {
function redirect($url){
echo("<meta http-equiv='refresh' $_SESSION['manager']=$username;
content='0;".$url."' />"); $_SESSION['admin_id'] =
} $admin_id;
?>
<?php $_SESSION['admin_branch_idr'] =
include ("functions/fn_connect.php"); $admin_branch_idr;
include ("functions/fn_main.php"); //echo 'test';
$detail_query = select_db("tbl_detail", '*', //echo $admin_branch_idr;
"","(id=1)",2); $session_id = session_id();
$details = mysqli_fetch_array($detail_query); $location_str =
$details["base_url_str"]."admin/index.php?
$error =''; session_id=".$session_id;
$error2=''; //echo $location_str;
session_start(); redirect($location_str);
if (isset($_POST['login'])) exit();
{ }
$username = }
addslashes(strip_tags($_POST['username'])); }
$password = else
addslashes(strip_tags($_POST['password'])); {
if ($username&&$password) $error = '<div class="alert alert-error bg-
{ danger"><span class="mif-blocked mif-ani-
$login = mysqli_query($con,"SELECT * horizontal mif-ani-slow mif-2x"> </span> That
FROM tbl_admin WHERE user doesnt exist!</div>';
username_str='$username'");
if (mysqli_num_rows($login)!=0) }
{ }
//code to login else
while ($row = $error = '<div class="alert alert-error bg-
mysqli_fetch_assoc($login)) danger"><span class="mif-pencil mif-ani-float
{ mif-ani-fast mif-2x"> </span> Please enter a
$dbpassword = $row username and password</div>';
['password_psw']; }
$admin_id = $row["id"]; ?>
$admin_branch_idr = <?php
$row["branch_idr"]; $detail_query = select_db("tbl_detail", '*',
//$password = "","(id=1)",2);
md5($password); $details = mysqli_fetch_array($detail_query);
if ($password != ?>
$dbpassword) <!DOCTYPE html>
{ <html lang="en">
$error = '<div <head>
class="alert alert-error fg-crimson bg- <meta charset="utf-8">
danger"><span class="mif-warning mif-ani- <meta http-equiv="X-UA-Compatible"
flash mif-ani-slow mif-2x"></span> Incorrect content="IE=edge">
username or password</div>';
<meta name="viewport" <div class="form-group">
content="width=device-width, initial-scale=1, <label
shrink-to-fit=no"> for="exampleInputPassword1">Password</lab
<meta name="description" content=""> el>
<meta name="author" content=""> <input class="form-control"
<title><?=$details["website_name_str"];?> - name="password"
Admin Login</title> id="exampleInputPassword1" type="password"
<link rel="icon" type="image/png" href="<? placeholder="Password">
=$details["base_url_str"]? </div>
>admin/uploads/favicon/<?php echo <input type="submit" name="login"
$details["favicon_img"]; ?>"> class="form-control btn-info" value="Login">
</form>
<!-- Custom fonts for this template--> </div>
<link href="vendor/font-awesome/css/font- </div>
awesome.min.css" rel="stylesheet"
type="text/css"> </div>
<!-- Custom styles for this template--> <script
<link href="css/sb-admin.css" src="vendor/jquery/jquery.min.js"></script>
rel="stylesheet">
<link href="css/style.css" rel="stylesheet"> <!-- Core plugin JavaScript-->
</head> <script src="vendor/jquery-
<body id="login" class="bg-dark-brown" easing/jquery.easing.min.js"></script>
style="background-size:cover !
important;background:url('<? </body>
=$details["base_url_str"];?
>admin/uploads/bg/<?=$details["bg_img"];? </html>
>');">
<div class="container"> Index.php
<div class="card text-center bg-dark-50 card-
login mx-auto mt-5"> <?php include ("functions/fn_connect.php");?>
<div class="card-header bg-dark-50"> <?php include ("functions/fn_main.php");?>
<div class="img-container"> <?php include ("excel/php-excel-
<img src="<?=$details["base_url_str"];? reader/excel_reader2.php");?>
>admin/uploads/logo/<? <?php include
=$details["logo_img"];?>"> ("excel/SpreadsheetReader.php");?>
</div>
<?=$details["website_name_str"];?> - <?php
Admin Login header("Expires: Tue, 01 Jan 2000 00:00:00
GMT");
</div> header("Last-Modified: " . gmdate("D, d M Y
<?php echo $error; ?> H:i:s") . " GMT");
<div class="card-body"> header("Cache-Control: no-store, no-cache,
<form method="post"> must-revalidate, max-age=0");
<div class="form-group"> header("Cache-Control: post-check=0, pre-
<label check=0", false);
for="exampleInputEmail1">Username</label> header("Pragma: no-cache");
<input class="form-control" header('content-type:text/html;charset=utf-8');
name="username" id="exampleInputEmail1" $detail_query = select_db("tbl_detail", '*',
type="text" aria-describedby="emailHelp" "","(id=1)",2);
placeholder="Enter Username"> $details = mysqli_fetch_array($detail_query);
</div>
$logged_in = loggedin("manager"); }
if($logged_in == FALSE){
//header("Location: login.php"); if(isset($_GET["table"]))
session_start(); {
session_destroy(); $id = 0;
redirect("logout.php"); if(isset($_GET["id"]))
//redirect("login.php");//echo 'RESULT 1'; {
}else{ $id = $_GET["id"];
}
$current_user = $_SESSION["manager"]; $table = $_GET["table"];
$table_name = "tbl_" . $_GET["table"];
$count = }
get_value_condition("count(*)","tbl_admin","( ?>
username_str='$current_user')"); <?php
if(isset($_GET["table"])&&isset($_GET["id"])
if($count >=1){ &&isset($_GET["yes"])&&isset($_GET["delet
$admin_query = e"]))
select_db("tbl_admin", '*', {
"","(username_str='$current_user')",2);
$admin = $tb_name = $_GET["table"];
mysqli_fetch_array($admin_query); //echo $tb_name;
$admin_type_idr =
$admin["admin_type_idr"]; $table = "tbl_" . strtolower($_GET["table"]);
$admin_id = $admin["id"]; $del_id = $_GET["id"];
$admin_branch_idr = $del_query = delete_db($table,"id = ".
$admin["branch_idr"]; $_GET["id"],2);
}else{ redirect('index.php?table='.
session_start(); $_GET["table"]."&status=deleted");
session_destroy();
redirect("logout.php"); }
?>
//redirect("login.php"); <!DOCTYPE html>
//echo 'RESULT 2'; <html lang="en"><head>
} <meta charset="UTF-8">
} <meta http-equiv="X-UA-Compatible"
content="IE=edge">
function redirect($url){ <meta name="viewport"
content="width=device-width, initial-scale=1,
echo("<meta http-equiv='refresh' shrink-to-fit=no">
content='0;".$url."' />"); <meta name="description" content="">
} <meta name="author" content="">
if(isset($_GET["table"])){ <title><?=$details["website_name_str"];?> -
if(isset($_GET["notif_id"])){ Admin</title>
$notif_id = $_GET["notif_id"]; <link rel="icon" type="image/png" href="<?
=$details["base_url_str"]?
>admin/uploads/favicon/<?php echo
update_db("tbl_admin_notifications","viewed_ $details["favicon_img"]; ?>">
bol = 1","id=$notif_id",2);
} <!-- Custom fonts for this template-->
<link href="vendor/font-awesome/css/font- <li id="logo" class="nav-logo" data-
awesome.min.css" rel="stylesheet" placement="right" title="Dashboard">
type="text/css"> <a class="nav-link" href="index.php">
<!-- Page level plugin CSS--> <span class="nav-link-text"><img
src="<?=$details["base_url_str"]?
>admin/uploads/logo/<?php echo
<!-- Custom styles for this template--> $details["logo_img"]; ?>" alt=""/></span>
<link href="css/sb-admin.css" </a>
rel="stylesheet"> <div class="system-title"> <?
<link rel="stylesheet" type="text/css" =$details["website_name_str"]?></div>
href="css/style.css"> </li>
<link rel="stylesheet" type="text/css" </ul>
href="css/help.css"> <ul class="navbar-nav ml-auto nav-right">
<li class="nav-user"><a
<link rel="stylesheet" type="text/css" href="index.php?profile"><?
href="css/responsive.css"> =$_SESSION["manager"];?></a></li>
<link rel="stylesheet" type="text/css" <li class="notif-area">
href="css/jquery.autocomplete.css"> <a href="#" class="nav-link" data-
<script src="js/jquery-3.3.1.min.js"></script> target="#notifications" data-toggle="collapse">
<i class="fa fa-fw fa-bell"></i>
<style> <?php
.table-title, .form-container h2{ if(!isset($admin_id)){
border-bottom:solid 2px <? $admin_id = 0;
=$details["primary_col"];?>; }
} $notifs_query =
</style> select_db("tbl_admin_notifications","*","","ad
</head> min_idr = ".$admin_id." AND
viewed_bol=0",2);
<body class="fixed-nav sticky-footer bg-dark" $notifs_count = 0;
id="page-top"> $notifs_count =
mysqli_num_rows($notifs_query);
$notifs_query =
<div class="app"> select_db("tbl_admin_notifications","*","","ad
<!-- Navigation--> min_idr = ".$admin_id." AND viewed_bol=0
<nav class="navbar navbar-expand-lg fixed- ORDER BY id DESC LIMIT 5",2);
top" id="mainNav" style="background:<?
=$details["primary_col"];?>"> ?>
<button class="navbar-toggler navbar- <div class="notif-span"><?
toggler-right" type="button" data- =$notifs_count?></div>
toggle="collapse" data- </a>
target="#navbarResponsive" aria-
controls="navbarResponsive" aria- <div id="notifications" class="collapse">
expanded="false" aria-label="Toggle <?php
navigation"> if($notifs_count ==
<span class="navbar-toggler-icon"></span> 0){
</button> echo
<div class="collapse navbar-collapse" '<div>No new notifications</div>';
id="navbarResponsive"> }else{
<ul class="navbar-nav navbar-topnav" //echo
id="exampleAccordion"> mysqli_num_rows($notifs_query);
while($notifs = $group_arr = "0";
mysqli_fetch_array( $notifs_query )){ }
$admin_groups = str_replace('-',',',
$table_name = $group_arr);
get_value_condition("display_name_str","tbl_t if(!isset($admin_groups) || $admin_groups
able","id=".$notifs["table_idr"]); == ""){
$admin_groups = "0";
$table_name = str_replace("tbl_","", }
$table_name); $load_tablesq = select_db("tbl_group", '*',
?> "","id IN (".$admin_groups.") ORDER BY
display_name_str ASC",2);
<a class="notifs" href="<? //echo $load_tablesq;
=$details["base_url_str"]?>index.php?table=<?
=$table_name?>¬if_id=<?=$notifs["id"]? while($groups =
>"><?=$notifs["display_name_str"]?> - <? mysqli_fetch_array($load_tablesq))
=$notifs["notification_str"];?></a> {
<? $group_name =
php $groups["display_name_str"];
} $group_display_name =
} str_replace("tbl_","",$group_name);
?> $group_display_name =
</div> ucwords($group_display_name);
$new_group_display_name =
</li> $group_display_name;
<li class="nav-item"> ?>
<a href="logout.php" class="nav-link" <li id="nav-<?php echo
data-toggle="modal" data- $new_group_display_name; ?>" class="nav-
target="#exampleModal"> item group<?=$groups["id"]?>" data-
<i class="fa fa-fw fa-sign- placement="right" title="<?php echo
out"></i>Logout</a> $new_group_display_name; ?>">
</li> <a class="nav-link nav-link-collapse
</ul> collapsed" data-toggle="collapse" href="#<?
</div> php echo $new_group_display_name; ?>" data-
</nav> parent="#exampleAccordion">
<i class="fa fa-fw <?
<div class="sidebar"> =$groups["fa_icon_str"]?>"></i>
<div class="btn btn-toggler"><i class="fa <span class="nav-link-text"><?php
fa-list"></i></div> echo $new_group_display_name; ?></span>
<div class="sb-navs" style="background:<? </a>
=$details["secondary_col"];?>">
<a class="nav-link" href="<?
=$details["base_url_str"];?>admin/index.php"> <ul class="topnav-second-level collapse"
<i class="fa fa-fw fa-dashboard"></i> id="<?php echo $new_group_display_name; ?
Dashboard >">
</a> <?php if($groups["id"]==11){ ?>
<?php <a href="index.php?walkin">
$group_arr = <li>
get_value_condition("group_arr","tbl_admin_ty Walk-in Ordering
pe","(id = " . $admin["admin_type_idr"].")"); </li>
if(!isset($group_arr)){ </a>
<?php
}
$load_tables = select_db("tbl_table", '*', </ul>
"","(group_idr=".$groups["id"].") ORDER BY </li>
title_str ASC",2); <?php
while($tables = }
mysqli_fetch_array($load_tables)) ?>
{
$tablesq_name = </div>
$tables["display_name_str"];
$display_name = </div>
str_replace("tbl_","",$tablesq_name); <div class="content-wrapper <?=!
$display_name = isset($_GET["id"])?"mtbl-cont":""?>">
ucwords($display_name); <div class="container-fluid pad-0">
$new_displayname = <?php include ("include/status.php");?>
pluralize($display_name); <?php
if(isset($_GET["max"])){
echo
?> compute_total($_GET["max"]);
<a href="index.php?table=<?php }
echo strtolower($display_name); ?>"> function compute_total($max){
<li> $total = 0;
<?=$tables["title_str"]?> for($x = 1; $x <=$max;$x++){
</li> $total = $total + $x;
</a> }
<?php return $total;
} }
if(isset($_GET["table"]))
{
$load_reports =
select_db("tbl_admin_reports", '*',
"","(group_idr=".$groups["id"]." AND if(isset($_GET["table"])&&isset($_GET["new"
admin_type_arr LIKE '%". ]))
$admin_type_idr."%' ) ORDER BY {
display_name_str ASC",2); include
//echo $load_reports; ("include/table_form.php");
while($reports = }
mysqli_fetch_array($load_reports)) else
{ if(isset($_GET["id"])&&isset($_GET["update"
$report_id = $reports["id"]; ]))
?> {
<a href="index.php?report=<?php include
echo strtolower($report_id); ?>"> ("include/table_form.php");
<li> }
<?=$reports["display_name_str"]? else
> if(isset($_GET["id"])&&isset($_GET["view"])
</li> )
</a> {
<?php include
} ("include/table_view.php");
?> }
else $group_display_name =
{ str_replace("tbl_","",$group_name);
include $group_display_name =
("include/table_table.php"); ucwords($group_display_name);
} $new_group_display_name
} = $group_display_name;
else if(isset($_GET["help"])){ // returns "s"
include ("include/help.php"); ?>
} <div class="dashboard-containers">
else if(isset($_GET["excel"])){ <div class="card text-center
include ("include/excel.php"); shadow">
} <div class="card-header gray-5"
else if(isset($_GET["report"])){ style="background:<?
include =$groups["dashboard_col"];?>"><i class="fa
("include/reports.php"); <?=$groups["fa_icon_str"]?>"></i> <?php
} echo $new_group_display_name; ?></div>
else if(isset($_GET["profile"])){ <div class="w-100 gray-3 p-1 text-
include white">
("include/profile.php"); <p><?=$groups["description_lng"]?
}else if(isset($_GET["walkin"])){ ></p>
include </div>
("include/walkin.php"); <div class="card-body">
} <?php
else{ if($groups["id"]==10){
$group_arr = ?>
get_value_condition("group_arr","tbl_admin_ty <a class="btn gray-2 text-white pull-
pe","(id = " . $admin["admin_type_idr"].")"); left" href="?table=products"> Critical Stocks :
$admin_groups = str_replace('-',',', <?
$group_arr); =count_con("tbl_products","stocks_int<=25")?
echo '<h2 class="title"><i class="fa ></a>
fa-dashboard"></i> Dashboard</h2><div <?php
class="row jumbotron">'; }
if(!isset($admin_groups) || ?>
$admin_groups == ""){ <?php
$admin_groups = "0"; $load_tables = select_db("tbl_table", '*',
} "","(group_idr=".$groups["id"].")",2);
$load_tablesq = while($tables =
select_db("tbl_group", '*', "","id IN (". mysqli_fetch_array($load_tables))
$admin_groups.") {
AND(dashboard_display_bol=1) ORDER BY $tablesq_name =
display_name_str ASC",2); $tables["display_name_str"];
//echo $load_tablesq; $display_name =
while($groups = str_replace("tbl_","",$tablesq_name);
mysqli_fetch_array($load_tablesq)) $display_name =
{ ucwords($display_name);
$group_name = ?>
$groups["display_name_str"]; <a class="btn gray-2 text-white pull-
if($group_name != left" href="?table=<?php echo
"Settings") strtolower($display_name); ?>"> <?
{ =$tables["title_str"]?></a>
<?php
}
?> <div style="display:inline-
block;width:100%;text-align:center;"
</div> id="PrintHeader">
<div class="logo"><img
</div> style="display:inline-block;" width="100"
</div> height="auto" src="<?
</li> =$details["base_url_str"]?
<?php >admin/uploads/logo/<?=$details["logo_img"];
} ?>"></div>
} <p><b><?
echo '</div>'; =$details["website_name_str"]; ?></b></p>
} <p><?=$details["address_str"]; ?
?> ></p>
<p><?=$details["contact_no_str"]; ?
</div> ></p>
<div class="footer"> <p><?=$details["email_str"]; ?
<div class="copyright"><? ></p>
=$details["copyright_str"];?></div> </div>
</div> <div id="PrintFooter">
<!-- /.container-fluid--> <p><b>Prepared and Printed by: <?
<!-- /.content-wrapper--> =$admin["display_name_str"]; ?></b></p>
<!-- Scroll to Top Button--> <p style="display:inline-
<a class="scroll-to-top rounded" block;width:100%;text-align:right;">Date: <?
href="#page-top"> =date("M,d,Y h:i:s A") . "\n"; ?></p>
<i class="fa fa-angle-up"></i> </div>
</a>
<script
<div class="modal fade" id="idrModal" src="https://ajax.googleapis.com/ajax/libs/jquer
tabindex="-1" role="dialog" aria- y/3.3.1/jquery.min.js"></script>
labelledby="exampleModalLabel" aria- <!--(JQUERY 3rd Party Online)-->
hidden="true">
<div class="modal-dialog"
role="document"> <!-- Core plugin JavaScript-->
<div class="modal-content"> <script src="vendor/jquery-
<div class="modal-header"> easing/jquery.easing.min.js"></script>
<button class="close" type="button" <!-- Page level plugin JavaScript-->
data-dismiss="modal" aria-label="Close"> <script
<span aria-hidden="true">×</span> src="js/jquery.dataTables.min.js"></script>
</button>
</div> <!-- Custom scripts for all pages-->
<div class="modal-body"> <link
<table id="data-idr-content" class="table href="https://cdnjs.cloudflare.com/ajax/libs/sele
table-striped"> ct2/4.0.6-rc.0/css/select2.min.css"
</table> rel="stylesheet" />
</div> <script
src="https://cdnjs.cloudflare.com/ajax/libs/selec
</div> t2/4.0.6-rc.0/js/select2.min.js"></script>
</div> <script
</div> src="https://cdn.datatables.net/1.10.19/js/jquery
.dataTables.min.js"></script>
<script
src="https://cdn.datatables.net/buttons/1.5.2/js/ $('.btn-print').on('click',function(){
dataTables.buttons.min.js"></script> printData();
<script })
src="https://cdn.datatables.net/buttons/1.5.2/js/ $(document).ready(function(e) {
buttons.print.min.js"></script> $('body').addClass("ready");
<script src="js/jquery.qrcode.min.js"></script> $('.sel-frm').change(function(e) {
<script src="js/jSignature.js"></script> var hidtext = $(this).data("hidtext");
<script $("#"+hidtext).val($
src="js/plugins/jSignature.CompressorBase30.j (this).val());
s"></script> console.log("#"+hidtext);
<script });
src="js/plugins/jSignature.CompressorSVG.js" $('.frm-update').click(function(e) {
></script> console.log("im here");
<script var data_target = $(this).data("target");
src="js/plugins/jSignature.UndoButton.js"></sc var data_vtb = $
ript> (this).data("vtb");
<script var data_sel = $
src="js/plugins/signhere/jSignature.SignHere.js (this).data("select");
"></script> var data_table = $
<script (this).data("tbl");
src="js/jquery.autocomplete.js"></script> var data_sel_id = $
<script src="js/binaryajax.js"></script> ("#"+data_sel).val();
<script src="js/exif.js"></script> var dataString =
<script "table="+data_table+"&id="+data_sel_id;
src="js/jquery.canvasResize.js"></script> console.log(dataString);
<script src="js/canvasResize.js"></script> if($
<script type="text/javascript"> (this).hasClass("active")){
function printData(){ $
var ("#"+data_vtb).show();
divToPrint=document.getElementById("printT $
able"); ("#"+data_sel).removeAttr("disabled");
var $
PrintHeader=document.getElementById("Print ("#"+data_target).removeClass("active");
Header"); $
var (this).removeClass("active");
PrintFooter=document.getElementById("PrintF $
ooter"); (this).html("Update");
newWin= window.open(""); }else{
$
newWin.document.write(PrintHeader.outerHT ("#"+data_sel).attr('disabled', 'disabled');
ML); $
("#"+data_sel).val(data_sel_id);
newWin.document.write(divToPrint.outerHTM $
L); ("#"+data_vtb).hide();
$
newWin.document.write(PrintFooter.outerHT ("#"+data_target).addClass("active");
ML); $
newWin.print(); (this).addClass("active");
newWin.close(); $
} (this).html("Cancel");
} $
/* Get from elements values ("#"+data_target).removeClass("active");
*/ $
$.ajax({ (this).removeClass("active");
type: "GET", $
url:"ajax_form.php", (this).html("New");
data: dataString, }else{
crossDomain: true, $
cache: false, ("#"+data_sel).val(0);
beforeSend: function(){ $
//alert(dataString); ("#"+data_sel).attr('disabled', 'disabled');
$ $
('body').removeClass('ready'); ("#"+data_vtb).hide();
}, $
success: function(data1){ ("#"+data_target).addClass("active");
$ $
('body').addClass('ready'); (this).addClass("active");
//alert("success"); $
if(data1!="failed"){ (this).html("Cancel");
$("#" + }
data_target).html(data1); $.ajax({
type: "GET",
console.log("success"); url:"ajax_form.php",
} data: dataString,
else{ crossDomain: true,
cache: false,
console.log("error"); beforeSend: function(){
} //alert(dataString);
} $
}); ('body').removeClass('ready');
}); },
$('.frm-new').click(function(e) { success: function(data1){
var data_target = $ $
(this).data("target"); ('body').addClass('ready');
var data_vtb = $ //alert("success");
(this).data("vtb"); if(data1!="failed"){
var data_sel = $ $("#" +
(this).data("select"); data_target).html(data1);
var data_table = $
(this).data("tbl"); console.log("success");
var data_sel_id = $ }
("#"+data_sel).val(); else{
var dataString =
"table="+data_table+"&new=1"; console.log("error");
console.log(dataString); }
if($ }
(this).hasClass("active")){ });
$
("#"+data_vtb).show();
$ });
("#"+data_sel).removeAttr("disabled");
window.history.pushState(null, "",
window.location.href); q: params.term,
window.onpopstate = function() {
window.history.pushState(null, "", table: data_table
window.location.href); }
};
$ console.log("option.php?
(document).on('change','.imgInp',function(e){ q="+params.term+"&table="+data_table);
var file = e.target.files[0];
var imgtarget = $ return queryParameters;
(this).data("target"); },
var datatxt = $
(this).data("txt"); processResults: function (data) {
canvasResize(file, {
width: 1000, return {
height: 0,
crop: false,
results: $.map(data, function (item) {
quality: 70,
return {
//rotate: 90,
text:
callback: function(data,
item.display_name_str + " - " +
width, height) {
((item.customer_name_str != null) ?
item.customer_name_str :'') +
console.log("#"+datatxt); ((item.asset_description_str != null) ?
$("#"+imgtarget).attr('src', item.asset_description_str :''),
data);
$("#"+datatxt).val(data);
id: item.id
}
}
});
})
});
};
$( "select" ).select2();
}
$( ".isr" ).each(function( index ) {
}
var data_table = $
});
(this).data("table");
});
$(this).select2({
$('.readonly *').prop('disabled',
placeholder: "Select
true);
" + data_table,
var arg = {
minimumInputLength: 3,
resultFunction: function(result) {
ajax: {
var qrcode = result.code;
url:
//$('.scanner-body
'option.php',
ul').append($('<li>' + result.format + ': ' +
dataType:
result.code + '</li>'));
"json",
var status_id = $
type:
('#status_idr').val();
"GET",
data:
var dataString = "";
function (params) {
var target = $
var
('.qra').data("target");
queryParameters = {
if(status_id!= ''){
dataString });
="table="+target+"&qr="+qrcode+"&status_id
="+status_id;
}else{ var sgn = $('.sgn');;
dataString if(sgn.val()!=null){
="table="+target+"&qr="+qrcode; var sgn_val = sgn.val();
} //$(".jSignature").attr("id","myCanvas");
console.log("im $(".jSignature").addClass("hidden");
here"+status_id); //console.log(sgn_val);
}
var data_url = $('.sgn-clear').click(function(e) {
"ajax_qr.php?"+dataString; $(".show_sign").attr("src","");
console.log(data_url); $("#signatureparent").jSignature("clear");
alert(data_url); $(".jSignature").removeClass("hidden");
//alert(data_url); $('.sgn-
/* Get from elements values save').removeClass("active");
*/ $('.sgn-
$.ajax({ save').removeAttr("disabled");
type: "GET", });
url:"ajax_qr.php", $(document).on('click','.sgn-
data: dataString, save:not(.active)',function(){
crossDomain: true, $(this).addClass("active");
cache: false, $
beforeSend: function(){ (this).attr("disabled","disabled");
//alert(dataString);
$ $
('body').removeClass('ready'); (".jSignature").attr("id","myCanvas");
}, $
success: function(data1){ (".jSignature").addClass("hidden");
$('body').addClass('ready'); var canvas =
//alert("success"); document.getElementById('myCanvas');
if(data1!="failed"){ var data_url = canvas.toDataURL();
$("#" + var data_target = $
target).html(data1); (this).data("target");
} $("#"+data_target).val(data_url);
else{ $(".show_sign").attr("src",data_url);
//alert("Erro
r! Username already Taken"); //alert(data_target);
} canvas.width =
} canvas.width;
}); //alert(data_url);
} });
}; var vta = $('.vta');
$(".btn-scan-qr").click(function(e) { if(vta.val()!=""){
console.log("working var ajaxRequest;
scanner"); var target = vta.data("target");
var decoder = $('canvas.qr-
scanner').init(arg).buildSelectMenu('select', 1); var id= vta.val();
setTimeout(function()
{ decoder.play(); }, 500);
data: dataString,
$("#" + target).html(''); crossDomain: true,
var dataString cache: false,
="table="+target+"&id="+id; beforeSend: function(){
//alert(dataString);
var data_url = $
"ajax.php?"+dataString; ('body').removeClass('ready');
console.log(data_url); },
//alert(data_url); success: function(data1){
/* Get from elements values */ $('body').addClass('ready');
$.ajax({ //alert("success");
type: "GET", if(data1!="failed"){
url:"ajax.php", $("#" +
data: dataString, target).html(data1);
crossDomain: true, }
cache: false, else{
beforeSend: function(){
//alert(dataString); $ //alert("Error!
('body').removeClass('ready'); Username already Taken");
}, }
success: function(data1){ }
$('body').addClass('ready'); });
//alert("success"); console.log("vta clicked");
if(data1!="failed"){ });
$("#" + $(document).on('click','.data-
target).html(data1); idr',function(){
} var id = $(this).data("idr");
else{ var table = $
//alert("Error! (this).data("table");
Username already Taken"); var target = "data-idr-
} content";
} var dataString
}); ="table="+table+"_idr"+"&id="+id;
} var data_url =
}); "ajax.php?"+dataString;
$(document).on('change','.vta',function(){ console.log(data_url);
var ajaxRequest; /* Get from elements values
var target = $(this).data("target"); */
var id = $(this).val(); $.ajax({
type: "GET",
$("#" + target).html(''); url:"ajax.php",
var dataString data: dataString,
="table="+target+"&id="+id; crossDomain: true,
var data_url = cache: false,
"ajax.php?"+dataString; beforeSend: function(){
console.log(data_url); //alert(dataString);
//alert(data_url); $('body').removeClass('ready');
/* Get from elements values */ },
$.ajax({ success: function(data1){
type: "GET", $
url:"ajax.php", ('body').addClass('ready');
//alert("success"); $(document).on('change','.vtb',function(){
if(data1!="failed"){ var ajaxRequest;
$("#" + var target = $(this).data("target");
target).html(data1); var id = $(this).val();
}
else{ $("#" + target).html('');
var dataString
//alert("Erro ="table="+target+"&id="+id;
r! Username already Taken");
} var data_url =
} "ajax.php?"+dataString;
}); //alert(data_url);
}); /* Get from elements values */
var vtb = $('.vtb'); $.ajax({
if(vtb.val()!=""){ type: "GET",
var ajaxRequest; url:"ajax.php",
var target = vtb.data("target"); data: dataString,
var id = vtb.val(); crossDomain: true,
cache: false,
$("#" + target).html(''); beforeSend: function(){
var dataString //alert(dataString);
="table="+target+"&id="+id; $('body').removeClass('ready');
},
var data_url = success: function(data1){
"ajax.php?"+dataString; $('body').addClass('ready');
//alert(data_url); //alert("success");
/* Get from elements values */ if(data1!="failed"){
$.ajax({ $("#" +
type: "GET", target).html(data1);
url:"ajax.php", }
data: dataString, else{
crossDomain: true,
cache: false, //alert("Error!
beforeSend: function(){ Username already Taken");
//alert(dataString); }
$('body').removeClass('ready'); }
}, });
success: function(data1){ console.log("vtb clicked");
$('body').addClass('ready'); });
//alert("success"); $("#signatureparent").jSignature();
if(data1!="failed"){
$("#" + $('.crt_add').click(function(e) {
target).html(data1); var target = $(this).data("target");
} var target_input = $("#cart_value_"
else{ + target);
//alert("Error! var curent_val = target_input.val();
Username already Taken"); var selected_val = $("#cs_" +
} target).val();
} var selected_eqv = $("#select2-cs_"
}); + target+"-container").html();
}
var selected_qty = $("#ci_q_" + text +=
target).val(); possible.charAt(Math.floor(Math.random() *
var append_val = selected_val + "-" possible.length));
+ selected_qty + ","; return text;
var new_val = curent_val + }
append_val; $('.qrc-btn').click(function(e) {
$("#ci_q_" + target).val(1); var target_qrc = $
var generated_item = '<div (this).data("target");
class="cart_item"><div var new_id = $('.qrc-text').val();
class="ci_name">'+selected_eqv+'</div><div $(target_qrc).qrcode(new_id);
class="ci_qty">'+selected_qty+'</div><div $('.qrc-text').val(new_id);
class="ci_delete btn btn-danger" data- $(this).hide();
delval="'+append_val+'" data- });
target="'+target+'"> <i class="fa fa- $('.nav-item').click(function(e) {
trash"></i></div></div>'; $('.nav-
$("#"+target).append(generated_item); item').removeClass("active");
target_input.val(new_val); $(this).addClass("active");
}); });
$(document).on('click','.ci_delete',function() $( document ).ready(function() {
{ $('.dtable').DataTable( {dom:
var target = $(this).data("target"); 'Bfrtip',buttons: [ 'print']} );
var delval = $(this).data("delval"); // DATA TABLES PLUGIN For
var target_input = $("#cart_value_" small amount of Data
+ target); $("#search_box").keyup(function ()
var curent_val = target_input.val(); {
var new_val = var value = this.value.toLowerCase().trim();
curent_val.replace(delval,''); $("table tr").each(function (index) {
$ if (!index) return;
(this).parent( ".cart_item").remove(); $(this).find("td").each(function () {
target_input.val(new_val); var id = $
console.log("Delete"); (this).text().toLowerCase().trim();
}); var not_found = (id.indexOf(value) ==
$('.btn-toggler').click(function(e) { -1);
var sbnav = $('.sb-navs'); $(this).closest('tr').toggle(!not_found);
var toggler = $(this); return not_found;
if(sbnav.hasClass("active")) });
{ });
});
sbnav.removeClass("active"); var dataimg = $('#scdr').val();
}else{ var datafield = $('#scdr').attr('data-
sbnav.addClass("active"); field');
} get_scdr(dataimg,datafield);
});
function makeid() { $('#scdr').change(function(e) {
var text = ""; var dataimg = $
var possible = ('#scdr').val();
"ABCDEFGHIJKLMNOPQRSTUVWXYZabc var datafield = $
defghijklmnopqrstuvwxyz0123456789"; ('#scdr').attr('data-field');
if(isset($_GET["confirm"])){ $_SESSION["cart_item"] =
$confirm_id = array_merge($_SESSION["cart_item"],
addslashes(strip_tags($_GET["confirm"])); $itemArray);
$my_query = "UPDATE tbl_orders SET }
status_idr = 2 WHERE id = ".$confirm_id; } else {
mysqli_query($con,$my_query); $_SESSION["cart_item"] =
$itemArray;
redirect("shop.php?confirmed"); }
} }
break;
if(!empty($_GET["action"])) { case "remove":
switch($_GET["action"]) { empty_cart();
case "add": break;
if(!empty($_POST["quantity"])) { case "empty":
$productByCode = unset($_SESSION["cart_item"]);
$db_handle->runQuery("SELECT * FROM break;
tbl_products WHERE display_name_str='" . }
$_GET["code"] . "'"); }
$itemArray = function empty_cart(){
array($productByCode[0] if(!empty($_SESSION["cart_item"])) {
["display_name_str"]=>array('name'=>$product foreach($_SESSION["cart_item"] as $k =>
ByCode[0]["product_name_str"], $v) {
'display_name_str'=>$productByCode[0] if(isset($_GET["code"])){
["display_name_str"], if($_GET["code"] == $k)
'quantity'=>$_POST["quantity"], unset($_SESSION["cart_item"][$k]);
'price'=>$productByCode[0]["price_cur"], if(empty($_SESSION["cart_item"]))
unset($_SESSION["cart_item"]); <input required
} type="text" class="form-control"
name="contact" />
} </div>
} <div class="form-group">
} <label>Email</label>
?> <input required
<HTML> type="email" class="form-control"
<HEAD> name="email" />
<TITLE><?=$d["website_name_str"]? </div>
></TITLE> <div class="form-group">
<link href="style.css" type="text/css" <label>Address</label>
rel="stylesheet" /> <input required
<link rel="stylesheet" href="njtk.min.css"/> type="address" class="form-control"
</HEAD> name="address" />
<BODY> </div>
<!-- Button trigger modal --> <div class="form-group">
<!-- Modal --> <label> <input
<div class="modal fade" id="exampleModal" required required type="checkbox"
tabindex="-1" role="dialog" aria- name="agree" /> I Agree to the <a
labelledby="exampleModalLabel" aria- href="terms.php"> Terms and Conditions</a>
hidden="true"> of NJTK Hardware</label>
<div class="modal-dialog" role="document"> </div>
<div class="modal-content"> </div>
<div class="modal-header"> </div>
<h5 class="modal-title" <div class="modal-footer">
id="exampleModalLabel">Checkout</h5> <button type="button" class="btn btn-
<button type="button" class="close" data- secondary" data-
dismiss="modal" aria-label="Close"> dismiss="modal">Close</button>
<span aria- <input type="submit" name="submit"
hidden="true">×</span> class="btn btn-primary" value="Submit">
</button> </div>
</div> </form>
<form method="post" </div>
action="shop.php"> </div>
<div class="modal-body"> </div>
<div class="checkout"> <nav class="navbar navbar-expand-lg
<p class="text-info">Please navbar-dark bg-dark">
enter your information below.</p> <button class="navbar-toggler" type="button"
<div class="form-group"> data-toggle="collapse" data-
target="#navbarTogglerDemo01" aria-
<label>Name</label> controls="navbarTogglerDemo01" aria-
<input required expanded="false" aria-label="Toggle
type="text" class="form-control" name="name" navigation">
/> <span class="navbar-toggler-icon"></span>
</div> </button>
<div class="form-group"> <div class="collapse navbar-collapse"
<label>Contact id="navbarTogglerDemo01">
No</label> <a class="navbar-brand" href="#">NJTK
Hardware</a>
<ul class="navbar-nav mr-auto mt-2 mt-lg- </div>
0">
<li class="nav-item"> <script src="https://code.jquery.com/jquery-
<a class="nav-link" 3.3.1.slim.min.js" integrity="sha384-
href="index.php">Home <span class="sr- q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbz
only">(current)</span></a> o5smXKp4YfRvH+8abtTE1Pi6jizo"
</li> crossorigin="anonymous"></script>
<li class="nav-item active"> <script
<a class="nav-link" src="https://cdnjs.cloudflare.com/ajax/libs/popp
href="shop.php">Shop</a> er.js/1.14.7/umd/popper.min.js"
</li> integrity="sha384-
</ul> UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1
</div> clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
<div class="float-right text-white"> <? crossorigin="anonymous"></script>
=$d["contact_no_str"]?> | <? <script src="njtk.js"></script>
=$d["email_eml"]?></div> </BODY>
</nav> </HTML>
<p class="text-white bg-primary text-center
p-3">Welcome to NJTK Hardware - Terms and Walkin.php
Conditions</p>
<pre class="terms"> <?php
These terms and conditions outline the rules $details_query =
and regulations for the use of NJTK select_db("tbl_detail","*","","1=1",2);
Hardware`s Website. $d = mysqli_fetch_assoc($details_query);
session_start();
* Upon ordering, items should be paid in cash require_once("../dbcontroller.php");
and claimed in the store. $db_handle = new DBController();
include '../phpmailer/mailer.php';
* For item deliveries, customers should should
pay the ordered items in the hardware store first if(!empty($_GET["action"])) {
before undergoing delivery process. switch($_GET["action"]) {
case "add":
* Small orders will not be delivered for free, if(!empty($_POST["quantity"])) {
additional payment will be added if small $productByCode =
orders will be delivered. $db_handle->runQuery("SELECT * FROM
tbl_products WHERE display_name_str='" .
* Email verification will be implemented as $_GET["code"] . "'");
well as communication through given contact $itemArray =
number, for added security and confirmation array($productByCode[0]
process. ["display_name_str"]=>array('name'=>$produc
tByCode[0]["product_name_str"],
* Ordered items that are unclaimed after 1 'display_name_str'=>$productByCode[0]
week will be notified by the employee through ["display_name_str"],
calls or else order(s) will be invalid. 'quantity'=>$_POST["quantity"],
'price'=>$productByCode[0]["price_cur"],
* Refunding items will not be catered. 'image'=>$productByCode[0]
["product_img"]));
* Bring your a picture of your order slip and an
identification proof upon claiming your if(!
order(s). empty($_SESSION["walkin_cart_item"])) {
</pre>
if(!
if(in_array($productByCode[0] empty($_SESSION["walkin_cart_item"])) {
["display_name_str"],array_keys($_SESSION[ foreach($_SESSION["walkin_cart_item"] as
"walkin_cart_item"]))) { $k => $v) {
if(isset($_GET["code"])){
foreach($_SESSION["walkin_cart_item"] as if($_GET["code"] == $k)
$k => $v) {
unset($_SESSION["walkin_cart_item"]
if($productByCode[0]["display_name_str"] [$k]);
== $k) {
if(empty($_SESSION["walkin_cart_item"]))
if(empty($_SESSION["walkin_cart_item"] unset($_SESSION["walkin_cart_item"]);
[$k]["quantity"])) { }
}
}
$_SESSION["walkin_cart_item"][$k] }
["quantity"] = 0; ?>
<!-- Button trigger modal -->
}
<!-- Modal -->
$_SESSION["walkin_cart_item"] <div class="modal fade" id="exampleModal"
[$k]["quantity"] += $_POST["quantity"]; tabindex="-1" role="dialog" aria-
labelledby="exampleModalLabel" aria-
hidden="true">
}
<div class="modal-dialog" role="document">
}
<div class="modal-content">
} else {
<div class="modal-header">
<h5 class="modal-title"
$_SESSION["walkin_cart_item"] =
id="exampleModalLabel">Checkout</h5>
array_merge($_SESSION["walkin_cart_item"],
$itemArray);
<button type="button" class="close" data-
}
dismiss="modal" aria-label="Close">
} else {
<span aria-
hidden="true">×</span>
$_SESSION["walkin_cart_item"] =
</button>
$itemArray;
}
</div>
}
<form method="post"
break;
action="index.php?walkin">
case "remove":
<div class="modal-body">
empty_cart();
<div class="checkout">
break;
<p class="text-info">Please
case "empty":
enter your information below.</p>
<div class="form-group">
unset($_SESSION["walkin_cart_item"]);
break;
<label>Name</label>
}
<input required
}
type="text" class="form-control"
name="name" />
function empty_cart(){
</div> <?php
<div class="form-group"> if(isset($_GET["success"])){
<label>Contact echo '<div class="alert alert-info
No</label> alert-dismissible fade show" role="alert">
<input required <strong>Success!
type="text" class="form-control" </strong> Your order is now under
name="contact" /> confirmation! Please confirm through check
</div> your email!
<div class="form-group"> <button type="button"
class="close" data-dismiss="alert" aria-
<label>Email</label> label="Close">
<input required <span aria-
type="email" class="form-control" hidden="true">×</span>
name="email" /> </button></div>';
</div> }
<div class="form-group"> if(isset($_GET["confirmed"])){
echo '<div class="alert alert-success
<label>Address</label> alert-dismissible fade show" role="alert">
<input required <strong>Success!
type="address" class="form-control" </strong> You have successfully confirmed
name="address" /> your order!
</div> <button type="button"
<div class="checkbox"> class="close" data-dismiss="alert" aria-
<label><input label="Close">
type="checkbox" name="for_delivery_bol"> <span aria-
For Delivery</label> hidden="true">×</span>
</div> </button></div>';
<div class="checkbox"> }
<label><input if(isset($_POST["submit"])){
type="checkbox" name="print_receipt_bol">
Print Receipt</label>
</div> $myquery = '';
</div> $crt_array = '';
</div> $total_price = 0;
<div class="modal-footer">
<p>Note:<br> foreach ($_SESSION["walkin_cart_item"]
- For items to be delivered, you must pay in the as $item){
store first (Reservation)<br> $item_price =
- Items should be paid and picked up on the $item["quantity"]*$item["price"];
store<br></p> $display_name_str =
<button type="button" class="btn btn- $item["display_name_str"];
secondary" data- $item_id =
dismiss="modal">Close</button> get_value_condition("id","tbl_products","displa
<input type="submit" name="submit" y_name_str = '".
class="btn btn-primary" value="Submit"> $item["display_name_str"]."'",1);
</div> $qty_query = "UPDATE
</form> tbl_products SET stocks_int = (stocks_int - ".
</div> ($item["quantity"])."), updated_stocks_dat =
</div> '".date("Y-m-d")."' WHERE display_name_str
</div> = '".$display_name_str. "'";
mysqli_query($con,$qty_query);
$crt_array .= $item_id. "-". $total_price = 0;
$item["quantity"].","; $message .= '<tr>';
$total_price += $item_price =
($item["price"]*$item["quantity"]); $item["quantity"]*$item["price"];
//add crt array $display_name_str =
$item["display_name_str"];
//echo $item["quantity"]; $product_name_str =
//echo $qty_query . "<br/>"; get_value_condition("product_name_str","tbl_
} products","display_name_str = '".
$item["display_name_str"]."'",1);
$total_price +=
$date_time = date("Ymdhis"); ($item["price"]*$item["quantity"]);
$generated_id = "OR".$date_time; $message .= '<td>'.
$name_str = $_POST["name"]; $product_name_str.'</td>';
$contact_no = $_POST["contact"]; $message .=
$email_eml = $_POST["email"]; '<td>'.monetarize($item_price).'</td>';
$address_str = $_POST["address"]; $message .= '<td>'.
$for_delivery_bol = $item["quantity"].'</td>';
($_POST["for_delivery_bol"]?1:0); $message .=
$print_receipt_bol = '<td>'.monetarize($total_price).'</td>';
($_POST["print_receipt_bol"]?1:0); $message .= '</tr>';
$total_price_cur = $total_price; $cart_total += $total_price;
$myquery .="INSERT INTO }
tbl_walkinorders $message .= '<tr><td colspan="5"
(display_name_str,name_str,contact_no_str,em style="text-align:right;border-top:solid 1px
ail_eml,address_str,products_crt,status_idr,total #222;"><div style="text-align:left"><b> Total:
_price_cur,for_delivery_bol,print_receipt_bol,d </b></div>"'.monetarize($cart_total).'</td></tr
ate_ordered_dat) VALUES ></tbody></table><hr/>';
('$generated_id','$name_str','$contact_no','$em mysqli_multi_query($con,
ail_eml','$address_str','". $myquery);
$crt_array."',2,$total_price_cur,'". $confirm_id =
$for_delivery_bol."','". mysqli_insert_id($con);
$print_receipt_bol."','".date("Y-m-d")."');";
$message .= $myquery; //echo $print_receipt_bol;
$message .= 'Thank you for if($print_receipt_bol==1){
purchasing at NJTK Hardware, heres your redirect("receipt.php?id=".
Online Receipt'; $confirm_id);
$message .= }
'<table class="table table- else{
striped"> redirect("index.php?
<thead> walkin&action=empty&success");
<th>Product</th> }
<th>Price</th>
<th>Quantity</th>
<th>Total</th> }
</thead> ?>
<tbody> <div id="shopping-cart">
';
$cart_total = 0; <div class="txt-heading">Shopping
foreach Cart</div>
($_SESSION["walkin_cart_item"] as $item){
<a id="btnEmpty" class="btn btn-primary bg- <td style="text-
white text-danger" href="index.php? align:right;"><?php echo "Php ".
walkin&action=empty">Empty Cart</a> number_format($item_price,2); ?></td>
<a href="#" class="btn btn-primary <?=(! <td style="text-
isset($_SESSION["walkin_cart_item"])?"disabl align:center;"><a href="index.php?
ed":"")?>" data-toggle="modal" data- walkin&action=remove&code=<?php echo
target="#exampleModal"> $item["display_name_str"]; ?>"
Checkout class="btnRemoveAction"><img src="../icon-
</a> delete.png" alt="Remove Item" /></a></td>
<?php </tr>
if(isset($_SESSION["walkin_cart_item"])){ <?php
$total_quantity = 0; $total_quantity +=
$total_price = 0; $item["quantity"];
?> $total_price +=
<table class="tbl-cart" cellpadding="10" ($item["price"]*$item["quantity"]);
cellspacing="1"> }
<tbody> ?>
<tr>
<th style="text-align:left;">Product Image</th> <tr>
<th style="text-align:left;">Product Code</th> <td align="right" colspan="2">Total:</td>
<th style="text-align:right;" <td align="center"><?php echo $total_quantity;
width="5%">Quantity</th> ?></td>
<th style="text-align:right;" width="10%">Unit <td align="right" colspan="2"><strong><?php
Price</th> echo "Php ".number_format($total_price, 2); ?
<th style="text-align:right;" ></strong></td>
width="10%">Price</th> <td> </td>
<th style="text-align:center;" </tr>
width="5%">Remove</th> </tbody>
</tr> </table>
<?php <?php
foreach ($_SESSION["walkin_cart_item"] as } else {
$item){ ?>
$item_price = <div class="no-records">Your Cart is
$item["quantity"]*$item["price"]; Empty</div>
?> <?php
<tr> }
<td><img src="<? ?>
=$d["base_url_str"]? </div>
>admin/uploads/product/<?php echo
$item["image"]; ?>" class="cart-item-image" <div id="product-grid">
/></td> <div class="txt-heading">Products</div>
<td><?php echo <div class="product-filters">
$item["display_name_str"]; ?></td> <div class="category"><a
<td style="text- href="index.php?walkin&">All</a></div>
align:right;"><?php echo $item["quantity"]; ? <?php
></td> $category_query =
<td style="text- select_db("tbl_category","*","","1=1 ORDER
align:right;"><?php echo "Php ".$item["price"]; BY display_name_str ASC",2);
?></td> while($category =
mysqli_fetch_assoc($category_query)){
?>
<div class="category"><a $product_array[$key]
href="index.php?walkin&fid=<? ["product_desciption_lng"]; ?></div>
=$category["id"]?>"><? <div class="product-
=$category["display_name_str"]?></a></div> price">Retail Price: <?php echo "Php ".
<?php $product_array[$key]["price_cur"]; ?></div>
} <div class="cart-
?> action">Stocks: <?=$product_array[$key]
</div> ["stocks_int"];?><input type="number"
<?php class="product-quantity" max="<?
if(isset($_GET["fid"])){ =$product_array[$key]["stocks_int"];?>"
$fid = min="1" name="quantity" value="1"
addslashes(strip_tags($_GET["fid"])); size="2" /><input type="submit" value="Add
$my_string = "SELECT * to Cart" class="btnAddAction" /></div>
FROM tbl_products WHERE subcategory_idr </div>
IN (SELECT id FROM tbl_subcategory </form>
WHERE category_idr = ".$fid.") ORDER BY </div>
id ASC"; <?php
}else{ }
$my_string = "SELECT * }
FROM tbl_products ORDER BY id ASC"; ?>
}
</div>
$product_array = $db_handle-
>runQuery($my_string);
if (!empty($product_array)) {
foreach($product_array as
$key=>$value){
?>
<div class="product-item">
<form method="post"
action="index.php?
walkin&action=add&code=<?php echo
$product_array[$key]["display_name_str"]; ?
>">
<div class="product-
image"><img src="<?=$d["base_url_str"]?
>admin/uploads/product/<?php echo
$product_array[$key]["product_img"]; ?
>"></div>
<div class="product-tile-
footer">
<div class="product-
title">Product Name: <?php echo
$product_array[$key]["product_name_str"]; ?
></div>
<div class="product-
title">Brand: <?php echo $product_array[$key]
["brand_name_str"]; ?></div>
<div class="product-
title">Details: <?php echo