public function languages() { $this->check_post_ajax_request(); $return_data = array('status' => 0); $arr_language = dropdownFromDb('languages', 'abbr', array('where' => array('allow_template' => 1))); $html = $this->load->view('agent/leadtemplates/language_list', array('languages' => $arr_language), true); $return_data['status'] = 1; $return_data['html'] = $html; echo json_encode($return_data); }
public function index() { $this->dynamic_load->add_js('footer', array('src' => base_url() . 'ckeditor/ckeditor.js', 'type' => 'text/javascript')); $temp_cond = array('select' => array('`templates`.*'), 'result' => 1); $templates = $this->common_model->get_rows($temp_cond, 'templates'); $template_lists = array('' => '-- Add New Funnel --'); foreach ($templates as $template) { $template_lists[$template['id']] = $template['name']; } $tcats = dropdownFromDb('template_categories', 'name'); $this->template->view('admin/leadtemplates/index', array('templates' => $templates, 'template_lists' => $template_lists, 'tcats' => $tcats)); }
public function languages() { $this->check_post_ajax_request(); $return_data = array('status' => 0); $arr_language = dropdownFromDb('languages', 'abbr', array('where' => array('allow_template' => 1))); $template_id = $this->secure_data($this->input->post('template_id')); $cond = array('select' => array('template_categories.name'), 'join' => array(0 => array('table' => 'template_categories', 'condition' => 'templates.tc_id = template_categories.id', 'type' => 'inner')), 'where' => array('templates.id' => $template_id), 'row' => 2); $cat_data = $this->common_model->get_rows($cond, 'templates'); if ($cat_data) { $category = $cat_data['name']; $html = $this->load->view('agent/emailmanager/lang_content', array('languages' => $arr_language, 'category' => $category), true); $return_data['status'] = 1; $return_data['html'] = $html; } else { $return_data['message'] = 'No category associated with this template.'; } echo json_encode($return_data); }