Exemplo n.º 1
0
 public function get_related_grid_build($id)
 {
     $this->load->model('catalogue/mproducts');
     if (!$this->mproducts->check_isset_pr($id)) {
         return FALSE;
     }
     $relared_products = $this->get_related_products($id);
     //echo var_dump($relared_products);
     $this->load->library('grid');
     $this->grid->_init_grid('product_' . $id . '_related_products_grid', array('limit' => 1000, 'url' => set_url('catalogue/products_related/get_ajax_get_related/id/' . $id)), TRUE);
     $this->grid->init_fixed_buttons(FALSE);
     $this->grid->db->select("A.`" . self::ID_PR . "` AS ID, A.`sku`, B.`name`, A.`status`, A.`in_stock`")->from("`" . self::PR . "` AS A")->join("`" . self::PR_DESC . "` AS B", "B.`" . self::ID_PR . "` = A.`" . self::ID_PR . "` && B.`" . self::ID_LANGS . "` = " . $this->id_langs, "LEFT")->where_in("A.`" . self::ID_PR . "`", $relared_products)->where("A.`" . self::ID_USERS . "`", $this->id_users);
     /*if(count($relared_products)>0) 
     		{
     			$this->grid->db->where_in("A.`".self::ID_PR."`", $relared_products);
     		}
     		else
     		{}*/
     $this->load->helper('catalogue/products_related_helper');
     get_related_grid_build($this->grid, $id);
     $this->grid->create_grid_data();
     $this->grid->update_grid_data('active', array('0' => 'Нет', '1' => 'Да'));
     $this->grid->update_grid_data('in_stock', array('0' => 'Нет', '1' => 'Да'));
     $this->grid->update_grid_data('status', array('0' => 'Нет', '1' => 'Да'));
     return $this->grid->render_grid(TRUE);
 }
Exemplo n.º 2
0
 public function index()
 {
     $this->template->add_title(' | Продажи | Возвраты');
     $this->template->add_navigation('Продажи', set_url('*/warehouses_sales'))->add_navigation('Возвраты', set_url('*/warehouses_credit_memo'));
     $this->load->model('warehouse/mwarehouses_credit_memo');
     $this->mwarehouses_credit_memo->render_wh_credit_memo_grid();
 }
function helper_block_additionally_form_build($data = array(), $save_param = '')
{
    $form_id = 'block_additionally_add_edit_form';
    $CI =& get_instance();
    $CI->load->library('form');
    $CI->form->_init('Дополнительный блок', $form_id, set_url('*/*/save' . $save_param));
    $CI->form->add_button(array('name' => 'Назад', 'href' => set_url('*/*/'), 'options' => array()));
    if ($save_param != '') {
        $CI->form->add_button(array('name' => 'Добавить блок', 'href' => set_url('*/*/add'), 'options' => array()));
        $CI->form->add_button(array('name' => 'Удалить блок', 'href' => set_url('*/*/delete' . $save_param), 'options' => array('class' => 'delete_question')));
    }
    $CI->form->add_button(array('name' => 'Сохранить и продолжить редактирование', 'href' => '#', 'options' => array('id' => 'submit_back', 'class' => 'addButton')));
    $CI->form->add_button(array('name' => 'Сохранить', 'href' => '#', 'options' => array('id' => 'submit', 'class' => 'addButton')));
    $CI->form->add_tab('base', 'Данные блока');
    if (!isset($data['base'])) {
        $data['base'] = FALSE;
    }
    $CI->form->add_group('base', $data['base']);
    $lid = $CI->form->group('base')->add_object('fieldset', 'base_fieldset', 'Активность, Идентификатор');
    $CI->form->group('base')->add_object_to($lid, 'text', 'main[alias]', 'Идентификатор :');
    $CI->form->group('base')->add_object_to($lid, 'select', 'main[active]', 'Активность :', array('options' => array('0' => 'Нет', '1' => 'Да')));
    $lid = $CI->form->group('base')->add_object('fieldset', 'code_fieldset', 'Наполнение блока');
    $CI->form->group('base')->add_object_to($lid, 'textarea', 'main[code]', 'Код наполнения блока :', array('option' => array('cols' => 8)));
    $CI->form->add_block_to_tab('base', 'base');
    $CI->form->render_form();
}
function helper_excel_export_form($data)
{
    $form_id = 'excel_export_form';
    $CI =& get_instance();
    $CI->load->library('form');
    $CI->form->_init('Действия с покупателями', $form_id, set_url('*/*/export'));
    $CI->form->add_button(array('name' => 'Назад', 'href' => set_url('customers')));
    $CI->form->add_button(array('name' => 'Експортировать в Excel', 'href' => '#', 'options' => array('id' => 'submit')));
    $CI->form->add_tab('m_b', 'Настройки экспорта');
    $CI->form->add_group('m_b');
    $lid = $CI->form->group('m_b')->add_object('fieldset', 'sale_actions_data', 'Опции');
    $CI->form->group('m_b')->add_object_to($lid, 'select', 'excel_export_type', 'Экспортируемая информация :', array('options' => array('0' => 'Только E-mail адреса', '1' => 'Полная информация')));
    $CI->form->group('m_b')->add_object_to($lid, 'select', 'excel_customers_type', 'Выбор покупателей :', array('options' => array('0' => 'Все покупатели', '1' => 'Выбранные групы'), 'option' => array('id' => 'discount_coupons_add_edit_form_customers_type_select')));
    $CI->form->add_group('group_block');
    $CI->form->group('group_block')->add_object('html', "<div id='discount_coupons_group_customers_grid_data' style='display: none; padding-left: 50px; '>");
    $grup = $CI->form->group('group_block')->add_object('fieldset', 'base_fieldset', 'Групы покупателей');
    foreach ($data['customers_groups'] as $group => $ms) {
        $CI->form->group('group_block')->add_object_to($grup, 'checkbox', 'customers_group[' . $group . ']', $ms . ' :', array('value' => $group));
    }
    $CI->form->group('group_block')->add_object('html', "</div>");
    $js = '
        $("#discount_coupons_add_edit_form_customers_type_select").change(function(){
            var visible_type_customers = $("#discount_coupons_add_edit_form_customers_type_select").val();
            if (visible_type_customers == 0){
                $("#discount_coupons_group_customers_grid_data").hide();
            } else {
                $("#discount_coupons_group_customers_grid_data").show();
            }
        });
    ';
    $CI->form->group('group_block')->add_object('js', $js);
    $CI->form->add_block_to_tab('m_b', 'm_b');
    $CI->form->add_block_to_tab('m_b', 'group_block');
    $CI->form->render_form();
}
Exemplo n.º 5
0
function helper_m_catalogue_photo_form($ID, $data, $save_param = '')
{
    $form_id = 'm_catalogue_form';
    $CI =& get_instance();
    $CI->load->library('form');
    $CI->form->_init('Добавление фотографий объекта', $form_id, set_url('*/*/*/save_photo_desc' . $save_param));
    $CI->form->add_button(array('name' => 'Назад', 'href' => set_url('*/*/*/'), 'options' => array()));
    $CI->form->add_button(array('name' => 'Сохранить и продолжить редактирование описания фотографий', 'href' => '#', 'options' => array('id' => 'submit_back', 'class' => 'addButton')));
    $CI->form->add_button(array('name' => 'Сохранить описание фотографий', 'href' => '#', 'options' => array('id' => 'submit', 'class' => 'addButton')));
    $CI->form->add_group('main_block');
    $array = array();
    if (!isset($data['image'])) {
        $data['image'] = FALSE;
        $data['img_desc'] = FALSE;
    }
    $array['PID'] = $ID;
    $array['form_id'] = $form_id;
    $ddata['PID'] = $ID;
    $ddata['form_id'] = $form_id;
    $ddata['id_users'] = $data['id_users'];
    $ddata['on_langs'] = $data['on_langs'];
    $ddata['ajax'] = FALSE;
    $array['img_html'] = '';
    if (is_array($data['image'])) {
        foreach ($data['image'] as $key => $ms) {
            $ddata['id'] = $ms['id_m_catalogue_photos'];
            $ddata['image'] = $ms['image'];
            $ddata['values'] = array('img_desc' => array($key => $data['img_desc'][$key]));
            $array['img_html'] .= helper_m_catalogue_photo_desc_form($ddata);
        }
    }
    $CI->form->group('main_block')->add_view('m_catalogue/form_img', $array);
    $CI->form->add_block($CI->form->group('main_block'));
    $CI->form->render_form();
}
function upload_form($data)
{
    $form_id = 'xls_add_edit_form';
    $CI =& get_instance();
    $CI->load->library('form');
    $CI->form->_init('Импорт файлов', $form_id, set_url('*/*/upload_xls'));
    $CI->form->add_button(array('name' => 'Назад', 'href' => set_url('catalogue/products')));
    $CI->form->add_button(array('name' => 'Загрузить файл', 'href' => '#', 'options' => array('id' => 'submit', 'value' => 'upload', 'class' => 'addButton')));
    $CI->form->add_tab('main_block', 'Загрузка');
    $CI->form->add_group('main_block', $data);
    $lid = $CI->form->group('main_block')->add_object('fieldset', 'base_fieldset', 'Загрузка файлов');
    $CI->form->group('main_block')->add_object_to($lid, 'file', 'userfile', 'Выберите файл:', array('options' => array('size' => '20')));
    $lid2 = $CI->form->group('main_block')->add_object('fieldset', 'base_fieldset', 'Список файлов');
    if (isset($data['files_list']) && count($data['files_list']) > 0) {
        foreach ($data['files_list'] as $key => $val) {
            $import_url = setUrl('*/*/import/file/' . $val);
            $delete_url = setUrl('*/*/delete_file/file/' . $val);
            $html_string = '<div style="margin:5px 0 0 0" align="center">
				<a href="' . $import_url . '" class="icon_arrow_r " title="Импортировать"></a>
				<a href="' . $delete_url . '" class="icon_detele delete_question" title="Удалить файл"></a>
			</div>';
            $CI->form->group('main_block')->add_object_to($lid2, 'text', 'files_list[' . $key . ']', $html_string, array('option' => array('readonly' => NULL)));
        }
    }
    $CI->form->add_block_to_tab('main_block', 'main_block');
    $CI->form->render_form();
}
Exemplo n.º 7
0
function helper_discount_form_build($data = array(), $save_param = '')
{
    $form_id = "discounts_add_edit_form";
    $CI =& get_instance();
    $CI->load->library("form");
    $CI->form->_init("Скидки на покупку", $form_id, set_url('*/*/save' . $save_param));
    $CI->form->add_button(array('name' => 'Назад', 'href' => set_url('*/*')));
    if ($save_param != '') {
        $CI->form->add_button(array('name' => 'Добавить скидку', 'href' => set_url('*/*/add')));
        $CI->form->add_button(array('name' => 'Удалить скидку', 'href' => set_url('*/*/delete' . $save_param), 'options' => array('class' => 'delete_question')));
    }
    $CI->form->add_button(array('name' => 'Сохранить и продолжить редактирование', 'href' => '#', 'options' => array('id' => 'submit_back', 'class' => 'addButton')));
    $CI->form->add_button(array('name' => 'Сохранить', 'href' => '#', 'options' => array('id' => 'submit', 'class' => 'addButton')));
    $CI->form->add_validation('main[sum_from]', array('required' => 'true'));
    //$CI->form->add_validation('main[sum_to]', array('required' => 'true'));
    $CI->form->add_inputmask('main[sum_from]', 'Regex', 'regex: "^([0-9]{1,10})([\\.][0-9]{2})$"');
    //$CI->form->add_inputmask('main[sum_to]', 'Regex', 'regex: "^([0-9]{1,10})([\\.][0-9]{2})$"');
    $CI->form->add_tab('main_block', 'Основные данные');
    $PMdata['main'] = FALSE;
    if (isset($data['main'])) {
        $PMdata['main'] = $data['main'];
    }
    $CI->form->add_group('main_block', $PMdata);
    $lid = $CI->form->group('main_block')->add_object('fieldset', 'base_fieldset', 'Основные данные');
    $CI->form->group('main_block')->add_object_to($lid, 'select', 'main[type_discounts]', 'Тип скидки (*):', array('options' => array('0' => 'Сумма', '1' => 'Процент'), 'option' => array('id' => 'discounts_add_edit_form_type')));
    $CI->form->group('main_block')->add_object_to($lid, 'text', 'main[sum_from]', 'Сумма заказа в ' . $data['data_default_currency'] . ' от (*):');
    $CI->form->group('main_block')->add_object_to($lid, 'text', 'main[sum_to]', 'Сумма заказа в ' . $data['data_default_currency'] . ' до (*):');
    $CI->form->group('main_block')->add_object_to($lid, 'html', '<div style="padding: 0;" id="discounts_add_edit_form_sum">');
    $CI->form->group('main_block')->add_object_to($lid, 'text', 'main[discount_sum]', 'Сумма скидки в ' . $data['data_default_currency'] . ':');
    $CI->form->group('main_block')->add_object_to($lid, 'html', '</div>');
    $CI->form->group('main_block')->add_object_to($lid, 'html', '<div style="padding: 0;" id="discounts_add_edit_form_percent">');
    $CI->form->group('main_block')->add_object_to($lid, 'text', 'main[discount_percent]', 'Процент скидки:');
    $CI->form->group('main_block')->add_object_to($lid, 'html', '</div>');
    $CI->form->group('main_block')->add_object_to($lid, 'select', 'main[active]', 'Активность (*):', array('options' => array('0' => 'Нет', '1' => 'Да')));
    $js = '
    var active_type = $("#discounts_add_edit_form_type").val();
    if (active_type == 0){
        $("#discounts_add_edit_form_percent").hide();
        $("#discounts_add_edit_form_sum").show();
    }
    else {
        $("#discounts_add_edit_form_percent").show();
        $("#discounts_add_edit_form_sum").hide();
    }

    $("#discounts_add_edit_form_type").change(function(){
        active_type = $(this).val();
        if (active_type == 0){
            $("#discounts_add_edit_form_percent").hide();
            $("#discounts_add_edit_form_sum").show();
        }
        else {
            $("#discounts_add_edit_form_percent").show();
            $("#discounts_add_edit_form_sum").hide();
        }
    });';
    $CI->form->group('main_block')->add_object('js', $js);
    $CI->form->add_block_to_tab('main_block', 'main_block');
    $CI->form->render_form();
}
function helper_catalogue_mass_sale_categories_action_export_form_build($cat_id, $data)
{
    $form_id = 'catalogue_categories_products_form';
    $CI =& get_instance();
    $CI->load->library('form');
    $CI->form->_init('Действия с товарами', $form_id, set_url('*/*/export_cat/cat_id/' . $cat_id));
    $CI->form->add_button(array('name' => 'Назад', 'href' => set_url('*/*/action/cat_id/' . $cat_id)));
    $CI->form->add_button(array('name' => 'Експортировать', 'href' => '#', 'options' => array('id' => 'submit')));
    $CI->form->add_tab('m_b', 'Продукты');
    //$CI->form->add_tab('e_b', 'Експорт');
    $CI->form->add_group('m_b');
    $lid = $CI->form->group('m_b')->add_object('fieldset', 'categories_products_data', 'Опции експорта', array());
    $CI->form->group('m_b')->add_object_to($lid, 'select', 'excel_short_description', 'Добавить короткое описание :', array('options' => array('0' => 'Нет', '1' => 'Да')));
    $CI->form->group('m_b')->add_object_to($lid, 'select', 'excel_images', 'Добавить изображения :', array('options' => array('0' => 'Нет', '1' => 'Да')));
    if ($data['settings']['products_sort_type'] == 1) {
        $CI->form->group('m_b')->add_object('html', '<div style="margin:10px 0; color:#EEEEEE;">Сортировка продуктов по "весу" от большего к меньшему. Измение порядка сортировки в меню <b>Каталог продукции->Продукты каталога->Настройки продуктов</b><br>Приоритет в сортировке имеют продукты, которые отмечены как <b>Новинка</b></div>');
    } else {
        $CI->form->group('m_b')->add_object('html', '<div style="margin:10px 0; color:#EEEEEE;">Сортировка продуктов по "весу" от меньшего к большему. Измение порядка сортировки в меню <b>Каталог продукции->Продукты каталога->Настройки продуктов</b><br>Приоритет в сортировке имеют продукты, которые отмечены как <b>Новинка</b></div>');
    }
    $lid = $CI->form->group('m_b')->add_object('fieldset', 'categories_products_data', 'Товары в категории', array('style' => 'background-color:#CCCCCC;'));
    $CI->form->group('m_b')->add_html_to($lid, $data['products']);
    $CI->form->group('m_b')->add_view_to($lid, 'catalogue/products/products_grid_js', array('product_grid_id' => 'categories_products_grid'));
    $CI->form->add_block_to_tab('m_b', 'm_b');
    $CI->form->render_form();
}
Exemplo n.º 9
0
 public function index()
 {
     $this->template->add_title(' | Продажи | Инвойсы');
     $this->template->add_navigation('Продажи', set_url('*/warehouses_sales'))->add_navigation('Инвойсы', set_url('*/warehouses_invoices'));
     $this->load->model('warehouse/mwarehouses_invoices');
     $this->mwarehouses_invoices->render_wh_invoices_grid();
 }
Exemplo n.º 10
0
function helper_news_settings_form_build($data)
{
    $form_id = 'news_settings_edit_form';
    $CI =& get_instance();
    $CI->load->library('form');
    $CI->form->_init('Настройки', $form_id, set_url('*/*/*/save_settings'));
    $CI->form->add_button(array('name' => 'Назад', 'href' => set_url('site_modules'), 'options' => array()));
    $CI->form->add_button(array('name' => 'Сохранить', 'href' => '#', 'options' => array('id' => 'submit', 'class' => 'addButton')));
    $CI->form->add_tab('img_settings', 'Настройки фотографий');
    if (!isset($data['img_settings'])) {
        $data['img_settings'] = FALSE;
    }
    $CI->form->add_group('img_settings', $data['img_settings']);
    $lid = $CI->form->group('img_settings')->add_object('text', 'img_settings[img_width]', 'Максимальная ширина изображения px :', array('option' => array('maxlength' => '4')));
    $lid = $CI->form->group('img_settings')->add_object('text', 'img_settings[img_height]', 'Максимальная высота изображения px :', array('option' => array('maxlength' => '4')));
    $lid = $CI->form->group('img_settings')->add_object('text', 'img_settings[img_width_thumbs]', 'Максимальная ширина изображения(превью) px :', array('option' => array('maxlength' => '3')));
    $lid = $CI->form->group('img_settings')->add_object('text', 'img_settings[img_height_thumbs]', 'Максимальная высота изображения(превью) px :', array('option' => array('maxlength' => '3')));
    $lid = $CI->form->group('img_settings')->add_object('select', 'img_settings[img_wm]', 'Водяной знак :', array('options' => array('0' => 'Нет', '1' => 'Да')));
    $lid = $CI->form->group('img_settings')->add_object('text', 'img_settings[img_wm_text]', 'Текст водяного знака :', array('option' => array('maxlength' => '50')));
    $lid = $CI->form->group('img_settings')->add_object('text', 'img_settings[img_wm_text_size]', 'Размер шрифта текста px :', array('option' => array('maxlength' => '3')));
    $lid = $CI->form->group('img_settings')->add_object('text', 'img_settings[img_wm_text_color]', 'Цвет текста :', array('option' => array('maxlength' => '7', 'id' => 'textcolor', 'class' => 'iColorPicker', 'style' => 'float:right; width:95%;', 'readonly' => '1')));
    $lid = $CI->form->group('img_settings')->add_object('text', 'img_settings[img_wm_text_shadow_color]', 'Цвет тени :', array('option' => array('maxlength' => '7', 'id' => 'shadowcolor', 'class' => 'iColorPicker', 'style' => 'float:right; width:95%;', 'readonly' => '1')));
    $lid = $CI->form->group('img_settings')->add_object('text', 'img_settings[img_wm_text_shadow_padding]', 'Отступ тени от шрифта px :', array('option' => array('maxlength' => '1')));
    $lid = $CI->form->group('img_settings')->add_object('select', 'img_settings[img_wm_valign]', 'Выравнивание по вертикали :', array('options' => array('T' => 'По верхнему краю', 'M' => 'По центру', 'B' => 'По нижнему краю')));
    $lid = $CI->form->group('img_settings')->add_object('select', 'img_settings[img_wm_align]', 'Выравнивание по горизонтали :', array('options' => array('L' => 'По левому краю', 'C' => 'По центру', 'R' => 'По правому краю')));
    $lid = $CI->form->group('img_settings')->add_object('text', 'img_settings[img_wm_opacity]', 'Степень прозрачности от 1 до 99(1 -  полная прозрачность, 99 - без прозрачности) :', array('option' => array('maxlength' => '2')));
    $CI->form->add_block_to_tab('img_settings', 'img_settings');
    $CI->form->render_form();
}
function helper_excel_export_form($data)
{
    $form_id = 'excel_export_form';
    $CI =& get_instance();
    $CI->load->library('form');
    $CI->form->_init('Действия с товарами', $form_id, set_url('*/*/export'));
    $CI->form->add_button(array('name' => 'Назад', 'href' => set_url('catalogue/products')));
    $CI->form->add_button(array('name' => 'Експортировать в Excel', 'href' => '#', 'options' => array('id' => 'submit')));
    $CI->form->add_tab('m_b', 'Список продуктов');
    $CI->form->add_group('m_b');
    $lid = $CI->form->group('m_b')->add_object('fieldset', 'sale_actions_data', 'Действие');
    $CI->form->group('m_b')->add_object_to($lid, 'select', 'excel_short_description', 'Добавить короткое описание :', array('options' => array('0' => 'Нет', '1' => 'Да')));
    $CI->form->group('m_b')->add_object_to($lid, 'select', 'excel_images', 'Добавить изображения :', array('options' => array('0' => 'Нет', '1' => 'Да')));
    /*$lid = $CI->form->group('m_b')->add_object(
    		'fieldset',
    		'categories_products_data',
    		'Список продуктов',
    		array(
    			'style' => 'background-color:#CCCCCC;'
    		)
    	);*/
    $CI->form->group('m_b')->add_html_to($lid, $data['products']);
    $CI->form->group('m_b')->add_view_to($lid, 'catalogue/products/products_grid_js');
    $CI->form->add_block_to_tab('m_b', 'm_b');
    $CI->form->render_form();
}
Exemplo n.º 12
0
function helper_reviews_form_build($data = FALSE, $save_param = '')
{
    $form_id = 'reviews_add_edit_form';
    $CI =& get_instance();
    $CI->load->library('form');
    $CI->form->_init('Отзывы', $form_id, set_url('*/*/*/save' . $save_param));
    $CI->form->add_button(array('name' => 'Назад', 'href' => set_url('*/*/*/'), 'options' => array()));
    if ($save_param != '') {
        $CI->form->add_button(array('name' => 'Добавить отзыв', 'href' => set_url('*/*/*/add'), 'options' => array()));
        $CI->form->add_button(array('name' => 'Удалить отзыв', 'href' => set_url('*/*/*/delete' . $save_param), 'options' => array('class' => 'delete_question')));
    }
    $CI->form->add_button(array('name' => 'Сохранить и продолжить редактирование', 'href' => '#', 'options' => array('id' => 'submit_back', 'class' => 'addButton')));
    $CI->form->add_button(array('name' => 'Сохранить', 'href' => '#', 'options' => array('id' => 'submit', 'class' => 'addButton')));
    $CI->form->add_tab('base', 'Основные данные');
    $mdata = FALSE;
    if ($data) {
        $mdata['main'] = $data;
    }
    $CI->form->add_group('base', $mdata);
    $lid = $CI->form->group('base')->add_object('fieldset', 'base_fieldset', 'Основные данные');
    $CI->form->group('base')->add_object_to($lid, 'select', 'main[active]', 'Активность :', array('options' => array('1' => 'Да', '0' => 'Нет')));
    $CI->form->group('base')->add_object_to($lid, 'text', 'main[name]', 'Имя :');
    $CI->form->group('base')->add_object_to($lid, 'text', 'main[email]', 'E-mail :');
    if ($save_param != '') {
        $CI->form->group('base')->add_object_to($lid, 'select', 'main[id_langs]', 'Выберите язык :', array('option' => array('disabled' => NULL, 'readonly' => NULL), 'options' => $data['on_langs']));
    } else {
        $CI->form->group('base')->add_object_to($lid, 'select', 'main[id_langs]', 'Выберите язык :', array('options' => $data['on_langs']));
    }
    $CI->form->group('base')->add_object_to($lid, 'textarea', 'main[review]', 'Текст отзыва:', array('option' => array('rows' => '4')));
    $CI->form->group('base')->add_object_to($lid, 'textarea', 'main[answer]', 'Текст ответа:', array('option' => array('rows' => '8', 'class' => 'ckeditor')));
    $CI->form->add_block_to_tab('base', 'base');
    $CI->form->render_form();
}
Exemplo n.º 13
0
function helper_textpage_form_build($data = array(), $save_param = '')
{
    $form_id = 'photo_gallery_add_edit_form';
    $CI =& get_instance();
    $CI->load->library('form');
    $CI->form->_init('Текстовые блоки', $form_id, set_url('*/*/*/save' . $save_param));
    $CI->form->enable_CKE();
    $CI->form->add_button(array('name' => 'Назад', 'href' => set_url('*/*/*/'), 'options' => array()));
    if ($save_param != '') {
        $CI->form->add_button(array('name' => 'Добавить текстовый блок', 'href' => set_url('*/*/*/add'), 'options' => array('class' => '')));
        $CI->form->add_button(array('name' => 'Удалить текстовый блок', 'href' => set_url('*/*/*/delete' . $save_param), 'options' => array('class' => 'delete_question')));
    }
    $CI->form->add_button(array('name' => 'Сохранить и продолжить редактирование', 'href' => '#', 'options' => array('id' => 'submit_back', 'class' => 'addButton')));
    $CI->form->add_button(array('name' => 'Сохранить', 'href' => '#', 'options' => array('id' => 'submit', 'class' => 'addButton')));
    $CI->form->add_tab('base', 'Основные данные');
    $CI->form->add_tab('desc', 'Текст');
    if (!isset($data['base'])) {
        $data['base'] = FALSE;
    }
    $CI->form->add_group('base', $data['base']);
    $lid = $CI->form->group('base')->add_object('fieldset', 'base_fieldset', 'Основные данные');
    $CI->form->group('base')->add_object_to($lid, 'select', 'main[active]', 'Активность :', array('options' => array('0' => 'Нет', '1' => 'Да')));
    $CI->form->group('base')->add_object_to($lid, 'select', 'main[show]', 'Отображение:', array('options' => array('0' => 'Показывать только заголовок', '1' => 'Показыть весь текст')));
    if (!isset($data['desc'])) {
        $data['desc'] = FALSE;
    }
    $CI->form->add_group('desc', $data['desc'], $data['on_langs']);
    $lid = $CI->form->group('desc')->add_object('fieldset', 'name_fieldset', 'Название текстовго блока');
    $CI->form->group('desc')->add_object_to($lid, 'text', 'langs[$][name]', 'Название текстовго блока :', array('option' => array()));
    $lid = $CI->form->group('desc')->add_object('textarea', 'langs[$][text]', 'Текст:', array('option' => array('class' => 'ckeditor')));
    $CI->form->group('desc')->add_object('hidden', 'langs[$][id_m_textpage_description]');
    $CI->form->add_block_to_tab('base', 'base');
    $CI->form->add_block_to_tab('desc', 'desc');
    $CI->form->render_form();
}
Exemplo n.º 14
0
 public function index()
 {
     $this->template->add_title(' | Продажи | Отправки');
     $this->template->add_navigation('Продажи', set_url('*/warehouses_sales'))->add_navigation('Отправки', set_url('*/warehouses_shippings'));
     $this->load->model('warehouse/mwarehouses_shippings');
     $this->mwarehouses_shippings->render_wh_shippings_grid();
 }
