Exemplo n.º 1
0
 function initialize()
 {
     global $osC_Database, $osC_Language, $osC_Currencies;
     $Qupcoming = $osC_Database->query('select p.products_id, p.products_price, p.products_tax_class_id, p.products_date_available as date_expected, pd.products_name, pd.products_keyword, s.specials_new_products_price, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag) left join :table_specials s on (p.products_id = s.products_id and s.status = 1), :table_products_description pd where to_days(p.products_date_available) >= to_days(now()) and p.products_status = :products_status and p.products_id = pd.products_id and pd.language_id = :language_id order by p.products_date_available limit :max_display_upcoming_products');
     $Qupcoming->bindTable(':table_products', TABLE_PRODUCTS);
     $Qupcoming->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
     $Qupcoming->bindTable(':table_specials', TABLE_SPECIALS);
     $Qupcoming->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
     $Qupcoming->bindInt(':default_flag', 1);
     $Qupcoming->bindInt(':products_status', 1);
     $Qupcoming->bindInt(':language_id', $osC_Language->getID());
     $Qupcoming->bindInt(':max_display_upcoming_products', MODULE_CONTENT_UPCOMING_PRODUCTS_MAX_DISPLAY);
     if (MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE > 0) {
         $Qupcoming->setCache('upcoming_products-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode(), MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE);
     }
     $Qupcoming->execute();
     if ($Qupcoming->numberOfRows() > 0) {
         $this->_content = '<ol style="list-style: none;">';
         while ($Qupcoming->next()) {
             $this->_content .= '<li>' . osC_DateTime::getLong($Qupcoming->value('date_expected')) . ': ' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qupcoming->value('products_id')), $Qupcoming->value('products_name')) . ' ';
             if (osc_empty($Qupcoming->value('specials_new_products_price'))) {
                 $this->_content .= '(' . $osC_Currencies->displayPrice($Qupcoming->value('products_price'), $Qupcoming->valueInt('products_tax_class_id')) . ')';
             } else {
                 $this->_content .= '(<s>' . $osC_Currencies->displayPrice($Qupcoming->value('products_price'), $Qupcoming->valueInt('products_tax_class_id')) . '</s> <span class="productSpecialPrice">' . $osC_Currencies->displayPrice($Qupcoming->value('specials_new_products_price'), $Qupcoming->valueInt('products_tax_class_id')) . '</span>)';
             }
             $this->_content .= '</li>';
         }
         $this->_content .= '</ol>';
     }
     $Qupcoming->freeResult();
 }
Exemplo n.º 2
0
    function initialize()
    {
        global $osC_Database, $osC_Language, $osC_Currencies, $osC_Image, $osC_Template;
        $Qupcoming = $osC_Database->query('select p.products_id, p.products_price, p.products_tax_class_id, p.products_date_available as date_expected, pd.products_name, pd.products_keyword, s.specials_new_products_price, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag) left join :table_specials s on (p.products_id = s.products_id and s.status = 1), :table_products_description pd where to_days(p.products_date_available) >= to_days(now()) and p.products_status = :products_status and p.products_id = pd.products_id and pd.language_id = :language_id order by p.products_date_available limit :max_display_upcoming_products');
        $Qupcoming->bindTable(':table_products', TABLE_PRODUCTS);
        $Qupcoming->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
        $Qupcoming->bindTable(':table_specials', TABLE_SPECIALS);
        $Qupcoming->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
        $Qupcoming->bindInt(':default_flag', 1);
        $Qupcoming->bindInt(':products_status', 1);
        $Qupcoming->bindInt(':language_id', $osC_Language->getID());
        $Qupcoming->bindInt(':max_display_upcoming_products', MODULE_CONTENT_UPCOMING_PRODUCTS_MAX_DISPLAY);
        if (MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE > 0) {
            $Qupcoming->setCache('upcoming_products-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode(), MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE);
        }
        $Qupcoming->execute();
        $i = 0;
        if ($Qupcoming->numberOfRows() > 0) {
            $this->_content = '<div class="upcomingProductsModule clearfix">';
            while ($Qupcoming->next()) {
                $osC_Product = new osC_Product($Qupcoming->valueInt('products_id'));
                if ($i % 3 == 0 && $i != 0) {
                    $this->_content .= '<div class="productItem clearLeft">';
                } else {
                    $this->_content .= '<div class="productItem">';
                }
                $this->_content .= '<div class="productName">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qupcoming->value('products_id')), $Qupcoming->value('products_name')) . '</div>' . '<div>' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qupcoming->value('products_id')), $osC_Image->show($Qupcoming->value('image'), $Qupcoming->value('products_name'))) . '</div>' . '<div>' . $osC_Product->getPriceFormated(true) . '</div>' . '<div><strong>' . osC_DateTime::getLong($Qupcoming->value('date_expected')) . '</strong></div>';
                $this->_content .= '</div>';
                $i++;
            }
            $this->_content .= '</div>';
            //add the css block for this module
            $osC_Template->addStyleDeclaration('.clearLeft{clear:left;}
	                                          .upcomingProductsModule{overflow: auto; height: 100%;}
	                                          .upcomingProductsModule .productItem{width: 32%; float: left; text-align: center; padding: 2px;}
	                                          .upcomingProductsModule .productItem .productName{height:30px;}
	                                          .upcomingProductsModule .productItem div {margin:3px 0;}');
        }
        $Qupcoming->freeResult();
    }
Exemplo n.º 3
0
 function initialize()
 {
     global $osC_Database, $osC_Language, $osC_Currencies;
     $Qupcoming = $osC_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->bindTable(':table_products', TABLE_PRODUCTS);
     $Qupcoming->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
     $Qupcoming->bindTable(':table_product_attributes', TABLE_PRODUCT_ATTRIBUTES);
     $Qupcoming->bindValue(':code', 'date_available');
     $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-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode(), MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE);
     }
     $Qupcoming->execute();
     if ($Qupcoming->numberOfRows() > 0) {
         $this->_content = '<ol style="list-style: none;">';
         while ($Qupcoming->next()) {
             $osC_Product = new osC_Product($Qupcoming->valueInt('products_id'));
             $this->_content .= '<li>' . osC_DateTime::getLong($Qupcoming->value('date_expected')) . ': ' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getKeyword()), $osC_Product->getTitle()) . ' ' . $osC_Product->getPriceFormated(true) . '</li>';
         }
         $this->_content .= '</ol>';
     }
     $Qupcoming->freeResult();
 }
