$sProductListBuyNow = '<form name="buy_slave" action="' . OOS_HTTP_SERVER . OOS_SHOP . 'index.php" method="post">'; $sProductListBuyNow .='<input type="hidden" name="action" value="buy_slave">'; $sProductListBuyNow .='<input type="hidden" name="slave_id" value="' . $listing['products_id'] .'">'; $sProductListBuyNow .='<input type="hidden" name="page" value="' . $sPage .'">'; $sProductListBuyNow .='<input type="hidden" name="formid" value="' . $sFormid .'">'; $sProductListBuyNow .='<input type="hidden" name="categories" value="' . $categories .'">'; $sProductListBuyNow .='<input type="hidden" name="products_id" value="' . $nProductsId .'">'; $sProductListBuyNow .=oos_hide_session_id(); // todo remove oos_get_all_as_hidden_field $sProductListBuyNow .=oos_get_all_as_hidden_field(array('action')); $sProductListBuyNow .='<input type="hidden" name="nv" value="' . $nCurrentPageNumber .'">'; $sProductListBuyNow .=$aLang['products_order_qty_text']; $sProductListBuyNow .=' <input type="text" name="cart_quantity" value="' . $order_min . '" size="3" /><br />'; $sProductListBuyNow .=oos_image_submit('buy_now.gif', $aLang['text_buy'] . $listing['products_name'] . $aLang['text_now']); $sProductListBuyNow .='</form>'; } else { $sProductListBuyNow = '<a href="' . oos_href_link($sPage, $all_get_listing . 'action=buy_slave&slave_id=' . $listing['products_id'] . '&cart_quantity=' . $order_min ) . '" title="' . $listing['products_name'] . '">' . oos_image_button('buy_now.gif', $aLang['text_buy'] . $listing['products_name'] . $aLang['text_now']) . '</a> '; } } $aProductListing[] = array( 'products_id' => $listing['products_id'], 'products_model' => $listing['products_model'], 'products_image' => $listing['products_image'], 'products_name' => $listing['products_name'], 'manufacturers_id' => $listing['manufacturers_id'], 'manufacturers_name' => $listing['manufacturers_name'], 'products_quantity' => $listing['products_quantity'],
function confirm() { $audience = array(); // Get database information $dbconn =& oosDBGetConn(); $oostable =& oosDBGetTables(); $aFilename = oos_get_filename(); if ($_GET['global'] == 'true') { $products_result = $dbconn->Execute("SELECT distinct customers_id FROM " . $oostable['products_notifications']); while ($products = $products_result->fields) { $audience[$products['customers_id']] = '1'; // Move that ADOdb pointer! $products_result->MoveNext(); } $customers_result = $dbconn->Execute("SELECT customers_info_id FROM " . $oostable['customers_info'] . " WHERE global_product_notifications = '1'"); while ($customers = $customers_result->fields) { $audience[$customers['customers_info_id']] = '1'; // Move that ADOdb pointer! $customers_result->MoveNext(); } } else { $chosen = $_POST['chosen']; $ids = implode(',', $chosen); $products_result = $dbconn->Execute("SELECT DISTINCT customers_id FROM " . $oostable['products_notifications'] . " WHERE products_id in (" . $ids . ")"); while ($products = $products_result->fields) { $audience[$products['customers_id']] = '1'; $products_result->MoveNext(); } $customers_result = $dbconn->Execute("SELECT customers_info_id FROM " . $oostable['customers_info'] . " WHERE global_product_notifications = '1'"); while ($customers = $customers_result->fields) { $audience[$customers['customers_info_id']] = '1'; // Move that ADOdb pointer! $customers_result->MoveNext(); } } $confirm_string = '<table border="0" cellspacing="0" cellpadding="2">' . "\n" . ' <tr>' . "\n" . ' <td class="main"><font color="#ff0000"><b>' . sprintf(TEXT_COUNT_CUSTOMERS, count($audience)) . '</b></font></td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td>' . oos_draw_separator('trans.gif', '1', '10') . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td class="main"><b>' . $this->title . '</b></td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td>' . oos_draw_separator('trans.gif', '1', '10') . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td class="main"><tt>' . nl2br($this->content) . '</tt></td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . "\n" . ' <td>' . oos_draw_separator('trans.gif', '1', '10') . '</td>' . "\n" . ' </tr>' . "\n" . ' <tr>' . oos_draw_form('confirm', $aFilename['newsletters'], 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'] . '&action=confirm_send') . "\n" . ' <td align="right">'; if (count($audience) > 0) { if ($_GET['global'] == 'true') { $confirm_string .= oos_draw_hidden_field('global', 'true'); } else { for ($i = 0, $n = count($chosen); $i < $n; $i++) { $confirm_string .= oos_draw_hidden_field('chosen[]', $chosen[$i]); } } $confirm_string .= oos_image_submit('send.gif', IMAGE_SEND) . ' '; } $confirm_string .= '<a href="' . oos_href_link_admin($aFilename['newsletters'], 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'] . '&action=send') . '">' . oos_image_button('back.gif', IMAGE_BACK) . '</a> <a href="' . oos_href_link_admin($aFilename['newsletters'], 'page=' . $_GET['page'] . '&nID=' . $_GET['nID']) . '">' . oos_image_button('cancel_off.gif', IMAGE_CANCEL) . '</a></td>' . "\n" . ' </tr>' . "\n" . '</table>'; return $confirm_string; }