initializing git repo
This commit is contained in:
commit
3df8fc53b8
86 changed files with 5649 additions and 0 deletions
73
pages/repeat_order.php
Executable file
73
pages/repeat_order.php
Executable file
|
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
|
||||
function RepeatOrderTableByVendor ($VendorName, $VendorId)
|
||||
{
|
||||
global $GlobalMysqlHandler;
|
||||
global $GlobalContent;
|
||||
|
||||
$RepOrdQuery="SELECT * FROM `Parts` WHERE `Qty` < `MinQty` AND `VendorId` = $VendorId ORDER BY `Name` ASC";
|
||||
$RepOrdQuery=mysqli_query($GlobalMysqlHandler, $RepOrdQuery);
|
||||
|
||||
$ShowTable=0;
|
||||
if (mysqli_num_rows($RepOrdQuery))
|
||||
{
|
||||
$GlobalContent .= '<table>';
|
||||
$GlobalContent .= ' <tr>';
|
||||
$GlobalContent .= ' <td colspan="8">{'.$VendorId.'} <strong>'.$VendorName.'</strong></td>';
|
||||
$GlobalContent .= ' </tr>';
|
||||
$GlobalContent .= ' <tr>';
|
||||
$GlobalContent .= ' <th>'.LangSpellHtml('PartsName').'</th>';
|
||||
$GlobalContent .= ' <th>'.LangSpellHtml('PartsQuantity').'</th>';
|
||||
$GlobalContent .= ' <th>'.LangSpellHtml('PartsMinQuantity').'</th>';
|
||||
$GlobalContent .= ' <th>'.LangSpellHtml('PartsPackageUnit').'</th>';
|
||||
$GlobalContent .= ' <th>'.LangSpellHtml('PartsPrice').'</th>';
|
||||
$GlobalContent .= ' <th>'.LangSpellHtml('PartsVendorLink').'</th>';
|
||||
$GlobalContent .= ' <th>'.LangSpellHtml('RepeatOrderPackagesToOrder').'</th>';
|
||||
$GlobalContent .= ' <th>'.LangSpellHtml('RepeatOrderSumPrice').'</th>';
|
||||
$GlobalContent .= ' </tr>';
|
||||
$ShowTable = 1;
|
||||
}
|
||||
|
||||
$AllSumPrice=0;
|
||||
while ($Part = mysqli_fetch_array($RepOrdQuery))
|
||||
{
|
||||
if (!$Part['PackageUnit']) $Part['PackageUnit']=1;
|
||||
$Price=OtherFormatPrice($Part['Price']);
|
||||
$VendorLink=($Part['VendorLink'])? '<a href="'.$Part['VendorLink'].'" target="_new">':'-';
|
||||
$OrderPackages = ceil(($Part['MinQty']-$Part['Qty'])/$Part['PackageUnit']);
|
||||
$SumPrice = OtherFormatPrice($OrderPackages * $Part['Price']);
|
||||
$AllSumPrice += $OrderPackages * $Part['Price'];
|
||||
|
||||
$GlobalContent .= ' <tr>';
|
||||
$GlobalContent .= ' <td><a href="'.$Part['VendorLink'].'" title="'.$Part['VendorLink'].'" target="_new">'.$Part['Name'].'</a></td>';
|
||||
$GlobalContent .= ' <td>'.$Part['Qty'].'</td>';
|
||||
$GlobalContent .= ' <td>'.$Part['MinQty'].'</td>';
|
||||
$GlobalContent .= ' <td>'.$Part['PackageUnit'].'</td>';
|
||||
$GlobalContent .= ' <td>'.$Price.'</td>';
|
||||
$GlobalContent .= ' <td>'.$VendorLink.'</td>';
|
||||
$GlobalContent .= ' <td>'.$OrderPackages.'</td>';
|
||||
$GlobalContent .= ' <td>'.OtherFormatPrice($SumPrice).'</td>';
|
||||
$GlobalContent .= ' </tr>';
|
||||
}
|
||||
if ($ShowTable)
|
||||
{
|
||||
$GlobalContent .= ' <tr>';
|
||||
$GlobalContent .= ' <td colspan="7"></td><td><strong>'.OtherFormatPrice($AllSumPrice).'</strong></td>';
|
||||
$GlobalContent .= ' </tr>';
|
||||
$GlobalContent .= '</table>';
|
||||
}
|
||||
}
|
||||
|
||||
global $GlobalMysqlHandler;
|
||||
|
||||
|
||||
$VendorQuery = "SELECT * FROM `Vendors` ORDER BY `Name` ASC";
|
||||
$VendorQuery = mysqli_query($GlobalMysqlHandler, $VendorQuery);
|
||||
RepeatOrderTableByVendor(LangSpellHtml('PartsNotSpecified'),0);
|
||||
while ($Vendor = mysqli_fetch_array($VendorQuery))
|
||||
{
|
||||
RepeatOrderTableByVendor($Vendor['Name'],$Vendor['Id']);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue