D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
realadss
/
.trash
/
public_html
/
partymaker.in
/
controllers
/
Filename :
Admin.php
back
Copy
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Admin extends CI_Controller { public function __construct() { parent::__construct(); $this->load->library('grocery_CRUD'); } public function index() { $this->common_model->checkLogin_dash(); $this->load->view('login'); } public function change_password() { $this->common_model->checkLogin(); $this->load->view('change_password'); } public function change_password_process() { $this->load->library('form_validation'); $this->form_validation->set_rules('old_password', 'Old Password', 'trim|required'); $this->form_validation->set_rules('new_password', 'New Password', 'trim|required'); $this->form_validation->set_rules('confirm_password', 'Confirmation Password', 'trim|required|matches[new_password]'); $status = 'error'; $message = "Please try again"; if ($this->form_validation->run() == FALSE) { $message = validation_errors(); $this->session->set_flashdata('message_err', $message); } else { $data_return = $this->common_model->change_password_process(); if(isset($data_return['status']) && $data_return['status'] =='success') { $status = 'success'; $this->session->set_flashdata('message_succ', $data_return['message']); } else { $this->session->set_flashdata('message_err', $data_return['message']); } } redirect(base_url().'admin/change_password'); } public function log_out() { $this->session->unset_userdata($this->common_model->admin_session_name); redirect(base_url().'admin/index'); } public function check_login() { $this->common_model->checkLogin_dash(); $this->load->library('form_validation'); $this->form_validation->set_rules('username', 'Username', 'trim|required'); $this->form_validation->set_rules('password', 'Password', 'trim|required'); if ($this->form_validation->run() == FALSE) { $message = validation_errors(); $this->session->set_flashdata('error_message', $message); } else { $data_return = $this->common_model->check_login_admin(); if($data_return['status'] =='success') { redirect(base_url().'admin/common_setting'); } else { $this->session->set_flashdata('error_message', $data_return['message']); } } $this->load->view('login'); } public function _example_output($output = null) { $this->load->view('example.php',(array)$output); } function callback_update($post_array) { $add_html = ''; if(strpos($_REQUEST['alias'],'.html')) { $add_html = '.html'; } $post_array['alias'] = url_title($_REQUEST['alias']).$add_html; $post_array['alias'] = str_replace("html.html",".html",$post_array['alias']); return $post_array; } public function common_setting() { $this->common_model->checkLogin(); $crud = new grocery_CRUD(); $crud->set_theme('flexigrid'); $crud->unset_clone(); $crud->unset_print(); $crud->unset_export(); $crud->unset_add(); $crud->unset_delete(); //$crud->unset_read(); $crud->set_table('common_setting'); $crud->columns('web_name','logo','footer_text','contact_email','mobile'); $crud->required_fields('web_name','logo','fevicon','footer_text','contact_email','mobile','meta_title'); $crud->unset_texteditor('map_address','seo_content','meta_description','meta_keyword','contact_us_address'); $crud->set_field_upload('logo',$this->common_model->path_logo); $crud->set_field_upload('blog_banner',$this->common_model->path_logo); $crud->set_field_upload('fevicon',$this->common_model->path_logo); $output = $crud->render(); $this->_example_output($output); } public function menu() { $this->common_model->checkLogin(); $crud = new grocery_CRUD(); $crud->set_theme('flexigrid'); $crud->unset_clone(); $crud->unset_print(); $crud->unset_export(); $crud->unset_read(); $crud->required_fields('menu','status'); $crud->set_relation('cms_page_id','cms_page','title'); $crud->display_as('cms_page_id','CMS Page'); $crud->set_table('menu'); $output = $crud->render(); $this->_example_output($output); } public function submenu() { $this->common_model->checkLogin(); $crud = new grocery_CRUD(); $crud->set_theme('flexigrid'); $crud->unset_clone(); $crud->unset_print(); $crud->unset_export(); $crud->unset_read(); $crud->set_relation('menu_id','menu','menu'); $crud->required_fields('menu_id','submenu','cms_page_id','status'); $crud->set_relation('cms_page_id','cms_page','title'); $crud->display_as('menu_id','Menu'); $crud->display_as('cms_page_id','CMS Page'); $crud->set_table('submenu'); $output = $crud->render(); $this->_example_output($output); } public function home_slider() { $this->common_model->checkLogin(); $crud = new grocery_CRUD(); $crud->set_theme('flexigrid'); $crud->unset_clone(); $crud->unset_print(); $crud->unset_export(); $crud->unset_read(); $crud->required_fields('image','status'); $crud->set_field_upload('image',$this->common_model->path_slider_image); $crud->set_table('home_slider_master'); $output = $crud->render(); $this->_example_output($output); } public function gallery_type() { $this->common_model->checkLogin(); $crud = new grocery_CRUD(); $crud->set_theme('flexigrid'); $crud->unset_clone(); $crud->unset_print(); $crud->unset_export(); $crud->unset_read(); $crud->required_fields('gallery_name'); $crud->set_table('gallery_type'); $output = $crud->render(); $this->_example_output($output); } public function gallery() { $this->common_model->checkLogin(); $crud = new grocery_CRUD(); $crud->set_theme('flexigrid'); $crud->unset_clone(); $crud->unset_print(); $crud->unset_export(); $crud->unset_read(); $crud->set_relation('gallery_type_id','gallery_type','gallery_name'); $crud->display_as('gallery_type_id','Gallery Type'); $crud->required_fields('gallery_type_id','image','status'); $crud->set_field_upload('image',$this->common_model->path_gallery); $crud->set_table('gallery_master'); $output = $crud->render(); $this->_example_output($output); } public function get_faq() { $faq_array = []; $faq_data = $this->common_model->get_count_data_manual('faq_master','',2,'id,question','question asc'); if(isset($faq_data) && $faq_data !='') { foreach($faq_data as $faq_data_val) { $faq_array[$faq_data_val['id']] = $faq_data_val['question']; } } return $faq_array; } public function home_content() { $this->common_model->checkLogin(); $crud = new grocery_CRUD(); $crud->set_theme('flexigrid'); $crud->unset_clone(); $crud->unset_print(); $crud->unset_export(); $crud->unset_add(); $crud->unset_delete(); //$crud->unset_read(); $crud->set_table('home_content'); $crud->set_relation('our_gallery','gallery_type','gallery_name'); $crud->columns('our_gallery','testimonail_title'); $crud->required_fields('artist_type','url_alias','meta_title','title','content','image','banner_image','banner_desc'); $crud->unset_texteditor('seo_content','meta_description','meta_keyword','home_page_banner','top_image','who_we_image'); $cms_arr = $this->get_cms_array(); $crud->display_as('our_services_cms_pages','Our Services Pages'); $crud->field_type('theme_cms_page','multiselect',$cms_arr); $crud->field_type('our_services_cms_pages','multiselect',$cms_arr); $crud->field_type('our_entertaiment_cms','multiselect',$cms_arr); $crud->set_field_upload('home_page_banner',$this->common_model->path_home); $crud->set_field_upload('top_image',$this->common_model->path_home); $crud->set_field_upload('who_we_image',$this->common_model->path_home); $crud->set_field_upload('above_gallery_image',$this->common_model->path_home); $crud->field_type('video','multiselect',$this->get_video_array()); // $crud->set_field_upload('top_image',$this->common_model->path_home); // $crud->set_field_upload('top_image',$this->common_model->path_home); // $crud->set_field_upload('top_image',$this->common_model->path_home); $crud->field_type('faq','multiselect',$this->get_faq()); $output = $crud->render(); $this->_example_output($output); } public function testimonial() { $this->common_model->checkLogin(); $crud = new grocery_CRUD(); $crud->set_theme('flexigrid'); $crud->unset_clone(); $crud->unset_print(); $crud->unset_export(); $crud->unset_read(); $crud->required_fields('content','photo','name','event','status'); $crud->set_field_upload('photo',$this->common_model->path_gallery); $crud->set_table('testimonial'); $output = $crud->render(); $this->_example_output($output); } public function cms_pages() { $this->common_model->checkLogin(); $crud = new grocery_CRUD(); $crud->set_theme('flexigrid'); $crud->unset_clone(); $crud->unset_print(); $crud->unset_export(); //$crud->unset_read(); $crud->columns('title','alias','image','gallery_id'); $crud->required_fields('title','content','alias','content','meta_title','status','banner_image'); $crud->unset_texteditor('seo_content','meta_description','meta_keyword'); $crud->display_as('gallery_id','Gallery Type'); $crud->set_relation('gallery_id','gallery_type','gallery_name'); $crud->set_field_upload('banner_image',$this->common_model->path_banner); $crud->field_type('faq','multiselect',$this->get_faq()); $crud->set_field_upload('image',$this->common_model->path_banner); $crud->field_type('sub_category_page','multiselect',$this->get_cms_array()); $crud->field_type('video','multiselect',$this->get_video_array()); $crud->set_table('cms_page'); $output = $crud->render(); $this->_example_output($output); } public function blog() { $this->common_model->checkLogin(); $crud = new grocery_CRUD(); $crud->set_theme('flexigrid'); $crud->unset_clone(); $crud->unset_print(); $crud->unset_export(); //$crud->unset_read(); $crud->set_table('blog_master'); $crud->callback_before_update(array($this,'callback_update')); $crud->columns('author','title','image'); $crud->required_fields('author','title','alias','content','image','meta_title','status'); $crud->unset_texteditor('seo_content','meta_description','meta_keyword'); $crud->field_type('faq','multiselect',$this->get_faq()); $crud->set_field_upload('image',$this->common_model->path_blog); $crud->set_relation('gallery_id','gallery_type','gallery_name'); $output = $crud->render(); $this->_example_output($output); } public function get_cms_array() { $cms_array = []; $cms_data = $this->common_model->get_count_data_manual('cms_page','',2,'id,title','title asc'); if(isset($cms_data) && $cms_data !='') { foreach($cms_data as $cms_data_val) { $cms_array[$cms_data_val['id']] = $cms_data_val['title']; } } return $cms_array; } public function get_video_array() { $cms_array = []; $cms_data = $this->common_model->get_count_data_manual('video_master','',2,'id,title','title asc'); if(isset($cms_data) && $cms_data !='') { foreach($cms_data as $cms_data_val) { $cms_array[$cms_data_val['id']] = $cms_data_val['title']; } } return $cms_array; } public function our_package() { $this->common_model->checkLogin(); $crud = new grocery_CRUD(); $crud->set_theme('flexigrid'); $crud->unset_clone(); $crud->unset_print(); $crud->unset_export(); //$crud->unset_read(); $crud->required_fields('package_name','price','package_detail','cms_page_id','status'); $crud->display_as('cms_page_id','CMS Page'); $crud->set_relation('cms_page_id','cms_page','title'); $crud->set_table('our_package'); $output = $crud->render(); $this->_example_output($output); } public function contact_us() { $this->common_model->checkLogin(); $crud = new grocery_CRUD(); $crud->set_theme('flexigrid'); $crud->unset_clone(); $crud->unset_print(); $crud->unset_export(); //$crud->unset_read(); $crud->unset_add(); $crud->unset_edit(); $crud->set_table('contact_us_request'); $output = $crud->render(); $this->_example_output($output); } public function enquiry() { $this->common_model->checkLogin(); $crud = new grocery_CRUD(); $crud->set_theme('flexigrid'); $crud->unset_clone(); $crud->unset_print(); $crud->unset_export(); //$crud->unset_read(); $crud->unset_add(); $crud->unset_edit(); $crud->order_by('id','desc'); $crud->set_table('enquiry_form'); $output = $crud->render(); $this->_example_output($output); } public function faq() { $this->common_model->checkLogin(); $crud = new grocery_CRUD(); $crud->set_theme('flexigrid'); $crud->unset_clone(); $crud->unset_print(); $crud->unset_export(); //$crud->unset_read(); //$crud->unset_add(); // $crud->unset_edit(); $crud->set_table('faq_master'); $output = $crud->render(); $this->_example_output($output); } public function video() { $this->common_model->checkLogin(); $crud = new grocery_CRUD(); $crud->set_theme('flexigrid'); $crud->unset_clone(); $crud->unset_print(); $crud->unset_export(); //$crud->unset_read(); //$crud->unset_add(); // $crud->unset_edit(); $crud->set_table('video_master'); $output = $crud->render(); $this->_example_output($output); } }