Exemplo n.º 15
0
function helper_site_settings_form_build($data)
{
    $form_id = 'site_settings_edit_form';
    $CI =& get_instance();
    $CI->load->library('form');
    $CI->form->_init('Настройки', $form_id, set_url('*/save'));
    $CI->form->add_button(array('name' => 'Сохранить', 'href' => '#', 'options' => array('id' => 'submit')));
    $CI->form->add_validation('site_admin[email]', array('required' => 'true', 'email' => 'true'));
    $CI->form->add_validation('site_admin[name]', array('required' => 'true'));
    $CI->form->add_tab('site_admin', 'Администратор сайта');
    $CI->form->add_tab('site_description', 'Описание сайта');
    $CI->form->add_group('site_admin', $data['site_admin']);
    $CI->form->group('site_admin')->add_object('text', 'site_admin[email]', 'E-Mail администратора :', array('option' => array('maxlength' => '50')));
    $CI->form->group('site_admin')->add_object('text', 'site_admin[name]', 'Имя администратора :', array('option' => array('maxlength' => '60')));
    $CI->form->add_group('site_description', $data['site_description'], $data['on_langs']);
    $CI->form->group('site_description')->add_object('text', 'site_description[$][company_name]', 'Название компании :', array('option' => array('maxlength' => '100')));
    $CI->form->group('site_description')->add_object('text', 'site_description[$][work_name]', 'Название деятельности :', array('option' => array('maxlength' => '100')));
    $CI->form->group('site_description')->add_object('text', 'site_description[$][work_description]', 'Описание деятельности :', array('option' => array('cols' => '5')));
    $CI->form->group('site_description')->add_object('text', 'site_description[$][company_title]', 'Начало Meta Title :', array('option' => array('maxlength' => '100')));
    $CI->form->group('site_description')->add_object('text', 'site_description[$][company_description]', 'Начало Meta Decsription :', array('option' => array('maxlength' => '100')));
    $CI->form->group('site_description')->add_object('text', 'site_description[$][TD_separator]', 'Розделитель перед продолжением Meta Title, Meta Decsription :', array('option' => array('maxlength' => '10', 'value' => '')));
    $CI->form->add_block_to_tab('site_admin', 'site_admin');
    $CI->form->add_block_to_tab('site_description', 'site_description');
    $CI->form->render_form();
}
Exemplo n.º 16
0
function helper_site_modules_form_build($data = array(), $save_param = '')
{
    $form_id = 'modules_add_edit_form';
    $CI =& get_instance();
    $CI->load->library('form');
    $CI->form->_init('Модули сайта', $form_id, set_url('*/save' . $save_param));
    $CI->form->add_button(array('name' => 'Назад', 'href' => set_url('*/')));
    if ($save_param != '') {
        $CI->form->add_button(array('name' => 'Добавить модуль', 'href' => set_url('*/add')));
        $CI->form->add_button(array('name' => 'Удалить модуль', 'href' => set_url('*/delete' . $save_param), 'options' => array('class' => 'delete_question')));
    }
    $CI->form->add_button(array('name' => 'Сохранить', 'href' => '#', 'options' => array('id' => 'submit', 'class' => 'addButton')));
    $CI->form->add_tab('base', 'Основные данные');
    if (!isset($data['base'])) {
        $data['base'] = FALSE;
    }
    $CI->form->add_group('base', $data['base']);
    $lid = $CI->form->group('base')->add_object('fieldset', 'base_fieldset', 'Основные данные');
    $CI->form->group('base')->add_object_to($lid, 'text', 'main[alias]', 'Идентификатор:', array('maxlenght' => '50'));
    if ($save_param == '') {
        $CI->form->group('base')->add_object_to($lid, 'select', 'main[id_modules]', 'Выбор модуля:', array('options' => $data['modules_list']));
    }
    $CI->form->group('base')->add_object_to($lid, 'select', 'main[active]', 'Активность:', array('options' => array('0' => 'Нет', '1' => 'Да')));
    $CI->form->add_block_to_tab('base', 'base');
    $CI->form->render_form();
}
Exemplo n.º 17
0
function waitlist_grid_build($Grid, $id)
{
    $Grid->add_button('Назад', set_url('*/*'), array('rel' => 'add', 'class' => 'addButton'));
    $Grid->add_column(array('index' => 'name', 'type' => 'text', 'filter' => true), 'Имя');
    $Grid->add_column(array('index' => 'email', 'type' => 'text', 'filter' => true), 'Email');
    $Grid->add_column(array('index' => 'action', 'type' => 'action', 'tdwidth' => '10%', 'option_string' => 'align="center"', 'actions' => array()), 'Действия');
    return $Grid;
}
Exemplo n.º 18
0
function helper_currency_form_build($data)
{
    $form_id = 'ucurrency_edit_form';
    $CI =& get_instance();
    $CI->load->library('form');
    $CI->form->_init('Редактирование настроек валют', $form_id, set_url('*/*/save'));
    $CI->form->add_button(array('name' => 'Сохранить', 'href' => '#', 'options' => array('id' => 'submit_back', 'class' => 'addButton')));
    $CI->form->add_tab('currency_block', 'Валюты магазина');
    if (!isset($data['users_currency'])) {
        $data['users_currency'] = FALSE;
    }
    $CI->form->add_group('currency_block', $data['users_currency']);
    foreach ($data['data_currency'] as $key => $ms) {
        $display = 'none';
        if (isset($data['users_currency']['users_currency'][$key])) {
            $display = 'block';
        }
        $lid = $CI->form->group('currency_block')->add_object('fieldset', 'name_fieldset', $ms['name']);
        $CI->form->group('currency_block')->add_object_to($lid, 'checkbox', 'users_currency[' . $key . ']', $ms['name'], array('value' => $key, 'option' => array('class' => $form_id . '_cur')));
        $CI->form->group('currency_block')->add_object_to($lid, 'html', '<div style="padding:5px 0 0 30px; display:' . $display . '" id="' . $form_id . '_curdesc_' . $key . '">');
        $CI->form->group('currency_block')->add_object_to($lid, 'text', 'users_currency_desc[' . $key . '][rate]', 'Курс по соотношению к основной валюте :');
        $CI->form->group('currency_block')->add_object_to($lid, 'select', 'users_currency_desc[' . $key . '][active]', 'Показывать на сайте :', array('options' => array('1' => 'Да', '0' => 'Нет')));
        $CI->form->group('currency_block')->add_object_to($lid, 'select', 'users_currency_desc[' . $key . '][visible_rules]', 'Правила показа валюты :', array('options' => array('0' => 'Показывать всем посетителям', '1' => 'Показывать только зарегистрированым покупателям', '2' => 'Показать только выбранным группам покупателей'), 'option' => array('class' => $form_id . '_customers_types_select')));
        $display = 'none';
        $CI->form->group('currency_block')->add_object_to($lid, 'html', '<div style="padding:5px 0 0 30px; display:' . $display . '" id="' . $form_id . '_customers_types">');
        foreach ($data['customers_types'] as $key1 => $ms1) {
            $CI->form->group('currency_block')->add_object_to($lid, 'checkbox', 'users_currency_desc[' . $key . '][m_u_types][' . $key1 . ']', $ms1 . ' :', array('value' => $key1));
        }
        $CI->form->group('currency_block')->add_object_to($lid, 'html', '</div>');
        $CI->form->group('currency_block')->add_object_to($lid, 'hidden', 'users_currency_desc[' . $key . '][ID]');
        $CI->form->group('currency_block')->add_object_to($lid, 'radio', 'users_currency_desc[default]', 'Основная валюта каталога :', array('option' => array('value' => $key)));
        $CI->form->group('currency_block')->add_object_to($lid, 'radio', 'users_currency_desc[default_selected]', 'Валюта выбрана по умолчанию :', array('option' => array('value' => $key)));
        $CI->form->group('currency_block')->add_object_to($lid, 'html', '</div>');
    }
    $js = '
		$(".' . $form_id . '_cur").live("change",function()
		{
			if($(this).prop("checked"))
			{
				$("#' . $form_id . '_curdesc_"+$(this).val()).css("display","block");
			}
			else
			{
				$("#' . $form_id . '_curdesc_"+$(this).val()).css("display","none");
			}
		}
	);	
	';
    $CI->form->group('currency_block')->add_object('js', $js);
    $js = "\n\t\$('." . $form_id . "_customers_types_select').each(function()\n\t{\n\t\tif(\$(this).val() == 2)\n\t\t{\n\t\t\t\$(this).parents('fieldset').find('#" . $form_id . "_customers_types').css('display','block');\n\t\t}\n\t});\n\t\$('." . $form_id . "_customers_types_select').live('change',function()\n\t\t{\n\t\t\tif(\$(this).val() == 2)\n\t\t\t{\n\t\t\t\t\$(this).parents('fieldset').find('#" . $form_id . "_customers_types').css('display','block');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\$(this).parents('fieldset').find('#" . $form_id . "_customers_types').css('display','none');\n\t\t\t}\n\t\t}\n\t);\n\t";
    $CI->form->group('currency_block')->add_object('js', $js);
    //$CI->form->group('currency_block')->add_view('currency/form_ucurrency', $cur_array);
    $CI->form->add_block_to_tab('currency_block', 'currency_block');
    $CI->form->render_form();
}
Exemplo n.º 19
0
 public function save()
 {
     $this->load->model('site_settings/msite_settings');
     if ($this->msite_settings->save()) {
         $this->messages->add_success_message('Настройки успешно сохранены!');
         $this->_redirect(set_url(self::BACK));
     } else {
         $this->messages->add_error_message('Возникли ошибки при сохранении настроек! Повторите попытку.');
         $this->_redirect(set_url(self::BACK));
     }
 }
 public function save_changes()
 {
     $URI = $this->uri->uri_to_assoc(4);
     if (isset($URI['cat_id']) && ($cat_id = intval($URI['cat_id'])) > 0) {
         $this->load->model('catalogue/mcatalogue_mass_edit_price');
         $this->mcatalogue_mass_edit_price->save_changes();
         $this->_redirect(set_url('*/*/actions/cat_id/' . $cat_id));
     } else {
         $this->massages->add_error_massage('Параметры отсутствуют!');
         $this->_redirect(set_url('*/*'));
     }
 }
