Ejemplo n.º 1
0
 /**
  * Check to see if there are updates availablw
  *  
  * @access public      
  * @return boolean
  */
 public static function hasUpdatesAvailable()
 {
     global $lC_Database, $lC_Language;
     $lC_Language->loadIniFile('updates.php');
     $result = array();
     $available = self::getAvailablePackages();
     $result['hasUpdates'] = $available['total'] > 0;
     $lastChecked = date("Y-m-d H:i:s");
     $result['lastChecked'] = $lC_Language->get('text_last_checked') . ' ' . lC_DateTime::getLong($lastChecked, TRUE);
     $result['total'] = $available['total'];
     if ($result['hasUpdates']) {
         $to_version = 0;
         $to_version_date = '';
         foreach ($available['entries'] as $k => $v) {
             if (version_compare($to_version, $v['version'], '<')) {
                 $to_version = $v['version'];
                 $to_version_date = $v['date'];
             }
         }
     } else {
         $to_version = utility::getVersion();
         $to_version_date = utility::getVersionDate();
     }
     $result['toVersion'] = $to_version;
     $result['toVersionDate'] = $to_version_date;
     // update last checked value
     $lC_Database->startTransaction();
     if (!defined('UPDATE_LAST_CHECKED')) {
         $Qupdate = $lC_Database->query('insert into :table_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, last_modified) values (:configuration_title, :configuration_key, :configuration_value, :configuration_description, :configuration_group_id, :last_modified)');
         $Qupdate->bindValue(':configuration_title', 'Update Last Checked');
         $Qupdate->bindValue(':configuration_key', 'UPDATE_LAST_CHECKED');
         $Qupdate->bindValue(':configuration_value', 'See Last Modified');
         $Qupdate->bindValue(':configuration_description', 'Update Last Checked');
         $Qupdate->bindValue(':configuration_group_id', '6');
     } else {
         $Qupdate = $lC_Database->query("update :table_configuration set last_modified = :last_modified where configuration_key = 'UPDATE_LAST_CHECKED'");
     }
     $Qupdate->bindTable(':table_configuration', TABLE_CONFIGURATION);
     $Qupdate->bindValue(':last_modified', $lastChecked);
     $Qupdate->setLogging($_SESSION['module']);
     $Qupdate->execute();
     if (!$lC_Database->isError()) {
         $lC_Database->commitTransaction();
         $result['rpcStatus'] = 1;
     } else {
         $lC_Database->rollbackTransaction();
         $result['rpcStatus'] = -1;
     }
     return $result;
 }
Ejemplo n.º 2
0
 public function getListingOutput($id = null)
 {
     global $lC_Database, $lC_Language, $lC_Image;
     if (is_numeric($id)) {
         $Qreviews = $lC_Database->query('select reviews_id, reviews_text, reviews_rating, date_added, customers_name from :table_reviews where products_id = :products_id and languages_id = :languages_id and reviews_status = 1 order by reviews_id desc');
         $Qreviews->bindInt(':products_id', $id);
         $Qreviews->bindInt(':languages_id', $lC_Language->getID());
     } else {
         $Qreviews = $lC_Database->query('select r.reviews_id, left(r.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, r.customers_name, p.products_id, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_keyword, i.image from :table_reviews r, :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd where r.reviews_status = 1 and r.languages_id = :languages_id and r.products_id = p.products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id order by r.reviews_id desc');
         $Qreviews->bindTable(':table_products', TABLE_PRODUCTS);
         $Qreviews->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
         $Qreviews->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
         $Qreviews->bindInt(':default_flag', 1);
         $Qreviews->bindInt(':languages_id', $lC_Language->getID());
         $Qreviews->bindInt(':language_id', $lC_Language->getID());
     }
     $Qreviews->bindTable(':table_reviews', TABLE_REVIEWS);
     $Qreviews->setBatchLimit(isset($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : 1, MAX_DISPLAY_NEW_REVIEWS);
     $Qreviews->execute();
     $counter = 0;
     $output = '';
     if ($Qreviews->numberOfRows() > 0) {
         while ($Qreviews->next()) {
             $counter++;
             if ($counter > 1) {
                 $output .= '<br />' . "\n";
             }
             $text = strlen($Qreviews->valueProtected('reviews_text')) > 60 ? substr($Qreviews->valueProtected('reviews_text'), 0, 360) . '...' : $Qreviews->valueProtected('reviews_text');
             $output .= '<div class="content-reviews-stars">' . lc_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $Qreviews->valueInt('reviews_rating') . '.png', sprintf($lC_Language->get('rating_of_5_stars'), $Qreviews->valueInt('reviews_rating'))) . '&nbsp;' . sprintf($lC_Language->get('reviewed_by'), $Qreviews->valueProtected('customers_name')) . '; ' . lC_DateTime::getLong($Qreviews->value('date_added')) . '</div>' . "\n";
             $output .= '<div class="content-reviews-text"><em>' . nl2br($text) . '</em></div>' . "\n";
         }
     } else {
         $output = '<div>' . $lC_Language->get('no_reviews_available') . '</div>' . "\n";
     }
     return $output;
 }
