public function initialize()
 {
     $OSCOM_PDO = Registry::get('PDO');
     $OSCOM_Language = Registry::get('Language');
     $OSCOM_Currencies = Registry::get('Currencies');
     $Qupcoming = $OSCOM_PDO->prepare('select p.products_id, pa.value as date_expected from :table_products p, :table_templates_boxes tb, :table_product_attributes pa where tb.code = :code and tb.id = pa.id and to_days(str_to_date(pa.value, "%Y-%m-%d")) >= to_days(now()) and pa.products_id = p.products_id and p.products_status = :products_status order by pa.value limit :max_display_upcoming_products');
     $Qupcoming->bindValue(':code', 'DateAvailable');
     $Qupcoming->bindInt(':products_status', 1);
     $Qupcoming->bindInt(':max_display_upcoming_products', MODULE_CONTENT_UPCOMING_PRODUCTS_MAX_DISPLAY);
     if (MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE > 0) {
         $Qupcoming->setCache('upcoming_products-' . $OSCOM_Language->getCode() . '-' . $OSCOM_Currencies->getCode(), MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE);
     }
     $Qupcoming->execute();
     $result = $Qupcoming->fetchAll();
     if (!empty($result)) {
         $this->_content = '<ol style="list-style: none;">';
         foreach ($result as $r) {
             $OSCOM_Product = new Product($r['products_id']);
             $this->_content .= '<li>' . DateTime::getLong($r['date_expected']) . ': ' . HTML::link(OSCOM::getLink(null, 'Products', $OSCOM_Product->getKeyword()), $OSCOM_Product->getTitle()) . ' ' . $OSCOM_Product->getPriceFormated(true) . '</li>';
         }
         $this->_content .= '</ol>';
     }
 }
Example #2
0
 public function initialize()
 {
     $OSCOM_Database = Registry::get('Database');
     $OSCOM_Language = Registry::get('Language');
     $OSCOM_Currencies = Registry::get('Currencies');
     $Qupcoming = $OSCOM_Database->query('select p.products_id, pa.value as date_expected from :table_products p, :table_templates_boxes tb, :table_product_attributes pa where tb.code = :code and tb.id = pa.id and to_days(str_to_date(pa.value, "%Y-%m-%d")) >= to_days(now()) and pa.products_id = p.products_id and p.products_status = :products_status order by pa.value limit :max_display_upcoming_products');
     $Qupcoming->bindValue(':code', 'DateAvailable');
     $Qupcoming->bindInt(':products_status', 1);
     $Qupcoming->bindInt(':max_display_upcoming_products', MODULE_CONTENT_UPCOMING_PRODUCTS_MAX_DISPLAY);
     if (MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE > 0) {
         $Qupcoming->setCache('upcoming_products-' . $OSCOM_Language->getCode() . '-' . $OSCOM_Currencies->getCode(), MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE);
     }
     $Qupcoming->execute();
     if ($Qupcoming->numberOfRows() > 0) {
         $this->_content = '<ol style="list-style: none;">';
         while ($Qupcoming->next()) {
             $OSCOM_Product = new Product($Qupcoming->valueInt('products_id'));
             $this->_content .= '<li>' . DateTime::getLong($Qupcoming->value('date_expected')) . ': ' . osc_link_object(OSCOM::getLink(null, 'Products', $OSCOM_Product->getKeyword()), $OSCOM_Product->getTitle()) . ' ' . $OSCOM_Product->getPriceFormated(true) . '</li>';
         }
         $this->_content .= '</ol>';
     }
     $Qupcoming->freeResult();
 }
}
$counter = 0;
$reviews_listing = Reviews::getListing($OSCOM_Product->getID());
foreach ($reviews_listing['entries'] as $r) {
    $counter++;
    if ($counter > 1) {
        ?>

<hr style="height: 1px; width: 150px; text-align: left; margin-left: 0px" />

<?php 
    }
    ?>

<p><?php 
    echo HTML::image(OSCOM::getPublicSiteLink('images/stars_' . (int) $r['reviews_rating'] . '.png'), sprintf(OSCOM::getDef('rating_of_5_stars'), (int) $r['reviews_rating'])) . '&nbsp;' . sprintf(OSCOM::getDef('reviewed_by'), HTML::outputProtected($r['customers_name'])) . '; ' . DateTime::getLong($r['date_added']);
    ?>
</p>

<p><?php 
    echo nl2br(wordwrap(HTML::outputProtected($r['reviews_text']), 60, '&shy;'));
    ?>
</p>

<?php 
}
?>