Exemplo n.º 21
0
 public function render_wh_shop_products_grid($wh_id_from)
 {
     $this->load->model('catalogue/mproducts');
     $this->mproducts->prepare_products_grid_query();
     $this->grid->db->join("`" . self::WH_PR . "` AS WH_PR", "WH_PR.`" . self::ID_WH . "` = '" . $wh_id_from . "' && WH_PR.`" . self::ID_PR . "` = A.`" . self::ID_PR . "`", "INNER")->select("A.`" . self::ID_PR . "` AS ID, A.`sku`, B.`name`, WH_PR.`qty`, A.`status`, A.`create_date`");
     $this->grid->keep_filter_data(TRUE);
     $this->grid->_init_grid('wh_' . $wh_id_from . '_transfer_add_view', array('sort' => 'A.' . self::ID_PR, 'desc' => 'DESC', 'url' => set_url('warehouse/warehouses_transfers/ajax_get_wh_shop_products_grid/wh_id_from/' . $wh_id_from)));
     $this->load->helper('warehouses_transfers');
     helper_transfers_wh_shop_products_grid_build($this->grid, $wh_id_from);
     $this->grid->create_grid_data();
     $this->grid->update_grid_data('status', array('0' => 'Нет', '1' => 'Да'));
     return $this->grid->render_grid(TRUE);
 }
