/**
 * @copyright Copyright (c) ark-web, Inc. All rights reserved.
 * @author Syuichi Kohata
 * @copyright Portions Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 */
if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
}
require dirname(__FILE__) . '/includes/products_attributes.php';
$products_id = $_REQUEST['products_id'];
$attributes_id = $_REQUEST['attributes_id'];
$edit_mode = $attributes_id ? true : false;
$model = new easy_admin_products_attribute_model();
$html = new easy_admin_products_html();
# load | new attributes
$zco_notifier->notify('NOTIFY_EASY_ADMIN_PRODUCTS_ATTRIBUTES_START_EDIT');
$easy_admin_products_attributes_validate = array();
if ($_REQUEST['attribute']) {
    $attribute = $_REQUEST['attribute'];
} else {
    $columns = array("attributes_column" => $attributes_column);
    if ($edit_mode) {
        $attribute = $model->load_attribute($columns, $products_id, $attributes_id);
    } else {
        $attribute = $model->new_attribute($columns, $products_id);
    }
}
# get datas for display
 * @copyright Portions Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 */
if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
}
if (file_exists(DIR_WS_CLASSES . 'split_page_results.php')) {
    require_once DIR_WS_CLASSES . 'split_page_results.php';
}
global $zco_notifier;
global $easy_admin_products_attribute;
global $easy_admin_products_attribute_validate;
global $easy_admin_products_attribute_id;
$languages = zen_get_languages();
$model = new easy_admin_products_attribute_model();
$html = new easy_admin_products_html();
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'index';
$products_id = (int) $_REQUEST['products_id'];
$attributes_id = (int) $_REQUEST['attributes_id'];
$options_id = (int) $_REQUEST['options_id'];
require dirname(__FILE__) . '/products_attributes.php';
$template = "index";
$zco_notifier->notify('NOTIFY_EASY_ADMIN_PRODUCTS_ATTRIBUTES_BEFORE_ACTION');
switch ($action) {
    case 'index':
        break;
    case 'status_on':
        $zco_notifier->notify('NOTIFY_EASY_ADMIN_PRODUCTS_START_ATTRIBUTES_STATUS_ON');
        $ret_change_status = $model->change_status($products_id, $attributes_id, $_REQUEST['type'], 1);
        if ($ret_change_status) {
<?php

/**
 * @copyright Copyright (c) ark-web, Inc. All rights reserved.
 * @author Syuichi Kohata
 * @copyright Portions Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 */
if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
}
$options_id = $_REQUEST['options_id'];
$model = new easy_admin_products_attribute_model();
$options_values = $model->get_options_values($options_id);
$data = array("result" => "ok", "message" => "", "response" => array());
while (!$options_values->EOF) {
    $data['response'][] = array("id" => $options_values->fields['products_options_values_id'], "label" => mb_convert_encoding($options_values->fields['products_options_values_name'], 'utf8'));
    $options_values->MoveNext();
}
print $model->toJSON($data);