<div class="listingPageLinks">
  <span style="float: right;"><?php 
echo PDO::getBatchPageLinks('page', $reviews_listing['total'], OSCOM::getAllGET('page'));
$order = new Order($_GET['Orders']);
?>

<h1><?php 
echo $OSCOM_Template->getPageTitle();
?>
</h1>

<div class="moduleBox">
  <span style="float: right;"><h6><?php 
echo OSCOM::getDef('order_total_heading') . ' ' . $order->info['total'];
?>
</h6></span>

  <h6><?php 
echo OSCOM::getDef('order_date_heading') . ' ' . DateTime::getLong($order->info['date_purchased']) . ' <small>(' . $order->info['orders_status'] . ')</small>';
?>
</h6>

  <div class="content">
    <table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td width="30%" valign="top">

<?php 
if ($order->delivery != false) {
    ?>

          <h6><?php 
    echo OSCOM::getDef('order_delivery_address_title');
    ?>
<div style="float: right; text-align: center;">
  <?php 
    echo HTML::link(OSCOM::getLink(null, null, 'Images&' . $OSCOM_Product->getKeyword()), $OSCOM_Image->show($OSCOM_Product->getImage(), $OSCOM_Product->getTitle(), 'hspace="5" vspace="5"', 'thumbnail'), 'target="_blank" onclick="window.open(\'' . OSCOM::getLink(null, null, 'Images&' . $OSCOM_Product->getKeyword()) . '\', \'popUp\', \'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=' . ($OSCOM_Product->numberOfImages() > 1 ? $OSCOM_Image->getWidth('large') + $OSCOM_Image->getWidth('thumbnails') * 2 + 70 : $OSCOM_Image->getWidth('large') + 20) . ',height=' . ($OSCOM_Image->getHeight('large') + 20) . '\'); return false;"');
    ?>
  <?php 
    echo '<p>' . HTML::button(array('href' => OSCOM::getLink(null, 'Cart', 'Add&' . $OSCOM_Product->getKeyword()), 'icon' => 'cart', 'title' => OSCOM::getDef('button_add_to_cart'))) . '</p>';
    ?>
</div>

<?php 
}
?>

<p><?php 
echo HTML::image(OSCOM::getPublicSiteLink('images/stars_' . $Qreviews->valueInt('reviews_rating') . '.png'), sprintf(OSCOM::getDef('rating_of_5_stars'), $Qreviews->valueInt('reviews_rating'))) . '&nbsp;' . sprintf(OSCOM::getDef('reviewed_by'), $Qreviews->valueProtected('customers_name')) . '; ' . DateTime::getLong($Qreviews->value('date_added'));
?>
</p>

<p><?php 
echo nl2br(wordwrap($Qreviews->valueProtected('reviews_text'), 60, '&shy;'));
?>
</p>

<div class="submitFormButtons">
  <span style="float: right;"><?php 
echo HTML::button(array('href' => OSCOM::getLink(null, null, 'Reviews&Write&' . $OSCOM_Product->getKeyword()), 'icon' => 'pencil', 'title' => OSCOM::getDef('button_write_review')));
?>
</span>

  <?php 
Example #6
0
<div style="float: right; text-align: center;">
  <?php 
    echo osc_link_object(OSCOM::getLink(null, null, 'Images&' . $OSCOM_Product->getKeyword()), $OSCOM_Image->show($OSCOM_Product->getImage(), $OSCOM_Product->getTitle(), 'hspace="5" vspace="5"', 'thumbnail'), 'target="_blank" onclick="window.open(\'' . OSCOM::getLink(null, null, 'Images&' . $OSCOM_Product->getKeyword()) . '\', \'popUp\', \'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=' . ($OSCOM_Product->numberOfImages() > 1 ? $OSCOM_Image->getWidth('large') + $OSCOM_Image->getWidth('thumbnails') * 2 + 70 : $OSCOM_Image->getWidth('large') + 20) . ',height=' . ($OSCOM_Image->getHeight('large') + 20) . '\'); return false;"');
    ?>
  <?php 
    echo '<p>' . osc_link_object(OSCOM::getLink(null, 'Cart', 'Add&' . $OSCOM_Product->getKeyword()), osc_draw_image_button('button_in_cart.gif', OSCOM::getDef('button_add_to_cart'))) . '</p>';
    ?>
</div>

<?php 
}
?>

<p><?php 
echo osc_image(DIR_WS_IMAGES . 'stars_' . $Qreviews->valueInt('reviews_rating') . '.png', sprintf(OSCOM::getDef('rating_of_5_stars'), $Qreviews->valueInt('reviews_rating'))) . '&nbsp;' . sprintf(OSCOM::getDef('reviewed_by'), $Qreviews->valueProtected('customers_name')) . '; ' . DateTime::getLong($Qreviews->value('date_added'));
?>
</p>

<p><?php 
echo nl2br(wordwrap($Qreviews->valueProtected('reviews_text'), 60, '&shy;'));
?>
</p>

<div class="submitFormButtons">
  <span style="float: right;"><?php 
echo osc_link_object(OSCOM::getLink(null, null, 'Reviews&Write&' . $OSCOM_Product->getKeyword()), osc_draw_image_button('button_write_review.gif', OSCOM::getDef('button_write_review')));
?>
</span>

  <?php 
Example #7
0
<?php 
echo osc_image(DIR_WS_IMAGES . $OSCOM_Template->getPageImage(), $OSCOM_Template->getPageTitle(), HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT, 'id="pageIcon"');
?>

<h1><?php 
echo $OSCOM_Template->getPageTitle();
?>
</h1>