Exemplo n.º 22
0
 public function get_collection_to_html()
 {
     $this->load->library("grid");
     $this->grid->_init_grid("zabava_catalogue_grid", array(), FALSE);
     $this->grid->db->select("A.`" . self::ID_CAT . "` AS ID, A.`active`, B.`name`, A.`create_date`, A.`update_date`, A.`sort`")->from("`" . self::CAT . "` AS A")->join("`" . self::CAT_DESCRIPTION . "` AS B", "B.`" . self::ID_CAT . "` = A.`" . self::ID_CAT . "` && B.`" . self::ID_LANGS . "` = '1'", "LEFT")->where("A.`id_users_modules`", $this->segment)->where("A.`" . self::ID_USERS . "`", $this->id_users);
     $this->load->helper('zabava_catalogue/zabava_catalogue_helper');
     helper_zabava_catalogue_grid_build($this->grid);
     $this->grid->add_extra_sort('sort');
     $this->grid->create_grid_data();
     $this->grid->update_grid_data('active', array('0' => 'Нет', '1' => 'Да'));
     $this->grid->update_grid_data_using_string("sort", "<a class='arrow_down' href='" . set_url('*/*/*/change_position/') . "id/\$1/type/down' title='Смена позиции: Опустить'></a><a class='arrow_up' href='" . set_url('*/*/*/change_position/') . "id/\$1/type/up' title='Смена позиции: Поднять'></a>", array('$1' => 'ID'));
     $this->grid->render_grid();
 }
