load->model('Mail_model'); if (!$this->ion_auth->in_group(array('admin'))) { redirect('home/permission'); } } public function index() { $data['mail_body']=$this->Mail_model->getMailBodySettingsList(); // pre($data['specialities']);die; $this->load->view('home/dashboard'); // just the header file $this->load->view('list',$data); $this->load->view('home/footer'); // just the header file } public function editBasicInfo() { if(!empty($_POST)){ //pre($_POST);die; $success=$this->Website_model->savebasicInfo($_POST); if($success>0){ $this->session->set_flashdata('msg_success', 'Basic information updated successfully.'); } //redirect($_SERVER['HTTP_REFERER']); redirect('website_settings'); } $data['basic_info']=$this->Website_model->getbasicInfo(); //pre($data);die; $this->load->view('home/dashboard'); // just the header file $this->load->view('editBasicInfo',$data); $this->load->view('home/footer'); // just the header file } public function editAboutUs(){ if(!empty($_POST)){ //pre($_POST);die; $about_us['title']=$_POST['title']; $about_us['description']=$_POST['description']; $data['about_us']=json_encode($about_us); $this->Website_model->savebasicInfo($data); //redirect($_SERVER['HTTP_REFERER']); redirect('website_settings'); } $basic_info=$this->Website_model->getbasicInfo(); $data['about_us']=json_decode($basic_info->about_us); $this->load->view('home/dashboard'); // just the header file $this->load->view('editAboutUs',$data); $this->load->view('home/footer'); // just the header file } public function bannerList(){ $data['banners']=$this->Website_model->getBannerList(); $this->load->view('home/dashboard'); // just the header file $this->load->view('bannerList',$data); $this->load->view('home/footer'); // just the header file } public function addBanner(){ if(!empty($_POST)){ $folder_name='uploads/Banner/'; $uploadData['folder_name']=$folder_name; $uploadData['NAME']='banner_image'; $uploadData['NEW_FILENAME_START']='BAN'; //$uploadData['CONFIG']['allowed_types']='gif|jpg|png|jpeg|pdf'; $uploadData['CONFIG']['allowed_types']=array('gif','jpg','png','jpeg','pdf'); $uploadData['CONFIG']['max_size']='20480000'; $output=fileStore($_FILES,$uploadData); //pre($output);die; if($_POST['banner_heading']!=""){ $data['banner_heading']=$_POST['banner_heading']; } if($_POST['banner_sub_heading']!=""){ $data['banner_sub_heading']=$_POST['banner_sub_heading']; } if($_POST['banner_description']!=""){ $data['banner_description']=$_POST['banner_description']; } if($output['NEW_FILE_NAME']!=""){ $data['banner_image']=$output['PATH'].''.$output['NEW_FILE_NAME']; } if($_POST['id']!=""){ $success=$this->Website_model->updateBanner($data,$_POST['id']); if($success>0){ $this->session->set_flashdata('msg_success', 'Banner Update Successfully.'); }else{ $this->session->set_flashdata('msg_error', 'Banner Not Updated.'); } redirect('website_settings/bannerList'); }else{ //pre($data);die; $insert_id=$this->Website_model->addBanner($data); //echo $insert_id;die; if($insert_id>0){ $this->session->set_flashdata('msg_success', 'Banner Added Successfully.'); }else{ $this->session->set_flashdata('msg_error', 'Banner Not Added.'); } redirect('website_settings/bannerList'); } } if($_GET['id']!=""){ $data['banner']=$this->Website_model->getBannerByid($_GET['id']); //pre($data['banner']);die; } $this->load->view('home/dashboard'); // just the header file $this->load->view('banner',$data); $this->load->view('home/footer'); // just the header file } public function contentList(){ $data['content']=$this->Website_model->getContentList(); //pre($data['content']);die; $this->load->view('home/dashboard'); // just the header file $this->load->view('contentList',$data); $this->load->view('home/footer'); // just the header file } public function addContent(){ if(!empty($_POST)){ $folder_name='uploads/Content/'; $uploadData['folder_name']=$folder_name; $uploadData['NAME']='image'; $uploadData['NEW_FILENAME_START']='CON'; //$uploadData['CONFIG']['allowed_types']='gif|jpg|png|jpeg|pdf'; $uploadData['CONFIG']['allowed_types']=array('gif','jpg','png','jpeg','pdf'); $uploadData['CONFIG']['max_size']='20480000'; $output=fileStore($_FILES,$uploadData); //pre($output);die; if($_POST['heading']!=""){ $data['heading']=$_POST['heading']; } if($_POST['sub_heading']!=""){ $data['sub_heading']=$_POST['sub_heading']; } // if($_POST['description']!=""){ $data['description']=$_POST['description']; } $datadesc = array('english'=>$_POST['description'],'spanish'=>$_POST['description_2']); $data['description'] = json_encode($datadesc); if($output['NEW_FILE_NAME']!=""){ $data['image']=$output['PATH'].''.$output['NEW_FILE_NAME']; } if($_POST['id']!=""){ $success=$this->Website_model->updateContent($data,$_POST['id']); if($success>0){ $this->session->set_flashdata('msg_success', 'Content Update Successfully.'); }else{ $this->session->set_flashdata('msg_error', 'Content Not Updated.'); } redirect('website_settings/contentList'); }else{ //pre($data);die; $insert_id=$this->Website_model->addContent($data); //echo $insert_id;die; if($insert_id>0){ $this->session->set_flashdata('msg_success', 'Content Added Successfully.'); }else{ $this->session->set_flashdata('msg_error', 'Content Not Added.'); } redirect('website_settings/contentList'); } } if($_GET['id']!=""){ $data['content']=$this->Website_model->getContentByid($_GET['id']); //pre($data['banner']);die; } $this->load->view('home/dashboard'); // just the header file $this->load->view('content',$data); $this->load->view('home/footer'); // just the header file } /* | updated on 07-09-2021 |------------------------ | this contactMessage method was transfered | to Auth controller from this | controller(website_settings) */ // public function contactMessage() // { // //pre($_POST);die; // $data['name']=$_POST['name']; // $data['email']=$_POST['email']; // $data['subject']=$_POST['subject']; // $data['message']=$_POST['message']; // if(!empty($data)) // { // $success=$this->Website_model->saveContactMessage($data); // if($success>0) // { // $this->session->set_flashdata('msg_success', 'Your message has been sent.'); // } // else // { // $this->session->set_flashdata('msg_error', 'Your message not sent'); // } // redirect('/#contact-section'); // } // } /* | our specialities section */ public function specialitiesList() { $data['specialities']=$this->Website_model->getSpecialitiesList(); // pre($data['specialities']);die; $this->load->view('home/dashboard'); // just the header file $this->load->view('specialitiesList',$data); $this->load->view('home/footer'); // just the header file } public function addMailBody() { if(!empty($_POST)) { $data['name']=$_POST['name']; $data['message']=$_POST['msg']; $slug = url_title($_POST['name'], 'dash', true); $data['slug']=$slug; $success=$this->Mail_model->updateMailBodySettings($data,$_POST['id']); if($success) { $this->session->set_flashdata('msg_success', 'Mail Settings Table Updated Successfully.'); } else { $this->session->set_flashdata('msg_error', 'Mail Settings Table Not Updated.'); } redirect('mail_settings'); } if($_GET['id']!=""){ $data['mailBody']=$this->Mail_model->getMailBodySettingsByid($_GET['id']); // pre($data['specialities']);die; } $this->load->view('home/dashboard'); // just the header file $this->load->view('edit',$data); $this->load->view('home/footer'); // just the header file } public function addMailPreference() { $id=$this->input->get("id"); $data['mailBody']=$this->Mail_model->getMailBodySettingsByid($_GET['id']); $this->load->view('home/dashboard'); $this->load->view('preference_edit',$data); $this->load->view('home/footer'); } public function updateMailPreference() { $email_preference = $this->input->post(); $length=count($email_preference['no_email']); for($i=0;$i<$length;$i++) { $array[$email_preference['no_email'][$i]]=[ "days"=>$email_preference['days'][$i], "hours"=>$email_preference['hours'][$i], "minutes"=>$email_preference['minutes'][$i], ]; } // $email_preference_json=json_encode($array); $data['email_interval']=json_encode($array); $data['max_email']=$length; $updateEmailPreff=$this->Mail_model->updateMailBodySettings($data,$email_preference['id']); if($updateEmailPreff){ $this->session->set_flashdata('success', 'Updated Successfully'); }else{ $this->session->set_flashdata('error', 'Email Preference not updated'); } redirect(base_url()."mail_settings/addMailPreference?id=".$email_preference['id']); } public function doc() { $data['mail_body']=$this->Mail_model->getDocMailTemplateList(); // pre($data['specialities']);die; $this->load->view('home/dashboard'); // just the header file $this->load->view('doc_mail_list',$data); $this->load->view('home/footer'); // just the header file } public function edit_doc_mail_body() { if(!empty($_POST)) { // $data['name']=$_POST['name']; // _die($_POST); $data['message']=$_POST['msg']; $data['subject']=$_POST['subject']; // $data['short_code']=$_POST['short_code']; // $slug = url_title($_POST['name'], 'dash', true); // $data['slug']=$slug; $success=$this->Mail_model->updateDocMailTemplate($data,$_POST['id']); if($success) { $this->session->set_flashdata('msg_success', 'Mail Settings Table Updated Successfully.'); } else { $this->session->set_flashdata('msg_error', 'Mail Settings Table Not Updated.'); } redirect('mail_settings/doc'); } if($_GET['id']!=""){ $data['mailBody']=$this->Mail_model->getDocMailTemplateByid($_GET['id']); // pre($data['specialities']);die; } $this->load->view('home/dashboard'); // just the header file $this->load->view('doc_mail_edit',$data); $this->load->view('home/footer'); // just the header file } } /* End of file accountant.php */ /* Location: ./application/modules/accountant/controllers/accountant.php */