whoami7 - Manager
:
/
home
/
papecmvm
/
public_html
/
application
/
controllers
/
Upload File:
files >> //home/papecmvm/public_html/application/controllers/Webcontroller.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ob_start(); //error_reporting(0); class Webcontroller 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('app', "app"); $CI = & get_instance(); $this->db = $CI->load->database('default', TRUE); $this->db2 = $CI->load->database('db2', TRUE); $this->load->model('alldata', "model"); } public function index() { $session_data=$this->session->all_userdata(); $flang=$session_data['flang']; $this->load->model('alldata', "model"); $where=array('page_category'=>'index','publish'=>'on'); $data['viewdata']=$this->model->containdetail($where); $data['pagecount']=count($data['viewdata']); $data['get_address']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'address'),'other_cat','ASC'); $data['get_email']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'email'),'other_cat','ASC'); $data['get_conno']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'contact-no'),'other_cat','ASC'); $data['social']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'social-icon'),'other_cat','ASC'); $data['logo']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'logo'),'other_cat','ASC'); $where_homebox=array('post_cat'=>'service'); $this->db->limit("3"); $data['home_ser']=$this->model->DetailData('tblposts',$where_homebox); $data['event']=$this->model->portfolio_model(array('portfolio_cat_name'=>'event')); $where_ser=array('page_category'=>'service','publish'=>'on'); $this->db->limit("4"); $data['service_home']=$this->model->containdetail($where_ser); $where_rsn=array('post_cat'=>'reason'); $data['reason']=$this->model->DetailData('tblposts',$where_rsn); $where_plan=array('post_cat'=>'plans_pricing'); $data['plans']=$this->model->DetailData('tblposts',$where_plan); $where_about=array('page_code'=>'about5048'); $data['about']=$this->model->containdetail($where_about); /*echo "<pre>"; print_r($data['event']); die;*/ $this->load->view("Web/header",$data); $this->load->view("Web/Template/index",$data); //$this->load->view("Web/footer"); $this->load->view("Web/footer2"); } public function page($id='epd',$id2='null') { $this->model->pagesesstion(); //set a 404 page $id= urldecode($id); if($id=='epd') { $this->errorpage(); }else if($id=='home'){ redirect(base_url()); } else{ $session_data=$this->session->all_userdata(); $flang=$session_data['flang']; $this->load->model('alldata', "model"); $where=array('slug'=>$id,'publish'=>'on'); $data['viewdata']=$this->model->containdetail($where); if(count($data['viewdata'])==0) { redirect('webcontroller/errorpage'); } $subid=''; $data['brad']=array(); foreach($data['viewdata'] as $key){ if($key['submenu']!=Null) { $subid=$key['submenu']; } } if($subid!=''){ $where=array('submenu'=>$subid); $data['sub']=$this->model->containdetail($where); //level 1 breadcrumbs $lev1=''; foreach($data['sub'] as $key){ if($key['submenu']!=Null) { $lev1=$key['submenu']; } } if($lev1!=''){ $where=array('menu_content'=>$lev1); $data['sub1']=$this->model->containdetail($where); array_push($data['brad'],$data['sub1'][0]); //level 2 breadcrumbs $lev2=''; foreach($data['sub1'] as $key){ if($key['submenu']!=Null) { $lev2=$key['submenu']; } } if($lev2!=''){ $where=array('menu_content'=>$lev2); $data['sub2']=$this->model->containdetail($where); array_push($data['brad'],$data['sub2'][0]);; } } } $data['get_address']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'address'),'other_cat','ASC'); $data['get_email']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'email'),'other_cat','ASC'); $data['get_conno']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'contact-no'),'other_cat','ASC'); $data['social']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'social-icon'),'other_cat','ASC'); $data['logo']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'logo'),'other_cat','ASC'); $where8=array("portfolio_cat_name" => 'event'); $data['postall'] = $this->model->portfolio_model($where8); $where_blog=array('post_cat'=>'plan'); $this->db->order_by("tblpost_id", "desc"); $data['plan']=$this->model->DetailData('tblposts',$where_blog); $where_about=array('page_code'=>'about5048'); $data['about']=$this->model->containdetail($where_about); $Template='Web/Template/'.$data['viewdata'][0]['page_category']; $this->load->view("Web/header",$data); $this->load->view($Template); $this->load->view("Web/footer2"); } } public function viewpage($slug){ $slug= urldecode($slug); $session_data=$this->session->all_userdata(); //print_r($session_data); $flang=$session_data['flang']; $this->model->pagesesstion(); $this->db->select('*'); $this->db->where("post_cat", "Headlines"); $this->db->order_by("tblpost_id", "desc"); $data['post']=$this->db->get($flang.'tblposts')->result_array(); $slug= urldecode($slug); $data['brad']=array(); $this->load->model('alldata', "model"); $where=array('slug'=>'box','publish'=>'on'); $data['viewdata']=$this->model->pagedetail($where); $Template='Web/Template/'.$data['viewdata'][0]['page_category']; $where_about=array('page_code'=>'about5048'); $data['about']=$this->model->containdetail($where_about); $this->load->view("Web/header",$data); $this->load->view($Template); $this->load->view("Web/footer"); $this->load->view("Web/footer2"); } public function errorpage(){ $where_about=array('page_code'=>'about5048'); $data['about']=$this->model->containdetail($where_about); $data['get_address']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'address'),'other_cat','ASC'); $data['get_email']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'email'),'other_cat','ASC'); $data['get_conno']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'contact-no'),'other_cat','ASC'); $data['social']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'social-icon'),'other_cat','ASC'); $data['logo']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'logo'),'other_cat','ASC'); $this->load->view("Web/header", $data); $this->load->view('Web/error'); // $this->load->view("Web/footer"); $this->load->view("Web/footer2"); } public function menucreate($id) { $session_data=$this->session->all_userdata(); $flang=$session_data['flang']; $where=array('menushortcode'=>$id); $data['view']=$this->model->DetailData('tblmenugroup',$where); $this->db->order_by("menu_position", "asc"); $this->db->select('*'); $this->db->from($flang.'tblmenu'); $where= array('menugroup' => $data['view'][0]['menugroup_id']); $this->db->where($where); $this->db->join( $flang.'tblcontent', $flang.'tblcontent.content_id = '.$flang.'tblmenu.menu_content','left'); $data['menu'] = $this->db->get()->result_array(); $where=array('menugroup_id'=>$id); $data['menugroup']=$this->model->DetailData('tblmenugroup',$where); $this->load->view("Web/menuview",$data); } public function sitemapcreate($id) { $session_data=$this->session->all_userdata(); $flang=$session_data['flang']; $where=array('menushortcode'=>$id); $data['view']=$this->model->DetailData('tblmenugroup',$where); $this->db->order_by("menu_position", "asc"); $this->db->select('*'); $this->db->from($flang.'tblmenu'); $where= array('menugroup' => $data['view'][0]['menugroup_id']); $this->db->where($where); $this->db->join( $flang.'tblcontent', $flang.'tblcontent.content_id = '.$flang.'tblmenu.menu_content','left'); $data['menu'] = $this->db->get()->result_array(); $where=array('menugroup_id'=>$id); $data['menugroup']=$this->model->DetailData('tblmenugroup',$where); $this->db->select('*'); $data["searchmenu"]=$this->db->get($flang.'tblcontent')->result_array(); $this->load->view("Web/sitemapview",$data); } public function footerlink($id) { $session_data=$this->session->all_userdata(); $flang=$session_data['flang']; $where=array('menushortcode'=>$id); $data['view']=$this->model->DetailData('tblmenugroup',$where); $this->db->order_by("menu_position", "asc"); $this->db->select('*'); $this->db->from($flang.'tblmenu'); $where= array('menugroup' => $data['view'][0]['menugroup_id']); $this->db->where($where); $this->db->join( $flang.'tblcontent', $flang.'tblcontent.content_id = '.$flang.'tblmenu.menu_content','left'); $data['menu'] = $this->db->get()->result_array(); $where=array('menugroup_id'=>$id); $data['menugroup']=$this->model->DetailData('tblmenugroup',$where); $this->load->view("Web/footerlinkview",$data); } public function homebox($id) { $session_data=$this->session->all_userdata(); $flang=$session_data['flang']; $where=array('menushortcode'=>$id); $data['view']=$this->model->DetailData('tblmenugroup',$where); $this->db->order_by("menu_position", "asc"); $this->db->select('*'); $this->db->from($flang.'tblmenu'); $where= array('menugroup' => $data['view'][0]['menugroup_id']); $this->db->where($where); $this->db->join( $flang.'tblcontent', $flang.'tblcontent.content_id = '.$flang.'tblmenu.menu_content','left'); $data['menu'] = $this->db->get()->result_array(); $where=array('menugroup_id'=>$id); $data['menugroup']=$this->model->DetailData('tblmenugroup',$where); $this->load->view("Web/home_box",$data); } public function pageview($id) { $session_data=$this->session->all_userdata(); $flang=$session_data['flang']; $where=array('page_code'=>$id); $data['view']=$this->model->DetailData($flang.'tblcontent',$where); if(count($data['view'])==0) { redirect('webcontroller/errorpage'); } echo $data['view'][0]['content_text']; } public function changelang($language='') { $this->session->set_userdata('flang', $language); if ($language != "") { $this->lang->load('translate',$language); } else { $this->lang->load('translate','english'); } redirect('webcontroller'); } public function changecolor($color) { $this->session->set_userdata('color', $color); redirect('webcontroller'); } public function lastmodification() { $this->db->select('lasttime'); $this->db->from('lastmodifytime'); $query = $this->db->get()->result_array(); $date1=date_create(date("Y-m-d")); $date2=date_create(date("Y-m-d", strtotime($query[0]['lasttime']))); $diff=date_diff($date1,$date2); $count=$diff->format("%a"); if($count>=7) { $dates=array('lasttime'=> date("Y-m-d H:i:s",strtotime(' -1 day'))); $this->db->update('lastmodifytime',$dates); } $mydate = date("d-m-Y", strtotime($query[0]['lasttime'])); $mytime= date("g:i A", strtotime($query[0]['lasttime'])); if($mytime >= "12.00 PM" && $mytime <= "5.00 PM"){ //echo $mydate." ".$mytime; echo $mydate; } else{ //echo date("d-m-Y", strtotime($mydate))." 4:00 PM"; echo $mydate; } } public function serach() { $key=$this->input->post('srch-term'); $session_data=$this->session->all_userdata(); $lang=$session_data['flang']; $this->db->select('*'); $this->db->group_by('content_title'); $this->db->or_like($lang.'tblcontent.content_text',$key); $this->db->or_like($lang.'tblcontent.content_title',$key); //$this->db->group_by('content_title'); $this->db->from($lang.'tblmenu'); $this->db->join($lang.'tblcontent', $lang.'tblmenu.menu_content = '.$lang.'tblcontent.content_id','left'); $data['search']=$this->db->get()->result_array(); //echo "<pre>"; print_r($data['search']); echo "</pre>"; $this->db->select('*'); $data["searchmenu"]=$this->db->get($lang.'tblcontent')->result_array(); $this->load->view("Web/header",$data); $this->load->view("Web/search",$data); $this->load->view("Web/footer"); $this->load->view("Web/footer2"); } public function advserach(){ $advs=$this->input->post('adv-search'); $advt=$this->input->post('adv-topic'); $session_data=$this->session->all_userdata(); $lang=$session_data['flang']; $where=array('content_id'=>$advt); $this->db->or_like($lang.'tblcontent.content_text',$advs); $this->db->from($lang.'tblcontent'); $this->db->where($where); $data['search']=$this->db->get()->result_array(); //echo "<pre>"; print_r($data['advsearch']); echo "</pre>"; die; $this->db->select('*'); $data["searchmenu"]=$this->db->get($lang.'tblcontent')->result_array(); $this->load->view("Web/header",$data); $this->load->view("Web/search",$data); $this->load->view("Web/footer"); $this->load->view("Web/footer2"); } public function service($id){ $where=array("post_slug" => $id); $this->db->order_by("tblpost_id", "desc"); $data['service'] = $this->model->DetailData('tblposts', $where); $data['get_address']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'address'),'other_cat','ASC'); $data['get_email']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'email'),'other_cat','ASC'); $data['get_conno']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'contact-no'),'other_cat','ASC'); $data['social']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'social-icon'),'other_cat','ASC'); $data['logo']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'logo'),'other_cat','ASC'); $this->load->view("Web/header", $data); $this->load->view("Web/service"); $this->load->view("Web/footer2"); } public function event_gallery($id){ $where=array('banner_id'=>$id); $data=$this->model->DetailData('tblbanners', $where); $id=$data[0]['banner_images']; $element=explode('|',$id); $this->db->where_in('tblmedia_id', $element); $data['image']=$this->db->get('tblmedia')->result_array(); $this->load->view("Web/event_gallery",$data,'true'); } public function event($id){ $decrypted_id = $this->model->decryptdata($id); if($id=="allevents"){ $where=array("portfolio_cat_name" => 'event'); $data['postall'] = $this->model->portfolio_model($where); //echo "<pre>"; print_r($data['postall']); die; }else{ $where=array("portfolio_id" => $decrypted_id); $data['event'] = $this->model->portfolio_model($where); //echo "<pre>"; print_r($data['event']); die; if(count($data['event'])==0) { redirect('webcontroller/errorpage'); } } $data['get_address']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'address'),'other_cat','ASC'); $data['get_email']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'email'),'other_cat','ASC'); $data['get_conno']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'contact-no'),'other_cat','ASC'); $data['social']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'social-icon'),'other_cat','ASC'); $data['logo']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'logo'),'other_cat','ASC'); $this->load->view("Web/header", $data); $this->load->view("Web/Template/event"); $this->load->view("Web/footer2"); } //-------------------- feedback form -------------------// public function feedback(){ $code=$this->input->post('code'); $rcode=$this->input->post('rcode'); if($rcode==$code){ $to=$this->input->post('email'); $name=$this->input->post('name'); $org=$this->input->post('org'); $sub='You have got feedback'; $address=$this->input->post('address'); $email=$this->input->post('email'); $Feedback=$this->input->post('Feedback'); $msg=" Name : ".$name."<br/> Organization : ".$org."<br/> Address : ".$address."<br/> Email : ".$email."<br/> Feedback : ".$Feedback."<br/> "; if($to!='' || $message!=''){ $email_config = Array( 'protocol' => 'smtp', 'smtp_host' => 'sl://smtp.gmail.com',//bh-24.webhostbox.net 'smtp_port' => '587', ///465', 'smtp_user' => 'noreplydgps@gmail.com', 'smtp_pass' => '12dgps34', 'mailtype' => 'html', 'starttls' => true, 'newline' => "\r\n", 'charset' => 'iso-8859-1' ); $this->load->library('email', $email_config); $this->email->set_mailtype("html"); $this->email->from('noreplydgps@gmail.com','DGPS'); $this->email->to('');//vishal.panara@staroneweb.co.in $this->email->cc('noreplydgps@gmail.com'); $this->email->subject($sub); $this->email->message($msg); $this->email->send(); $this->email->set_mailtype("html"); $this->session->set_flashdata('msg', '<div class="success-msg"> <h3>Thanks for feedback <i class="fa fa-smile-o" aria-hidden="true"></i></h3> </div>'); }else{ //error $this->session->set_flashdata('msg', '<div class="success-msg"> <h3>Sorry...! Form not submitted. <i class="fa fa-frown-o" aria-hidden="true"></i> <span>Please try again later</span></h3> </div>'); } }else{ $this->session->set_flashdata('msg', '<div class="success-msg"> <h3>Form not submitted. <i class="fa fa-frown-o" aria-hidden="true"></i> <span>Please enter the valid sum</span></h3> </div>'); } redirect('webcontroller/page/Feedback'); } public function slider($id){ $element=explode('|',$id); $this->db->where_in('tblmedia_id', $element); $data['image']=$this->db->get('tblmedia')->result_array(); $this->load->view("Web/banner",$data,'true'); } public function singleslider($id){ $element=explode('|',$id); $this->db->where_in('tblmedia_id', $element); $data['image']=$this->db->get('tblmedia')->result_array(); $this->load->view("Web/single",$data); } public function teamslider($id){ $element=explode('|',$id); $this->db->where_in('tblmedia_id', $element); $data['image']=$this->db->get('tblmedia')->result_array(); $this->load->view("Web/team",$data); } public function profileslider($id){ $element=explode('|',$id); $this->db->where_in('tblmedia_id', $element); $data['image']=$this->db->get('tblmedia')->result_array(); $this->load->view("Web/profile",$data); } public function themecolor($color){ $this->session->set_userdata('themecolor', $color); } public function screenreader(){ $session_data=$this->session->all_userdata(); $flang=$session_data['flang'];$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("Web/screenreader"); $this->load->view("Web/footer"); $this->load->view("Web/footer2"); } public function sitemap() { $session_data=$this->session->all_userdata(); $flang=$session_data['flang']; $this->load->model('alldata', "model"); $where=array('page_category'=>'index','publish'=>'on'); $data['viewdata']=$this->model->containdetail($where); $data['client']=$this->model->portfolio_model(array('portfolio_cat_name'=>'clients')); $data['message']=$this->model->getDatamodel($flang.'tblmsg'); $this->db->select('*'); $this->db->where('post_cat',"homebox"); $data["box"]=$this->db->get($flang.'tblposts')->result_array(); $this->db->select('*'); $this->db->where('post_cat',"messageslider"); $data["msg"]=$this->db->get($flang.'tblposts')->result_array(); $this->db->select('*'); //$this->db->limit(2); $this->db->where('post_cat',"news"); $data["news"]=$this->db->get($flang.'tblposts')->result_array(); $this->db->select('*'); //$this->db->limit(2); $this->db->where('post_cat',"event"); $data["event"]=$this->db->get($flang.'tblposts')->result_array(); $this->db->select('*'); $data["searchmenu"]=$this->db->get($flang.'tblcontent')->result_array(); $this->load->view("Web/header",$data); $this->load->view("Web/sitemap"); $this->load->view("Web/footer"); $this->load->view("Web/footer2"); } public function visit(){ @$source =('count.txt'); @$data = file_get_contents($source); @$handle = fopen($source, "w"); // if($data==""){$data=0;} fwrite($handle, $data+1); fclose($handle); echo number_format($data); /* $fatchcount=$this->model->getDatamodel("tbl_counter"); $count=$fatchcount[0]['count']; $data=array('count'=>$count+0.5); $where=array('count'=>$count); $this->model->UpdateData("tbl_counter",$data,$where); $fatch=$this->model->getDatamodel("tbl_counter"); echo number_format($fatch[0]['count']); */ } public function member_registration() { if($this->input->post('save')=='save') { $code=$this->input->post('code'); $rcode=$this->input->post('rcode'); if($code==$rcode){ $joining_date = date("Y-m-d", strtotime($this->input->post('joining_date'))); $joining_date2 = date("d-M-Y", strtotime($this->input->post('joining_date'))); $dob = date("Y-m-d", strtotime($this->input->post('dob'))); $insertdata=array('name'=>$this->input->post('name'), 'joining_date'=>$joining_date, 'typeofmembership'=>$this->input->post('typeofmembership'), 'rcpt_no'=>$this->input->post('rcpt_no'), 'memb_amt'=>$this->input->post('memb_amt'), 'memb_amt_paidby'=>$this->input->post('memb_amt_paidby'), 'dob'=>$dob, 'contact_no'=>$this->input->post('contact_no'), 'alt_contact_no'=>$this->input->post('alt_contact_no'), 'home_address'=>$this->input->post('home_address'), 'gender'=>$this->input->post('gender'), 'other_address'=>$this->input->post('other_address'), 'email'=>$this->input->post('email'), 'highersecondary'=>$this->input->post('highersecondary'), //'highersecondaryscore'=>$this->input->post('highersecondaryscore'), //'graduation'=>$this->input->post('graduation'), //'graduationascore'=>$this->input->post('graduationascore'), 'graduationayear'=>$this->input->post('graduationayear'), 'postgraduation'=>$this->input->post('postgraduation'), //'postgraduationscore'=>$this->input->post('postgraduationscore'), 'postgraduationyear'=>$this->input->post('postgraduationyear'), 'fieldofstudy'=>$this->input->post('fieldofstudy'), 'fieldofstudyotherinfo'=>$this->input->post('fieldofstudyotherinfo'), //'degreesought'=>$this->input->post('degreesought'), //'intendedmajor'=>$this->input->post('intendedmajor'), 'academic_intake'=>$this->input->post('academic_intake'), //'toefl_score'=>$this->input->post('toefl_score'), //'gre_score'=>$this->input->post('gre_score'), //'gmat_score'=>$this->input->post('gmat_score'), //'sat_act_score'=>$this->input->post('sat_act_score'), 'test_scores'=>$this->input->post('test_scores'), 'field_of_graduation'=>$this->input->post('field_of_graduation'), 'howdidyouknow'=>$this->input->post('howdidyouknow'), 'sharingemailid'=>$this->input->post('sharingemailid'), ); $to='eduadviser@iaesgujarat.org';//eduadviser@iaesgujarat.org $msg = ' <!DOCTYPE html> <html> <head> <title>New Registration</title> </head> <body style="font-family: sans-serif;"> <div class="container" style="width:50%; margin: 0 auto; background-color: #eee; box-shadow: 1px 1px 1px 1px #a09191; margin-top: 5rem; margin-bottom: 5rem;"> <div style="color:#fff; background-image: linear-gradient(-20deg, #CF212A 0%, #003865 100%); padding: 10px; text-align: center;"> <h3>New Registration</h3> </div> <div style="padding: 1rem;"> <p><strong>Name :</strong> ' . $this->input->post('name') . '</p> <p><strong>Email :</strong> ' . $this->input->post('email') . '</p> <p><strong>Contact :</strong> ' . $this->input->post('contact_no') . '</p> <p><strong>Joining Date :</strong> ' . $joining_date2 . '</p> <p><strong>Type of Membership :</strong> ' . $this->input->post('typeofmembership') . '</p> <p><strong>Receipt No :</strong> ' . $this->input->post('rcpt_no') . '</p> <p><strong>Membership Amount :</strong> ' . $this->input->post('memb_amt') . '</p> <p><strong>Membership Amount Paid By :</strong> ' . $this->input->post('memb_amt_paidby') . '</p> </div> </div> </body> </html>'; $sub = "New Registration"; $this->model->emailsend2($to, $sub, $msg); $this->model->insertData('tbl_students_registration',$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> Registration completed. </div>'); }else{ $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> Please enter the valid sum. </div>'); } redirect('webcontroller/member_registration'); } else { $subid=''; if($subid!=''){ $where=array('submenu'=>$subid); $data['sub']=$this->model->containdetail($where); //level 1 breadcrumbs $lev1=''; foreach($data['sub'] as $key){ if($key['submenu']!=Null) { $lev1=$key['submenu']; } } if($lev1!=''){ $where=array('menu_content'=>$lev1); $data['sub1']=$this->model->containdetail($where); array_push($data['brad'],$data['sub1'][0]); //level 2 breadcrumbs $lev2=''; foreach($data['sub1'] as $key){ if($key['submenu']!=Null) { $lev2=$key['submenu']; } } if($lev2!=''){ $where=array('menu_content'=>$lev2); $data['sub2']=$this->model->containdetail($where); array_push($data['brad'],$data['sub2'][0]);; } } } $data['get_address']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'address'),'other_cat','ASC'); $data['get_email']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'email'),'other_cat','ASC'); $data['get_conno']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'contact-no'),'other_cat','ASC'); $data['social']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'social-icon'),'other_cat','ASC'); $data['logo']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'logo'),'other_cat','ASC'); $this->load->view("Web/header",$data); $this->load->view("Web/member_registration"); $this->load->view("Web/footer2"); } } public function ask() { $code=$this->input->post('code'); $rcode=$this->input->post('rcode'); $current_url=$this->input->post('c_url'); if($code==$rcode){ $to='eduadviser@iaesgujarat.org'; $msg = ' <!DOCTYPE html> <html> <head> <title>New Question</title> </head> <body style="font-family: sans-serif;"> <div class="container" style="width:50%; margin: 0 auto; background-color: #eee; box-shadow: 1px 1px 1px 1px #a09191; margin-top: 5rem; margin-bottom: 5rem;"> <div style="color:#fff; background-image: linear-gradient(-20deg, #CF212A 0%, #003865 100%); padding: 10px; text-align: center;"> <h3>New Question</h3> </div> <div style="padding: 1rem;"> <p><strong>Name :</strong> ' . $this->input->post('name') . '</p> <p><strong>Email :</strong> ' . $this->input->post('email') . '</p> <p><strong>Mobile :</strong> ' . $this->input->post('mobile') . '</p> <p><strong>Address :</strong> ' . $this->input->post('address') . '</p> <p><strong>Question :</strong> ' . $this->input->post('que') . '</p> </div> </div> </body> </html>'; $sub = "New Question"; $this->model->emailsend2($to, $sub, $msg); $this->session->set_flashdata('askmsg', ' <div style="position:absolute; z-index:1; top:0;top: 0; left: 0; right: 0; width: 50%; margin: 0 auto;" 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> Thank you for asking a question, You will be answered shortly. </div>'); }else{ $this->session->set_flashdata('askmsg', ' <div style="position:absolute; z-index:1; top:0;top: 0; left: 0; right: 0; width: 50%; margin: 0 auto;" 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> Please enter the valid sum. </div>'); } redirect($current_url); } public function bam() { $code=$this->input->post('code'); $rcode=$this->input->post('rcode'); $current_url=$this->input->post('c_url'); $occu = implode(',', $this->input->post('occu')); $interest = implode(',', $this->input->post('interest')); if($code==$rcode){ $to='americancorner@iaesgujarat.org'; $msg = ' <!DOCTYPE html> <html> <head> <title>Become a Member</title> </head> <body style="font-family: sans-serif;"> <div class="container" style="width:50%; margin: 0 auto; background-color: #eee; box-shadow: 1px 1px 1px 1px #a09191; margin-top: 5rem; margin-bottom: 5rem;"> <div style="color:#fff; background-image: linear-gradient(-20deg, #CF212A 0%, #003865 100%); padding: 10px; text-align: center;"> <h3>Become a Member</h3> </div> <div style="padding: 1rem;"> <p><strong>Name :</strong> ' . $this->input->post('name') . '</p> <p><strong>Email :</strong> ' . $this->input->post('email') . '</p> <p><strong>Mobile :</strong> ' . $this->input->post('mobile') . '</p> <p><strong>Occupation :</strong> ' . $occu . '</p> <p><strong>Interest Area :</strong> ' . $interest . '</p> </div> </div> </body> </html>'; $sub = "Become a Member"; $this->model->emailsend2($to, $sub, $msg); $this->session->set_flashdata('askmsg', ' <div style="position:absolute; z-index:1; top:0;top: 0; left: 0; right: 0; width: 50%; margin: 0 auto;" 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> Thank you for become a member. </div>'); }else{ $this->session->set_flashdata('askmsg', ' <div style="position:absolute; z-index:1; top:0;top: 0; left: 0; right: 0; width: 50%; margin: 0 auto;" 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> Please enter the valid sum. </div>'); } redirect($current_url); } public function state($id){ $state = $this->model->DetailData('states', array('country_id' => $id)); $html = ''; $html.='<option value="">--Select State--</option>'; foreach ($state as $k => $v) { $html.=' <option value="'.$v["name"].'">'.$v["name"].'</option> '; } $array['html'] = $html; echo json_encode($array); } public function reg(){ if($this->input->post('save') == 'save'){ echo "<pre>"; print_r($_POST); }else{ $data['get_address']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'address'),'other_cat','ASC'); $data['get_email']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'email'),'other_cat','ASC'); $data['get_conno']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'contact-no'),'other_cat','ASC'); $data['social']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'social-icon'),'other_cat','ASC'); $data['logo']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'logo'),'other_cat','ASC'); $this->load->view("Web/header", $data); $this->load->view('Web/reg'); $this->load->view("Web/footer2"); } } public function forgot_pass(){ $otp = mt_rand(100000, 999999); $to = $this->input->post('email'); $username = $this->input->post('username'); $en_to = base64_encode($to); $en_username = base64_encode($username); $sub = 'Forgot Password'; $url = base_url().'users/reset_pass/'.$en_to.'/'.$en_username; $whereGet = array('email' => $to,'username' => $username); $query = $this->app->DetailData('tbl_registration', $whereGet); $cnt = count($query); if($cnt == 1){ $msg = ' <!DOCTYPE html> <html> <head> <title>Forgot Password</title> </head> <body style="font-family: sans-serif;"> <div class="container" style="width:50%; margin: 0 auto; background-color: #eee; box-shadow: 1px 1px 1px 1px #a09191; margin-top: 5rem; margin-bottom: 5rem;"> <div style="color:#fff; background-image: linear-gradient(-20deg, #CF212A 0%, #003865 100%); padding: 10px; text-align: center;"> <h3>Forgot Password</h3> </div> <div style="padding: 1rem;"> <p>We are sharing a verification code to access your account. Once you have verified the code, you will be prompted to set a new password immediately. This is to ensure that only you have access to your account.</p> <p>Your OTP: '.$otp.'</p> </div> </div> </body> </html>'; $this->model->emailsend($to, $sub, $msg); $this->session->set_flashdata('msg_n', ' <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> Please check your email. An OTP has been sent to your email id</div>'); //$where = array('email' => $to); $where = array('email' => $to,'username' => $username); $data = array('otp' => $otp); $this->app->UpdateData('tbl_registration', $data, $where); redirect('webcontroller/reset_pass/'.$en_to.'/'.$en_username); }else{ $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> Username and Email not match.</div>'); redirect(base_url()); } } public function reset_pass($en_to='',$en_username=''){ if($this->input->post('save') == 'save'){ $email = $this->input->post('email'); $username = $this->input->post('username'); $otp = $this->input->post('otp'); $pass = $this->input->post('pass'); $conf_pass = $this->input->post('conf_pass'); $password = md5($pass); $enn = base64_encode($email); $enn_user = base64_encode($username); $where = array('email' => $email,'username' => $username); $get = $this->app->DetailData('tbl_registration', array('email'=>$email,'username' => $username)); $get_otp = $get[0]['otp']; if($pass != $conf_pass){ $this->session->set_flashdata('msg_n', ' <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> Both passwords are not matched</div>'); }else{ if($otp != $get_otp){ $this->session->set_flashdata('msg_n', ' <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> Wrong OTP</div>'); }else{ $this->session->set_flashdata('msg_n', ' <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> Password has been changed.</div>'); $data = array( 'otp' => '0', 'pass' => $password ); $this->app->UpdateData('tbl_registration', $data, $where); } } redirect('webcontroller/reset_pass/'.$enn.'/'.$enn_user); }else{ $data['get_address']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'address'),'other_cat','ASC'); $data['get_email']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'email'),'other_cat','ASC'); $data['get_conno']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'contact-no'),'other_cat','ASC'); $data['social']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'social-icon'),'other_cat','ASC'); $data['logo']=$this->model->sortingWheredata('*','tbl_other_detail',array('other_cat'=>'logo'),'other_cat','ASC'); $data['email'] = base64_decode($en_to); $data['username'] = base64_decode($en_username); $this->load->view("Web/header",$data); $this->load->view("Web/reset_pass"); $this->load->view("Web/footer2"); } } public function inquiry(){ $code=$this->input->post('code'); $rcode=$this->input->post('rcode'); $current_url=$this->input->post('current_url'); if($code==$rcode){ $to='cjrajpara@gmail.com'; $msg = ' <!DOCTYPE html> <html> <head> <title>New Inquiry</title> </head> <body style="font-family: sans-serif;"> <div class="container" style="width:50%; margin: 0 auto; background-color: #eee; box-shadow: 1px 1px 1px 1px #a09191; margin-top: 5rem; margin-bottom: 5rem;"> <div style="color:#fff; background-image: linear-gradient(-20deg,#f58aeaf2 0%,#30c6d0e0 100%); padding: 10px; text-align: center;"> <h3>New Inquiry</h3> </div> <div style="padding: 1rem;"> <p><strong>Name :</strong> ' . $this->input->post('name') . '</p> <p><strong>Email :</strong> ' . $this->input->post('email') . '</p> <p><strong>Contact :</strong> ' . $this->input->post('mobile') . '</p> <p><strong>Subject :</strong> ' . $this->input->post('subject') . '</p> </div> </div> </body> </html>'; $sub = "New Inquiry"; $this->model->emailsend($to, $sub, $msg); $this->session->set_flashdata('msg_new', ' <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> Thank you for inquiry, You will be contacted shortly. </div>'); //redirect("webcontroller/ThankYou"); }else{ $this->session->set_flashdata('msg_new', ' <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> Please enter the valid sum. </div>'); //redirect($current_url); } redirect($current_url); } public function get_touch(){ $code=$this->input->post('code'); $rcode=$this->input->post('rcode'); $current_url=$this->input->post('current_url'); if($code==$rcode){ $to='cjrajpara@gmail.com'; $msg = ' <!DOCTYPE html> <html> <head> <title>New Inquiry</title> </head> <body style="font-family: sans-serif;"> <div class="container" style="width:50%; margin: 0 auto; background-color: #eee; box-shadow: 1px 1px 1px 1px #a09191; margin-top: 5rem; margin-bottom: 5rem;"> <div style="color:#fff; background-image: linear-gradient(-20deg,#f58aeaf2 0%,#30c6d0e0 100%); padding: 10px; text-align: center;"> <h3>New Inquiry</h3> </div> <div style="padding: 1rem;"> <p><strong>Name :</strong> ' . $this->input->post('name') . '</p> <p><strong>Email :</strong> ' . $this->input->post('email') . '</p> <p><strong>Contact :</strong> ' . $this->input->post('mobile') . '</p> <p><strong>Subject :</strong> ' . $this->input->post('subject') . '</p> </div> </div> </body> </html>'; $sub = "New Inquiry"; $this->model->emailsend($to, $sub, $msg); $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> Thank you for inquiry, You will be contacted shortly. </div>'); //redirect("webcontroller/ThankYou"); }else{ $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> Please enter the valid sum. </div>'); //redirect($current_url); } redirect($current_url); } public function newsletter(){ $to='cjrajpara@gmail.com'; $msg = ' <!DOCTYPE html> <html> <head> <title>NEWSLETTER</title> </head> <body style="font-family: sans-serif;"> <div class="container" style="width:50%; margin: 0 auto; background-color: #eee; box-shadow: 1px 1px 1px 1px #a09191; margin-top: 5rem; margin-bottom: 5rem;"> <div style="color:#fff; background-image: linear-gradient(-20deg,#f58aeaf2 0%,#30c6d0e0 100%); padding: 10px; text-align: center;"> <h3>NEWSLETTER</h3> </div> <div style="padding: 1rem;"> <p><strong>Newsletter :</strong> ' . $this->input->post('newsletter') . '</p> </div> </div> </body> </html>'; $sub = "NEWSLETTER"; $this->model->emailsend($to, $sub, $msg); $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> Thank you for inquiry, You will be contacted shortly. </div>'); redirect($current_url); } public function testEmail(){ $to = 'anil.patel@staroneweb.co.in'; $sub = "Paper Push"; $msg = 'Paper'; $this->model->emailsend($to, $sub, $msg); } } /* End of file welcome.php */ /* Location: ./application/controllers/welcome.php */
Copyright ©2021 || Defacer Indonesia