Exemplo n.º 23
0
 public function render_attributes_grid()
 {
     $this->load->library('grid');
     $this->grid->_init_grid('products_attributes_grid', array());
     $this->grid->db->select("A.`" . self::ID_ATTR . "` AS ID, A.`sort`, A. `alias`, A. `active`, B. `name`")->from("`" . self::ATTR . "` AS A")->join("`" . self::ATTR_DESC . "` AS B", "B.`" . self::ID_ATTR . "` = A.`" . self::ID_ATTR . "` && B.`" . self::ID_LANGS . "` = " . $this->id_langs, "LEFT")->where("A.`" . self::ID_USERS . "`", $this->id_users);
     $this->load->helper('catalogue/products_attributes_helper');
     helper_products_attributes_grid_build($this->grid);
     $this->grid->add_extra_sort('sort');
     $this->grid->create_grid_data();
     $this->grid->update_grid_data_using_string("sort", "<a class='arrow_down' href='" . set_url('*/*/change_position/') . "id/\$1/type/down' title='Смена позиции: Опустить'></a><a class='arrow_up' href='" . set_url('*/*/change_position/') . "id/\$1/type/up' title='Смена позиции: Поднять'></a>", array('$1' => 'ID'));
     $this->grid->update_grid_data("active", array('0' => 'Нет', '1' => 'Да'));
     $this->grid->render_grid();
 }