<?php 
while ($Qreviews->next()) {
    ?>

<div class="moduleBox">
  <div style="float: right; margin-top: 5px;"><?php 
    echo sprintf(OSCOM::getDef('review_date_added'), DateTime::getLong($Qreviews->value('date_added')));
    ?>
</div>

  <h6><?php 
    echo osc_link_object(OSCOM::getLink(null, 'Products', 'Reviews&View=' . $Qreviews->valueInt('reviews_id') . '&' . $Qreviews->value('products_keyword')), $Qreviews->value('products_name'));
    ?>
 (<?php 
    echo sprintf(OSCOM::getDef('reviewed_by'), $Qreviews->valueProtected('customers_name'));
    ?>
)</h6>

  <div class="content">

<?php 
    if (!osc_empty($Qreviews->value('image'))) {
Example #8
0
  <tr>
    <td width="<?php 
        echo $OSCOM_Image->getWidth('thumbnails') + 10;
        ?>
" valign="top" align="center">

<?php 
        if ($OSCOM_Product->hasImage()) {
            echo osc_link_object(OSCOM::getLink(null, null, $OSCOM_Product->getKeyword()), $OSCOM_Image->show($OSCOM_Product->getImage(), $OSCOM_Product->getTitle()));
        }
        ?>

    </td>
    <td valign="top"><?php 
        echo osc_link_object(OSCOM::getLink(null, null, $OSCOM_Product->getKeyword()), '<b><u>' . $OSCOM_Product->getTitle() . '</u></b>') . '<br />' . OSCOM::getDef('date_added') . ' ' . DateTime::getLong($OSCOM_Product->getDateAdded()) . '<br />' . OSCOM::getDef('manufacturer') . ' ' . $OSCOM_Product->getManufacturer() . '<br /><br />' . OSCOM::getDef('price') . ' ' . $OSCOM_Product->getPriceFormated();
        ?>
</td>
    <td align="right" valign="middle"><?php 
        echo osc_link_object(OSCOM::getLink(null, 'Cart', 'Add&' . $OSCOM_Product->getKeyword()), osc_draw_image_button('button_in_cart.gif', OSCOM::getDef('button_add_to_cart')));
        ?>
</td>
  </tr>
  <tr>
    <td colspan="3">&nbsp;</td>
  </tr>

<?php 
    }
} else {
    ?>
Example #9
0
use osCommerce\OM\Core\Site\Shop\Reviews;
$reviews_listing = Reviews::getListing();
?>

<h1><?php 
echo $OSCOM_Template->getPageTitle();
?>
</h1>

<?php 
foreach ($reviews_listing['entries'] as $r) {
    ?>

<div class="moduleBox">
  <div style="float: right; margin-top: 5px;"><?php 
    echo sprintf(OSCOM::getDef('review_date_added'), DateTime::getLong($r['date_added']));
    ?>
</div>

  <h6><?php 
    echo HTML::link(OSCOM::getLink(null, 'Products', 'Reviews&View=' . $r['reviews_id'] . '&' . $r['products_keyword']), $r['products_name']);
    ?>
 (<?php 
    echo sprintf(OSCOM::getDef('reviewed_by'), HTML::outputProtected($r['customers_name']));
    ?>
)</h6>

  <div class="content">

<?php 
    if (!empty($r['image'])) {
Example #10
0
 public static function sendEmail($id)
 {
     $OSCOM_PDO = Registry::get('PDO');
     $OSCOM_Currencies = Registry::get('Currencies');
     $OSCOM_Language = Registry::get('Language');
     $Qorder = $OSCOM_PDO->prepare('select * from :table_orders where orders_id = :orders_id limit 1');
     $Qorder->bindInt(':orders_id', $id);
     $Qorder->execute();
     if ($Qorder->fetch() !== false) {
         $email_order = STORE_NAME . "\n" . OSCOM::getDef('email_order_separator') . "\n" . sprintf(OSCOM::getDef('email_order_order_number'), $id) . "\n" . sprintf(OSCOM::getDef('email_order_invoice_url'), OSCOM::getLink('Shop', 'Account', 'Orders=' . $id, 'SSL', false, true, true)) . "\n" . sprintf(OSCOM::getDef('email_order_date_ordered'), DateTime::getLong()) . "\n\n" . OSCOM::getDef('email_order_products') . "\n" . OSCOM::getDef('email_order_separator') . "\n";
         $Qproducts = $OSCOM_PDO->prepare('select orders_products_id, products_model, products_name, products_price, products_tax, products_quantity from :table_orders_products where orders_id = :orders_id order by orders_products_id');
         $Qproducts->bindInt(':orders_id', $id);
         $Qproducts->execute();
         while ($Qproducts->fetch()) {
             $email_order .= $Qproducts->valueInt('products_quantity') . ' x ' . $Qproducts->value('products_name') . ' (' . $Qproducts->value('products_model') . ') = ' . $OSCOM_Currencies->displayPriceWithTaxRate($Qproducts->value('products_price'), $Qproducts->value('products_tax'), $Qproducts->valueInt('products_quantity'), false, $Qorder->value('currency'), $Qorder->value('currency_value')) . "\n";
             $Qvariants = $OSCOM_PDO->prepare('select group_title, value_title from :table_orders_products_variants where orders_id = :orders_id and orders_products_id = :orders_products_id order by id');
             $Qvariants->bindInt(':orders_id', $id);
             $Qvariants->bindInt(':orders_products_id', $Qproducts->valueInt('orders_products_id'));
             $Qvariants->execute();
             while ($Qvariants->fetch()) {
                 $email_order .= "\t" . $Qvariants->value('group_title') . ': ' . $Qvariants->value('value_title') . "\n";
             }
         }
         $email_order .= OSCOM::getDef('email_order_separator') . "\n";
         $Qtotals = $OSCOM_PDO->prepare('select title, text from :table_orders_total where orders_id = :orders_id order by sort_order');
         $Qtotals->bindInt(':orders_id', $id);
         $Qtotals->execute();
         while ($Qtotals->fetch()) {
             $email_order .= strip_tags($Qtotals->value('title') . ' ' . $Qtotals->value('text')) . "\n";
         }
         if (strlen($Qorder->value('delivery_name')) > 0 && strlen($Qorder->value('delivery_street_address')) > 0) {
             $address = array('name' => $Qorder->value('delivery_name'), 'company' => $Qorder->value('delivery_company'), 'street_address' => $Qorder->value('delivery_street_address'), 'suburb' => $Qorder->value('delivery_suburb'), 'city' => $Qorder->value('delivery_city'), 'state' => $Qorder->value('delivery_state'), 'zone_code' => $Qorder->value('delivery_state_code'), 'country_title' => $Qorder->value('delivery_country'), 'country_iso2' => $Qorder->value('delivery_country_iso2'), 'country_iso3' => $Qorder->value('delivery_country_iso3'), 'postcode' => $Qorder->value('delivery_postcode'), 'format' => $Qorder->value('delivery_address_format'));
             $email_order .= "\n" . OSCOM::getDef('email_order_delivery_address') . "\n" . OSCOM::getDef('email_order_separator') . "\n" . Address::format($address) . "\n";
         }
         $address = array('name' => $Qorder->value('billing_name'), 'company' => $Qorder->value('billing_company'), 'street_address' => $Qorder->value('billing_street_address'), 'suburb' => $Qorder->value('billing_suburb'), 'city' => $Qorder->value('billing_city'), 'state' => $Qorder->value('billing_state'), 'zone_code' => $Qorder->value('billing_state_code'), 'country_title' => $Qorder->value('billing_country'), 'country_iso2' => $Qorder->value('billing_country_iso2'), 'country_iso3' => $Qorder->value('billing_country_iso3'), 'postcode' => $Qorder->value('billing_postcode'), 'format' => $Qorder->value('billing_address_format'));
         $email_order .= "\n" . OSCOM::getDef('email_order_billing_address') . "\n" . OSCOM::getDef('email_order_separator') . "\n" . Address::format($address) . "\n\n";
         $Qstatus = $OSCOM_PDO->prepare('select orders_status_name from :table_orders_status where orders_status_id = :orders_status_id and language_id = :language_id');
         $Qstatus->bindInt(':orders_status_id', $Qorder->valueInt('orders_status'));
         $Qstatus->bindInt(':language_id', $OSCOM_Language->getID());
         $Qstatus->execute();
         $email_order .= sprintf(OSCOM::getDef('email_order_status'), $Qstatus->value('orders_status_name')) . "\n" . OSCOM::getDef('email_order_separator') . "\n";
         $Qstatuses = $OSCOM_PDO->prepare('select date_added, comments from :table_orders_status_history where orders_id = :orders_id and comments != "" order by orders_status_history_id');
         $Qstatuses->bindInt(':orders_id', $id);
         $Qstatuses->execute();
         while ($Qstatuses->fetch()) {
             $email_order .= DateTime::getLong($Qstatuses->value('date_added')) . "\n\t" . wordwrap(str_replace("\n", "\n\t", $Qstatuses->value('comments')), 60, "\n\t", 1) . "\n\n";
         }
         // HPDL
         //        if (is_object($GLOBALS[$payment])) {
         //          $email_order .= OSCOM::getDef('email_order_payment_method') . "\n" .
         //                          OSCOM::getDef('email_order_separator') . "\n";
         //          $email_order .= $OSCOM_ShoppingCart->getBillingMethod('title') . "\n\n";
         //          if (isset($GLOBALS[$payment]->email_footer)) {
         //            $email_order .= $GLOBALS[$payment]->email_footer . "\n\n";
         //          }
         //        }
         $oEmail = new Mail($Qorder->value('customers_name'), $Qorder->value('customers_email_address'), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, OSCOM::getDef('email_order_subject'));
         $oEmail->setBodyPlain($email_order);
         $oEmail->send();
         // send emails to other people
         if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
             $oEmail = new Mail('', SEND_EXTRA_ORDER_EMAILS_TO, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, OSCOM::getDef('email_order_subject'));
             $oEmail->setBodyPlain($email_order);
             $oEmail->send();
         }
     }
 }
Example #11
0
<div class="moduleBox">
  <span style="float: right;"><h6><?php 
        echo OSCOM::getDef('order_status') . ' ' . $o['orders_status_name'];
        ?>
</h6></span>

  <h6><?php 
        echo OSCOM::getDef('order_number') . ' ' . $o['orders_id'];
        ?>
</h6>

  <div class="content">
    <table border="0" width="100%" cellspacing="2" cellpadding="4">
      <tr>
        <td width="50%" valign="top"><?php 
        echo '<b>' . OSCOM::getDef('order_date') . '</b> ' . DateTime::getLong($o['date_purchased']) . '<br /><b>' . $order_type . '</b> ' . HTML::outputProtected($order_name);
        ?>
</td>
        <td width="30%" valign="top"><?php 
        echo '<b>' . OSCOM::getDef('order_products') . '</b> ' . Order::numberOfProducts($o['orders_id']) . '<br /><b>' . OSCOM::getDef('order_cost') . '</b> ' . strip_tags($o['order_total']);
        ?>
</td>
        <td width="20%"><?php 
        echo HTML::button(array('href' => OSCOM::getLink(null, null, 'Orders=' . $o['orders_id'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''), 'SSL'), 'icon' => 'document', 'title' => OSCOM::getDef('button_view')));
        ?>
</td>
      </tr>
    </table>
  </div>
</div>
Example #12
0
<div class="moduleBox">
  <span style="float: right;"><h6><?php 
        echo OSCOM::getDef('order_status') . ' ' . $Qhistory->value('orders_status_name');
        ?>
</h6></span>

  <h6><?php 
        echo OSCOM::getDef('order_number') . ' ' . $Qhistory->valueInt('orders_id');
        ?>
</h6>

  <div class="content">
    <table border="0" width="100%" cellspacing="2" cellpadding="4">
      <tr>
        <td width="50%" valign="top"><?php 
        echo '<b>' . OSCOM::getDef('order_date') . '</b> ' . DateTime::getLong($Qhistory->value('date_purchased')) . '<br /><b>' . $order_type . '</b> ' . osc_output_string_protected($order_name);
        ?>
</td>
        <td width="30%" valign="top"><?php 
        echo '<b>' . OSCOM::getDef('order_products') . '</b> ' . Order::numberOfProducts($Qhistory->valueInt('orders_id')) . '<br /><b>' . OSCOM::getDef('order_cost') . '</b> ' . strip_tags($Qhistory->value('order_total'));
        ?>
</td>
        <td width="20%"><?php 
        echo osc_link_object(OSCOM::getLink(null, null, 'Orders=' . $Qhistory->valueInt('orders_id') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''), 'SSL'), osc_draw_image_button('small_view.gif', OSCOM::getDef('button_view')));
        ?>
</td>
      </tr>
    </table>
  </div>
</div>