| Linux premium274.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64 Path : /home/whagcoha/mos.mwagalwaservices.com/ |
| Current File : /home/whagcoha/mos.mwagalwaservices.com/printx.php |
<?php
include 'dbconfig/db.php';
?>
<html>
<head>
<?php
$bid=$_GET['bid'];
// $query="SELECT *,(items.unitprice*iquantity.quantity) AS stotal FROM iquantity,site,activity,items WHERE(iquantity.itemid=items.id) AND (iquantity.siteid=site.id) AND(iquantity.activityid=activity.id) AND (site.id='$bid') ORDER BY iquantity.id ASC";
$query4="SELECT *,CONCAT(firstname, ' ', lastname) AS cname FROM client,site WHERE (site.id='$bid') AND (site.clientid=client.id)";
$result = mysqli_query($conn,$query4);
$count4 = 1;
while($row = mysqli_fetch_assoc($result) ){
$site = $row['sitename'];
$cname = $row['cname'];
$contact = $row['contact'];
$email = $row['email'];
$gen = $row['gender'];
if ($gen=="Male") {
$salute= "Mr";
}if ($gen=="Female") {
$salute= "M/s";
}
else{
echo " ";
}
?>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="logo.png" type="image/x-icon" />
<!-- Bob Joel
Owned -->
<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<link href="joel1.css" rel="stylesheet" id="bootstrap-css">
<link href="css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<link href="css/search.css" rel="stylesheet" id="bootstrap-css">
<!-- <link href="css/bootstrap.css" rel="stylesheet" id="bootstrap-css"> -->
<link href="css/all2.css" rel="stylesheet" id="bootstrap-css">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://use.fontawesome.com/releases/v5.0.6/css/all.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" id="main-stylesheet" data-version="1.1.0" href="styles/shards-dashboards.1.1.0.min.css">
<link rel="stylesheet" href="styles/extras.1.1.0.min.css">
<!-- End Of Owned -->
<!-- <link href="css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<link href="css/signin.css" rel="stylesheet" id="bootstrap-css">
<link href="css/n.css" rel="stylesheet" id="bootstrap-css"> -->
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="qr/jquery.min.js"></script>
<script type="text/javascript" src="qr/qrcode.js"></script>
<title><?php echo $site; ?> Quotation</title>
<style type="text/css">
@media print {
@page {
size: 8.5in 13in;
}
head {
height: 0px;
display: none;
}
#head {
display: none;
height: 0px;
}
#print {
position: fixed;
top: 0px;
margin-top: 20px;
margin-bottom: 30px;
margin-right: 50px;
margin-left: 50px;
}
}
</style>
</head>
<body>
<div id="head"><br>
<button class="btn btn-info" onclick="print()"><i class="glyphicon glyphicon-print"></i>PRINT</button><br><br>
<!-- <a class="btn btn-info" onclick="window.close()">Cancel</a> -->
<a href="index.php"> <button class="btn btn-info">Back to Home</button></a><br><br>
</div>
<div id='print'>
<!-- <div class="container"> -->
<div class="row">
<!-- <div class="col-12"> -->
<div class="card">
<div class="card-body p-0">
<div class="row p-5">
<div class="col-md-12 text-center">
<img class="img-responsive" src="images/quote.png">
</div>
</div>
<div class="text-center"><u><h1>QUOTATION</h1></u></div>
<hr class="my-5">
<div class="row pb-5 p-5">
<!-- Removed php by BOB -->
<div class="col-md-6">
<p class="font-weight-bold mb-4">Client Information</p>
<p class="mb-1"><?php echo $salute; ?> <?php echo $cname; ?></p>
<p><?php echo $site; ?></p>
<p class="mb-1"><?php echo $email; ?></p>
<p class="mb-1"><?php echo $contact; ?></p>
</div>
<?php
$count4 ++;
}
?>
<!-- <div class="col-md-6 text-right">
<p class="font-weight-bold mb-4">Payment Details</p>
<p class="mb-1"><span class="text-muted">VAT: </span> 1425782</p>
<p class="mb-1"><span class="text-muted">VAT ID: </span> 10253642</p>
<p class="mb-1"><span class="text-muted">Payment Type: </span> Root</p>
<p class="mb-1"><span class="text-muted">Name: </span> John Doe</p>
</div> -->
</div>
<div class="row p-5">
<div class="col-md-12">
<table class="table">
<thead>
<tr class="table-primary">
<th class="border-0 text-uppercase small font-weight-bold">ITEM</th>
<th class="border-0 text-uppercase small font-weight-bold">DESCRIPTION</th>
<th class="border-0 text-uppercase small font-weight-bold">QTY</th>
<th class="border-0 text-uppercase small font-weight-bold">UNIT</th>
<th class="border-0 text-uppercase small font-weight-bold">UNIT PRICE</th>
<th class="border-0 text-uppercase small font-weight-bold">TOTAL</th>
</tr>
</thead>
<tbody>
<?php
$bid=$_GET['bid'];
$query="SELECT *,(items.unitprice*iquantity.quantity) AS stotal FROM iquantity,site,activity,items WHERE(iquantity.itemid=items.id) AND (iquantity.siteid=site.id) AND(iquantity.activityid=activity.id) AND (site.id='$bid') ORDER BY iquantity.id ASC";
$result = mysqli_query($conn,$query);
$count = 1;
while($row = mysqli_fetch_assoc($result) ){
$description = $row['description'];
$unit = $row['units'];
$unitprice = $row['unitprice'];
$quantity = $row['quantity'];
$stotal = $row['stotal'];
// $pclass = $row['pclass'];
?>
<tr>
<td><?php echo $count; ?></td>
<td><?php echo $description; ?></td>
<td><?php echo $quantity; ?></td>
<td><?php echo $unit; ?></td>
<td><?php echo $unitprice; ?></td>
<td><?php echo $stotal; ?></td>
</tr>
<?php
$count ++;
}
?>
<?php
$bid=$_GET['bid'];
$query2="SELECT SUM(items.unitprice*iquantity.quantity) AS subtotal,ROUND((SUM(items.unitprice*iquantity.quantity)+(SUM(items.unitprice*iquantity.quantity)*(labour.rate/100)))) AS total,ROUND((SUM(items.unitprice*iquantity.quantity)*(labour.rate/100))) AS labour FROM iquantity,site,activity,items,labour WHERE(iquantity.itemid=items.id) AND (iquantity.siteid=site.id) AND(iquantity.activityid=activity.id) AND (site.id='$bid') AND(site.id=labour.siteid) ORDER BY iquantity.id ASC";
$result2 = mysqli_query($conn,$query2);
$row = mysqli_fetch_assoc($result2);
$total = $row['total'];
$labour = $row['labour'];
$sub=$row['subtotal'];
// echo $total;
?>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="lead">Sub Total</td>
<td class="lead"> <?php echo $sub; ?></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="lead">Labour</td>
<td class="lead"> <?php echo $labour; ?></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="lead">Total </td>
<td class="lead"><b> <?php echo $total; ?></b></td>
</tr>
</tbody>
</table>
<!-- The Qr Code Start -->
<br>
<?php
$bidx=$_GET['bid'];
$aidx=$_GET['aid'];
?>
<input id="text" type="hidden" value="https://mos.iammwagalwa.com/print.php?&bid=<?php echo $bidx;?>&aid=<?php echo $aidx;?>" style="width:80%" />Scan Code<br />
<div id="qrcode" style="width:100px; height:100px; margin-top:15px;"></div></p>
<script type="text/javascript">
var qrcode = new QRCode(document.getElementById("qrcode"), {
width : 100,
height : 100
});
function makeCode () {
var elText = document.getElementById("text");
if (!elText.value) {
alert("Input a text");
elText.focus();
return;
}
qrcode.makeCode(elText.value);
}
makeCode();
$("#text").
on("blur", function () {
makeCode();
}).
on("keydown", function (e) {
if (e.keyCode == 13) {
makeCode();
}
});
</script>
<!-- The QR Code End -->
</div>
</div>
<div class="text-light mt-5 mb-5 text-center small">System Created and Owned By Mwagalwa Services Ltd</div>
</div>
</div>
</div>
</div>
<div class="text-light mt-5 mb-5 text-center small">by : <a class="text-light" target="_blank" href="">Mwagalwa Services Ltd</a></div>
</div>
<!-- </div> -->
</body>
<script>
function printContent(el) {
var restorepage = document.body.innerHTML;
var printcontent = document.getElementById(el).innerHTML;
document.body.innerHTML = printcontent;
window.print();
document.body.innerHTML = restorepage;
$.ajax({
url: 'print_log.php?act=printable_form&id=<?php echo $_GET['id'] ?>',
success: function(html) {
$('#returncode').html(html);
}
});
}
</script>
</html>