public static function formData($id = null)
 {
     global $lC_Database, $lC_DateTime;
     $result = array();
     if (isset($id) && is_numeric($id)) {
         $lC_ObjectInfo = new lC_ObjectInfo(lC_Products_Admin::get($id));
         $Qdata = $lC_Database->query('select pa.value as products_date_available from :table_product_attributes pa, :table_templates_boxes tb where tb.code = :code and tb.modules_group = :modules_group and tb.id = pa.id');
         $Qdata->bindTable(':table_product_attributes', TABLE_PRODUCT_ATTRIBUTES);
         $Qdata->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
         $Qdata->bindValue(':code', 'date_available');
         $Qdata->bindValue(':modules_group', 'product_attributes');
         $Qdata->execute();
         $lC_ObjectInfo->set('products_date_available', $Qdata->value('products_date_available'));
         $result['pDate'] = $lC_ObjectInfo->get('products_date_available');
         $Qdata->freeResult();
     }
     return $result;
 }
Example #2
0
 protected function _setData()
 {
     global $lC_Database, $lC_Language, $lC_Currencies, $lC_Vqmod;
     if (!$this->enabled) {
         $this->_data = '';
     } else {
         $this->_data = '<div class="four-columns six-columns-tablet twelve-columns-mobile clear-both">' . '  <h2 class="relative thin">' . $this->_title . '</h2>' . '  <ul class="list spaced">';
         if (!isset($lC_Currencies)) {
             if (!class_exists('lC_Currencies')) {
                 include $lC_Vqmod->modCheck('../includes/classes/currencies.php');
             }
             $lC_Currencies = new lC_Currencies();
         }
         $Qproducts = $lC_Database->query('select p.products_id, greatest(p.products_date_added, p.products_last_modified) as date_last_modified, pd.products_name from :table_products p, :table_products_description pd where parent_id = 0 and p.products_id = pd.products_id and pd.language_id = :language_id order by date_last_modified desc limit 6');
         $Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
         $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
         $Qproducts->bindInt(':language_id', $lC_Language->getID());
         $Qproducts->execute();
         while ($Qproducts->next()) {
             $data = lC_Products_Admin::get($Qproducts->valueInt('products_id'));
             $products_icon = lc_icon_admin('products.png');
             $products_price = $data['products_price'];
             if (!empty($data['variants'])) {
                 $products_icon = lc_icon_admin('attach.png');
                 $products_price = null;
                 foreach ($data['variants'] as $variant) {
                     if ($products_price === null || $variant['data']['price'] < $products_price) {
                         $products_price = $variant['data']['price'];
                     }
                 }
                 if ($products_price === null) {
                     $products_price = 0;
                 }
             }
             $this->_data .= '    <li>' . '      <span class="list-link icon-bag icon-blue" title="' . $lC_Language->get('edit') . '">' . '        <strong>' . (!empty($data['variants']) ? $lC_Language->get('text_from') . ' ' : '') . $lC_Currencies->format($products_price) . '</strong> <span class="anthracite">' . lc_output_string_protected($data['products_name']) . '</span>' . '      </span>' . '      <div class="absolute-right compact show-on-parent-hover">' . '        <a href="' . ((int) ($_SESSION['admin']['access']['products'] < 3) ? '#' : lc_href_link_admin(FILENAME_DEFAULT, 'products=' . $Qproducts->valueInt('products_id') . '&cID=' . $category_id . '&action=save')) . '" class="button icon-pencil' . ((int) ($_SESSION['admin']['access']['products'] < 3) ? ' disabled' : NULL) . '">' . $lC_Language->get('icon_edit') . '</a>' . '        <a href="' . ((int) ($_SESSION['admin']['access']['products'] < 3) ? '#' : 'javascript://" onclick="copyProduct(\'' . $Qproducts->valueInt('products_id') . '\', \'' . urlencode($Qproducts->value('products_name')) . '\')') . '" class="button icon-pages with-tooltip' . ((int) ($_SESSION['admin']['access']['products'] < 3) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_copy') . '"></a>' . '        <a href="' . ((int) ($_SESSION['admin']['access']['products'] < 4) ? '#' : 'javascript://" onclick="deleteProduct(\'' . $Qproducts->valueInt('products_id') . '\', \'' . urlencode($Qproducts->value('products_name')) . '\')') . '" class="button icon-trash with-tooltip' . ((int) ($_SESSION['admin']['access']['products'] < 4) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_delete') . '"></a>' . '      </div>' . '    </li>';
         }
         $this->_data .= '  </ul>' . '</div>';
         $Qproducts->freeResult();
         $this->_data .= $this->loadModal();
     }
 }
Example #3
0
/**
  @package    catalog::admin::applications
  @author     Loaded Commerce
  @copyright  Copyright 2003-2014 Loaded Commerce, LLC
  @copyright  Portions Copyright 2003 osCommerce
  @copyright  Template built on Developr theme by DisplayInline http://themeforest.net/user/displayinline under Extended license 
  @license    https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt
  @version    $Id: edit.php v1.0 2013-08-08 datazen $
*/
global $lC_Vqmod;
if (is_numeric($_GET[$lC_Template->getModule()])) {
    $pInfo = new lC_ObjectInfo(lC_Products_Admin::get($_GET[$lC_Template->getModule()]));
}
if (is_numeric($_GET[$lC_Template->getModule()])) {
    $lC_ObjectInfo = new lC_ObjectInfo(lC_Products_Admin::get($_GET[$lC_Template->getModule()]));
    $attributes = $lC_ObjectInfo->get('attributes');
    $Qpd = $lC_Database->query('select products_name, products_blurb, products_description, products_keyword, products_tags, 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', $lC_ObjectInfo->getInt('products_id'));
    $Qpd->execute();
    $products_name = array();
    $products_blurb = array();
    $products_description = array();
    $products_keyword = array();
    $products_tags = array();
    $products_url = array();
    while ($Qpd->next()) {
        $products_name[$Qpd->valueInt('language_id')] = $Qpd->value('products_name');
        $products_blurb[$Qpd->valueInt('language_id')] = $Qpd->value('products_blurb');
        $products_description[$Qpd->valueInt('language_id')] = $Qpd->value('products_description');
Example #4
0
<?php

/**
  @package    catalog::admin::applications
  @author     Loaded Commerce
  @copyright  Copyright 2003-2014 Loaded Commerce, LLC
  @copyright  Portions Copyright 2003 osCommerce
  @copyright  Template built on Developr theme by DisplayInline http://themeforest.net/user/displayinline under Extended license 
  @license    https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt
  @version    $Id: edit.php v1.0 2013-08-08 datazen $
*/
$lC_ObjectInfo = new lC_ObjectInfo(lC_Products_Admin::get($_GET['pID']));
$Qdata = $lC_Database->query('select str_to_date(pa.value, "%Y-%m-%d") as products_date_available from :table_product_attributes pa, :table_templates_boxes tb where tb.code = :code and tb.modules_group = :modules_group and tb.id = pa.id');
$Qdata->bindTable(':table_product_attributes', TABLE_PRODUCT_ATTRIBUTES);
$Qdata->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
$Qdata->bindValue(':code', 'date_available');
$Qdata->bindValue(':modules_group', 'product_attributes');
$Qdata->execute();
$lC_ObjectInfo->set('products_date_available', $Qdata->value('products_date_available'));
?>
<h1><?php 
echo lc_link_object(lc_href_link_admin(FILENAME_DEFAULT, $lC_Template->getModule()), $lC_Template->getPageTitle());
?>
</h1>
<?php 
if ($lC_MessageStack->exists($lC_Template->getModule())) {
    echo $lC_MessageStack->get($lC_Template->getModule());
}
?>
<div class="infoBoxHeading"><?php 
echo lc_icon_admin('edit.png') . ' ' . $lC_ObjectInfo->getProtected('products_name');
Example #5
0
 public static function getProductAttributeModules($section = '')
 {
     global $lC_Database, $lC_Language, $_module;
     $aInfo = new lC_ObjectInfo(lC_Products_Admin::get($_GET[$_module]));
     $attributes = $aInfo->get('attributes');
     $attributes2 = $aInfo->get('attributes2');
     $output = '';
     $Qattributes = $lC_Database->query('select id, code from :table_templates_boxes where modules_group = :modules_group order by code desc');
     $Qattributes->bindTable(':table_templates_boxes');
     $Qattributes->bindValue(':modules_group', 'product_attributes');
     $Qattributes->execute();
     while ($Qattributes->next()) {
         $module = basename($Qattributes->value('code'));
         if (!class_exists('lC_ProductAttributes_' . $module)) {
             if (file_exists(DIR_FS_ADMIN . 'includes/modules/product_attributes/' . $module . '.php')) {
                 include DIR_FS_ADMIN . 'includes/modules/product_attributes/' . $module . '.php';
             } else {
                 if (lC_Addons_Admin::hasAdminAddonsProductAttributesModule($module)) {
                     include lC_Addons_Admin::getAdminAddonsProductAttributesModulePath($module);
                 }
             }
         }
         if (class_exists('lC_ProductAttributes_' . $module)) {
             $module = 'lC_ProductAttributes_' . $module;
             $module = new $module();
             if ($module->getSection() == $section) {
                 if (file_exists(DIR_FS_ADMIN . 'includes/languages/' . $lC_Language->getCode() . '/modules/product_attributes/' . $module->getCode() . '.php')) {
                     $lC_Language->loadIniFile('/modules/product_attributes/' . $module->getCode() . '.php');
                 } else {
                     lC_Addons_Admin::loadAdminAddonsProductAttributesDefinitions($module->getCode());
                 }
                 // added for value2 support
                 $value2 = isset($attributes2[$Qattributes->valueInt('id')]) && $attributes2[$Qattributes->valueInt('id')] != null ? $attributes2[$Qattributes->valueInt('id')] : '';
                 $output .= '<div class="new-row-mobile six-columns six-columns-tablet twelve-columns-mobile no-margin-bottom">
                     <div class="twelve-columns strong mid-margin-bottom">
                       <span>' . $lC_Language->get('product_attributes_' . $module->getCode() . '_title') . '</span>' . lc_show_info_bubble($lC_Language->get('info_bubble_attributes_' . $module->getCode() . '_text'), null, 'info-spot on-left grey float-right mid-margin-bottom') . '
                     </div>
                     <div class="twelve-columns product-module-content margin-bottom">
                       ' . $module->setFunction(isset($attributes[$Qattributes->valueInt('id')]) ? $attributes[$Qattributes->valueInt('id')] : null, $value2) . '
                     </div>
                   </div>';
             }
         }
     }
     return $output;
 }