Exemplo n.º 4
0
}
$counter = 0;
$Qreviews = osC_Reviews::getListing($osC_Product->getID());
while ($Qreviews->next()) {
    $counter++;
    if ($counter > 1) {
        ?>

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

<?php 
    }
    ?>

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

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

<?php 
}
?>

<div class="listingPageLinks">
  <span style="float: right;"><?php 
echo $Qreviews->getBatchPageLinks('page', 'reviews');
Exemplo n.º 5
0
}
?>
    
    <div id="tabReviews">
      <div class="moduleBox">
        <div class="content">
          <?php 
if ($osC_Reviews->getReviewsCount($osC_Product->getID()) == 0) {
    echo '<p>' . $osC_Language->get('no_review') . '</p>';
} else {
    $Qreviews = osC_Reviews::getListing($osC_Product->getID());
    while ($Qreviews->next()) {
        ?>
              <dl class="review">
                <?php 
        echo '<dt>' . osc_image(DIR_WS_IMAGES . 'stars_' . $Qreviews->valueInt('reviews_rating') . '.png', sprintf($osC_Language->get('rating_of_5_stars'), $Qreviews->valueInt('reviews_rating'))) . '&nbsp;&nbsp;&nbsp;&nbsp;' . sprintf($osC_Language->get('reviewed_by'), '&nbsp; <b>' . $Qreviews->valueProtected('customers_name')) . '</b>' . '&nbsp;&nbsp;(' . $osC_Language->get('field_posted_on') . '&nbsp;' . osC_DateTime::getLong($Qreviews->value('date_added')) . ')' . '</dt>';
        echo '<dd>';
        $ratings = osC_Reviews::getCustomersRatings($Qreviews->valueInt('reviews_id'));
        if (sizeof($ratings) > 0) {
            echo '<table class="ratingsResult">';
            foreach ($ratings as $rating) {
                echo '<tr>
                             <td class="name">' . $rating['name'] . '</td><td>' . osc_image(DIR_WS_IMAGES . 'stars_' . $rating['value'] . '.png', sprintf($osC_Language->get('rating_of_5_stars'), $rating['value'])) . '</td>
                            </tr>';
            }
            echo '</table>';
        }
        echo '<p>' . $Qreviews->valueProtected('reviews_text') . '</p>';
        echo '</dd>';
        ?>
              </dl>
Exemplo n.º 6
0
<?php 
echo osc_image(DIR_WS_IMAGES . $osC_Template->getPageImage(), $osC_Template->getPageTitle(), HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT, 'id="pageIcon"');
?>

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

<?php 
while ($Qarticles->next()) {
    ?>
  <div class="moduleBox">

    <div style="float: right; margin-top: 5px;"><?php 
    echo osC_DateTime::getLong($Qarticles->value('articles_date_added'));
    ?>
</div>

    <h6><?php 
    echo osc_link_object(osc_href_link(FILENAME_INFO, 'articles&articles_id=' . $Qarticles->valueInt('articles_id')), $Qarticles->value('articles_name'));
    ?>
</h6>

    <div class="content">

  <?php 
    if (!osc_empty($Qarticles->value('articles_image'))) {
        echo osc_link_object(osc_href_link(FILENAME_INFO, 'articles&articles_id=' . $Qarticles->valueInt('articles_id')), $osC_Image->show($Qarticles->value('articles_image'), $Qarticles->value('articles_name'), 'style="float: left;"', '', 'articles'));
    }
    ?>
Exemplo n.º 7
0
  <tr>
    <td width="<?php 
        echo $osC_Image->getWidth('thumbnails') + 10;
        ?>
" valign="top" align="center">

<?php 
        if ($osC_Product->hasImage()) {
            echo osc_link_object(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getKeyword()), $osC_Image->show($osC_Product->getImage(), $osC_Product->getTitle()));
        }
        ?>

    </td>
    <td valign="top"><?php 
        echo osc_link_object(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getKeyword()), '<b><u>' . $osC_Product->getTitle() . '</u></b>') . '<br />' . $osC_Language->get('date_added') . ' ' . osC_DateTime::getLong($osC_Product->getDateAdded()) . '<br />' . $osC_Language->get('manufacturer') . ' ' . $osC_Product->getManufacturer() . '<br /><br />' . $osC_Language->get('price') . ' ' . $osC_Product->getPriceFormated();
        ?>
</td>
    <td align="right" valign="middle"><?php 
        echo osc_link_object(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getKeyword() . '&action=cart_add'), osc_draw_image_button('button_in_cart.gif', $osC_Language->get('button_add_to_cart')));
        ?>
