This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| public function get_sub_researchs() | |
| { | |
| $research_group_id = $this->input->post('research_group_id'); // this input come from ajax post. | |
| var_dump($research_group_id); | |
| $sub_researchs = $this->profile_model->get_sub_research($research_group_id); | |
| if(count($sub_researchs) > 0) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| public function get_profile_data() | |
| { | |
| $this->db->Select('*'); | |
| $this->db->join('faculties','faculties.faculty_id = profiles.faculty_id','left'); | |
| $this->db->join('departments','departments.dept_id = profiles.dept_id','left'); | |
| $this->db->join('users','users.user_id = profiles.user_id','left'); | |
| // when using where in this case should mention the table name also. because there are some join queries. | |
| // so module will not able to get the correct where field if not mention the table name. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| public function edit_profile() | |
| { | |
| $pro_id = $this->uri->segment(3); | |
| $profile_data = $this->profile_model->profile_data($pro_id); | |
| $pro_data['profileEdit'] = $profile_data; | |
| $this->load->view('profile/edit_profile',$pro_data); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/javascript"> | |
| var uploadField = document.getElementById("userfile"); | |
| uploadField.onchange = function() { | |
| if(this.files[0].size > 1048576){ | |
| alert("Unable to proceed upload, File is larger than 1mb."); | |
| this.value = ""; | |
| }; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| public function image_upload() | |
| { | |
| $config['upload_path'] = './uploads/'; | |
| $config['allowed_types'] = 'gif|jpg|png|jpeg'; | |
| $config['max_size'] = 1000; | |
| $config['max_width'] = 500; | |
| $config['max_height'] = 500; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/javascript"> | |
| var today = new Date(); | |
| var dd = today.getDate(); | |
| var mm = today.getMonth()+1; //January is 0! | |
| var yyyy = today.getFullYear(); | |
| if(dd<10){ | |
| dd='0'+dd; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if($this->form_validation->run()) | |
| { | |
| $user_id = $this->user_model->add_user($data); | |
| // assign the autoincremented user id into this $user-id | |
| if($role == "Editor"){ //this code will run if the user select 'Editort' as the role. | |
| // then this will insert the below information in another table called 'profile'. | |
| $data = array( | |
| 'user_id' => $user_id, // user id which retrived from users table autoincremented id frield. |