public function restrict($permission, $uri = '') { // If user isn't logged in, redirect to the login page. if (!$this->is_logged and $this->uri->rsegment(1) !== 'login') { redirect(root_url(ADMINDIR . '/login')); } if (empty($permission)) { return TRUE; } // Split the permission string into array and // remove the last element and use it as the permission action $permission = explode('.', $permission); $action = ''; if (count($permission) === 3) { $action = strtolower(array_pop($permission)); } $permission = implode('.', $permission); // Check whether the user has the proper permissions action. if (($has_permission = $this->checkPermittedActions($permission, $action, TRUE)) === TRUE) { return TRUE; } if ($uri === '') { // get the previous page from the session. $uri = referrer_url(); // If previous page and current page are the same, but the user no longer // has permission, redirect to site URL to prevent an infinite loop. if ($uri === current_url() and !$this->CI->input->post()) { $uri = site_url(); } } if (!$this->CI->input->is_ajax_request()) { // remove later redirect($uri); } }
public function index() { if ($this->input->post() and $this->_addCustomer() === TRUE) { // checks if $_POST data is set and if registration validation was successful $this->alert->set('alert', $this->lang->line('alert_account_created')); // display success message and redirect to account login page redirect('account/login'); } $this->template->setTitle($this->lang->line('text_register_heading')); $data['login_url'] = site_url('account/login'); if ($this->config->item('registration_terms') > 0) { $data['registration_terms'] = str_replace(root_url(), '/', site_url('pages?popup=1&page_id=' . $this->config->item('registration_terms'))); } else { $data['registration_terms'] = FALSE; } $this->load->model('Security_questions_model'); // load the security questions model $data['questions'] = array(); $results = $this->Security_questions_model->getQuestions(); // retrieve array of security questions from getQuestions method in Security questions model foreach ($results as $result) { // loop through security questions array $data['questions'][] = array('id' => $result['question_id'], 'text' => $result['text']); } $data['captcha'] = $this->createCaptcha(); $this->template->render('account/register', $data); }
public function index() { $this->template->setTitle($this->lang->line('text_title')); $this->template->setHeading($this->lang->line('text_heading')); $this->template->setStyleTag(root_url('assets/js/daterange/daterangepicker-bs3.css'), 'daterangepicker-css', '100400'); $this->template->setScriptTag(root_url('assets/js/daterange/moment.min.js'), 'daterange-moment-js', '1000451'); $this->template->setScriptTag(root_url('assets/js/daterange/daterangepicker.js'), 'daterangepicker-js', '1000452'); $this->template->setScriptTag(root_url('assets/js/Chart.min.js'), 'chart-min-js', '1000453'); $data['total_menus'] = $this->Dashboard_model->getTotalMenus(); $data['current_month'] = mdate('%Y-%m', time()); $data['months'] = array(); $pastMonth = date('Y-m-d', strtotime(date('Y-m-01') . ' -3 months')); $futureMonth = date('Y-m-d', strtotime(date('Y-m-01') . ' +3 months')); for ($i = $pastMonth; $i <= $futureMonth; $i = date('Y-m-d', strtotime($i . ' +1 months'))) { $data['months'][mdate('%Y-%m', strtotime($i))] = mdate('%F', strtotime($i)); } $data['default_location_id'] = $this->config->item('default_location_id'); $data['locations'] = array(); $results = $this->Locations_model->getLocations(); foreach ($results as $result) { $data['locations'][] = array('location_id' => $result['location_id'], 'location_name' => $result['location_name']); } $filter = array(); $filter['page'] = '1'; $filter['limit'] = '10'; $data['activities'] = array(); $this->load->model('Activities_model'); $results = $this->Activities_model->getList($filter); foreach ($results as $result) { $data['activities'][] = array('activity_id' => $result['activity_id'], 'icon' => 'fa fa-tasks', 'message' => $result['message'], 'time' => mdate('%h:%i %A', strtotime($result['date_added'])), 'time_elapsed' => time_elapsed($result['date_added']), 'state' => $result['status'] === '1' ? 'read' : 'unread'); } $data['top_customers'] = array(); $results = $this->Dashboard_model->getTopCustomers($filter); foreach ($results as $result) { $data['top_customers'][] = array('first_name' => $result['first_name'], 'last_name' => $result['last_name'], 'total_orders' => $result['total_orders'], 'total_sale' => $result['total_sale']); } $filter = array(); $filter['page'] = ''; $filter['limit'] = 10; $filter['sort_by'] = 'orders.date_added'; $filter['order_by'] = 'DESC'; $data['order_by_active'] = 'DESC'; $data['orders'] = array(); $this->load->model('Orders_model'); $results = $this->Orders_model->getList($filter); foreach ($results as $result) { $current_date = mdate('%d-%m-%Y', time()); $date_added = mdate('%d-%m-%Y', strtotime($result['date_added'])); if ($current_date === $date_added) { $date_added = $this->lang->line('text_today'); } else { $date_added = mdate('%d %M %y', strtotime($date_added)); } $data['orders'][] = array('order_id' => $result['order_id'], 'location_name' => $result['location_name'], 'first_name' => $result['first_name'], 'last_name' => $result['last_name'], 'order_status' => $result['status_name'], 'status_color' => $result['status_color'], 'order_time' => mdate('%H:%i', strtotime($result['order_time'])), 'order_type' => $result['order_type'] === '1' ? $this->lang->line('text_delivery') : $this->lang->line('text_collection'), 'date_added' => $date_added, 'edit' => site_url('orders/edit?id=' . $result['order_id'])); } $this->template->render('dashboard', $data); }
/** * Class constructor * */ public function __construct() { parent::__construct(); log_message('info', 'Base Controller Class Initialized'); // Load session $this->load->library('session'); $this->load->library('alert'); // Load database if connected $DATABASE = $this->load->database('default', TRUE); if ($DATABASE->conn_id !== FALSE) { // Load system configuration from database $this->config->load_db_config(); // Load extension library $this->load->library('extension'); // Load template library $this->load->library('template'); } // Redirect to setup if app requires setup if (APPDIR !== 'setup' and TI_VERSION !== $this->config->item('ti_version')) { redirect(root_url('setup/')); } // Check app for setup or maintenance for production environments. if (ENVIRONMENT === 'production') { // Redirect to root url if app has already been set up if (APPDIR === 'setup' and $this->uri->rsegment(1) !== 'success' and TI_VERSION === $this->config->item('ti_version')) { redirect(root_url('setup/success')); } // Saving queries can vastly increase the memory usage, so better to turn off in production if ($DATABASE->conn_id !== FALSE) { $this->db->save_queries = FALSE; } // Show maintenance message if maintenance is enabled if ($this->maintenanceEnabled()) { show_error($this->config->item('maintenance_message'), '503', 'Maintenance Enabled'); } } else { if (ENVIRONMENT === 'development') { if ($DATABASE->conn_id !== FALSE) { $this->db->db_debug = TRUE; } } } if (ENVIRONMENT !== 'testing') { // If the requested controller is a module controller then load the module config if ($this->extension and $this->router and $_module = $this->router->fetch_module()) { // Load the module configuration file and retrieve its items. // Shows 404 error message on failure to load $this->extension->loadConfig($_module, TRUE); } } // Enable profiler for development environments. if (!$this->input->is_ajax_request()) { $this->output->enable_profiler(TI_DEBUG); } $this->form_validation->CI =& $this; }
/** * Class constructor * */ public function __construct() { parent::__construct(); log_message('info', 'Base Controller Class Initialized'); // Load session $this->load->library('session'); $this->load->library('alert'); // Load installer library and database config items $this->load->library('installer'); // If 'config/updated.txt' exists, system needs upgrade if (is_file(IGNITEPATH . 'config/updated.txt')) { if ($this->installer->upgrade()) { redirect(root_url(ADMINDIR . '/dashboard')); } } // Redirect to setup if app requires setup if (($installed = $this->installer->isInstalled()) !== TRUE and APPDIR !== 'setup') { redirect(root_url('setup')); } // If database is connected, then app is ready if ($this->installer->db_exists === TRUE) { // Load template library $this->load->library('template'); // Load extension library $this->load->library('extension'); // If the requested controller is a module controller then load the module config if (ENVIRONMENT !== 'testing') { if ($this->extension and $this->router and $_module = $this->router->fetch_module()) { // Load the module configuration file and retrieve its items. // Shows 404 error message on failure to load $this->extension->loadConfig($_module, TRUE); } } // Saving queries can vastly increase the memory usage, so better to turn off in production if (ENVIRONMENT === 'production') { $this->db->save_queries = FALSE; } else { if (ENVIRONMENT === 'development') { $this->db->db_debug = TRUE; } } } // Check app for maintenance in production environments. if (ENVIRONMENT === 'production') { // Show maintenance message if maintenance is enabled if ($this->maintenanceEnabled()) { show_error($this->config->item('maintenance_message'), '503', 'Maintenance Enabled'); } } // Enable profiler for development environments. if (!$this->input->is_ajax_request()) { $this->output->enable_profiler(TI_DEBUG); } $this->form_validation->CI =& $this; }
/** * Class constructor * */ public function __construct() { parent::__construct(); log_message('info', 'Admin Controller Class Initialized'); $this->load->library('user'); if (!$this->user->isLogged() and $this->uri->rsegment(1) !== 'login' and $this->uri->rsegment(1) !== 'logout') { $this->alert->set('danger', 'You must be logged in to access that page.'); $this->session->set_tempdata('previous_url', current_url()); redirect(root_url(ADMINDIR . '/login')); } }
public function parse_template($template, $data = array()) { if (!is_string($template) or !is_array($data)) { return NULL; } $data['site_name'] = $this->CI->config->item('site_name'); $data['signature'] = $this->CI->config->item('site_name'); $data['site_url'] = root_url(); $this->CI->load->model('Image_tool_model'); $data['site_logo'] = $this->CI->Image_tool_model->resize($this->CI->config->item('site_logo')); $this->CI->load->library('parser'); return $this->CI->parser->parse_string($template, $data); }
public function __construct() { $this->CI =& get_instance(); if (ENVIRONMENT !== 'production' and !$this->CI->input->is_ajax_request()) { $this->CI->output->enable_profiler(TRUE); } if (APPDIR !== 'setup' and !$this->CI->config->item('ti_version')) { redirect(root_url('setup/')); } if ($this->CI->config->item('maintenance_mode') === '1') { // if customer is not logged in redirect to account login page $this->setMaintenance(); } }
/** * Class constructor * */ public function __construct() { parent::__construct(); log_message('info', 'Base Controller Class Initialized'); // Load session $this->load->library('session'); $this->load->library('alert'); // Load database and system configuration from database $DATABASE = $this->load->database('default', TRUE); if ($DATABASE->conn_id !== FALSE) { $this->config->load_db_config(); $this->load->library('extension'); // Load template library $this->load->library('template'); } // Redirect to setup if app requires setup if (APPDIR !== 'setup' and !$this->config->item('ti_setup')) { redirect(root_url('setup/')); } // Check app for setup or maintenance for production environments. if (ENVIRONMENT === 'production') { // Redirect to root url if app has already been set up if (APPDIR === 'setup' and $this->config->item('ti_setup')) { redirect(root_url()); } // Saving queries can vastly increase the memory usage, so better to turn off in production $this->db->save_queries = FALSE; // Show maintenance message if maintenance is enabled if ($this->maintenanceEnabled()) { show_error($this->config->item('maintenance_message'), '503', 'Maintenance Enabled'); } } else { if (ENVIRONMENT === 'development') { // Enable profiler for development environments. if (!$this->input->is_ajax_request()) { $this->output->enable_profiler(TRUE); } } } // If the requested controller is a module controller then load the module config if ($this->router and $_module = $this->router->fetch_module()) { // Load the module configuration file and retrieve the configuration items $this->config->load($_module . '/' . $_module, TRUE); $config = $this->config->item($_module); // Check if the module configuration items are correctly set $this->checkModuleConfig($_module, $config); } $this->form_validation->CI =& $this; }
public function getList() { $themes = $this->getThemes(); $themes_list = list_themes(); $results = array(); if (!empty($themes) and !empty($themes_list)) { foreach ($themes_list as $theme) { $db_theme = (isset($themes[$theme['basename']]) and !empty($themes[$theme['basename']])) ? $themes[$theme['basename']] : array(); $extension_id = !empty($db_theme['extension_id']) ? $db_theme['extension_id'] : 0; $theme_name = !empty($db_theme['name']) ? $db_theme['name'] : $theme['basename']; $results[$theme['basename']] = array('extension_id' => $extension_id, 'name' => $theme_name, 'title' => isset($theme['config']['title']) ? $theme['config']['title'] : $theme_name, 'version' => isset($theme['config']['version']) ? $theme['config']['version'] : '', 'description' => isset($theme['config']['description']) ? $theme['config']['description'] : '', 'location' => $theme['location'], 'screenshot' => root_url($theme['path'] . '/screenshot.png'), 'path' => $theme['path'], 'is_writable' => is_writable($theme['path']), 'config' => $theme['config'], 'data' => !empty($db_theme['data']) ? $db_theme['data'] : array(), 'customize' => (isset($theme['config']['customize']) and !empty($theme['config']['customize'])) ? TRUE : FALSE); } } return $results; }
public function edit() { $template_info = $this->Mail_templates_model->getTemplate((int) $this->input->get('id')); if ($template_info) { $template_id = $template_info['template_id']; $data['_action'] = site_url('mail_templates/edit?id=' . $template_id); } else { $template_id = 0; $data['_action'] = site_url('mail_templates/edit'); } $title = isset($template_info['name']) ? $template_info['name'] : $this->lang->line('text_new'); $this->template->setTitle(sprintf($this->lang->line('text_edit_heading'), $title)); $this->template->setHeading(sprintf($this->lang->line('text_edit_heading'), $title)); $this->template->setButton($this->lang->line('button_save'), array('class' => 'btn btn-primary', 'onclick' => '$(\'#edit-form\').submit();')); $this->template->setButton($this->lang->line('button_save_close'), array('class' => 'btn btn-default', 'onclick' => 'saveClose();')); $this->template->setButton($this->lang->line('button_icon_back'), array('class' => 'btn btn-default', 'href' => site_url('mail_templates'))); $this->template->setStyleTag(root_url('assets/js/summernote/summernote.css'), 'summernote-css'); $this->template->setScriptTag(root_url('assets/js/summernote/summernote.min.js'), 'summernote-js'); if ($this->input->post() and $template_id = $this->_saveTemplate()) { if ($this->input->post('save_close') === '1') { redirect('mail_templates'); } redirect('mail_templates/edit?id=' . $template_id); } if ($template_id === '11') { $this->alert->set('info', $this->lang->line('alert_caution_edit')); } $data['template_id'] = $template_id; $data['name'] = $template_info['name']; $data['status'] = $template_info['status']; $titles = array('registration' => $this->lang->line('text_registration'), 'registration_alert' => $this->lang->line('text_registration_alert'), 'password_reset' => $this->lang->line('text_password_reset'), 'password_reset_alert' => $this->lang->line('text_password_reset_alert'), 'order' => $this->lang->line('text_order'), 'order_alert' => $this->lang->line('text_order_alert'), 'order_update' => $this->lang->line('text_order_update'), 'reservation' => $this->lang->line('text_reservation'), 'reservation_alert' => $this->lang->line('text_reservation_alert'), 'reservation_update' => $this->lang->line('text_reservation_update'), 'internal' => $this->lang->line('text_internal'), 'contact' => $this->lang->line('text_contact')); $data['template_data'] = array(); $template_data = $this->Mail_templates_model->getAllTemplateData($template_id); foreach ($titles as $key => $value) { foreach ($template_data as $tpl_data) { if ($key === $tpl_data['code']) { $data['template_data'][] = array('template_id' => $tpl_data['template_id'], 'template_data_id' => $tpl_data['template_data_id'], 'title' => $value, 'code' => $tpl_data['code'], 'subject' => $tpl_data['subject'], 'body' => html_entity_decode($tpl_data['body']), 'date_added' => mdate('%d %M %y - %H:%i', strtotime($tpl_data['date_added'])), 'date_updated' => mdate('%d %M %y - %H:%i', strtotime($tpl_data['date_updated']))); } } } $data['templates'] = array(); $results = $this->Mail_templates_model->getTemplates(); foreach ($results as $result) { $data['templates'][] = array('template_id' => $result['template_id'], 'name' => $result['name'], 'status' => $result['status']); } $this->template->render('mail_templates_edit', $data); }
public function resize($img_path, $width = '', $height = '') { $thumbs_path = IMAGEPATH . 'thumbs'; if (!is_dir($thumbs_path)) { $this->_createFolder($thumbs_path); } $setting = $this->config->item('image_tool'); if (isset($setting['root_folder']) and (strpos($setting['root_folder'], '/') !== 0 or strpos($setting['root_folder'], './') === FALSE)) { $root_folder = $setting['root_folder'] . '/'; } else { $root_folder = 'data/'; } if (strpos($img_path, $root_folder) === 0) { $img_path = str_replace($root_folder, '', $img_path); } if (!file_exists(IMAGEPATH . $root_folder . $img_path) or !is_file(IMAGEPATH . $root_folder . $img_path) or strpos($img_path, '/') === 0) { return; } if (is_dir(IMAGEPATH . $root_folder . $img_path) and !is_dir($thumbs_path . '/' . $img_path)) { $this->_createFolder($thumbs_path . '/' . $img_path); } $info = pathinfo($img_path); $extension = $info['extension']; $img_name = $info['basename']; $old_path = IMAGEPATH . $root_folder . $img_path; list($img_width, $img_height, $img_type, $attr) = getimagesize($old_path); $width = $width === '' ? $img_width : $width; $height = $height === '' ? $img_height : $height; $new_path = IMAGEPATH . 'thumbs/' . substr($img_path, 0, strrpos($img_path, '.')) . '-' . $width . 'x' . $height . '.' . $extension; $new_image = 'thumbs/' . substr($img_path, 0, strrpos($img_path, '.')) . '-' . $width . 'x' . $height . '.' . $extension; if (file_exists($old_path) and !file_exists($new_path)) { $this->load->library('image_lib'); $this->image_lib->clear(); $config['image_library'] = 'gd2'; $config['source_image'] = $old_path; $config['new_image'] = $new_path; $config['width'] = $width; $config['height'] = $height; $this->image_lib->initialize($config); if (!$this->image_lib->resize()) { return FALSE; } } return root_url() . 'assets/images/' . $new_image; }
public function index() { if (!file_exists(VIEWPATH . '/success.php')) { show_404(); } if ($this->session->tempdata('setup') === 'step_3' or $this->config->item('ti_setup') === 'v2.0') { $data['heading'] = 'TastyIgniter - Setup - Successful'; $data['sub_heading'] = 'Installation Successful'; $data['complete_setup'] = '<a href="' . root_url(ADMINDIR) . '">Login to Administrator Panel</a>'; $this->load->library('user'); $this->user->logout(); $this->load->view('header', $data); $this->load->view('success', $data); $this->load->view('footer', $data); } else { redirect('setup'); } }
" /></td>'; html += ' <td class="id">'; html += ' <input type="hidden" name="option_values[' + table_row + '][option_value_id]" class="form-control" value="<?php echo set_value("option_values[' + table_row + '][option_value_id]"); ?> " />'; html += ' -</td>'; html += '</tr>'; $('.table-sortable tbody').append(html); table_row++; } //--></script> <script src="<?php echo root_url("assets/js/jquery-sortable.js"); ?> "></script> <script type="text/javascript"><!-- $(function () { $('.table-sortable').sortable({ containerSelector: 'table', itemPath: '> tbody', itemSelector: 'tr', placeholder: '<tr class="placeholder"><td colspan="3"></td></tr>', handle: '.handle' }) }) //--></script> <?php echo get_footer();
public function edit() { $this->user->restrict('Site.Themes.Access'); $theme_name = $this->input->get('name'); $theme_location = $this->input->get('location'); $url = '?'; $url .= 'name=' . $theme_name . '&location=' . $theme_location; if (!($theme = $this->Themes_model->getTheme($theme_name))) { $this->alert->set('danger', $this->lang->line('error_theme_not_found')); redirect('themes'); } $_GET['extension_id'] = $theme['extension_id']; $theme_config = isset($theme['config']) ? $theme['config'] : FALSE; $this->load->library('customizer'); $this->customizer->initialize($theme); if ($this->input->post() and $this->_updateTheme($theme) === TRUE) { if ($this->input->post('save_close') === '1') { redirect('themes/edit' . '?name=' . $theme_name . '&location=' . $theme_location); } redirect(current_url()); } $this->template->setTitle(sprintf($this->lang->line('text_edit_heading'), $theme['title'])); $this->template->setHeading(sprintf($this->lang->line('text_edit_heading'), $theme['title'])); $this->template->setButton($this->lang->line('button_save'), array('class' => 'btn btn-primary', 'onclick' => '$(\'#edit-form\').submit();')); $this->template->setButton($this->lang->line('button_save_close'), array('class' => 'btn btn-default', 'onclick' => 'saveClose();')); $this->template->setBackButton('btn btn-back', site_url('themes')); $this->template->setStyleTag(root_url('assets/js/colorpicker/css/bootstrap-colorpicker.min.css'), 'bootstrap-colorpicker-css'); $this->template->setStyleTag(root_url('assets/js/codemirror/codemirror.css'), 'codemirror-css'); $this->template->setStyleTag(root_url('assets/js/fancybox/jquery.fancybox.css'), 'jquery-fancybox-css'); $this->template->setScriptTag(root_url('assets/js/colorpicker/js/bootstrap-colorpicker.min.js'), 'bootstrap-colorpicker-js'); $this->template->setScriptTag(root_url('assets/js/codemirror/codemirror.js'), 'codemirror-js', '300'); $this->template->setScriptTag(root_url('assets/js/codemirror/xml/xml.js'), 'codemirror-xml-js', '301'); $this->template->setScriptTag(root_url('assets/js/codemirror/css/css.js'), 'codemirror-css-js', '302'); $this->template->setScriptTag(root_url('assets/js/codemirror/javascript/javascript.js'), 'codemirror-javascript-js', '303'); $this->template->setScriptTag(root_url('assets/js/codemirror/php/php.js'), 'codemirror-php-js', '304'); $this->template->setScriptTag(root_url('assets/js/codemirror/htmlmixed/htmlmixed.js'), 'codemirror-htmlmixed-js', '305'); $this->template->setScriptTag(root_url('assets/js/codemirror/clike/clike.js'), 'codemirror-clike-js', '306'); $this->template->setScriptTag(root_url('assets/js/jquery-sortable.js'), 'jquery-sortable-js'); $this->template->setScriptTag(root_url("assets/js/fancybox/jquery.fancybox.js"), 'jquery-fancybox-js'); $data['file'] = array(); if ($this->input->get('file')) { $url .= '&file=' . $this->input->get('file'); $theme_file = load_theme_file($this->input->get('file'), $theme_name, $theme_location); if (isset($theme_file['type']) and $theme_file['type'] === 'img') { $theme_file['heading'] = sprintf($this->lang->line('text_viewing'), $this->input->get('file'), $theme_name); } else { if (isset($theme_file['type']) and $theme_file['type'] === 'file') { $theme_file['heading'] = sprintf($this->lang->line('text_editing'), $this->input->get('file'), $theme_name); } else { $this->alert->set('danger', $this->lang->line('error_file_not_supported')); } } $data['file'] = $theme_file; } $theme_files = ''; $tree_link = site_url('themes/edit' . $url . '&file={link}'); $theme_files .= $this->_themeTree($theme_name, $theme_location, $tree_link); $data['name'] = $theme['name']; $data['theme_files'] = $theme_files; $data['theme_config'] = $theme_config; $data['is_customizable'] = (isset($theme['customize']) and $theme['customize']) ? TRUE : FALSE; $data['customizer_nav'] = $this->customizer->getNavView(); $data['customizer_sections'] = $this->customizer->getSectionsView(); $data['sections'] = $data['error_fields'] = array(); if (!empty($data['is_customizable'])) { if (isset($theme_config['error_fields']) and is_array($theme_config['error_fields'])) { foreach ($theme_config['error_fields'] as $error_field) { if (isset($error_field['field']) and isset($error_field['error'])) { $data['error_fields'][$error_field['field']] = $error_field['error']; } } } } $data['_action'] = site_url('themes/edit' . $url); $data['mode'] = ''; if (!empty($data['file']['ext'])) { if ($data['file']['ext'] === 'php') { $data['mode'] = 'application/x-httpd-php'; } else { if ($data['file']['ext'] === 'css') { $data['mode'] = 'css'; } else { $data['mode'] = 'javascript'; } } } $this->template->render('themes_edit', $data); }
oEdit1.groups = [ ["group1", "", ["Bold", "Italic", "Underline", "FontDialog", "ForeColor", "TextDialog", /*"Styles",*/ "RemoveFormat"]] ,["group2", "", ["Bullets", "Numbering", "JustifyLeft", "JustifyCenter", "JustifyRight"]] ,["group3", "", ["LinkDialog", "ImageDialog", "YoutubeDialog", "TableDialog", "Emoticons"]] ,["group4", "", ["Undo", "Redo", "SourceDialog"]] //,["group5", "", ["Save"]] ];//*/ oEdit1.css = '<?php echo root_url($template->base_url() . 'wysiwyg/scripts/style/awesome.css'); ?> '; oEdit1.returnKeyMode = 3; oEdit1.fileBrowser = "<?php echo root_url($template->base_url() . 'wysiwyg/assetmanager/asset.php'); ?> "; var html = document.getElementById('text').value; html = html.replace('[/iu_textarea]', '</'+'textar'+'ea>'); html = html.replace('[/iu_form]', '</'+'fo'+'rm>'); html = html.replace('[iu_textarea', '<'+'textar'+'ea'); html = html.replace('[iu_form', '<'+'fo'+'rm'); document.getElementById('text').value = html; oEdit1.cleanEmptySpan = function() { return true; }; oEdit1.REPLACE("text"); </script> </div>
public function getMailData($reservation_id) { $data = array(); $result = $this->getReservation($reservation_id); if ($result) { $this->load->library('country'); $data['reservation_number'] = $result['reservation_id']; $data['reservation_view_url'] = root_url('main/reservations?id=' . $result['reservation_id']); $data['reservation_time'] = mdate('%H:%i', strtotime($result['reserve_time'])); $data['reservation_date'] = mdate('%l, %F %j, %Y', strtotime($result['reserve_date'])); $data['reservation_guest_no'] = $result['guest_num']; $data['first_name'] = $result['first_name']; $data['last_name'] = $result['last_name']; $data['email'] = $result['email']; $data['telephone'] = $result['telephone']; $data['location_name'] = $result['location_name']; $data['reservation_comment'] = $result['comment']; } return $data; }
</div> </div> <div id="pageModal"> <div class="pml_body"> <div class="pml_title">Reset Point</div> <div class="pml_detail">ล้างแต้มจากสมาชิกที่เลือกทั้งหมด ให้เป็น 0</div> <div class="pml_button_div"> <div class="btn pml_btn cancel rad_btn">Cancel</div> <div class="btn pml_btn done rad_btn">Done</div> </div> </div> </div> <ui-page-loading></ui-page-loading> <script type="text/javascript"> GURL.init("<?php echo root_url(); ?> ","<?php echo base_url(); ?> ","<?php echo base_api_url(); ?> "); </script> <div id="pageHeader"> </div> <div id="pageContent"> <!--pageContent :: START -->
<tr> <td colspan="3"><?php echo lang('text_empty'); ?> </td> </tr> <?php } ?> </tbody> </table> </div> </form> </div> </div> </div> <link type="text/css" rel="stylesheet" href="<?php echo root_url("assets/js/fancybox/jquery.fancybox.css"); ?> "> <script src="<?php echo root_url("assets/js/fancybox/jquery.fancybox.js"); ?> "></script> <script type="text/javascript"> $(document).ready(function() { $('.preview-thumb').fancybox(); }); </script> <?php echo get_footer();
function base_api_url() { $root_url = root_url(); //$root_url = "http://128.199.139.181/gae/"; return $root_url . @$GLOBALS['base_api_url']; }
if ($port != "80" && $port != "443") { $myurl .= ":" . $port; } $docu = $_SERVER["PHP_SELF"]; if ($_SERVER['PATH_INFO']) { $docu = substr($docu, 0, -strlen($_SERVER['PATH_INFO'])); } $array = explode("/", $docu); $count = count($array); if ($count > 1) { foreach ($array as $key => $value) { $value = trim($value); if ($value) { if ($key + 1 < $count) { $myurl .= "/" . $value; } } } unset($array, $count); } $myurl .= "/"; $myurl = str_replace("//", "/", $myurl); return $http_type . $myurl . '../../'; } include_once $root_dir . 'framework/libs/html.php'; $url = root_url() . "index.php?c=payment&f=notify&sn=" . rawurlencode($_POST['priv1']); foreach ($_POST as $key => $value) { $url .= "&" . $key . "=" . rawurlencode($value); } $cls = new html_lib(); echo $cls->get_content($url);
/** * Load a single theme generic file into an array. * * @param string $filename The name of the file to locate. The file will be * found by looking in the admin and main themes folders. * @param string $theme The theme to check. * * @return mixed The $theme_file array from the file or false if not found. Returns * null if $filename is empty. */ function load_theme_file($filename = NULL, $theme = NULL) { if (empty($filename) or empty($theme)) { return NULL; } $theme_file_path = ROOTPATH . MAINDIR . "/views/themes/{$theme}/{$filename}"; if (!file_exists($theme_file_path)) { return NULL; } $CI =& get_instance(); $CI->config->load('template'); $file_name = basename($theme_file_path); $file_ext = strtolower(substr(strrchr($theme_file_path, '.'), 1)); if (in_array($file_ext, config_item('allowed_image_ext'))) { $file_type = 'img'; $content = root_url(MAINDIR . "/views/themes/{$theme}/{$filename}"); } else { if (in_array($file_ext, config_item('allowed_file_ext'))) { $file_type = 'file'; $content = htmlspecialchars(file_get_contents($theme_file_path)); } else { return NULL; } } $theme_file = array('name' => $file_name, 'ext' => $file_ext, 'type' => $file_type, 'path' => $theme_file_path, 'content' => $content, 'is_writable' => is_really_writable($theme_file_path)); return $theme_file; }
public function edit() { $country_info = $this->Countries_model->getCountry((int) $this->input->get('id')); if ($country_info) { $country_id = $country_info['country_id']; $data['_action'] = site_url('countries/edit?id=' . $country_id); } else { $country_id = 0; $data['_action'] = site_url('countries/edit'); } $title = isset($country_info['country_name']) ? $country_info['country_name'] : $this->lang->line('text_new'); $this->template->setTitle(sprintf($this->lang->line('text_edit_heading'), $title)); $this->template->setHeading(sprintf($this->lang->line('text_edit_heading'), $title)); $this->template->setButton($this->lang->line('button_save'), array('class' => 'btn btn-primary', 'onclick' => '$(\'#edit-form\').submit();')); $this->template->setButton($this->lang->line('button_save_close'), array('class' => 'btn btn-default', 'onclick' => 'saveClose();')); $this->template->setBackButton('btn btn-back', site_url('countries')); $this->template->setStyleTag(root_url('assets/js/fancybox/jquery.fancybox.css'), 'jquery-fancybox-css'); $this->template->setScriptTag(root_url("assets/js/fancybox/jquery.fancybox.js"), 'jquery-fancybox-js'); $data['country_name'] = $country_info['country_name']; $data['iso_code_2'] = $country_info['iso_code_2']; $data['iso_code_3'] = $country_info['iso_code_3']; $data['format'] = $country_info['format']; $data['status'] = $country_info['status']; $data['no_photo'] = $this->Image_tool_model->resize('data/flags/no_flag.png'); if ($this->input->post('flag')) { $data['flag']['path'] = $this->Image_tool_model->resize($this->input->post('flag')); $data['flag']['name'] = basename($this->input->post('flag')); $data['flag']['input'] = $this->input->post('flag'); } else { if (!empty($country_info['flag'])) { $data['flag']['path'] = $this->Image_tool_model->resize($country_info['flag']); $data['flag']['name'] = basename($country_info['flag']); $data['flag']['input'] = $country_info['flag']; } else { $data['flag']['path'] = $this->Image_tool_model->resize('data/flags/no_flag.png'); $data['flag']['name'] = 'no_flag.png'; $data['flag']['input'] = 'data/flags/no_flag.png'; } } if ($this->input->post() and $country_id = $this->_saveCountry()) { if ($this->input->post('save_close') === '1') { redirect('countries'); } redirect('countries/edit?id=' . $country_id); } $this->template->setPartials(array('header', 'footer')); $this->template->render('countries_edit', $data); }
public function edit() { $page_info = $this->Pages_model->getPage((int) $this->input->get('id')); if ($page_info) { $page_id = $page_info['page_id']; $data['_action'] = site_url('pages/edit?id=' . $page_id); } else { $page_id = 0; $data['_action'] = site_url('pages/edit'); } $title = isset($page_info['name']) ? $page_info['name'] : $this->lang->line('text_new'); $this->template->setTitle(sprintf($this->lang->line('text_edit_heading'), $title)); $this->template->setHeading(sprintf($this->lang->line('text_edit_heading'), $title)); $this->template->setButton($this->lang->line('button_save'), array('class' => 'btn btn-primary', 'onclick' => '$(\'#edit-form\').submit();')); $this->template->setButton($this->lang->line('button_save_close'), array('class' => 'btn btn-default', 'onclick' => 'saveClose();')); $this->template->setButton($this->lang->line('button_icon_back'), array('class' => 'btn btn-default', 'href' => site_url('pages'))); $this->template->setStyleTag(assets_url('js/summernote/summernote.css'), 'summernote-css'); $this->template->setScriptTag(assets_url('js/summernote/summernote.min.js'), 'summernote-js'); if ($this->input->post() and $page_id = $this->_savePage()) { if ($this->input->post('save_close') === '1') { redirect('pages'); } redirect('pages/edit?id=' . $page_id); } $data['page_id'] = $page_info['page_id']; $data['language_id'] = $page_info['language_id']; $data['name'] = $page_info['name']; $data['page_title'] = $page_info['title']; $data['page_heading'] = $page_info['heading']; $data['content'] = html_entity_decode($page_info['content']); $data['meta_description'] = $page_info['meta_description']; $data['meta_keywords'] = $page_info['meta_keywords']; $data['layout_id'] = $page_info['layout_id']; $data['status'] = $page_info['status']; if ($this->input->post('navigation')) { $data['navigation'] = $this->input->post('navigation'); } else { if (!empty($page_info['navigation'])) { $data['navigation'] = unserialize($page_info['navigation']); } else { $data['navigation'] = array(); } } $data['permalink'] = $this->permalink->getPermalink('page_id=' . $page_info['page_id']); $data['permalink']['url'] = root_url(); $this->load->model('Layouts_model'); $data['layouts'] = array(); $results = $this->Layouts_model->getLayouts(); foreach ($results as $result) { $data['layouts'][] = array('layout_id' => $result['layout_id'], 'name' => $result['name']); } $this->load->model('Languages_model'); $data['languages'] = array(); $results = $this->Languages_model->getLanguages(); foreach ($results as $result) { $data['languages'][] = array('language_id' => $result['language_id'], 'name' => $result['name']); } $data['menu_locations'] = array('Hide', 'All', 'Header', 'Footer', 'Module'); $this->template->render('pages_edit', $data); }
/** * Create CAPTCHA * * @param array|string $data data for the CAPTCHA * @param string $img_path path to create the image in * @param string $img_url URL to the CAPTCHA image folder * @param string $font_path server path to font * * @return string */ function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = '') { $defaults = array('word' => '', 'img_path' => './assets/images/thumbs/captcha/', 'img_url' => root_url() . '/assets/images/thumbs/captcha/', 'img_width' => '150', 'img_height' => 30, 'font_path' => './system/fonts/texb.ttf', 'expiration' => 300, 'word_length' => 8, 'font_size' => 16, 'pool' => '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 'colors' => array('background' => array(255, 255, 255), 'border' => array(255, 255, 255), 'text' => array(0, 0, 0), 'grid' => array(255, 255, 255))); foreach ($defaults as $key => $val) { if (!is_array($data) && empty(${$key})) { ${$key} = $val; } else { ${$key} = isset($data[$key]) ? $data[$key] : $val; } } if (!is_dir($img_path)) { mkdir($img_path); } if ($img_path === '' or $img_url === '' or !is_dir($img_path) or !is_really_writable($img_path) or !extension_loaded('gd')) { return FALSE; } // ----------------------------------- // Remove old images // ----------------------------------- $now = microtime(TRUE); $current_dir = @opendir($img_path); while ($filename = @readdir($current_dir)) { if (substr($filename, -4) === '.jpg' && str_replace('.jpg', '', $filename) + $expiration < $now) { @unlink($img_path . $filename); } } @closedir($current_dir); // ----------------------------------- // Do we have a "word" yet? // ----------------------------------- if (empty($word)) { $word = ''; for ($i = 0, $mt_rand_max = strlen($pool) - 1; $i < $word_length; $i++) { $word .= $pool[mt_rand(0, $mt_rand_max)]; } } elseif (!is_string($word)) { $word = (string) $word; } // ----------------------------------- // Determine angle and position // ----------------------------------- $length = strlen($word); $angle = $length >= 6 ? mt_rand(-($length - 6), $length - 6) : 0; $x_axis = mt_rand(6, 360 / $length - 16); $y_axis = $angle >= 0 ? mt_rand($img_height, $img_width) : mt_rand(6, $img_height); // Create image // PHP.net recommends imagecreatetruecolor(), but it isn't always available $im = function_exists('imagecreatetruecolor') ? imagecreatetruecolor($img_width, $img_height) : imagecreate($img_width, $img_height); // ----------------------------------- // Assign colors // ---------------------------------- is_array($colors) or $colors = $defaults['colors']; foreach (array_keys($defaults['colors']) as $key) { // Check for a possible missing value is_array($colors[$key]) or $colors[$key] = $defaults['colors'][$key]; $colors[$key] = imagecolorallocate($im, $colors[$key][0], $colors[$key][1], $colors[$key][2]); } // Create the rectangle ImageFilledRectangle($im, 0, 0, $img_width, $img_height, $colors['background']); // ----------------------------------- // Create the spiral pattern // ----------------------------------- $theta = 1; $thetac = 7; $radius = 16; $circles = 20; $points = 32; for ($i = 0, $cp = $circles * $points - 1; $i < $cp; $i++) { $theta += $thetac; $rad = $radius * ($i / $points); $x = $rad * cos($theta) + $x_axis; $y = $rad * sin($theta) + $y_axis; $theta += $thetac; $rad1 = $radius * (($i + 1) / $points); $x1 = $rad1 * cos($theta) + $x_axis; $y1 = $rad1 * sin($theta) + $y_axis; imageline($im, $x, $y, $x1, $y1, $colors['grid']); $theta -= $thetac; } // ----------------------------------- // Write the text // ----------------------------------- $use_font = $font_path !== '' && file_exists($font_path) && function_exists('imagettftext'); if ($use_font === FALSE) { $font_size > 5 && ($font_size = 5); $x = mt_rand(0, $img_width / ($length / 3)); $y = 0; } else { $font_size > 30 && ($font_size = 30); $x = mt_rand(0, $img_width / ($length / 1.5)); $y = $font_size + 2; } for ($i = 0; $i < $length; $i++) { if ($use_font === FALSE) { $y = mt_rand(0, $img_height / 2); imagestring($im, $font_size, $x, $y, $word[$i], $colors['text']); $x += $font_size * 2; } else { $y = mt_rand($img_height / 2, $img_height - 3); imagettftext($im, $font_size, $angle, $x, $y, $colors['text'], $font_path, $word[$i]); $x += $font_size; } } // Create the border imagerectangle($im, 0, 0, $img_width - 1, $img_height - 1, $colors['border']); // ----------------------------------- // Generate the image // ----------------------------------- $img_url = rtrim($img_url, '/') . '/'; if (function_exists('imagejpeg')) { $img_filename = $now . '.jpg'; imagejpeg($im, $img_path . $img_filename); } elseif (function_exists('imagepng')) { $img_filename = $now . '.png'; imagepng($im, $img_path . $img_filename); } else { return FALSE; } $img = '<img src="' . $img_url . $img_filename . '" style="width: ' . $img_width . '; height: ' . $img_height . '; border: 0;" alt=" " />'; ImageDestroy($im); return array('word' => $word, 'time' => $now, 'image' => $img, 'filename' => $img_filename); }
public function edit() { $banner_info = $this->Banners_model->getBanner((int) $this->input->get('id')); if ($banner_info) { $banner_id = $banner_info['banner_id']; $data['_action'] = site_url('banners/edit?id=' . $banner_id); } else { $banner_id = 0; $data['_action'] = site_url('banners/edit'); } $title = isset($banner_info['name']) ? $banner_info['name'] : $this->lang->line('text_new'); $this->template->setTitle(sprintf($this->lang->line('text_edit_heading'), $title)); $this->template->setHeading(sprintf($this->lang->line('text_edit_heading'), $title)); $this->template->setButton($this->lang->line('button_save'), array('class' => 'btn btn-primary', 'onclick' => '$(\'#edit-form\').submit();')); $this->template->setButton($this->lang->line('button_save_close'), array('class' => 'btn btn-default', 'onclick' => 'saveClose();')); $this->template->setBackButton('btn btn-back', site_url('banners')); $this->template->setStyleTag(root_url('assets/js/fancybox/jquery.fancybox.css'), 'jquery-fancybox-css'); $this->template->setScriptTag(root_url("assets/js/fancybox/jquery.fancybox.js"), 'jquery-fancybox-js'); $data['banner_id'] = $banner_info['banner_id']; $data['name'] = $banner_info['name']; $data['type'] = $this->input->post('type') ? $this->input->post('type') : $banner_info['type']; $data['click_url'] = $banner_info['click_url']; $data['language_id'] = $banner_info['language_id']; $data['alt_text'] = $banner_info['alt_text']; $data['custom_code'] = $banner_info['custom_code']; $data['status'] = $banner_info['status']; $data['no_photo'] = $this->Image_tool_model->resize('data/no_photo.png'); $data['image'] = array('name' => 'no_photo.png', 'path' => 'data/no_photo.png', 'url' => $data['no_photo']); $data['carousels'] = array(); if (!empty($banner_info['image_code'])) { $image = unserialize($banner_info['image_code']); if ($banner_info['type'] === 'image') { if (!empty($image['path'])) { $name = basename($image['path']); $data['image'] = array('name' => $name, 'path' => $image['path'], 'url' => $this->Image_tool_model->resize($image['path'], 120, 120)); } } else { if ($banner_info['type'] === 'carousel') { if (!empty($image['paths']) and is_array($image['paths'])) { foreach ($image['paths'] as $path) { $name = basename($path); $data['carousels'][] = array('name' => $name, 'path' => $path, 'url' => $this->Image_tool_model->resize($path, 120, 120)); } } } } } $data['types'] = array('image' => 'Image', 'carousel' => 'Carousel', 'custom' => 'Custom'); $this->load->model('Languages_model'); $data['languages'] = array(); $results = $this->Languages_model->getLanguages(); foreach ($results as $result) { $data['languages'][] = array('language_id' => $result['language_id'], 'name' => $result['name']); } if ($this->input->post() and $banner_id = $this->_saveBanner()) { if ($this->input->post('save_close') === '1') { redirect('banners'); } redirect('banners/edit?id=' . $banner_id); } $this->template->render('banners_edit', $data); }
Show </a> <a ng-show="item.status == 2" ng-click="list.setStatusBlock(item.referral_id, 1)" class="item-hide"> hide </a> </div> <div> <a class="btn-edit" id="btn-edit-{{item.referral_id}}" ng-click="list.onClickEdit(item.referral_id)" data-referral_id="{{item.referral_id}}" data-name="{{item.name}}" data-image_id="{{item.image_id}}" data-image="<?php echo root_url(), 'root_images/'; ?> {{item.file_dir}}r100_{{item.file_name}}" > <span></span> </a> </div> </div> </div> <div class="row" ng-show="list.total"> <div class="col-xs-6"> <dir-pagination-controls template-url="<?php echo $curModule->file_url; ?> template/summary-pagination.html">
<img alt="<?php echo $slide['name']; ?> " src="<?php echo $slide['image_src']; ?> " /> </li> <?php } ?> <?php } ?> </ul> </div> </div> <link type="text/css" rel="stylesheet" href="<?php echo root_url("assets/js/flexslider/flexslider.css"); ?> "> <script src="<?php echo root_url("assets/js/flexslider/jquery.flexslider.js"); ?> "></script> <script type="text/javascript"><!-- $('.flexslider').flexslider({ prevText: '', nextText: '' }); //--></script>
private function getList($data, $filter) { $url = '?'; if ($this->input->get('page')) { $filter['page'] = (int) $this->input->get('page'); } else { $filter['page'] = 1; } if ($this->config->item('page_limit')) { $filter['limit'] = $this->config->item('page_limit'); } else { $filter['limit'] = ''; } if ($this->input->get('filter_search')) { $filter['filter_search'] = $data['filter_search'] = $this->input->get('filter_search'); } else { $data['filter_search'] = ''; } if ($this->input->get('filter_access')) { $filter['filter_access'] = $data['filter_access'] = $this->input->get('filter_access'); $url .= 'filter_access=' . $filter['filter_access'] . '&'; } else { $filter['filter_access'] = $data['filter_access'] = ''; } if ($this->input->get('filter_date')) { $filter['filter_date'] = $data['filter_date'] = $this->input->get('filter_date'); $url .= 'filter_date=' . $filter['filter_date'] . '&'; } else { $filter['filter_date'] = $data['filter_date'] = ''; } if ($this->input->get('sort_by')) { $filter['sort_by'] = $data['sort_by'] = $this->input->get('sort_by'); } else { $filter['sort_by'] = $data['sort_by'] = 'date_added'; } if ($this->input->get('order_by')) { $filter['order_by'] = $data['order_by'] = $this->input->get('order_by'); $data['order_by_active'] = $this->input->get('order_by') . ' active'; } else { $filter['order_by'] = $data['order_by'] = 'DESC'; $data['order_by_active'] = ''; } if ($filter['filter_type'] === 'online') { $data['text_empty'] = $this->lang->line('text_empty'); } else { $data['text_empty'] = $this->lang->line('text_empty_report'); } $order_by = (isset($filter['order_by']) and $filter['order_by'] == 'ASC') ? 'DESC' : 'ASC'; $data['sort_date'] = site_url('customers_online' . $url . 'sort_by=date_added&order_by=' . $order_by); $customers_online = $this->Customer_online_model->getList($filter); $data['customers_online'] = array(); foreach ($customers_online as $online) { $country_code = $online['country_code'] ? strtolower($online['country_code']) : 'no_flag'; $data['customers_online'][] = array('activity_id' => $online['activity_id'], 'ip_address' => $online['ip_address'], 'customer_name' => $online['customer_id'] ? $online['first_name'] . ' ' . $online['last_name'] : $this->lang->line('text_guest'), 'access_type' => ucwords($online['access_type']), 'browser' => $online['browser'], 'user_agent' => $online['user_agent'], 'request_uri' => !empty($online['request_uri']) ? $online['request_uri'] : '--', 'referrer_uri' => !empty($online['referrer_uri']) ? $online['referrer_uri'] : '--', 'request_url' => !empty($online['request_uri']) ? root_url($online['request_uri']) : '#', 'referrer_url' => !empty($online['referrer_uri']) ? root_url($online['referrer_uri']) : '#', 'date_added' => time_elapsed($online['date_added']), 'country_code' => image_url('data/flags/' . $country_code . '.png'), 'country_name' => $online['country_name'] ? $online['country_name'] : $this->lang->line('text_private')); } $data['types'] = array('online' => array('badge' => '', 'url' => site_url('customers_online'), 'title' => $this->lang->line('text_online')), 'all' => array('badge' => '', 'url' => site_url('customers_online/all'), 'title' => $this->lang->line('text_all'))); $data['online_dates'] = array(); $online_dates = $this->Customer_online_model->getOnlineDates($filter); foreach ($online_dates as $date) { $month_year = mdate('%Y-%m', strtotime($date['year'] . '-' . $date['month'])); $data['online_dates'][$month_year] = mdate('%F %Y', strtotime($date['date_added'])); } if ($this->input->get('sort_by') and $this->input->get('order_by')) { $url .= 'sort_by=' . $filter['sort_by'] . '&'; $url .= 'order_by=' . $filter['order_by'] . '&'; } $config['base_url'] = page_url() . $url; $config['total_rows'] = $this->Customer_online_model->getCount($filter); $config['per_page'] = $filter['limit']; $this->pagination->initialize($config); $data['pagination'] = array('info' => $this->pagination->create_infos(), 'links' => $this->pagination->create_links()); return $data; }
echo form_error('special_price', '<span class="text-danger">', '</span>'); ?> </div> </div> </div> </div> </div> </form> </div> </div> <link type="text/css" rel="stylesheet" href="<?php echo root_url("assets/js/datepicker/datepicker.css"); ?> "> <script type="text/javascript" src="<?php echo root_url("assets/js/datepicker/bootstrap-datepicker.js"); ?> "></script> <script type="text/javascript"><!-- $(document).ready(function() { $('#start-date, #end-date').datepicker({ format: 'dd-mm-yyyy', }); $('input[name="special_status"]').on('change', function() { if (this.value == '1') { $('#special-toggle').slideDown(300); } else { $('#special-toggle').slideUp(300); } });