</td>
  </tr>
  <tr>
    <td colspan="3">&nbsp;</td>
  </tr>

<?php 
    }
} else {
    ?>
Exemplo n.º 8
0
<div class="moduleBox">

  <h6><span style="float: left;"><?php 
        echo $osC_Language->get('order_status') . ' ' . osC_Order::getLastPublicStatus($Qhistory->value('orders_id'));
        ?>
</span><?php 
        echo $osC_Language->get('order_number') . ' ' . $Qhistory->valueInt('orders_id');
        ?>
</h6>

  <div class="content">
    <table border="0" width="100%" cellspacing="2" cellpadding="4">
      <tr>
        <td valign="top"><?php 
        echo '<b>' . $osC_Language->get('order_date') . '</b> ' . osC_DateTime::getLong($Qhistory->value('date_purchased')) . '<br /><b>' . $order_type . '</b> ' . osc_output_string_protected($order_name);
        ?>
</td>
        <td width="150" valign="top"><?php 
        echo '<b>' . $osC_Language->get('order_products') . '</b> ' . osC_Order::numberOfProducts($Qhistory->valueInt('orders_id')) . '<br /><b>' . $osC_Language->get('order_cost') . '</b> ' . strip_tags($Qhistory->value('order_total'));
        ?>
</td>
        <td width="100" align="center">
          <div style = "padding: 2px;"><?php 
        echo osc_link_object(osc_href_link(FILENAME_ACCOUNT, 'orders=' . $Qhistory->valueInt('orders_id') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''), 'SSL'), osc_draw_image_button('small_view.gif', $osC_Language->get('button_view')));
        ?>
</div>
          <div style = "padding: 2px;"><?php 
        echo osc_link_object(osc_href_link(FILENAME_PDF, 'module=account&pdf=print_order&orders_id=' . $Qhistory->valueInt('orders_id')), osc_draw_image_button('button_print.png', $osC_Language->get('button_print')), "target=_blank");
        ?>
</div>
Exemplo n.º 9
0
        $products_price = $osC_Product->getPriceFormated(true);
        ?>
    
      <tr>
        <td width="<?php 
        echo $osC_Image->getWidth('thumbnails') + 10;
        ?>
" valign="top" align="left">
    
    <?php 
        echo osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), $osC_Image->show($Qproducts->value('image'), $Qproducts->value('products_name')), 'id="img_ac_productsnew_' . $Qproducts->value('products_id') . '"');
        ?>
    
        </td>
        <td valign="top"><?php 
        echo osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), '<b><u>' . $Qproducts->value('products_name') . '</u></b>') . '<br />' . $osC_Language->get('date_added') . ' ' . osC_DateTime::getLong($Qproducts->value('products_date_added')) . '<br />' . $osC_Language->get('manufacturer') . ' ' . $Qproducts->value('manufacturers_name') . '<br /><br />' . $osC_Language->get('price') . ' ' . $products_price;
        ?>
