| Server IP : 61.19.30.66 / Your IP : 216.73.216.80 Web Server : Apache/2.2.22 (Ubuntu) System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 User : www-data ( 33) PHP Version : 5.3.10-1ubuntu3.48 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /var/www/gpa/rtec/main/ |
Upload File : |
<link href="../style.css" media="screen" rel="stylesheet" type="text/css" />
<table class="table table-bordered" id="resultTable" data-responsive="table" style="text-align: left;">
<thead>
<tr>
<th width="25%"> Name </th>
<th width="3%"> Qty </th>
<th width="8%"> Cost </th>
</tr>
</thead>
<tbody>
<?php
include('../connect.php');
$id=$_GET['iv'];
$result = $db->prepare("SELECT * FROM purchases_item WHERE invoice= :userid");
$result->bindParam(':userid', $id);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
?>
<tr class="record">
<td><?php
$rrrrrrr=$row['name'];
$resultss = $db->prepare("SELECT * FROM products WHERE product_code= :asas");
$resultss->bindParam(':asas', $rrrrrrr);
$resultss->execute();
for($i=0; $rowss = $resultss->fetch(); $i++){
echo $rowss['product_name'];
}
?></td>
<td><?php echo $row['qty']; ?></td>
<td>
<?php
$dfdf=$row['cost'];
echo formatMoney($dfdf, true);
?>
</td>
</tr>
<?php
}
?>
<tr>
<td colspan="2"><strong style="font-size: 12px; color: #222222;">Total:</strong></td>
<td><strong style="font-size: 12px; color: #222222;">
<?php
function formatMoney($number, $fractional=false) {
if ($fractional) {
$number = sprintf('%.2f', $number);
}
while (true) {
$replaced = preg_replace('/(-?\d+)(\d\d\d)/', '$1,$2', $number);
if ($replaced != $number) {
$number = $replaced;
} else {
break;
}
}
return $number;
}
$sdsd=$_GET['iv'];
$resultas = $db->prepare("SELECT sum(cost) FROM purchases_item WHERE invoice= :a");
$resultas->bindParam(':a', $sdsd);
$resultas->execute();
for($i=0; $rowas = $resultas->fetch(); $i++){
$fgfg=$rowas['sum(cost)'];
echo formatMoney($fgfg, true);
}
?>
</strong></td>
</tr>
</tbody>
</table>