Ejemplo n.º 3
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>' . lc_link_object(lc_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($lC_Language->get('download_link_expires'), lC_DateTime::getLong($download_expiry)) . '</td>' . "\n" . '            <td align="right">' . sprintf($lC_Language->get('download_counter_remaining'), $Qdownloads->valueInt('download_count')) . '</td>' . "\n" . '          </tr>' . "\n";
   }
   ?>
     </tr>
   </table></td>
 </tr>
 <?php 
   if (!strstr($_SERVER['SCRIPT_FILENAME'], 'receipt')) {
       ?>
   <tr>
     <td width="10">&nbsp;</td>
   </tr>
   <tr>
     <td class="smalltext" colspan="4"><p><?php 
       sprintf($lC_Language->get('download_footer'), lc_link_object(lc_href_link(FILENAME_ACCOUNT, null, 'SSL'), $lC_Language->get('my_account')));
       ?>
Ejemplo n.º 4
0
 public static function preview($id)
 {
     global $lC_Database, $lC_Language, $lC_Currencies;
     $lC_Image = new lC_Image_Admin();
     $lC_Language->loadIniFile('products.php');
     $result = array();
     $Qp = $lC_Database->query('select p.products_id, p.products_quantity, p.products_cost, p.products_price, p.products_msrp, p.products_model, p.products_sku, p.products_weight, p.products_weight_class, p.products_date_added, p.products_last_modified, p.products_status, p.products_tax_class_id, p.manufacturers_id, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and default_flag = :default_flag) where p.products_id = :products_id');
     $Qp->bindTable(':table_products', TABLE_PRODUCTS);
     $Qp->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
     $Qp->bindInt(':products_id', $id);
     $Qp->bindInt(':default_flag', 1);
     $Qp->execute();
     $Qpd = $lC_Database->query('select products_name, products_blurb, products_description, products_url, language_id from :table_products_description where products_id = :products_id');
     $Qpd->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
     $Qpd->bindInt(':products_id', $id);
     $Qpd->execute();
     $pd_extra = array();
     while ($Qpd->next()) {
         $pd_extra['products_name'][$Qpd->valueInt('language_id')] = $Qpd->valueProtected('products_name');
         $pd_extra['products_blurb'][$Qpd->valueInt('language_id')] = $Qpd->valueProtected('products_blurb');
         $pd_extra['products_description'][$Qpd->valueInt('language_id')] = $Qpd->value('products_description');
         $pd_extra['products_url'][$Qpd->valueInt('language_id')] = $Qpd->valueProtected('products_url');
     }
     $lC_ObjectInfo = new lC_ObjectInfo(array_merge($Qp->toArray(), $pd_extra));
     $products_name = $lC_ObjectInfo->get('products_name');
     $products_blurb = $lC_ObjectInfo->get('products_blurb');
     $products_description = $lC_ObjectInfo->get('products_description');
     $products_url = $lC_ObjectInfo->get('products_url');
     $result['previewHtml'] = '<div>';
     foreach ($lC_Language->getAll() as $l) {
         $result['previewHtml'] .= '<span id="lang_' . $l['code'] . '"' . ($l['code'] == $lC_Language->getCode() ? ' class="highlight"' : '') . '><a href="javascript:toggleDivBlocks(\'pName_\', \'pName_' . $l['code'] . '\'); toggleClass(\'lang_\', \'lang_' . $l['code'] . '\', \'highlight\', \'span\');">' . $lC_Language->showImage($l['code']) . '</a></span>&nbsp;&nbsp;';
     }
     $result['previewHtml'] .= '</div>';
     foreach ($lC_Language->getAll() as $l) {
         $result['previewHtml'] .= '<div id="pName_' . $l['code'] . '" ' . ($l['code'] != $lC_Language->getCode() ? ' style="display: none;"' : '') . '>';
         $result['previewHtml'] .= '  <table border="0" width="100%" cellspacing="0" cellpadding="2">';
         $result['previewHtml'] .= '    <tr>';
         $result['previewHtml'] .= '      <td><h1>' . lc_output_string_protected($products_name[$l['id']]) . (!lc_empty($lC_ObjectInfo->get('products_model')) ? '<br /><span>' . $lC_ObjectInfo->getProtected('products_model') . '</span>' : '') . '</h1></td>';
         $result['previewHtml'] .= '      <td align="right"><h1>' . $lC_Currencies->format($lC_ObjectInfo->get('products_price')) . '</h1></td>';
         $result['previewHtml'] .= '    </tr>';
         $result['previewHtml'] .= '  </table>';
         $result['previewHtml'] .= '  <p>' . $lC_Image->show($lC_ObjectInfo->get('image'), $products_name[$l['id']], 'align="right" hspace="5" vspace="5"', 'product_info') . $products_description[$l['id']] . '</p>';
         if (!empty($products_url[$l['id']])) {
             $result['previewHtml'] .= '<p>' . sprintf($lC_Language->get('text_more_product_information'), lc_output_string_protected($products_url[$l['id']])) . '</p>';
         }
         $result['previewHtml'] .= '<p align="center">' . sprintf($lC_Language->get('text_product_date_added'), lC_DateTime::getLong($lC_ObjectInfo->get('products_date_added'))) . '</p>';
         $result['previewHtml'] .= '</div>';
     }
     return $result;
 }
Ejemplo n.º 5
0
 public function sendEmail($id)
 {
     global $lC_Database, $lC_Language, $lC_Currencies, $lC_ShoppingCart;
     $Qorder = $lC_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" . $lC_Language->get('email_order_separator') . "\n" . sprintf($lC_Language->get('email_order_order_number'), $id) . "\n" . sprintf($lC_Language->get('email_order_invoice_url'), lc_href_link(FILENAME_ACCOUNT, 'receipt=' . $id, 'SSL', false, true, true)) . "\n" . sprintf($lC_Language->get('email_order_date_ordered'), lC_DateTime::getLong()) . "\n\n" . $lC_Language->get('email_order_products') . "\n" . $lC_Language->get('email_order_separator') . "\n";
         $Qproducts = $lC_Database->query('select orders_products_id, products_model, products_sku, 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()) {
             $skuModel = $Qproducts->value('products_model') != NULL ? $Qproducts->value('products_model') : NULL;
             if ($skuModel == NULL) {
                 $skuModel == ($Qproducts->value('products_sku') != NULL) ? $Qproducts->value('products_sku') : NULL;
             }
             $email_order .= $Qproducts->valueInt('products_quantity') . ' x ' . $Qproducts->value('products_name') . ' (' . $skuModel . ') = ' . $lC_Currencies->displayPriceWithTaxRate($Qproducts->value('products_price'), $Qproducts->value('products_tax'), $Qproducts->valueInt('products_quantity'), false, $Qorder->value('currency'), $Qorder->value('currency_value')) . "\n";
             $Qvariants = $lC_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 .= $lC_Language->get('email_order_separator') . "\n";
         $Qtotals = $lC_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 (lc_empty($Qorder->value('delivery_name')) === false && lc_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" . $lC_Language->get('email_order_delivery_address') . "\n" . $lC_Language->get('email_order_separator') . "\n" . lC_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" . $lC_Language->get('email_order_billing_address') . "\n" . $lC_Language->get('email_order_separator') . "\n" . lC_Address::format($address) . "\n\n";
         unset($address);
         $Qstatus = $lC_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', $lC_Language->getID());
         $Qstatus->execute();
         $email_order .= sprintf($lC_Language->get('email_order_status'), $Qstatus->value('orders_status_name')) . "\n" . $lC_Language->get('email_order_separator') . "\n";
         unset($Qstatus);
         $Qstatuses = $lC_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 .= lC_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($lC_ShoppingCart)) {
             $email_order .= $lC_Language->get('email_order_payment_method') . "\n" . $lC_Language->get('email_order_separator') . "\n";
             $email_order .= $Qorder->value('payment_method') . "\n\n";
             /*if (isset($this->email_footer)) {
                 $email_order .= $this->email_footer . "\n\n";
               }*/
         }
         lc_email($Qorder->value('customers_name'), $Qorder->value('customers_email_address'), $lC_Language->get('email_order_subject'), $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
         // send emails to other people
         if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
             lc_email('', SEND_EXTRA_ORDER_EMAILS_TO, $lC_Language->get('email_order_subject'), $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
         }
     }
     unset($Qorder);
 }
Ejemplo n.º 6
0
        <?php 
if ($lC_MessageStack->size('reviews') > 0) {
    echo '<div class="message-stack-container alert alert-error">' . $lC_MessageStack->get('reviews') . '</div>' . "\n";
}
?>

        <div class="content-product-reviews-container">  
          <h3 class="no-margin-top"><?php 
echo $lC_Template->getPageTitle();
?>
</h3>  
          <?php 
if ($lC_Product->getData('reviews_average_rating') > 0) {
    ?>
            <div class="content-reviews-info-stars"><?php 
    echo lc_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $Qreviews->valueInt('reviews_rating') . '.png', sprintf($lC_Language->get('rating_of_5_stars'), $Qreviews->valueInt('reviews_rating'))) . '&nbsp;' . sprintf($lC_Language->get('reviewed_by'), $Qreviews->valueProtected('customers_name')) . '; ' . lC_DateTime::getLong($Qreviews->value('date_added'));
    ?>
</div>
            <div class="content-reviews-info-text"><?php 
    echo nl2br(wordwrap($Qreviews->valueProtected('reviews_text'), 60, '&shy;'));
    ?>
</div>
            <?php 
}
?>
  
        </div>
      </div>
    </div>
  </div>   
  <div class="col-sm-12 col-lg-12 clearfix">