</td>
        
        <?php 
        if ($Qproducts->value('products_type') == PRODUCT_TYPE_SIMPLE) {
            ?>
        <td>
        	<input type="text" id="qty_<?php 
            echo $Qproducts->valueInt('products_id');
            ?>
" value="1" size="1" class="qtyField" />
        </td>
        <?php 
        } else {
            ?>
Exemplo n.º 10
0
  <p><?php 
    echo $osC_Image->show($osC_ObjectInfo->get('image'), $products_name[$l['id']], 'align="right" hspace="5" vspace="5"', 'product_info') . $products_description[$l['id']];
    ?>
</p>

<?php 
    if (!empty($products_url[$l['id']])) {
        echo '<p>' . sprintf($osC_Language->get('more_product_information'), osc_output_string_protected($products_url[$l['id']])) . '</p>';
    }
    ?>

<?php 
    // HPDL
    //    if ($osC_ObjectInfo->get('products_date_available') > date('Y-m-d')) {
    //      echo '<p align="center">' . sprintf($osC_Language->get('product_date_available'), osC_DateTime::getLong($osC_ObjectInfo->get('products_date_available'))) . '</p>';
    //    } else {
    echo '<p align="center">' . sprintf($osC_Language->get('product_date_added'), osC_DateTime::getLong($osC_ObjectInfo->get('products_date_added'))) . '</p>';
    //    }
    ?>

</div>

<?php 
}
?>

<p align="right"><?php 
echo '<input type="button" value="' . $osC_Language->get('button_back') . '" onclick="document.location.href=\'' . osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '&cID=' . $_GET['cID']) . '\';" class="operationButton" />';
?>
</p>
Exemplo n.º 11
0
$order = new osC_Order($_GET['orders']);
?>

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

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

  <h6><?php 
echo $osC_Language->get('order_date_heading') . ' ' . osC_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="50%" valign="top">
          <h6><?php 
echo $osC_Language->get('order_billing_address_title');
?>
</h6>

          <p><?php 
