Commit b4925e40 by Manoj

exam schedule

parent b1f9225a
...@@ -322,8 +322,8 @@ class ApplicationController extends CI_Controller ...@@ -322,8 +322,8 @@ class ApplicationController extends CI_Controller
$id = $this->input->post('id'); $id = $this->input->post('id');
$table = $this->input->post('table'); $table = $this->input->post('table');
$status = $this->input->post('status'); $status = $this->input->post('status');
$newStatus = ($status == 1 ) ? 0 : 1; $newStatus = ($status == 1) ? 0 : 1;
$update_array = array( $update_array = array(
'status' => $newStatus, 'status' => $newStatus,
...@@ -398,7 +398,7 @@ class ApplicationController extends CI_Controller ...@@ -398,7 +398,7 @@ class ApplicationController extends CI_Controller
$update_array = array( $update_array = array(
'year' => $year, 'year' => $year,
); );
if ($id!="") { if ($id != "") {
$update = $this->mcommon->common_edit('accadamic_year', $update_array, array('id' => $id)); $update = $this->mcommon->common_edit('accadamic_year', $update_array, array('id' => $id));
if ($update) { if ($update) {
...@@ -571,7 +571,7 @@ class ApplicationController extends CI_Controller ...@@ -571,7 +571,7 @@ class ApplicationController extends CI_Controller
$this->session->set_flashdata('alert_danger', 'Record Deleted successfully!'); $this->session->set_flashdata('alert_danger', 'Record Deleted successfully!');
redirect('ApplicationController/faculty'); redirect('ApplicationController/faculty');
} }
public function deleteQuestion($id) public function deleteQuestion($id)
{ {
$delete = $this->mcommon->common_delete('question', array('id' => $id)); $delete = $this->mcommon->common_delete('question', array('id' => $id));
...@@ -618,9 +618,9 @@ class ApplicationController extends CI_Controller ...@@ -618,9 +618,9 @@ class ApplicationController extends CI_Controller
$this->db->select('*, applications.id as appid, applications.status as apstatus,ai.payment_mode,applications.email as appEmail'); $this->db->select('*, applications.id as appid, applications.status as apstatus,ai.payment_mode,applications.email as appEmail');
$this->db->from('applications'); $this->db->from('applications');
$this->db->join('course', 'course.id = applications.course_id', 'left'); $this->db->join('course', 'course.id = applications.course_id', 'left');
$this->db->join('users', 'users.user_id = applications.user_id','left'); $this->db->join('users', 'users.user_id = applications.user_id', 'left');
$this->db->join('accomodation_info as ai', 'ai.application_id = applications.id','left'); $this->db->join('accomodation_info as ai', 'ai.application_id = applications.id', 'left');
$this->db->join('application_other_info as athinfo', 'athinfo.application_id = applications.id','left'); $this->db->join('application_other_info as athinfo', 'athinfo.application_id = applications.id', 'left');
// $this->db->where('athinfo.tab_status', '1'); // $this->db->where('athinfo.tab_status', '1');
$this->db->where('applications.payment_status', '1'); $this->db->where('applications.payment_status', '1');
$query = $this->db->get(); $query = $this->db->get();
...@@ -660,7 +660,6 @@ class ApplicationController extends CI_Controller ...@@ -660,7 +660,6 @@ class ApplicationController extends CI_Controller
'content' => $this->load->view('masters/Completedlist', $view_data, true), 'content' => $this->load->view('masters/Completedlist', $view_data, true),
); );
$this->load->view('base/base_template', $data); $this->load->view('base/base_template', $data);
} }
...@@ -755,7 +754,7 @@ class ApplicationController extends CI_Controller ...@@ -755,7 +754,7 @@ class ApplicationController extends CI_Controller
); );
$this->load->view('base/login_template', $data); $this->load->view('base/login_template', $data);
} }
public function downloadApplication($userId) public function downloadApplication($userId)
{ {
...@@ -790,8 +789,6 @@ class ApplicationController extends CI_Controller ...@@ -790,8 +789,6 @@ class ApplicationController extends CI_Controller
ob_clean(); ob_clean();
ob_flush(); ob_flush();
} }
} }
...@@ -851,7 +848,7 @@ class ApplicationController extends CI_Controller ...@@ -851,7 +848,7 @@ class ApplicationController extends CI_Controller
} }
public function referenceno() public function referenceno()
{ {
$view_data['record'] = $this->mcommon->specific_row('reference_no', array('id' => 1)); $view_data['record'] = $this->mcommon->specific_row('reference_no', array('id' => 1));
// print_r($view_data); exit; // print_r($view_data); exit;
$data = array( $data = array(
...@@ -907,7 +904,7 @@ class ApplicationController extends CI_Controller ...@@ -907,7 +904,7 @@ class ApplicationController extends CI_Controller
{ {
$states = $query = $this->db->select('*') $states = $query = $this->db->select('*')
->from('states') ->from('states')
...@@ -1045,14 +1042,13 @@ class ApplicationController extends CI_Controller ...@@ -1045,14 +1042,13 @@ class ApplicationController extends CI_Controller
$encname = $date . $rand; $encname = $date . $rand;
$bannername = md5($encname) . '.' . $bannerexptype; $bannername = md5($encname) . '.' . $bannerexptype;
$bannerpath = $upload_path . $bannername; $bannerpath = $upload_path . $bannername;
move_uploaded_file($_FILES["community_certificate"]["tmp_name"], $bannerpath); move_uploaded_file($_FILES["community_certificate"]["tmp_name"], $bannerpath);
$community_certificate = $upload_path_table . $bannername; $community_certificate = $upload_path_table . $bannername;
} else { } else {
$community_certificate = isset($input['oldCommunity']) ? $input['oldCommunity'] : ''; $community_certificate = isset($input['oldCommunity']) ? $input['oldCommunity'] : '';
} }
if ($_FILES['income_certificate']['name']) { if ($_FILES['income_certificate']['name']) {
if (!is_dir('./attachments/application/')) { if (!is_dir('./attachments/application/')) {
mkdir('./attachments/application/', 0777, true); mkdir('./attachments/application/', 0777, true);
...@@ -1072,7 +1068,7 @@ class ApplicationController extends CI_Controller ...@@ -1072,7 +1068,7 @@ class ApplicationController extends CI_Controller
} else { } else {
$income_certificate = isset($input['oldIncome']) ? $input['oldIncome'] : ''; $income_certificate = isset($input['oldIncome']) ? $input['oldIncome'] : '';
} }
// echo $income_certificate ; // echo $income_certificate ;
$certificates_Array = array( $certificates_Array = array(
'community_certificate' => $community_certificate, 'community_certificate' => $community_certificate,
...@@ -1309,8 +1305,8 @@ class ApplicationController extends CI_Controller ...@@ -1309,8 +1305,8 @@ class ApplicationController extends CI_Controller
if ($accomodationId) { //update if ($accomodationId) { //update
$update = $this->mcommon->common_edit('accomodation_info', $accomodationInfoArray, array('id' => $accomodationId)); $update = $this->mcommon->common_edit('accomodation_info', $accomodationInfoArray, array('id' => $accomodationId));
}else{ } else {
$this->mcommon->common_insert('accomodation_info', $accomodationInfoArray, array('id' => $accomodationId)); $this->mcommon->common_insert('accomodation_info', $accomodationInfoArray, array('id' => $accomodationId));
} }
...@@ -2003,16 +1999,13 @@ class ApplicationController extends CI_Controller ...@@ -2003,16 +1999,13 @@ class ApplicationController extends CI_Controller
$subject = 'Application Form – ACJ Postgraduate Diploma in Integrated Multimedia $subject = 'Application Form – ACJ Postgraduate Diploma in Integrated Multimedia
Journalism'; Journalism';
} else if ($view_data['course_id'] == 2) { } else if ($view_data['course_id'] == 2) {
$subject = 'Application Form – ACJ-Bloomberg Postgraduate Diploma in Business and $subject = 'Application Form – ACJ-Bloomberg Postgraduate Diploma in Business and
Financial Multimedia Journalism'; Financial Multimedia Journalism';
} else { } else {
$subject = 'Application Form – ACJ Postgraduate Diploma Programmes'; $subject = 'Application Form – ACJ Postgraduate Diploma Programmes';
} }
$to_email = $applicationdatas[0]->email; $to_email = $applicationdatas[0]->email;
...@@ -2141,16 +2134,13 @@ class ApplicationController extends CI_Controller ...@@ -2141,16 +2134,13 @@ class ApplicationController extends CI_Controller
$subject = 'Application Form – ACJ Postgraduate Diploma in Integrated Multimedia $subject = 'Application Form – ACJ Postgraduate Diploma in Integrated Multimedia
Journalism'; Journalism';
} else if ($view_data['course_id'] == 2) { } else if ($view_data['course_id'] == 2) {
$subject = 'Application Form – ACJ-Bloomberg Postgraduate Diploma in Business and $subject = 'Application Form – ACJ-Bloomberg Postgraduate Diploma in Business and
Financial Multimedia Journalism'; Financial Multimedia Journalism';
} else { } else {
$subject = 'Application Form – ACJ Postgraduate Diploma Programmes'; $subject = 'Application Form – ACJ Postgraduate Diploma Programmes';
} }
$to_email = $applicationdatas[0]->email; $to_email = $applicationdatas[0]->email;
...@@ -2174,14 +2164,12 @@ class ApplicationController extends CI_Controller ...@@ -2174,14 +2164,12 @@ class ApplicationController extends CI_Controller
$this->session->set_flashdata('alert_danger', 'something Error'); $this->session->set_flashdata('alert_danger', 'something Error');
redirect($_SERVER['HTTP_REFERER']); redirect($_SERVER['HTTP_REFERER']);
} }
} }
public function examType() public function examType()
{ {
$view_data['records'] = $this->mcommon->records_all('exam_type',array('status',1)); $view_data['records'] = $this->mcommon->records_all('exam_type', array('status', 1));
$data = array( $data = array(
'title' => 'Exam Type', 'title' => 'Exam Type',
...@@ -2222,13 +2210,13 @@ class ApplicationController extends CI_Controller ...@@ -2222,13 +2210,13 @@ class ApplicationController extends CI_Controller
if ($update) { if ($update) {
$this->session->set_flashdata('alert_success','Exam Type Updated Successfully!'); $this->session->set_flashdata('alert_success', 'Exam Type Updated Successfully!');
} else { } else {
$this->session->set_flashdata('alert_danger', 'Something went wrong'); $this->session->set_flashdata('alert_danger', 'Something went wrong');
} }
} else { } else {
$user_array = array( $user_array = array(
'exam_type_name' => $exam_type, 'exam_type_name' => $exam_type,
'total_marks' => $total_marks, 'total_marks' => $total_marks,
...@@ -2257,8 +2245,8 @@ class ApplicationController extends CI_Controller ...@@ -2257,8 +2245,8 @@ class ApplicationController extends CI_Controller
public function sectionCategory() public function sectionCategory()
{ {
$view_data['records'] = $this->mcommon->records_all('section_category',array('status',1)); $view_data['records'] = $this->mcommon->records_all('section_category', array('status', 1));
$view_data['exam_type'] = $this->mcommon->records_all('exam_type',array('status',1)); $view_data['exam_type'] = $this->mcommon->records_all('exam_type', array('status', 1));
$data = array( $data = array(
'title' => 'Section Category', 'title' => 'Section Category',
...@@ -2275,7 +2263,7 @@ class ApplicationController extends CI_Controller ...@@ -2275,7 +2263,7 @@ class ApplicationController extends CI_Controller
$id = $this->input->post('id'); $id = $this->input->post('id');
$exam_type = $this->input->post('exam_type'); $exam_type = $this->input->post('exam_type');
$category = $this->input->post('category'); $category = $this->input->post('category');
if ($id) { if ($id) {
...@@ -2291,13 +2279,13 @@ class ApplicationController extends CI_Controller ...@@ -2291,13 +2279,13 @@ class ApplicationController extends CI_Controller
if ($update) { if ($update) {
$this->session->set_flashdata('alert_success','Exam Type Updated Successfully!'); $this->session->set_flashdata('alert_success', 'Exam Type Updated Successfully!');
} else { } else {
$this->session->set_flashdata('alert_danger', 'Something went wrong'); $this->session->set_flashdata('alert_danger', 'Something went wrong');
} }
} else { } else {
$user_array = array( $user_array = array(
'exam_type' => $exam_type, 'exam_type' => $exam_type,
'category' => $category, 'category' => $category,
...@@ -2319,225 +2307,90 @@ class ApplicationController extends CI_Controller ...@@ -2319,225 +2307,90 @@ class ApplicationController extends CI_Controller
redirect('ApplicationController/sectionCategory'); redirect('ApplicationController/sectionCategory');
} }
public function createQuestion()
{
$view_data['records'] = $this->mcommon->records_all('section_category',array('status',1));
$view_data['exam_type'] = $this->mcommon->records_all('exam_type',array('status',1));
$data = array( public function examSchedule()
'title' => 'Section Category',
'page' => 'Section Category',
'content' => $this->load->view('questions/view', $view_data, true),
);
$this->load->view('base/base_template', $data);
}
public function viewQuestion()
{ {
$view_data['academic_year'] = $this->mcommon->records_all('accadamic_year', array('status', 1));
$view_data['records'] = $this->mcommon->records_all('question'); $view_data['records'] = $this->mcommon->records_all('exam_schedule', array('status', 1));
$view_data['exam_type'] = $this->mcommon->records_all('exam_type',array('status',1)); $view_data['exam_type'] = $this->mcommon->records_all('exam_type', array('status', 1));
$view_data['academic_year'] = $this->mcommon->records_all('accadamic_year',array('status',1));
$view_data['schedule'] = $this->mcommon->records_all('exam_schedule',array('status',1));
$view_data['category'] = $this->mcommon->records_all('section_category',array('status',1));
$data = array( $data = array(
'title' => 'View Question ', 'title' => 'Exam Schedule',
'page' => 'View Question', 'page' => 'Exam Schedule',
'content' => $this->load->view('questions/view', $view_data, true), 'content' => $this->load->view('masters/examSchedule', $view_data, true),
); );
$this->load->view('base/base_template', $data); $this->load->view('base/base_template', $data);
} }
public function questionAdd()
public function addEditexamSchedule()
{ {
if(isset($_POST['submit'])){ $id = $this->input->post('id');
$schedule = $this->input->post('schedule');
$academic = $this->input->post('academic'); $academic = $this->input->post('academic');
$exam_type = $this->input->post('exam_type'); $exam_type1 = $this->input->post('exam_type1');
$category = $this->input->post('category'); $exam_type2 = $this->input->post('exam_type2');
$schedule = $this->input->post('schedule'); $objective_date = $this->input->post('objective_date');
$question = $this->input->post('question'); $objective_time = $this->input->post('objective_time');
$option_a = $this->input->post('option_a'); $essay_date = $this->input->post('essay_date');
$option_b = $this->input->post('option_b'); $essay_time = $this->input->post('essay_time');
$option_c = $this->input->post('option_c');
$option_d = $this->input->post('option_d');
$answer = $this->input->post('answer');
$insert_array = array(
'academic' => $academic, if ($id) {
'exam_type' => $exam_type, $update_array = array(
'category' => $category, 'exam_schedule' => $schedule,
'schedule_id' => $schedule, 'academic' => $academic,
'question' => $question, 'exam_type1' => $exam_type1,
'option_a' => $option_a, 'exam_type2' => $exam_type2,
'option_b' => $option_b, 'objective_date' => $objective_date,
'option_c' => $option_c, 'objective_time' => $objective_time,
'option_d' => $option_d, 'essay_date' => $essay_date,
'answer' => $answer, 'essay_time' => $essay_time,
'status' => 1,
);
$insert = $this->mcommon->common_insert('question', $insert_array);
if ($insert) {
$this->session->set_flashdata('alert_success', 'Question added successfully!');
redirect('ApplicationController/viewQuestion');
} else {
$this->session->set_flashdata('alert_danger', 'Error in Add Question!');
}
}else{
$view_data['exam_type'] = $this->mcommon->records_all('exam_type',array('status',1));
$view_data['academic_year'] = $this->mcommon->records_all('accadamic_year',array('status',1));
$view_data['category'] = $this->mcommon->records_all('section_category',array('status',1));
$view_data['schedule'] = $this->mcommon->records_all('exam_schedule',array('status',1));
$data = array(
'title' => 'Add Question',
'page' => 'Add Question',
'content' => $this->load->view('questions/add', $view_data, true),
); );
$this->load->view('base/base_template', $data);
}
}
public function questionEdit($id){ $update = $this->mcommon->common_edit('exam_schedule', $update_array, array('id' => $id));
if(isset($_POST['submit'])){
$academic = $this->input->post('academic');
$exam_type = $this->input->post('exam_type');
$category = $this->input->post('category');
$schedule = $this->input->post('schedule');
$question = $this->input->post('question');
$option_a = $this->input->post('option_a');
$option_b = $this->input->post('option_b');
$option_c = $this->input->post('option_c');
$option_d = $this->input->post('option_d');
$answer = $this->input->post('answer');
$update_array = array(
'academic' => $academic, if ($update) {
'exam_type' => $exam_type,
'category' => $category,
'schedule_id' => $schedule,
'question' => $question,
'option_a' => $option_a,
'option_b' => $option_b,
'option_c' => $option_c,
'option_d' => $option_d,
'answer' => $answer,
);
$update = $this->mcommon->common_edit('question',$update_array,array('id' => $id));
if ($update) {
$this->session->set_flashdata('alert_success', 'Question Updated successfully!');
redirect('ApplicationController/viewQuestion');
} else {
$this->session->set_flashdata('alert_danger', 'Error in Updated Question!');
}
}else{
$view_data['default'] = $this->mcommon->specific_row('question', array('id' => $id));
$view_data['exam_type'] = $this->mcommon->records_all('exam_type',array('status',1));
$view_data['academic_year'] = $this->mcommon->records_all('accadamic_year',array('status',1));
$view_data['category'] = $this->mcommon->records_all('section_category',array('status',1));
$view_data['schedule'] = $this->mcommon->records_all('exam_schedule',array('status',1));
$data = array(
'title' => 'Edit Question',
'page' => 'Edit Question',
'content' => $this->load->view('questions/edit', $view_data, true),
);
$this->load->view('base/base_template', $data);
}
}
$this->session->set_flashdata('alert_success', 'Exam Schedule Updated Successfully!');
} else {
public function examSchedule()
{ $this->session->set_flashdata('alert_danger', 'Something went wrong');
$view_data['academic_year'] = $this->mcommon->records_all('accadamic_year',array('status',1)); }
$view_data['records'] = $this->mcommon->records_all('exam_schedule',array('status',1)); } else {
$data = array( $user_array = array(
'title' => 'Exam Schedule', 'exam_schedule' => $schedule,
'page' => 'Exam Schedule', 'academic' => $academic,
'content' => $this->load->view('masters/examSchedule', $view_data, true), 'exam_type1' => $exam_type1,
'exam_type2' => $exam_type2,
'objective_date' => $objective_date,
'objective_time' => $objective_time,
'essay_date' => $essay_date,
'essay_time' => $essay_time,
'status' => 1,
); );
$this->load->view('base/base_template', $data); $insert = $this->mcommon->common_insert('exam_schedule', $user_array);
}
if ($insert) {
$this->session->set_flashdata('alert_success', 'Exam Schedule Added successfully!');
public function addEditexamSchedule()
{
$id = $this->input->post('id');
$schedule = $this->input->post('schedule');
$academic = $this->input->post('academic');
$date = $this->input->post('date');
$time = $this->input->post('time');
if ($id) {
$update_array = array(
'exam_schedule' => $schedule,
'academic' => $academic,
'date' => $date,
'time' => $time,
'status' => 1,
);
$update = $this->mcommon->common_edit('exam_schedule', $update_array, array('id' => $id));
if ($update) {
$this->session->set_flashdata('alert_success','Exam Schedule Updated Successfully!');
} else {
$this->session->set_flashdata('alert_danger', 'Something went wrong');
}
} else { } else {
$user_array = array( $this->session->set_flashdata('alert_danger', 'Something went wrong');
'exam_schedule' => $schedule,
'academic' => $academic,
'date' => $date,
'time' => $time,
'status' => 1,
);
$insert = $this->mcommon->common_insert('exam_schedule', $user_array);
if ($insert) {
$this->session->set_flashdata('alert_success', 'Exam Schedule Added successfully!');
} else {
$this->session->set_flashdata('alert_danger', 'Something went wrong');
}
} }
redirect('ApplicationController/examSchedule');
} }
redirect('ApplicationController/examSchedule');
}
} }
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class QuestionController extends CI_Controller
{
public function viewQuestion()
{
$view_data['records'] = $this->mcommon->records_all('question');
$view_data['exam_type'] = $this->mcommon->records_all('exam_type',array('status',1));
$view_data['academic_year'] = $this->mcommon->records_all('accadamic_year',array('status',1));
$view_data['schedule'] = $this->mcommon->records_all('exam_schedule',array('status',1));
$view_data['category'] = $this->mcommon->records_all('section_category',array('status',1));
$data = array(
'title' => 'View Question ',
'page' => 'View Question',
'content' => $this->load->view('questions/view', $view_data, true),
);
$this->load->view('base/base_template', $data);
}
public function questionAdd()
{
if(isset($_POST['submit'])){
$academic = $this->input->post('academic');
$exam_type = $this->input->post('exam_type');
$category = $this->input->post('category');
$schedule = $this->input->post('schedule');
$question = $this->input->post('question');
$option_a = $this->input->post('option_a');
$option_b = $this->input->post('option_b');
$option_c = $this->input->post('option_c');
$option_d = $this->input->post('option_d');
$answer = $this->input->post('answer');
$insert_array = array(
'academic' => $academic,
'exam_type' => $exam_type,
'category' => $category,
'schedule_id' => $schedule,
'question' => $question,
'option_a' => $option_a,
'option_b' => $option_b,
'option_c' => $option_c,
'option_d' => $option_d,
'answer' => $answer,
);
$insert = $this->mcommon->common_insert('question', $insert_array);
if ($insert) {
$this->session->set_flashdata('alert_success', 'Question added successfully!');
redirect('QuestionController/viewQuestion');
} else {
$this->session->set_flashdata('alert_danger', 'Error in Add Question!');
}
}else{
$view_data['exam_type'] = $this->mcommon->records_all('exam_type',array('status',1));
$view_data['academic_year'] = $this->mcommon->records_all('accadamic_year',array('status',1));
$view_data['category'] = $this->mcommon->records_all('section_category',array('status',1));
$view_data['schedule'] = $this->mcommon->records_all('exam_schedule',array('status',1));
$data = array(
'title' => 'Add Question',
'page' => 'Add Question',
'content' => $this->load->view('questions/add', $view_data, true),
);
$this->load->view('base/base_template', $data);
}
}
public function questionEdit($id){
if(isset($_POST['submit'])){
$academic = $this->input->post('academic');
$exam_type = $this->input->post('exam_type');
$category = $this->input->post('category');
$schedule = $this->input->post('schedule');
$question = $this->input->post('question');
$option_a = $this->input->post('option_a');
$option_b = $this->input->post('option_b');
$option_c = $this->input->post('option_c');
$option_d = $this->input->post('option_d');
$answer = $this->input->post('answer');
$update_array = array(
'academic' => $academic,
'exam_type' => $exam_type,
'category' => $category,
'schedule_id' => $schedule,
'question' => $question,
'option_a' => $option_a,
'option_b' => $option_b,
'option_c' => $option_c,
'option_d' => $option_d,
'answer' => $answer,
);
$update = $this->mcommon->common_edit('question',$update_array,array('id' => $id));
if ($update) {
$this->session->set_flashdata('alert_success', 'Question Updated successfully!');
redirect('QuestionController/viewQuestion');
} else {
$this->session->set_flashdata('alert_danger', 'Error in Updated Question!');
}
}else{
$view_data['default'] = $this->mcommon->specific_row('question', array('id' => $id));
$view_data['exam_type'] = $this->mcommon->records_all('exam_type',array('status',1));
$view_data['academic_year'] = $this->mcommon->records_all('accadamic_year',array('status',1));
$view_data['category'] = $this->mcommon->records_all('section_category',array('status',1));
$view_data['schedule'] = $this->mcommon->records_all('exam_schedule',array('status',1));
$data = array(
'title' => 'Edit Question',
'page' => 'Edit Question',
'content' => $this->load->view('questions/edit', $view_data, true),
);
$this->load->view('base/base_template', $data);
}
}
public function viewEssayQuestion()
{
$view_data['records'] = $this->mcommon->records_all('question');
$view_data['exam_type'] = $this->mcommon->records_all('exam_type',array('status',1));
$view_data['academic_year'] = $this->mcommon->records_all('accadamic_year',array('status',1));
$view_data['schedule'] = $this->mcommon->records_all('exam_schedule',array('status',1));
$view_data['category'] = $this->mcommon->records_all('section_category',array('status',1));
$data = array(
'title' => 'View Question ',
'page' => 'View Question',
'content' => $this->load->view('essay_question/view', $view_data, true),
);
$this->load->view('base/base_template', $data);
}
public function essayquestionAdd()
{
if(isset($_POST['submit'])){
$academic = $this->input->post('academic');
$exam_type = $this->input->post('exam_type');
$category = $this->input->post('category');
$schedule = $this->input->post('schedule');
$question = $this->input->post('question');
$insert_array = array(
'academic' => $academic,
'exam_type' => $exam_type,
'category' => $category,
'schedule_id' => $schedule,
'question' => $question,
);
$insert = $this->mcommon->common_insert('question', $insert_array);
if ($insert) {
$this->session->set_flashdata('alert_success', 'Question added successfully!');
redirect('ApplicationController/viewQuestion');
} else {
$this->session->set_flashdata('alert_danger', 'Error in Add Question!');
}
}else{
$view_data['exam_type'] = $this->mcommon->records_all('exam_type',array('status',1));
$view_data['academic_year'] = $this->mcommon->records_all('accadamic_year',array('status',1));
$view_data['category'] = $this->mcommon->records_all('section_category',array('status',1));
$view_data['schedule'] = $this->mcommon->records_all('exam_schedule',array('status',1));
$data = array(
'title' => 'Add Question',
'page' => 'Add Question',
'content' => $this->load->view('questions/add', $view_data, true),
);
$this->load->view('base/base_template', $data);
}
}
public function essayquestionEdit($id){
if(isset($_POST['submit'])){
$academic = $this->input->post('academic');
$exam_type = $this->input->post('exam_type');
$category = $this->input->post('category');
$schedule = $this->input->post('schedule');
$question = $this->input->post('question');
$update_array = array(
'academic' => $academic,
'exam_type' => $exam_type,
'category' => $category,
'schedule_id' => $schedule,
'question' => $question,
);
$update = $this->mcommon->common_edit('question',$update_array,array('id' => $id));
if ($update) {
$this->session->set_flashdata('alert_success', 'Question Updated successfully!');
redirect('ApplicationController/viewQuestion');
} else {
$this->session->set_flashdata('alert_danger', 'Error in Updated Question!');
}
}else{
$view_data['default'] = $this->mcommon->specific_row('question', array('id' => $id));
$view_data['exam_type'] = $this->mcommon->records_all('exam_type',array('status',1));
$view_data['academic_year'] = $this->mcommon->records_all('accadamic_year',array('status',1));
$view_data['category'] = $this->mcommon->records_all('section_category',array('status',1));
$view_data['schedule'] = $this->mcommon->records_all('exam_schedule',array('status',1));
$data = array(
'title' => 'Edit Question',
'page' => 'Edit Question',
'content' => $this->load->view('questions/edit', $view_data, true),
);
$this->load->view('base/base_template', $data);
}
}
}
...@@ -59,12 +59,25 @@ ...@@ -59,12 +59,25 @@
</a> </a>
</li> </li>
<li><a href="<?php echo base_url(); ?>ApplicationController/viewQuestion/" aria-expanded="false"> <!-- <li><a href="<?php echo base_url(); ?>ApplicationController/viewQuestion/" aria-expanded="false">
<i class="material-symbols-outlined">note</i> <i class="material-symbols-outlined">note</i>
<span class="nav-text">Create Question</span> <span class="nav-text">Create Question</span>
</a> </a>
</li> -->
<li><a class="has-arrow " href="javascript:void(0);" aria-expanded="false">
<i class="material-icons"> note </i>
<span class="nav-text">Create Question</span>
</a>
<ul aria-expanded="false">
<li><a href="<?php echo base_url(); ?>QuestionController/viewQuestion/">Objective Question</a></li>
<li><a href="<?php echo base_url(); ?>QuestionController/viewEssayQuestion/">Essay Question</a></li>
</ul>
</li> </li>
<li><a class="has-arrow " href="javascript:void(0);" aria-expanded="false"> <li><a class="has-arrow " href="javascript:void(0);" aria-expanded="false">
<i class="material-symbols-outlined">list</i> <i class="material-symbols-outlined">list</i>
<span class="nav-text"> Application list</span> <span class="nav-text"> Application list</span>
......
...@@ -53,8 +53,10 @@ ...@@ -53,8 +53,10 @@
<th class="wd-20p">S.No</th> <th class="wd-20p">S.No</th>
<th class="wd-20p">Academic</th> <th class="wd-20p">Academic</th>
<th class="wd-25p"> Exam Schedule </th> <th class="wd-25p"> Exam Schedule </th>
<th class="wd-25p">Date</th> <th class="wd-25p">Objective Date</th>
<th class="wd-25p">Time</th> <th class="wd-25p">Objective Time</th>
<th class="wd-25p">Essay Date</th>
<th class="wd-25p">Essay Time</th>
<th class="wd-15p">Action</th> <th class="wd-15p">Action</th>
</tr> </tr>
</thead> </thead>
...@@ -67,10 +69,12 @@ ...@@ -67,10 +69,12 @@
<td><?= $i ?></td> <td><?= $i ?></td>
<td><?= $row->academic ?></td> <td><?= $row->academic ?></td>
<td><?= $row->exam_schedule ?></td> <td><?= $row->exam_schedule ?></td>
<td><?= date($row->date) ?></td> <td><?= date($row->objective_date) ?></td>
<td><?= $row->time ?></td> <td><?= $row->objective_time ?></td>
<td><?= date($row->essay_date) ?></td>
<td><?= $row->essay_time ?></td>
<td> <td>
<a data-toggle="tooltip" id="edit" data-placement="top" title="Edit" data-original-title="Edit" onclick="edit('<?php echo $row->id; ?>', '<?php echo $row->academic; ?>', '<?php echo $row->exam_schedule; ?>','<?php echo $row->date; ?>','<?php echo $row->time; ?>')" class="btn btn-sm btn-info"><i class="ti ti-pencil"></i></a> <a data-toggle="tooltip" id="edit" data-placement="top" title="Edit" data-original-title="Edit" onclick="edit('<?php echo $row->id; ?>', '<?php echo $row->academic; ?>', '<?php echo $row->exam_schedule; ?>','<?php echo $row->objective_date; ?>','<?php echo $row->objective_time; ?>','<?php echo $row->essay_date; ?>','<?php echo $row->essay_time; ?>')" class="btn btn-sm btn-info"><i class="ti ti-pencil"></i></a>
<a data-toggle="tooltip" data-placement="top" title="Delete" data-original-title="Delete" onclick="deleteCourse('<?php echo $row->id; ?>','<?php echo $row->status; ?>')" class="btn btn-sm <?php echo $row->status == 1 ? 'btn-primary' : 'btn-danger' ?> text-white"><?php echo $row->status == 1 ? 'Active' : 'In-Active' ?></a> <a data-toggle="tooltip" data-placement="top" title="Delete" data-original-title="Delete" onclick="deleteCourse('<?php echo $row->id; ?>','<?php echo $row->status; ?>')" class="btn btn-sm <?php echo $row->status == 1 ? 'btn-primary' : 'btn-danger' ?> text-white"><?php echo $row->status == 1 ? 'Active' : 'In-Active' ?></a>
</td> </td>
</tr> </tr>
...@@ -111,7 +115,6 @@ ...@@ -111,7 +115,6 @@
<?php } ?> <?php } ?>
</select> </select>
</div> </div>
...@@ -121,15 +124,53 @@ ...@@ -121,15 +124,53 @@
<!-- <p class="text-danger mt-2" id="fees_err"></p> --> <!-- <p class="text-danger mt-2" id="fees_err"></p> -->
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-4 mt-3">
<label class="tx-medium">Date <span class="text-danger">*</span> </label> <label class="tx-medium">Exam Type<span class="text-danger">*</span> </label>
<input type="date" class="form-control" id="date" name="date" placeholder="Date" required>
<select name="exam_type1" id="exam_type1" class="form-control select2 modal-select">
<option value="">--Select--</option>
<?php foreach ($exam_type as $row) { ?>
<option value="<?php echo $row->id ?>"> <?php echo $row->exam_type_name ?></option>
<?php } ?>
</select>
</div>
<div class="form-group col-md-4 mt-3">
<label class="tx-medium">Objective Date <span class="text-danger">*</span> </label>
<input type="date" class="form-control" id="objective_date" name="objective_date" placeholder="Date" required>
<!-- <p class="text-danger mt-2" id="fees_err"></p> --> <!-- <p class="text-danger mt-2" id="fees_err"></p> -->
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-4 mt-3">
<label class="tx-medium">Time <span class="text-danger">*</span> </label> <label class="tx-medium"> Objective Time <span class="text-danger">*</span> </label>
<input type="time" class="form-control" id="time" name="time" placeholder="Time" required> <input type="time" class="form-control" id="objective_time" name="objective_time" placeholder="Time" required>
<!-- <p class="text-danger mt-2" id="fees_err"></p> -->
</div>
<div class="form-group col-md-4 mt-3">
<label class="tx-medium">Exam Type<span class="text-danger">*</span> </label>
<select name="exam_type2" id="exam_type2" class="form-control select2 modal-select">
<option value="">--Select--</option>
<?php foreach ($exam_type as $row) { ?>
<option value="<?php echo $row->id ?>"> <?php echo $row->exam_type_name ?></option>
<?php } ?>
</select>
</div>
<div class="form-group col-md-4 mt-3">
<label class="tx-medium">Essay Date <span class="text-danger">*</span> </label>
<input type="date" class="form-control" id="essay_date" name="essay_date" placeholder="Date" required>
<!-- <p class="text-danger mt-2" id="fees_err"></p> -->
</div>
<div class="form-group col-md-4 mt-3">
<label class="tx-medium"> Essay Time <span class="text-danger">*</span> </label>
<input type="time" class="form-control" id="essay_time" name="essay_time" placeholder="Time" required>
<!-- <p class="text-danger mt-2" id="fees_err"></p> --> <!-- <p class="text-danger mt-2" id="fees_err"></p> -->
</div> </div>
</div> </div>
...@@ -176,15 +217,17 @@ ...@@ -176,15 +217,17 @@
</html> </html>
<script> <script>
function edit(id, academic, schedule,date,time) { function edit(id, academic,schedule,objective_date,objective_time,essay_date,essay_time) {
$('#id').val(id) $('#id').val(id)
$('#academic').val(academic) $('#academic').val(academic)
$('#schedule').val(schedule ) $('#schedule').val(schedule )
$('#date').val(date) $('#objective_date').val(objective_date)
$('#time').val(time) $('#objective_time').val(objective_time)
$('#essay_date').val(essay_date)
$('#essay_time').val(essay_time)
$('#formTitle').text('Edit Exam Schedule') $('#formTitle').text('Edit Exam Schedule')
$(".select").trigger("change");
$("#applicationModal").modal('show'); $("#applicationModal").modal('show');
$("#courseId").select2({ $("#courseId").select2({
width: '100%', width: '100%',
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<div class="card "> <div class="card ">
<div class="card-body"> <div class="card-body">
<h2 class="card-title">Add Question</h2><bR> <h2 class="card-title">Add Question</h2><bR>
<form action="<?php echo base_url(); ?>ApplicationController/questionAdd" method="post" enctype="multipart/form-data" id="registration_form"> <form action="<?php echo base_url(); ?>QuestionController/questionAdd" method="post" enctype="multipart/form-data" id="registration_form">
<div class="row"> <div class="row">
<div class="form-group col-md-3"> <div class="form-group col-md-3">
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
<button name="submit" type="submit" class="btn btn-primary waves-effect waves-light mr-1"> <button name="submit" type="submit" class="btn btn-primary waves-effect waves-light mr-1">
Submit Submit
</button> </button>
<a href="<?php echo base_url('ApplicationController/viewQuestion'); ?>" class="btn btn-secondary waves-effect">Cancel </a> <a href="<?php echo base_url('QuestionController/viewQuestion'); ?>" class="btn btn-secondary waves-effect">Cancel </a>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<div class="card "> <div class="card ">
<div class="card-body"> <div class="card-body">
<h2 class="card-title">Edit Question</h2><bR> <h2 class="card-title">Edit Question</h2><bR>
<form action="<?php echo base_url(); ?>ApplicationController/questionEdit/<?=$default['id']?>" method="post" enctype="multipart/form-data" id="registration_form"> <form action="<?php echo base_url(); ?>QuestionController/questionEdit/<?=$default['id']?>" method="post" enctype="multipart/form-data" id="registration_form">
<div class="row"> <div class="row">
<div class="form-group col-md-3"> <div class="form-group col-md-3">
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
<button name="submit" type="submit" class="btn btn-primary waves-effect waves-light mr-1"> <button name="submit" type="submit" class="btn btn-primary waves-effect waves-light mr-1">
Submit Submit
</button> </button>
<a href="<?php echo base_url('ApplicationController/viewQuestion'); ?>" class="btn btn-secondary waves-effect">Cancel </a> <a href="<?php echo base_url('QuestionController/viewQuestion'); ?>" class="btn btn-secondary waves-effect">Cancel </a>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</div> </div>
<div> <div>
<!-- Button trigger modal --> <!-- Button trigger modal -->
<a href="<?php echo base_url(); ?>ApplicationController/questionAdd" type="button" class="btn btn-primary" id="open-modal"> <a href="<?php echo base_url(); ?>QuestionController/questionAdd" type="button" class="btn btn-primary" id="open-modal">
+ New Question + New Question
</a> </a>
...@@ -80,8 +80,8 @@ ...@@ -80,8 +80,8 @@
<?php } ?></td> <?php } ?></td>
<td><?= $row->question; ?></td> <td><?= $row->question; ?></td>
<td> <td>
<a href="<?= base_url('ApplicationController/questionEdit/' . $row->id) ?>" data-toggle="tooltip" id="edit" data-placement="top" title="Edit" data-original-title="Edit" class="btn btn-sm btn-info"><i class="ti ti-pencil"></i></a> <a href="<?= base_url('QuestionController/questionEdit/' . $row->id) ?>" data-toggle="tooltip" id="edit" data-placement="top" title="Edit" data-original-title="Edit" class="btn btn-sm btn-info"><i class="ti ti-pencil"></i></a>
<a href="<?= base_url('ApplicationController/deleteQuestion/' . $row->id) ?>" data-toggle="tooltip" id="delete" data-placement="top" title="Delete" data-original-title="Edit" class="btn btn-sm btn-danger"><i class="ti ti-trash"></i></a> <a href="<?= base_url('QuestionController/deleteQuestion/' . $row->id) ?>" data-toggle="tooltip" id="delete" data-placement="top" title="Delete" data-original-title="Edit" class="btn btn-sm btn-danger"><i class="ti ti-trash"></i></a>
</td> </td>
</tr> </tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment