Example #1
0
       </tbody></table>
        <?php } ?> 

    </li> 
</ul>

</div>
</div>

</li> 
<?php } ?>
    <li>

<?php 
$product_id = getProductId($id);                                                                            
$superProductsUser = getsuperProducts($c_id,$product_id['sp_product_id']);
if(count($superProductsUser)>0) {
?>
<table width="100%"> 
<tbody>
<tr style="background-color: #F9F2DE;border-bottom: 1px solid #FF7E00;color:#fff;">                                                                            
<td align="center" height="30" valign="middle" bgcolor="#f68210"  class="brdr pad_lft">Product Name</td>
<td align="center" valign="middle" bgcolor="#f68210"  class="brdr pad_lft">List Price</td>
<td align="center" valign="middle" bgcolor="#f68210"  class="brdr pad_lft">Discount(%)</td>
<td align="center" valign="middle" bgcolor="#f68210"  class="brdr pad_lft">Selling Price</td>                                                                            
<td align="center" valign="middle" width="80" bgcolor="#f68210"  class="brdr">Action</td>
</tr>
<?php foreach ($superProductsUser as $Product) { 
    $special_price=in_array($Product['id'],$sprice_product) ? $sprice_dprice[$Product['id']][0] : $Product['list_price'];
    $price_product=in_array($Product['id'],$sprice_product) ? $sprice_dprice[$Product['id']][2] : $Product['list_price'];
<?php

require_once "../../controllers/DBfunctions/DbFunctions.php";
$dbh = $db->getPurePodo();
$temp = "hello";
//Die("Hello chamath");
foreach ($_GET as $key => $value) {
    //echo "Field ".htmlspecialchars($key)." is ".htmlspecialchars($value)."<br>";
}
$Ref_id = filter_var($_GET["refname"], FILTER_SANITIZE_STRING);
$date = filter_var($_GET["CurrentDate"], FILTER_SANITIZE_STRING);
$amount = abs(filter_var($_GET["Amount"], FILTER_SANITIZE_STRING));
$productIdlist = getProductId();
$result = 0;
$db->beginTransaction();
if ($amount != 0) {
    $result = $db->query("INSERT INTO Advances (ref_id,Amount,Time_stamp) VALUES(:ref_id,:Amount,:Timestampd)", array("ref_id" => $Ref_id, "Amount" => $amount, "Timestampd" => $date));
}
foreach ($productIdlist as $productid) {
    $total_salary = 0;
    $productInfo = getProductInfo();
    $saleskey = 'sales' . $productid;
    $returnkey = 'return' . $productid;
    //echo $saleskey.$returnkey;
    $sales = filter_var($_GET["{$saleskey}"], FILTER_SANITIZE_STRING);
    $return = filter_var($_GET["{$returnkey}"], FILTER_SANITIZE_STRING);
    //echo $sales.$return;
    if ($sales != 0 || $return != 0) {
        if ($sales != 0) {
            //add entry for stock table
            // $result = $db->query("INSERT INTO Stock (SalesOut,product_id) VALUES (:OutStock,:product_id)",array("OutStock" => $sales, "product_id" =>$productid));