$smarty->assign('featuredSubscriptionsRows',$returnRows); $smarty->assign('featuredSubscriptions',$featuredSubscriptionsArray); } */ } catch (Exception $e) { die(exceptionError($e)); } } /* * Get featured homepage credits */ if ($config['settings']['hpcredits']) { try { $featuredCreditsResult = mysqli_query($db, "\r\n\t\t\t\tSELECT *\r\n\t\t\t\tFROM {$dbinfo[pre]}credits \r\n\t\t\t\tLEFT JOIN {$dbinfo[pre]}perms\r\n\t\t\t\tON ({$dbinfo[pre]}credits.credit_id = {$dbinfo[pre]}perms.item_id AND {$dbinfo[pre]}perms.perm_area = 'credits') \r\n\t\t\t\tWHERE {$dbinfo[pre]}credits.active = 1 \r\n\t\t\t\tAND {$dbinfo[pre]}credits.homepage = 1 \r\n\t\t\t\tAND {$dbinfo[pre]}credits.deleted = 0\r\n\t\t\t\tAND ({$dbinfo[pre]}credits.everyone = 1 OR {$dbinfo[pre]}perms.perm_value IN ({$memberPermissionsForDB}))\r\n\t\t\t\tORDER BY {$dbinfo[pre]}credits.sortorder\r\n\t\t\t\t"); while ($featuredCredits = mysqli_fetch_assoc($featuredCreditsResult)) { $featuredCreditsArray[] = creditsList($featuredCredits); } $smarty->assign('featuredCreditsRows', count($featuredCreditsArray)); $smarty->assign('featuredCredits', $featuredCreditsArray); /* if($returnRows = mysqli_num_rows($featuredCreditsResult)) { while($featuredCredits = mysqli_fetch_assoc($featuredCreditsResult)) $featuredCreditsArray[] = creditsList($featuredCredits); $smarty->assign('featuredCreditsRows',$returnRows); $smarty->assign('featuredCredits',$featuredCreditsArray); } */ } catch (Exception $e) { die(exceptionError($e));
$cartItemsArray[$cartItem['oi_id']]['lineItemPriceEach'] = $lineItemPriceEach; $cartItemsArray[$cartItem['oi_id']]['lineItemPriceEachLocal'] = $lineItemPriceEachLocal; $cartItemsArray[$cartItem['oi_id']]['lineItemCreditsEach'] = $lineItemCreditsEach; $cartItemsArray[$cartItem['oi_id']]['lineItemCreditsTotal'] = $lineItemCreditsTotal; $cartItemsArray[$cartItem['oi_id']]['itemDetails'] = $subscriptionDetails; $cartItemsArray[$cartItem['oi_id']]['itemTypeShort'] = 'sub'; // Update prices and credits for invoice item in the db mysqli_query($db, "\r\n\t\t\t\t\t\t\tUPDATE {$dbinfo[pre]}invoice_items SET \r\n\t\t\t\t\t\t\tprice_total='{$lineItemPriceTotal}',\r\n\t\t\t\t\t\t\tprice='{$lineItemPriceEach}',\r\n\t\t\t\t\t\t\tcredits_total='{$lineItemCreditsTotal}',\r\n\t\t\t\t\t\t\tcredits='{$lineItemCreditsEach}'\r\n\t\t\t\t\t\t\tWHERE oi_id = '{$cartItem[oi_id]}'\r\n\t\t\t\t\t\t"); break; case "credits": $accountWorkbox = 1; // If they are buying credits we need to force an account $creditsResult = mysqli_query($db, "\r\n\t\t\t\t\t\t\tSELECT * FROM {$dbinfo[pre]}credits \r\n\t\t\t\t\t\t\tWHERE credit_id = '{$cartItem[item_id]}'\r\n\t\t\t\t\t\t\t"); // Select credits here $credits = mysqli_fetch_assoc($creditsResult); $creditsDetails = creditsList($credits, 0); $creditsDetails['cartEditLink'] .= '&edit=' . $cartItem['oi_id']; // Add edit var $creditsInCart += $creditsDetails['credits'] * $cartItem['quantity']; // Add these to the number of credits that are available in the cart to checkout with if (!$cartItem['paytype']) { $cartItem['paytype'] = 'cur'; } // Make sure the payType is set just in case $cartItemsArray[$cartItem['oi_id']]['usePayType'] = $cartItem['paytype']; // Set the payType to the item $cartItemsArray[$cartItem['oi_id']]['payTypeCount'] = 0; // Number of options available to pay $numOfCreditPacks += $cartItem['quantity']; // Count the number of credit packages items in the cart /*
try { //echo $id; exit; if ($config['EncryptIDs']) { // Decrypt IDs $id = k_decrypt($id); } idCheck($id); // Make sure ID is numeric $creditResult = mysqli_query($db, "\r\n\t\t\tSELECT *\r\n\t\t\tFROM {$dbinfo[pre]}credits \r\n\t\t\tLEFT JOIN {$dbinfo[pre]}perms\r\n\t\t\tON ({$dbinfo[pre]}credits.credit_id = {$dbinfo[pre]}perms.item_id AND {$dbinfo[pre]}perms.perm_area = 'credits')\r\n\t\t\tWHERE {$dbinfo[pre]}credits.credit_id = {$id}\r\n\t\t\tAND ({$dbinfo[pre]}credits.everyone = 1 OR {$dbinfo[pre]}perms.perm_value IN ({$memberPermissionsForDB}))\r\n\t\t\t"); if (@($returnRows = mysqli_num_rows($creditResult))) { if ($edit) { // We are editing this item $smarty->assign('edit', k_encrypt($edit)); } $credit = mysqli_fetch_assoc($creditResult); $creditArray = creditsList($credit); if ($credit['active'] == 1 and $credit['deleted'] == 0) { $smarty->assign('credit', $creditArray); $smarty->assign('creditRows', $returnRows); } else { $smarty->assign('noAccess', 1); } } else { $smarty->assign('noAccess', 1); } $smarty->display('credits.tpl'); // Smarty template } catch (Exception $e) { echo $e->getMessage(); } if ($db) {