Exemplo n.º 24
0
function helper_products_grid_build($grid)
{
    $grid->add_button('Экспорт продуктов в Excel', set_url('*/products_excel_export'), array('rel' => 'add', 'class' => 'addButton'));
    $grid->add_button('Добавить Продукт', set_url('*/*/add'), array('rel' => 'add', 'class' => 'addButton'));
    $grid->set_checkbox_actions('ID', 'products_checkbox', array('options' => array('status_on' => 'В поиске: Да', 'status_off' => 'В поиске: Нет', 'in_stock_on' => 'В наличии: Да', 'in_stock_off' => 'В наличии: Нет', 'delete' => 'Удалить выбраные'), 'name' => 'products_select_action'));
    $grid->add_column(array('index' => 'sku', 'type' => 'text', 'tdwidth' => '10%', 'filter' => true), 'Артикул');
    $grid->add_column(array('index' => 'name', 'type' => 'text', 'filter' => true), 'Название');
    $grid->add_column(array('index' => 'create_date', 'type' => 'date', 'tdwidth' => '11%', 'sortable' => true, 'filter' => true), 'Создан');
    $grid->add_column(array('index' => 'update_date', 'type' => 'date', 'tdwidth' => '11%', 'sortable' => true, 'filter' => true), 'Обновлен');
    $grid->add_column(array('index' => 'status', 'type' => 'select', 'options' => array('' => '', '0' => 'Нет', '1' => 'Да'), 'tdwidth' => '8%', 'filter' => true), 'В поиске');
    $grid->add_column(array('index' => 'in_stock', 'type' => 'select', 'options' => array('' => '', '0' => 'Нет', '1' => 'Да'), 'tdwidth' => '8%', 'filter' => true), 'В наличии');
    $grid->add_column(array('index' => 'action', 'type' => 'action', 'tdwidth' => '12%', 'option_string' => 'align="center"', 'sortable' => false, 'filter' => false, 'actions' => array(array('type' => 'link', 'html' => '', 'href' => set_url(array('*', '*', 'view', 'id', '$1')), 'href_values' => array('ID'), 'options' => array('class' => 'icon_view products_view', 'title' => 'Просмотр продукта')), array('type' => 'link', 'html' => '', 'href' => set_url(array('*', '*', 'photo', 'id', '$1')), 'href_values' => array('ID'), 'options' => array('class' => 'icon_photo', 'title' => 'Изображения')), array('type' => 'link', 'html' => '', 'href' => set_url(array('*', '*', 'edit', 'id', '$1')), 'href_values' => array('ID'), 'options' => array('class' => 'icon_edit', 'title' => 'Редактировать')), array('type' => 'link', 'html' => '', 'href' => set_url(array('*', '*', 'delete', 'id', '$1')), 'href_values' => array('ID'), 'options' => array('class' => 'icon_detele delete_question', 'title' => 'Удалить')))), 'Actions');
}
Exemplo n.º 25
0
 public function save()
 {
     if (isset($_POST)) {
         $this->load->model('mcurrency');
         if ($this->mcurrency->save()) {
             $this->messages->add_success_message('Валюты каталога успешно сохранены!');
             $this->_redirect(set_url('*/*/'));
         } else {
             $this->messages->add_error_message('Произошли ошибки при сохранение валют каталога!');
             $this->_redirect(set_url('*/*/'));
         }
     }
 }
Exemplo n.º 26
0
 public function delete_menu_modul()
 {
     $URI = $this->uri->uri_to_assoc(3);
     if (isset($URI['id_module']) && intval($URI['id_module']) > 0) {
         $id_module = intval($URI['id_module']);
         $this->load->model('mhome');
         $this->mhome->delete_menu_modul($id_module);
         $this->messages->add_success_message('Модуль успешно удален!');
         $this->_redirect(set_url('*/'));
     } else {
         $this->messages->_addErrorMassage('Параметр ID отсутствует! Процес удаления модуля не возможен!');
         $this->_redirect(set_url('*/'));
     }
 }
Exemplo n.º 27
0
 public function save()
 {
     if (isset($_POST)) {
         $this->load->model('customers/mcustomers_settings');
         if ($this->mcustomers_settings->save()) {
             $this->messages->add_success_message('Настройки успешно сохранены!');
             $this->_redirect(set_url('*/*/'));
         } else {
             $this->messages->add_error_message('Возникли ошибки при сохранении настроек!');
             $this->_redirect(set_url('*/*/'));
         }
     } else {
         $this->_redirect(set_url('*/*/'));
     }
 }
Exemplo n.º 28
0
 public function render_langs()
 {
     $this->load->library('grid');
     $this->grid->_init_grid("langs_grid");
     $this->grid->db->select("B.code, B.language, B.name, B.short_name, A.default, A.active, A.on, A.sort, A.`" . self::ID_USERS_LANGS . "` as ID, A.`" . self::ID_USERS_LANGS . "` AS ID_UL")->from("`" . self::USERS_LANGS . "` AS A")->join("`" . self::LANGS . "` AS B", "B.`" . self::ID_LANGS . "` = A.`" . self::ID_LANGS . "`", "INNER")->where("A.`" . self::ID_USERS . "`", $this->id_users);
     $this->load->helper('langs/langs_helper');
     helper_langs_grid_build($this->grid);
     $this->grid->add_extra_sort('sort');
     $this->grid->create_grid_data();
     $this->grid->update_grid_data_using_string("sort", "<a class='arrow_down' href='" . set_url('*/change_position/') . "id/\$1/type/down' title='Смена позиции: Опустить'></a><a class='arrow_up' href='" . set_url('*/change_position/') . "id/\$1/type/up' title='Смена позиции: Поднять'></a>", array('$1' => 'ID'));
     $this->grid->update_grid_data('active', array('0' => 'Нет', '1' => 'Да'));
     $this->grid->update_grid_data('on', array('0' => 'Нет', '1' => 'Да'));
     $this->grid->update_grid_data('default', array('0' => 'Нет', '1' => 'Да'));
     $this->grid->render_grid();
 }
Exemplo n.º 29
0
 public function add()
 {
     $this->load->helper('catalogue/products_properties_helper');
     $this->load->model('langs/mlangs');
     $data['on_langs'] = $this->mlangs->get_active_languages();
     $this->load->model('catalogue/mproducts_types');
     $data['products_types'] = $this->mproducts_types->get_collection_to_select();
     if (count($data['products_types']) == 0) {
         $CI =& get_instance();
         $CI->redirect = set_url('*/products_types/add');
         $this->messages->add_error_message('Типы свойств продукции отсутствуют, добавление свойства продукции не возможно.<br>Вы переадресированы на страницу добавления типов свойств продукции.');
         return FALSE;
     }
     helper_products_properties_form_build($data);
 }
Exemplo n.º 30
0
 function view_waitlist_customers()
 {
     $this->load->model('catalogue/mproducts_waitlist');
     $URI = $this->uri->uri_to_assoc(4);
     if (isset($URI['id']) && intval($URI['id']) > 0) {
         $ID = intval($URI['id']);
         if (!$this->mproducts_waitlist->view_product_waitlist($ID)) {
             $this->messages->add_error_message('Возникли ошибки просмотра запросов наличия продукта!');
             $this->_redirect(set_url('*/*'));
         }
     } else {
         $this->messages->add_error_message('Параметр ID отсутствует! Просмотр невозможен!');
         $this->_redirect(set_url('*/*'));
     }
 }