Exemplo n.º 1
0
 public function __construct()
 {
     global $lC_Database, $lC_Language, $fInfo, $products_array;
     $this->_page_title = $lC_Language->get('heading_title');
     $action = isset($_GET['action']) && empty($_GET['action']) === false ? preg_replace('/[^a-z\\s]/', '', $_GET['action']) : NULL;
     switch ($action) {
         case 'save':
             if (is_numeric($_GET[$this->_module])) {
                 $fInfo = new lC_ObjectInfo(lC_Featured_products_Admin::get($_GET[$this->_module]));
             }
             break;
     }
     $Qproducts = $lC_Database->query('select SQL_CALC_FOUND_ROWS products_id, products_name from :table_products_description where language_id = :language_id order by products_name');
     $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
     $Qproducts->bindInt(':language_id', $lC_Language->getID());
     $Qproducts->execute();
     $products_array = array();
     $products_array[] = array('id' => '', 'text' => $lC_Language->get('text_select_product'));
     while ($Qproducts->next()) {
         $Qfeatured = $lC_Database->query('select products_id from :table_featured_products where products_id = :products_id limit 1');
         $Qfeatured->bindTable(':table_featured_products', TABLE_FEATURED_PRODUCTS);
         $Qfeatured->bindInt(':products_id', $Qproducts->value('products_id'));
         $Qfeatured->execute();
         if ($Qfeatured->numberOfRows() < 1) {
             $products_array[] = array('id' => $Qproducts->value('products_id'), 'text' => $Qproducts->value('products_name'));
         }
     }
 }
Exemplo n.º 2
0
 public static function updateStatus()
 {
     $status = lC_Featured_products_Admin::updateStatus($_GET['fid'], $_GET['val']);
     if ($status) {
         $result['rpcStatus'] = RPC_STATUS_SUCCESS;
     }
     echo json_encode($result);
 }
Exemplo n.º 3
0
 public function __construct()
 {
     global $lC_Language, $lC_MessageStack, $lC_Currencies, $lC_DateTime;
     parent::__construct();
     $this->_page_contents = 'edit.php';
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         // validate the input
         $status = isset($_POST['status']) && $_POST['status'] == 'on' ? 1 : 0;
         $expires_date = isset($_POST['expires_date']) && $_POST['expires_date'] != NULL ? preg_replace('/[^0-9\\s\\/]/', '', $_POST['expires_date']) : '0000-00-00 00:00:00';
         $data = array('products_id' => $_POST['products_id'], 'status' => $status, 'expires_date' => $expires_date);
         $id = lC_Featured_products_Admin::save(isset($_GET[$this->_module]) && is_numeric($_GET[$this->_module]) ? $_GET[$this->_module] : null, $data);
         if (is_numeric($id)) {
             if (empty($_POST['save_close'])) {
                 lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $id . '&action=save'));
             } else {
                 lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module));
             }
         } else {
             $lC_MessageStack->add($this->_module, $lC_Language->get('ms_error_action_not_performed'), 'error');
         }
         lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module));
     }
 }
Exemplo n.º 4
0
 /**
  * Batch delete coupons records
  *
  * @param array $batch The coupons id's to delete
  * @access public
  * @return boolean
  */
 public static function batchDelete($batch)
 {
     foreach ($batch as $id) {
         lC_Featured_products_Admin::delete($id);
     }
     return true;
 }
Exemplo n.º 5
0
  @license    https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt
  @version    $Id: edit.php v1.0 2013-08-08 datazen $
*/
?>
<style>
  .legend { font-weight:bold; font-size: 1.1em; }
  .qq-upload-drop-area { min-height: 100px; top: -200px; }
  .qq-upload-drop-area span { margin-top:-16px; }
  LABEL { font-weight:bold; }
  TD { padding: 5px 0 0 5px; }
</style>
<!-- Main content -->
<section role="main" id="main">
  <hgroup id="main-title" class="thin">
    <h1><?php 
echo isset($fInfo) ? lC_Featured_products_Admin::getFeaturedName($fInfo->get('products_id')) : $lC_Language->get('heading_title_new_featured_product');
?>
</h1>
    <?php 
if ($lC_MessageStack->exists($lC_Template->getModule())) {
    echo $lC_MessageStack->get($lC_Template->getModule());
}
?>
  </hgroup>
  <form name="featured" id="featured" class="dataForm" action="<?php 
echo lc_href_link_admin(FILENAME_DEFAULT, $lC_Template->getModule() . '=' . (isset($fInfo) ? $fInfo->getInt('id') : '') . '&action=save');
?>
" method="post" enctype="multipart/form-data">
    <div id="featured_div" class="columns with-padding">
      <div class="new-row-mobile twelve-columns twelve-columns-mobile" id="content">
        <fieldset class="fieldset fields-list">