echo osC_Address::format($order->billing, '<br />');
?>
Exemplo n.º 12
0
 function sendEmail($id)
 {
     global $osC_Database, $osC_Language, $osC_Currencies;
     $Qorder = $osC_Database->query('select * from :table_orders where orders_id = :orders_id limit 1');
     $Qorder->bindTable(':table_orders', TABLE_ORDERS);
     $Qorder->bindInt(':orders_id', $id);
     $Qorder->execute();
     if ($Qorder->numberOfRows() === 1) {
         $email_order = STORE_NAME . "\n" . $osC_Language->get('email_order_separator') . "\n" . sprintf($osC_Language->get('email_order_order_number'), $id) . "\n" . sprintf($osC_Language->get('email_order_invoice_url'), osc_href_link(FILENAME_ACCOUNT, 'orders=' . $id, 'SSL', false, true, true)) . "\n" . sprintf($osC_Language->get('email_order_date_ordered'), osC_DateTime::getLong()) . "\n\n" . $osC_Language->get('email_order_products') . "\n" . $osC_Language->get('email_order_separator') . "\n";
         $Qproducts = $osC_Database->query('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->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
         $Qproducts->bindInt(':orders_id', $id);
         $Qproducts->execute();
         while ($Qproducts->next()) {
             $email_order .= $Qproducts->valueInt('products_quantity') . ' x ' . $Qproducts->value('products_name') . ' (' . $Qproducts->value('products_model') . ') = ' . $osC_Currencies->displayPriceWithTaxRate($Qproducts->value('products_price'), $Qproducts->value('products_tax'), $Qproducts->valueInt('products_quantity'), false, $Qorder->value('currency'), $Qorder->value('currency_value')) . "\n";
             $Qvariants = $osC_Database->query('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->bindTable(':table_orders_products_variants', TABLE_ORDERS_PRODUCTS_VARIANTS);
             $Qvariants->bindInt(':orders_id', $id);
             $Qvariants->bindInt(':orders_products_id', $Qproducts->valueInt('orders_products_id'));
             $Qvariants->execute();
             while ($Qvariants->next()) {
                 $email_order .= "\t" . $Qvariants->value('group_title') . ': ' . $Qvariants->value('value_title') . "\n";
             }
         }
         unset($Qproducts);
         unset($Qvariants);
         $email_order .= $osC_Language->get('email_order_separator') . "\n";
         $Qtotals = $osC_Database->query('select title, text from :table_orders_total where orders_id = :orders_id order by sort_order');
         $Qtotals->bindTable(':table_orders_total', TABLE_ORDERS_TOTAL);
         $Qtotals->bindInt(':orders_id', $id);
         $Qtotals->execute();
         while ($Qtotals->next()) {
             $email_order .= strip_tags($Qtotals->value('title') . ' ' . $Qtotals->value('text')) . "\n";
         }
         unset($Qtotals);
         if (osc_empty($Qorder->value('delivery_name')) === false && osc_empty($Qorder->value('delivery_street_address')) === false) {
             $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" . $osC_Language->get('email_order_delivery_address') . "\n" . $osC_Language->get('email_order_separator') . "\n" . osC_Address::format($address) . "\n";
             unset($address);
         }
         $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" . $osC_Language->get('email_order_billing_address') . "\n" . $osC_Language->get('email_order_separator') . "\n" . osC_Address::format($address) . "\n\n";
         unset($address);
         $Qstatus = $osC_Database->query('select orders_status_name from :table_orders_status where orders_status_id = :orders_status_id and language_id = :language_id');
         $Qstatus->bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
         $Qstatus->bindInt(':orders_status_id', $Qorder->valueInt('orders_status'));
         $Qstatus->bindInt(':language_id', $osC_Language->getID());
         $Qstatus->execute();
         $email_order .= sprintf($osC_Language->get('email_order_status'), $Qstatus->value('orders_status_name')) . "\n" . $osC_Language->get('email_order_separator') . "\n";
         unset($Qstatus);
         $Qstatuses = $osC_Database->query('select date_added, comments from :table_orders_status_history where orders_id = :orders_id and comments != "" order by orders_status_history_id');
         $Qstatuses->bindTable(':table_orders_status_history', TABLE_ORDERS_STATUS_HISTORY);
         $Qstatuses->bindInt(':orders_id', $id);
         $Qstatuses->execute();
         while ($Qstatuses->next()) {
             $email_order .= osC_DateTime::getLong($Qstatuses->value('date_added')) . "\n\t" . wordwrap(str_replace("\n", "\n\t", $Qstatuses->value('comments')), 60, "\n\t", 1) . "\n\n";
         }
         unset($Qstatuses);
         //        if (is_object($GLOBALS[$payment])) {
         //          $email_order .= $osC_Language->get('email_order_payment_method') . "\n" .
         //                          $osC_Language->get('email_order_separator') . "\n";
         //          $email_order .= $osC_ShoppingCart->getBillingMethod('title') . "\n\n";
         //          if (isset($GLOBALS[$payment]->email_footer)) {
         //            $email_order .= $GLOBALS[$payment]->email_footer . "\n\n";
         //          }
         //        }
         osc_email($Qorder->value('customers_name'), $Qorder->value('customers_email_address'), $osC_Language->get('email_order_subject'), $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
         // send emails to other people
         if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
             osc_email('', SEND_EXTRA_ORDER_EMAILS_TO, $osC_Language->get('email_order_subject'), $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
         }
     }
     unset($Qorder);
 }
Exemplo n.º 13
0
<?php 
echo osc_image(DIR_WS_IMAGES . $osC_Template->getPageImage(), $osC_Template->getPageTitle(), HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT, 'id="pageIcon"');
?>

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

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

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

  <h6><?php 
    echo osc_link_object(osc_href_link(FILENAME_PRODUCTS, 'reviews=' . $Qreviews->valueInt('reviews_id')), $Qreviews->value('products_name'));
    ?>
 (<?php 
    echo sprintf($osC_Language->get('reviewed_by'), $Qreviews->valueProtected('customers_name'));
    ?>
)</h6>

  <div class="content">

<?php 
    if (!osc_empty($Qreviews->value('image'))) {
      <?php 
if ($Qlisting->numberOfRows() > 0) {
    ?>
        <dl id="guestbook">
        <?php 
    $i = 1;
    $class = '';
    while ($Qlisting->next()) {
        if ($i == $Qlisting->numberOfRows()) {
            $class = ' class="last"';
        }
        ?>
  
          <dt>
            <span><?php 
        echo osC_DateTime::getLong($Qlisting->value('date_added'));
        ?>
</span>
            <?php 
        echo $Qlisting->value('title');
        ?>
          </dt>
          <dd<?php 
        echo $class;
        ?>
><?php 
        echo $Qlisting->value('content');
        ?>
</dd>
        
        <?php 
 function buildMessage()
 {
     global $osC_Database, $osC_Language, $osC_Currencies;
     $Qorder = $osC_Database->query('select * from :table_orders where orders_id = :orders_id limit 1');
     $Qorder->bindTable(':table_orders', TABLE_ORDERS);
     $Qorder->bindInt(':orders_id', $this->_order_id);
     $Qorder->execute();
     if ($Qorder->numberOfRows() === 1) {
         $this->addRecipient($Qorder->value('customers_name'), $Qorder->value('customers_email_address'));
         $order_number = $this->_order_id;
         $invoice_link = osc_href_link(FILENAME_ACCOUNT, 'orders=' . $this->_order_id, 'SSL', false, true, true);
         $date_ordered = osC_DateTime::getLong();
         $order_details = $osC_Language->get('email_order_products') . "<br />" . $osC_Language->get('email_order_separator') . "<br />";
         $Qproducts = $osC_Database->query('select orders_products_id, products_sku, products_name, final_price, products_tax, products_quantity from :table_orders_products where orders_id = :orders_id order by orders_products_id');
         $Qproducts->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
         $Qproducts->bindInt(':orders_id', $this->_order_id);
         $Qproducts->execute();
         while ($Qproducts->next()) {
             $order_details .= $Qproducts->valueInt('products_quantity') . ' x ' . $Qproducts->value('products_name') . ' (' . $Qproducts->value('products_sku') . ') = ' . $osC_Currencies->displayPriceWithTaxRate($Qproducts->value('final_price'), $Qproducts->value('products_tax'), $Qproducts->valueInt('products_quantity'), $Qorder->value('currency'), $Qorder->value('currency_value')) . "<br />";
             $Qvariants = $osC_Database->query('select products_variants_groups as groups_name, products_variants_values as values_name from :table_orders_products_variants where orders_id = :orders_id and orders_products_id = :orders_products_id order by orders_products_variants_id');
             $Qvariants->bindTable(':table_orders_products_variants', TABLE_ORDERS_PRODUCTS_VARIANTS);
             $Qvariants->bindInt(':orders_id', $this->_order_id);
             $Qvariants->bindInt(':orders_products_id', $Qproducts->valueInt('orders_products_id'));
             $Qvariants->execute();
             while ($Qvariants->next()) {
                 $order_details .= "\t" . $Qvariants->value('groups_name') . ': ' . $Qvariants->value('values_name') . "<br />";
             }
         }
         unset($Qproducts);
         unset($Qvariants);
         $order_details .= $osC_Language->get('email_order_separator') . "<br />";
         $Qtotals = $osC_Database->query('select title, text from :table_orders_total where orders_id = :orders_id order by sort_order');
         $Qtotals->bindTable(':table_orders_total', TABLE_ORDERS_TOTAL);
         $Qtotals->bindInt(':orders_id', $this->_order_id);
         $Qtotals->execute();
         while ($Qtotals->next()) {
             $order_details .= strip_tags($Qtotals->value('title') . ' ' . $Qtotals->value('text')) . "<br />";
         }
         unset($Qtotals);
         if (osc_empty($Qorder->value('delivery_name') === false) && osc_empty($Qorder->value('delivery_street_address') === false)) {
             $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'));
             $delivery_address = osC_Address::format($address, "<br />");
             unset($address);
         }
         $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'));
         $billing_address = osC_Address::format($address, "<br />");
         unset($address);
         $Qstatus = $osC_Database->query('select orders_status_name from :table_orders_status where orders_status_id = :orders_status_id and language_id = :language_id');
         $Qstatus->bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
         $Qstatus->bindInt(':orders_status_id', $Qorder->valueInt('orders_status'));
         $Qstatus->bindInt(':language_id', $osC_Language->getID());
         $Qstatus->execute();
         $order_status = $Qstatus->value('orders_status_name');
         unset($Qstatus);
         $Qstatuses = $osC_Database->query('select date_added, comments from :table_orders_status_history where orders_id = :orders_id and comments != "" order by orders_status_history_id');
         $Qstatuses->bindTable(':table_orders_status_history', TABLE_ORDERS_STATUS_HISTORY);
         $Qstatuses->bindInt(':orders_id', $this->_order_id);
         $Qstatuses->execute();
         $order_comments = '';
         while ($Qstatuses->next()) {
             $order_comments .= osC_DateTime::getLong($Qstatuses->value('date_added')) . "<br />\t" . wordwrap(str_replace("<br />", "<br />\t", $Qstatuses->value('comments')), 60, "<br />\t", 1) . "<br /><br />";
         }
         unset($Qstatuses);
         $replaces = array($order_number, $invoice_link, $date_ordered, $order_details, $delivery_address, $billing_address, $order_status, $order_comments, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS);
         $this->_title = str_replace($this->_keywords, $replaces, $this->_title);
         $this->_email_text = str_replace($this->_keywords, $replaces, $this->_content);
     }
     unset($Qorder);
 }
Exemplo n.º 16
0
if ($osC_Product->hasURL()) {
    ?>
      <tr>
        <td colspan="2"><?php 
    echo sprintf($osC_Language->get('go_to_external_products_webpage'), osc_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($osC_Product->getURL()), 'NONSSL', null, false));
    ?>
</td>
      </tr>
      
  <?php 
}
if ($osC_Product->getDateAvailable() > osC_DateTime::getNow()) {
    ?>
      <tr>  
        <td colspan="2" align="center"><?php 
    echo sprintf($osC_Language->get('date_availability'), osC_DateTime::getLong($osC_Product->getDateAvailable()));
    ?>
</td>
      </tr>
  <?php 
}
?>
      
  <?php 
if ($osC_Product->hasAttributes()) {
    $attributes = $osC_Product->getAttributes();
    foreach ($attributes as $attribute) {
        ?>
        <tr>          
          <td class="label" valign="top"><?php 
        echo $attribute['name'];
Exemplo n.º 17
0
  
  <?php 
    if (!empty($order_date_purchased)) {
        ?>
    <script type="text/javascript">
      window.addEvent("domready", function() {
        var datepurchased = {};
      <?php 
        foreach ($order_date_purchased as $key => $datepurchased) {
            ?>
      
        datepurchased['<?php 
            echo $key;
            ?>
'] = '<?php 
            echo osC_DateTime::getLong($datepurchased);
            ?>
';
      
      <?php 
        }
        ?>
          
        $('order_date_purchased').set('html', datepurchased[$('ordernumber').get('value')]);
          
        $('ordernumber').addEvent('change', function() {
          $('order_date_purchased').set('html', datepurchased[this.value]);
        });
      });
    
    </script>
Exemplo n.º 18
0
 function _updateStatus($id, $data)
 {
     global $osC_Database, $osC_Language, $orders_status_array;
     $error = false;
     $osC_Database->startTransaction();
     $orders_status = osC_OrdersStatus_Admin::getData($data['status_id']);
     if ($orders_status['downloads_flag'] == 1) {
         osC_Order::activeDownloadables($id);
     }
     if ($orders_status['gift_certificates_flag'] == 1) {
         osC_Order::activeGiftCertificates($id);
     }
     if ($data['status_id'] == ORDERS_STATUS_CANCELLED && $data['restock_products'] == true) {
         $Qproducts = $osC_Database->query('select orders_products_id, products_id, products_type, products_quantity from :table_orders_products where orders_id = :orders_id');
         $Qproducts->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
         $Qproducts->bindInt(':orders_id', $id);
         $Qproducts->execute();
         while ($Qproducts->next()) {
             $result = osC_Product::restock($id, $Qproducts->valueInt('orders_products_id'), $Qproducts->valueInt('products_id'), $Qproducts->valueInt('products_quantity'));
             if ($result == false) {
                 $error = true;
                 break;
             }
         }
     }
     $Qupdate = $osC_Database->query('update :table_orders set orders_status = :orders_status, last_modified = now() where orders_id = :orders_id');
     $Qupdate->bindTable(':table_orders', TABLE_ORDERS);
     $Qupdate->bindInt(':orders_status', $data['status_id']);
     $Qupdate->bindInt(':orders_id', $id);
     $Qupdate->setLogging($_SESSION['module'], $id);
     $Qupdate->execute();
     if (!$osC_Database->isError()) {
         $Qupdate = $osC_Database->query('insert into :table_orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values (:orders_id, :orders_status_id, now(), :customer_notified, :comments)');
         $Qupdate->bindTable(':table_orders_status_history', TABLE_ORDERS_STATUS_HISTORY);
         $Qupdate->bindInt(':orders_id', $id);
         $Qupdate->bindInt(':orders_status_id', $data['status_id']);
         $Qupdate->bindInt(':customer_notified', $data['notify_customer'] === true ? '1' : '0');
         $Qupdate->bindValue(':comments', $data['comment']);
         $Qupdate->setLogging($_SESSION['module'], $id);
         $Qupdate->execute();
         if ($osC_Database->isError()) {
             $error = true;
         }
         if ($data['notify_customer'] === true) {
             $Qorder = $osC_Database->query('select o.customers_name, o.customers_email_address, s.orders_status_name, o.date_purchased from :table_orders o, :table_orders_status s where o.orders_status = s.orders_status_id and s.language_id = :language_id and o.orders_id = :orders_id');
             $Qorder->bindTable(':table_orders', TABLE_ORDERS);
             $Qorder->bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
             $Qorder->bindInt(':language_id', $osC_Language->getID());
             $Qorder->bindInt(':orders_id', $id);
             $Qorder->execute();
             require_once '../includes/classes/email_template.php';
             $email_template = toC_Email_Template::getEmailTemplate('admin_order_status_updated');
             $email_template->setData($id, osc_href_link(FILENAME_ACCOUNT, 'orders=' . $id, 'SSL', false, true, true), osC_DateTime::getLong($Qorder->value('date_purchased')), $data['append_comment'], $data['comment'], $Qorder->value('orders_status_name'), $Qorder->value('customers_name'), $Qorder->value('customers_email_address'));
             $email_template->buildMessage();
             $email_template->sendEmail();
         }
     } else {
         $error = true;
     }
     if ($error === false) {
         $osC_Database->commitTransaction();
         return true;
     }
     $osC_Database->rollbackTransaction();
     return false;
 }
Exemplo n.º 19
0
 function _updateStatus($id, $data)
 {
     global $osC_Database, $osC_Language, $orders_status_array;
     $error = false;
     $osC_Database->startTransaction();
     $Qorder = $osC_Database->query('select customers_name, customers_email_address, orders_status, date_purchased from :table_orders where orders_id = :orders_id');
     $Qorder->bindTable(':table_orders', TABLE_ORDERS);
     $Qorder->bindInt(':orders_id', $id);
     $Qorder->execute();
     $Qupdate = $osC_Database->query('update :table_orders set orders_status = :orders_status, last_modified = now() where orders_id = :orders_id');
     $Qupdate->bindTable(':table_orders', TABLE_ORDERS);
     $Qupdate->bindInt(':orders_status', $data['status_id']);
     $Qupdate->bindInt(':orders_id', $id);
     $Qupdate->setLogging($_SESSION['module'], $id);
     $Qupdate->execute();
     if (!$osC_Database->isError()) {
         if ($data['notify_customer'] === true) {
             $email_body = sprintf($osC_Language->get('email_body'), STORE_NAME, $id, osc_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $id, 'SSL', false, false, true), osC_DateTime::getLong($Qorder->value('date_purchased'))) . "\n\n";
             if ($data['append_comment'] === true) {
                 $email_body .= sprintf($osC_Language->get('email_body_comment'), $data['comment']) . "\n\n";
             }
             $email_body .= sprintf($osC_Language->get('email_body_status'), $orders_status_array[$data['status_id']]) . "\n\n" . $osC_Language->get('email_body_contact');
             osc_email($Qorder->value('customers_name'), $Qorder->value('customers_email_address'), sprintf($osC_Language->get('email_subject'), STORE_NAME), $email_body, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
         }
         $Qupdate = $osC_Database->query('insert into :table_orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values (:orders_id, :orders_status_id, now(), :customer_notified, :comments)');
         $Qupdate->bindTable(':table_orders_status_history', TABLE_ORDERS_STATUS_HISTORY);
         $Qupdate->bindInt(':orders_id', $id);
         $Qupdate->bindInt(':orders_status_id', $data['status_id']);
         $Qupdate->bindInt(':customer_notified', $data['notify_customer'] === true ? '1' : '0');
         $Qupdate->bindValue(':comments', $data['comment']);
         $Qupdate->setLogging($_SESSION['module'], $id);
         $Qupdate->execute();
         if ($osC_Database->isError()) {
             $error = true;
         }
     } else {
         $error = true;
     }
     if ($error === false) {
         $osC_Database->commitTransaction();
         return true;
     }
     $osC_Database->rollbackTransaction();
     return false;
 }
Exemplo n.º 20
0
<!-- left box -->
<?php 
        // The link will appear only if:
        // - Download remaining count is > 0, AND
        // - The file is present in the DOWNLOAD directory, AND EITHER
        // - No expiry date is enforced (maxdays == 0), OR
        // - The expiry date is not reached
        if ($Qdownloads->valueInt('download_count') > 0 && file_exists(DIR_FS_DOWNLOAD . $Qdownloads->value('orders_products_filename')) && ($Qdownloads->value('download_maxdays') == 0 || $download_timestamp > time())) {
            echo '            <td>' . osc_link_object(osc_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $Qdownloads->valueInt('orders_products_download_id')), $Qdownloads->value('products_name')) . '</td>' . "\n";
        } else {
            echo '            <td>' . $Qdownloads->value('products_name') . '</td>' . "\n";
        }
        ?>
<!-- right box -->
<?php 
        echo '            <td>' . sprintf($osC_Language->get('download_link_expires'), osC_DateTime::getLong($download_expiry)) . '</td>' . "\n" . '            <td align="left">' . sprintf($osC_Language->get('download_counter_remaining'), $Qdownloads->valueInt('download_count')) . '</td>' . "\n" . '          </tr>' . "\n";
    }
    ?>
          </tr>
        </table></td>
      </tr>
<?php 
    if (!strstr($_SERVER['SCRIPT_FILENAME'], FILENAME_ACCOUNT_HISTORY_INFO)) {
        ?>
      <tr>
        <td width="10">&nbsp;</td>
      </tr>
      <tr>
        <td class="smalltext" colspan="4"><p><?php 
        sprintf($osC_Language->get('download_footer'), osc_link_object(osc_href_link(FILENAME_ACCOUNT, null, 'SSL'), $osC_Language->get('my_account')));
        ?>
Exemplo n.º 21
0
unset($content_right);
?>

  </tr>
</table>

<?php 
if ($osC_Template->hasPageFooter()) {
    ?>

<table border="0" width="100%" cellspacing="0" cellspacing="2">
  <tr id="footerBar">
    <td>

<?php 
    echo osC_DateTime::getLong();
    ?>

    </td>
  </tr>
  <tr>
    <td>

<?php 
    echo '<p align="center">' . sprintf($osC_Language->get('footer'), date('Y'), osc_href_link(FILENAME_DEFAULT), STORE_NAME) . '</p>';
    ?>

    </td>
  </tr>
</table>