diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index 6ec5b605..66feaa01 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -251,8 +251,15 @@ $route['addSessionScheduleDetails'] = 'SessionSchedule_Controller/addSessionSche $route['getSessionScheduleDetails'] = 'SessionSchedule_Controller/getSessionScheduleDetails'; $route['updateSessionScheduleDetails'] = 'SessionSchedule_Controller/updateSessionScheduleDetails'; -// halltickets -$route['getCourseSubjectDetails'] = 'HallTickets_Controller/getCourseSubjectDetails'; +/// halltickets +$route['getUniversityCourseDetails'] = 'HallTickets_Controller/getUniversityCourseDetails'; +$route['getSemesterSubjectDetails'] = 'HallTickets_Controller/getSemesterSubjectDetails'; +$route['saveAllSemSubMapping'] = 'HallTickets_Controller/saveAllSemesterSubjectMapping'; +$route['getAllSemSubjects'] = 'HallTickets_Controller/getAllSemesterSubjects'; +$route['getIndividualCourseSemMappingDetails'] = 'HallTickets_Controller/getIndividualCourseSemMappingDetails'; +$route['updateAllSemSubMapping'] = 'HallTickets_Controller/updateAllSemesterSubjectMapping'; +$route['getStudentListForHallTicket'] = 'HallTickets_Controller/getStudentListForHallTicket'; +$route['getHallTicket'] = 'HallTickets_Controller/getHallTicket'; //Reports $route['report_status'] = 'Report/status'; diff --git a/Apollo/api/application/controllers/HallTickets_Controller.php b/Apollo/api/application/controllers/HallTickets_Controller.php index 9a26ca5c..2907cc0b 100755 --- a/Apollo/api/application/controllers/HallTickets_Controller.php +++ b/Apollo/api/application/controllers/HallTickets_Controller.php @@ -11,17 +11,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); /** @noinspection PhpIncludeInspection */ require_once APPPATH . '/libraries/REST_Controller.php'; -/** - * This is an example of a few basic user interaction methods you could use - * all done with a hardcoded array - * - * @package CodeIgniter - * @subpackage Rest Server - * @category Controller - * @author - * @license MIT - * @link - */ + class HallTickets_Controller extends REST_Controller { function __construct() @@ -37,28 +27,23 @@ class HallTickets_Controller extends REST_Controller { $this->load->model('Hallticket_model', 'Hallticket_model'); } - - - + + + /* - * get student list for fees update - * created by kms + * get university and course details for semester course mappinig + * created by velz * */ - public function getStudentList_post() + public function getUniversityCourseDetails_post() { - $search['requestedBy'] = $this->post('requestedtBy'); - $search['Firstname'] = $this->post('studentName'); - $search['MobileNumber'] = $this->post('mobileNumber'); - $search['UniversityID'] = $this->post('university'); - $search['CourseID'] = $this->post('course'); - $search['requestedDept'] = $this->post('requestedDept'); - $search['requestedBranch'] = $this->post('branchId'); - $getStudentDetails = $this->Fees_model->getStudentList($search); - if ($getStudentDetails) + $branchId = $this->post('branchId'); + $getUnivDetails = $this->Hallticket_model->getUniversityDetails($branchId); + $getCenterDetails = $this->Hallticket_model->getCenterDetails($branchId); + if ($getUnivDetails) { - $getStudentDetails['status'] = REST_Controller::HTTP_OK; + $getUnivDetails['status'] = REST_Controller::HTTP_OK; // Set the response and exit - $this->response($getStudentDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + $this->response($getUnivDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { @@ -71,6 +56,215 @@ class HallTickets_Controller extends REST_Controller { } + + /* + * get semester and subjects list for sem course mapping + * created by velz + * */ + public function getSemesterSubjectDetails_post() + { + $universityID = $this->post('universityID'); + $courseIDS = $this->post('courseID'); + $requestedBy = $this->post('requestedBy'); + $branchId = $this->post('branchId'); + $tempCourseArray = array(); + foreach($courseIDS as $val) + { + foreach($val as $v){ + $tempCourseArray[] = $v; + } + //print_r($value); + } + + $data['subjectDetails'] = $this->Hallticket_model->getSubjectDetails($universityID,$tempCourseArray,$branchId); + //$data['semesterDetails'] = $this->Hallticket_model->getSemesterDetails($universityID,$tempCourseArray); + + if($data['subjectDetails']) + { + $data['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($data, REST_Controller::HTTP_OK); + } + else{ + + $this->response([ + 'message' => 'No records found!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); + + } + + } + + + public function saveAllSemesterSubjectMapping_post() + { + $UID = $this->post('universityID'); + $courseIDS = $this->post('courseID'); + $requestedBy = $this->post('requestedBy'); + $branchId = $this->post('branchId'); + $semArray = $this->post('Semesters'); + $res = $this->Hallticket_model->saveAllSemesterSubjectMappingmodel($UID,$courseIDS,$requestedBy,$branchId,$semArray,$requestedBy); + + if($res['insert'] == true and $res['exist'] == false) + { + $data['status'] = REST_Controller::HTTP_OK; + $data['txtStatus'] = '1'; + $this->response($data, REST_Controller::HTTP_OK); + } + else if($res['insert'] == false and $res['exist'] == true) + { + $data['status'] = REST_Controller::HTTP_OK; + $data['txtStatus'] = '2'; + $this->response($data, REST_Controller::HTTP_OK); + } + else if($res['insert'] == false and $res['exist'] == false) + { + + $this->response([ + 'message' => 'Something Went Wrong!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); + + } + } + + + public function getAllSemesterSubjects_get() + { + $branchId = $this->post('branchId'); + $res = $this->Hallticket_model->getAllSemesterSubjectsmodel($branchId); + + //$result_array = array(); + if(count($res) > 0 ) + { + + $data['semsubstatus'] = true; + $data['status'] = REST_Controller::HTTP_OK;; + $data['semsubjects'] = $res; + $this->response($data, REST_Controller::HTTP_OK); + } + else + { + $this->response([ + 'message' => 'Something Went Wrong!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); + } + + } + + public function getIndividualCourseSemMappingDetails_post() + { + $universityID = $this->post('universityID'); + $courseID = $this->post('courseID'); + $branchId = $this->post('branchId'); + + $res = $this->Hallticket_model->getIndividualCourseSemMappingDetailsmodel($universityID,$courseID,$branchId); + //print_r($res); + if(count($res['mappedSubjects']) == 0) + { + $data['subjectStatus'] = false; + $data['status'] = REST_Controller::HTTP_OK; + $data['subjects'] = ""; + $this->response($data, REST_Controller::HTTP_OK); + } + else + { + $data['subjectStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['subjects'] = $res['mappedSubjects']; + $data['overAllSubjects'] = $res['overAllSubjects']; + $this->response($data, REST_Controller::HTTP_OK); + } + + + + } + + + + public function updateAllSemesterSubjectMapping_post() + { + $UID = $this->post('universityID'); + $courseIDS = $this->post('courseID'); + $requestedBy = $this->post('requestedBy'); + $branchId = $this->post('branchId'); + $semArray = $this->post('Semesters'); + $res = $this->Hallticket_model->updateAllSemesterSubjectMappingmodel($UID,$courseIDS,$requestedBy,$branchId,$semArray,$requestedBy); + + if($res) + { + $data['status'] = REST_Controller::HTTP_OK; + $data['txtStatus'] = true; + $this->response($data, REST_Controller::HTTP_OK); + } + else + { + $this->response([ + 'message' => 'Something Went Wrong!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); + + } + } + + public function getStudentListForHallTicket_post() + { + $UID = $this->post('university'); + $courseID = $this->post('course'); + $batch = $this->post('batch'); + $requestedBy = $this->post('requestedBy'); + $branchId = $this->post('branchId'); + + $res = $this->Hallticket_model->getStudentListForHallTicketmodel($UID,$courseID,$batch,$requestedBy,$branchId); + if(count($res) > 0) + { + $data['status'] = REST_Controller::HTTP_OK; + $data['studentStatus'] = true; + $data['studentDetails'] = $res; + $this->response($data, REST_Controller::HTTP_OK); + } + else + { + $this->response([ + 'message' => 'Something Went Wrong!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); + } + } + + public function getHallTicket_post() + { + $UID = $this->post('universityID'); + $courseID = $this->post('courseID'); + $batch = $this->post('batchName'); + $requestedBy = $this->post('requestedBy'); + $branchId = $this->post('branchId'); + $studentIDs = $this->post('StudentIDs'); + $centerName = $this->post('centerName'); + + $res['UniversityDetails'] = $this->Hallticket_model->getUniversityDetials($UID,$branchId); + $res['studentDetails'] = $this->Hallticket_model->getStudentDetails($UID,$courseID,$branchId,$studentIDs); + + + if(count($res['UniversityDetails']) != 0 || count($res['studentDetails']) != 0 ) + { + $data['status'] = REST_Controller::HTTP_OK; + $data['hallTicketStatus'] = true; + $data['hallTicketData'] = $res; + $data['semDataType'] = $res['studentDetails']['NUMTYPE']; + $this->response($data, REST_Controller::HTTP_OK); + } + else + { + $this->response([ + 'message' => 'Something Went Wrong!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); + } + + } } \ No newline at end of file diff --git a/Apollo/api/application/models/Hallticket_model.php b/Apollo/api/application/models/Hallticket_model.php index 3b86a25a..4e9314ea 100755 --- a/Apollo/api/application/models/Hallticket_model.php +++ b/Apollo/api/application/models/Hallticket_model.php @@ -1,7 +1,820 @@ db->select('UniversityID,UniversityName'); + $this->db->where('IsActive','1'); + $this->db->where('BranchCode',$branchId); + $this->db->order_by('UniversityID','ASC'); + $unviversityDetails = $this->db->get(UNIVERSITY); + + if($unviversityDetails->result()){ + $result_university = array(); + $result_university['universityStatus'] = true; + foreach ($unviversityDetails->result() as $row) + { + + $university_array['universityID'] = $row->UniversityID; + $university_array['universityName'] = $row->UniversityName; + $university_array['courseDetails']= $this->getCourseDetails($row->UniversityID,$branchId); + $university_array['batchDetails']= $this->getBatchDetails($row->UniversityID,$branchId); + $result_array[]=$university_array; + } + $result_university['univerSityDetails']= $result_array; + $result_university['centerDetails'] = $this->getCenterDetails($branchId); + } + else { + $result_university['universityStatus'] = false; + $result_university['message'] = "No records found!"; + $result_university['universityID'] = ""; + $result_university['universityName'] = ""; + $result_university['courseDetails']= ""; + } + + + return $result_university; + + } + + + public function getCenterDetails($branchId) + { + $this->db->select('CenterID,CenterCode,CenterName,CenterAddress'); + $this->db->from('T_CenterMaster'); + $this->db->where('IsActive',1); + $this->db->where('BranchCode',$branchId); + $res = $this->db->get(); + return $res->result(); + } + + /* + * get course details + * @params university id + * created by velz + * */ + public function getCourseDetails($universityID=null,$branchId) + { + $this->db->select('CourseID,CONCAT(CourseName, "(",CourseCode,")") AS CourseName'); + $this->db->where('UniversityID',$universityID); + $this->db->where('BranchCode',$branchId); + $this->db->where('IsActive','1'); + $this->db->order_by('CourseID','ASC'); + $courseDetails = $this->db->get(COURSE); + return $courseDetails->result(); + } + + /* + * get subject details + * @params university id and CourseID + * created by velz + * */ + public function getSubjectDetails($universityID,$courseIDS,$branchId) + { + + $this->db->distinct(); + $this->db->select('SubjectID,SubjectCode,SubjectName'); + $this->db->from('T_SubjectMaster'); + //$this->db->join('T_SubjectMaster','T_CourseSubject_Details.SubjectID=T_SubjectMaster.SubjectID'); + $this->db->where('T_SubjectMaster.IsActive','1'); + $this->db->where('T_SubjectMaster.BranchCode',$branchId); + //$this->db->where('T_CourseSubject_Details.UniversityID',$universityID); + //$this->db->where_in('T_CourseSubject_Details.CourseID',$courseIDS); + $result = $this->db->get(); + //echo $this->db->last_query(); + return $result->result(); + } + + + /* + * get semester details + * @params university id and CourseID + * created by velz + * */ + public function getSemesterDetails($universityID,$courseIDS) + { + $this->db->distinct(); + $this->db->select('CourseID,Sem_Year'); + $this->db->from('T_Course_Fees_Details'); + $this->db->where('IsActive','1'); + $this->db->where_in('T_Course_Fees_Details.CourseID',$courseIDS); + $result = $this->db->get(); + return $result->result(); + } + + + /* + * save All Semester Subject Mapping Info + * @params university id,CourseID,requestedBy,branchId,semArray + * created by velz + * */ + public function saveAllSemesterSubjectMappingmodel($UID,$courseIDS,$requestedBy,$branchId,$semArray) + { + $sem1 = 0;$sem2=0;$sem3=0;$sem4=0;$sem5=0;$sem6=0;$sem7=0;$sem8 = 0; + foreach($semArray as $key => $s) + { + if($key == 0) + { + $sem1 = $s; + } + if($key == 1) + { + $sem2 = $s; + }if($key == 2) + { + $sem3 = $s; + }if($key == 3) + { + $sem4 = $s; + }if($key == 4) + { + $sem5 = $s; + }if($key == 5) + { + $sem6 = $s; + } + if($key == 6) + { + $sem7 = $s; + } + if($key == 7) + { + $sem8 = $s; + } + } + //Check If Exist or Not for UniversityID and CourseID's + + $this->db->select('count(*) as counts'); + $this->db->from('T_SemSubMap_Master'); + $this->db->where('BranchCode',$branchId); + $this->db->where('UniversityID',$UID); + $this->db->where_in('CourseID',$courseIDS); + $isExist = $this->db->get(); + $isExist = $isExist->result(); + $result_array = array('insert'=>'','exist'=>''); + if($isExist[0]->counts == 0 ) + { + + + + + $ids = array(); + + foreach($courseIDS as $course) + { + for($i=1;$i<=8;$i++) + { + + $dataArray = array('UniversityID'=>$UID,'CourseID'=>$course,'SemesterID'=>$i,'BranchCode'=>$branchId,'CreatedBy'=>$requestedBy); + + $this->db->trans_start(); + $this->db->insert('T_SemSubMap_Master',$dataArray); + $last_id = $this->db->insert_id(); + $this->db->trans_complete(); + //echo $last_id; + //$current = '$sem'.$i; + //echo $current;die(); + $ids[] = $last_id; + if($i == 1) + { + if(count($sem1) != 0){ + foreach($sem1 as $s) + { + $childArray = array('MapID'=>$last_id,'SubjectID'=>$s['SubjectID']); + $this->db->trans_start(); + $this->db->insert('T_SemSubMap_Child',$childArray); + $this->db->trans_complete(); + } + } + } + + if($i == 2) + { + if(count($sem2) != 0){ + foreach($sem2 as $s) + { + $childArray = array('MapID'=>$last_id,'SubjectID'=>$s['SubjectID']); + $this->db->trans_start(); + $this->db->insert('T_SemSubMap_Child',$childArray); + $this->db->trans_complete(); + } + } + } + + if($i == 3) + { + if(count($sem3) != 0){ + foreach($sem3 as $s) + { + $childArray = array('MapID'=>$last_id,'SubjectID'=>$s['SubjectID']); + $this->db->trans_start(); + $this->db->insert('T_SemSubMap_Child',$childArray); + $this->db->trans_complete(); + } + } + } + + if($i == 4) + { + if(count($sem4) != 0){ + foreach($sem4 as $s) + { + $childArray = array('MapID'=>$last_id,'SubjectID'=>$s['SubjectID']); + $this->db->trans_start(); + $this->db->insert('T_SemSubMap_Child',$childArray); + $this->db->trans_complete(); + } + } + } + + if($i == 5) + { + if(count($sem5) != 0){ + foreach($sem5 as $s) + { + $childArray = array('MapID'=>$last_id,'SubjectID'=>$s['SubjectID']); + $this->db->trans_start(); + $this->db->insert('T_SemSubMap_Child',$childArray); + $this->db->trans_complete(); + } + } + } + + if($i == 6) + { + if(count($sem6) != 0){ + foreach($sem6 as $s) + { + $childArray = array('MapID'=>$last_id,'SubjectID'=>$s['SubjectID']); + $this->db->trans_start(); + $this->db->insert('T_SemSubMap_Child',$childArray); + $this->db->trans_complete(); + } + } + } + + if($i == 7) + { + if(count($sem7) != 0){ + foreach($sem7 as $s) + { + $childArray = array('MapID'=>$last_id,'SubjectID'=>$s['SubjectID']); + $this->db->trans_start(); + $this->db->insert('T_SemSubMap_Child',$childArray); + $this->db->trans_complete(); + } + } + } + + if($i == 8) + { + if(count($sem8) != 0){ + foreach($sem8 as $s) + { + $childArray = array('MapID'=>$last_id,'SubjectID'=>$s['SubjectID']); + $this->db->trans_start(); + $this->db->insert('T_SemSubMap_Child',$childArray); + $this->db->trans_complete(); + } + } + } + + } + + + } + + if(count($ids) > 0) + { + $result_array['insert'] = true; + $result_array['exist'] = false; + return $result_array; + } + else + { + $result_array['insert'] = false; + $result_array['exist'] = false; + return $result_array; + + } + + } + else + { + + + $result_array['insert'] = false; + $result_array['exist'] = true; + return $result_array; + } + + } + + /* + * get All Semester Subject Mapping Info + * @params branchId + * created by velz + * */ + public function getAllSemesterSubjectsmodel($branchId) + { + $this->db->select('T_SemSubMap_Master.UniversityID,T_UniversityMaster.UniversityName,T_CourseMaster.CourseID,T_CourseMaster.CourseCode,T_CourseMaster.CourseName'); + $this->db->from('T_SemSubMap_Master'); + $this->db->join('T_UniversityMaster','T_SemSubMap_Master.UniversityID=T_UniversityMaster.UniversityID and T_SemSubMap_Master.BranchCode=T_UniversityMaster.BranchCode') ; + $this->db->join('T_CourseMaster','T_SemSubMap_Master.CourseID=T_CourseMaster.CourseID and T_SemSubMap_Master.BranchCode=T_CourseMaster.BranchCode'); + $this->db->group_by('T_SemSubMap_Master.UniversityID,T_SemSubMap_Master.CourseID'); + $res = $this->db->get(); + return $res->result(); + + + } + + public function getIndividualCourseSemMappingDetailsmodel($universityID,$courseID,$branchId) + { + //FOR GET MAPPED SUBJECTS FOR $universityID,$courseID,$branchId + $this->db->select('T_SemSubMap_Master.UniversityID,T_SemSubMap_Master.SemesterID,T_UniversityMaster.UniversityName,T_CourseMaster.CourseID,T_CourseMaster.CourseCode,T_CourseMaster.CourseName,T_SubjectMaster.SubjectID,T_SubjectMaster.SubjectCode,T_SubjectMaster.SubjectName'); + $this->db->from('T_SemSubMap_Master'); + $this->db->join('T_UniversityMaster','T_SemSubMap_Master.UniversityID=T_UniversityMaster.UniversityID and T_SemSubMap_Master.BranchCode=T_UniversityMaster.BranchCode','left') ; + $this->db->join('T_CourseMaster','T_SemSubMap_Master.CourseID=T_CourseMaster.CourseID and T_SemSubMap_Master.BranchCode=T_CourseMaster.BranchCode','left'); + $this->db->join('T_SemSubMap_Child','T_SemSubMap_Master.MapID=T_SemSubMap_Child.MapID and T_SemSubMap_Child.isActive = 1','left'); + $this->db->join('T_SubjectMaster','T_SemSubMap_Child.SubjectID=T_SubjectMaster.SubjectID','left'); + $this->db->where('T_SemSubMap_Master.UniversityID',$universityID); + $this->db->where('T_SemSubMap_Master.CourseID',$courseID); + $this->db->where('T_SemSubMap_Master.BranchCode',$branchId); + + //$this->db->group_by('T_SemSubMap_Master.UniversityID,T_SemSubMap_Master.CourseID'); + $res1 = $this->db->get(); + $res['mappedSubjects'] = $res1->result(); + + //FOR GET OVERALL SUBJECTS FOR $universityID,$courseID,$branchId + $this->db->distinct(); + $this->db->select('T_SubjectMaster.SubjectID,T_SubjectMaster.SubjectCode,T_SubjectMaster.SubjectName'); + $this->db->from('T_SubjectMaster'); + $this->db->where('T_SubjectMaster.IsActive','1'); + $this->db->where('T_SubjectMaster.BranchCode',$branchId); + $result = $this->db->get(); + $res['overAllSubjects'] = $result->result(); + + return $res; + } + + + + /* + * update All Semester Subject Mapping Info + * @params university id,CourseID,requestedBy,branchId,semArray + * created by velz + * */ + public function updateAllSemesterSubjectMappingmodel($UID,$courseIDS,$requestedBy,$branchId,$semArray) + { + $sem1 = 0;$sem2=0;$sem3=0;$sem4=0;$sem5=0;$sem6=0;$sem7=0;$sem8 = 0; + foreach($semArray as $key => $s) + { + if($key == 0) + { + $sem1 = $s; + } + if($key == 1) + { + $sem2 = $s; + }if($key == 2) + { + $sem3 = $s; + }if($key == 3) + { + $sem4 = $s; + }if($key == 4) + { + $sem5 = $s; + }if($key == 5) + { + $sem6 = $s; + } + if($key == 6) + { + $sem7 = $s; + } + if($key == 7) + { + $sem8 = $s; + } + } + //Check If Exist or Not for UniversityID and CourseID's + // echo 'FROM MODEL-'.$UID.'-'.$courseIDS.'-'.$branchId.'-'.$requestedBy; + // print_r(array($sem1,$sem2,$sem3,$sem4,$sem5,$sem6,$sem7,$sem8)); + // die(); + + + + + for($i=1;$i<=8;$i++) + { + $this->db->trans_start(); + $this->db->select('MapID'); + $this->db->from('T_SemSubMap_Master'); + $this->db->where('BranchCode',$branchId); + $this->db->where('UniversityID',$UID); + $this->db->where('CourseID',$courseIDS); + $this->db->where('SemesterID',$i); + $isExist = $this->db->get(); + $this->db->trans_complete(); + $isExist = $isExist->result(); + if(!empty($isExist[0]->MapID)) + { + + $MapID = $isExist[0]->MapID; + + $this->db->trans_start(); + $this->db->set('UpdatedBy',$requestedBy); + $this->db->where('MapID',$MapID); + $this->db->update('T_SemSubMap_Master'); + $this->db->trans_complete(); + + + $this->db->trans_start(); + $this->db->set('isActive',0); + $this->db->where('MapID',$MapID); + $this->db->update('T_SemSubMap_Child'); + $this->db->trans_complete(); + + if($i == 1) + { + if(count($sem1) != 0){ + foreach($sem1 as $s) + { + $childArray = array('MapID'=>$MapID,'SubjectID'=>$s['SubjectID']); + $this->db->trans_start(); + $this->db->insert('T_SemSubMap_Child',$childArray); + $this->db->trans_complete(); + } + } + } + + if($i == 2) + { + if(count($sem2) != 0){ + foreach($sem2 as $s) + { + $childArray = array('MapID'=>$MapID,'SubjectID'=>$s['SubjectID']); + $this->db->trans_start(); + $this->db->insert('T_SemSubMap_Child',$childArray); + $this->db->trans_complete(); + } + } + } + + if($i == 3) + { + if(count($sem3) != 0){ + foreach($sem3 as $s) + { + $childArray = array('MapID'=>$MapID,'SubjectID'=>$s['SubjectID']); + $this->db->trans_start(); + $this->db->insert('T_SemSubMap_Child',$childArray); + $this->db->trans_complete(); + } + } + } + + if($i == 4) + { + if(count($sem4) != 0){ + foreach($sem4 as $s) + { + $childArray = array('MapID'=>$MapID,'SubjectID'=>$s['SubjectID']); + $this->db->trans_start(); + $this->db->insert('T_SemSubMap_Child',$childArray); + $this->db->trans_complete(); + } + } + } + + if($i == 5) + { + if(count($sem5) != 0){ + foreach($sem5 as $s) + { + $childArray = array('MapID'=>$MapID,'SubjectID'=>$s['SubjectID']); + $this->db->trans_start(); + $this->db->insert('T_SemSubMap_Child',$childArray); + $this->db->trans_complete(); + } + } + } + + if($i == 6) + { + if(count($sem6) != 0){ + foreach($sem6 as $s) + { + $childArray = array('MapID'=>$MapID,'SubjectID'=>$s['SubjectID']); + $this->db->trans_start(); + $this->db->insert('T_SemSubMap_Child',$childArray); + $this->db->trans_complete(); + } + } + } + + if($i == 7) + { + if(count($sem7) != 0){ + foreach($sem7 as $s) + { + $childArray = array('MapID'=>$MapID,'SubjectID'=>$s['SubjectID']); + $this->db->trans_start(); + $this->db->insert('T_SemSubMap_Child',$childArray); + $this->db->trans_complete(); + } + } + } + + if($i == 8) + { + if(count($sem8) != 0){ + foreach($sem8 as $s) + { + $childArray = array('MapID'=>$MapID,'SubjectID'=>$s['SubjectID']); + $this->db->trans_start(); + $this->db->insert('T_SemSubMap_Child',$childArray); + $this->db->trans_complete(); + } + } + } + + } + + + } + return true; + + } + + public function getBatchDetails($UniversityID,$branchId) + { + $this->db->select('BatchID,BatchCode,BatchName'); + $this->db->from('T_BatchMaster'); + $this->db->where('UniversityID',$UniversityID); + $this->db->where('IsActive',1); + $this->db->where('BranchCode',$branchId); + $res = $this->db->get(); + return $res->result(); + + } + + public function getStudentListForHallTicketmodel($UID,$courseID,$batch,$requestedBy,$branchId) + { + $this->db->select('T_StudentDetails.StudentID,T_StudentDetails.MobileNumber,T_StudentDetails.Firstname,T_StudentDetails.Lastname,T_StudentDetails.EmailID,T_StudentDetails.ProfilePicPath,T_Student_CourseDetails.EnrollmentID'); + $this->db->from('T_Students_Fees_Status'); + $this->db->join('T_StudentDetails','T_Students_Fees_Status.StudentID=T_StudentDetails.StudentID and T_StudentDetails.IsActive = 1'); + $this->db->join('T_Student_CourseDetails','T_StudentDetails.StudentID = T_Student_CourseDetails.StudentID'); + $this->db->where('T_Students_Fees_Status.BatchCode',$batch['BatchCode']); + $this->db->where('T_Students_Fees_Status.BranchCode',$branchId); + $this->db->where('T_Students_Fees_Status.CourseID',$courseID['CourseID']); + + $res = $this->db->get(); + $data = $res->result(); + $result_array = array(); + if(count($data) > 0) + { + $result_array = array(); + $prestu = ""; + foreach($data as $r) + { + if($prestu != $r->StudentID) + { + $studetdetails['StudentID'] = $r->StudentID; + $studetdetails['MobileNumber'] = $r->MobileNumber; + $studetdetails['Firstname'] = $r->Firstname; + $studetdetails['Lastname'] = $r->Lastname; + $studetdetails['EmailID'] = $r->EmailID; + $studetdetails['ProfilePicPath'] = $r->ProfilePicPath; + $studetdetails['EnrollmentID'] = $r->EnrollmentID; + $studetdetails['FeeDetails'] = $this->getFeeSemesterDetails($r->StudentID,$batch['BatchCode'],$branchId,$courseID); + $result_array[] = $studetdetails; + $prestu = $r->StudentID; + } + } + + } + return $result_array; + // $this->db->distinct(); + // $this->db->select("T_StudentDetails.StudentID,T_StudentDetails.MobileNumber,T_StudentDetails.Firstname,T_StudentDetails.Lastname,T_StudentDetails.EmailID,T_Course_Fees_Details.ID as FeesID,if(substr(substr(T_Course_Fees_Details.sem_Year,-4),1,3) = 'sem',substr(sem_Year,-1),if(substr(substr(T_Course_Fees_Details.sem_Year,-5),1,4) = 'year',substr(T_Course_Fees_Details.sem_Year,-1),false)) as SemID,if(substr(substr(T_Course_Fees_Details.sem_Year,-4),1,3) = 'sem','SEM',if(substr(substr(T_Course_Fees_Details.sem_Year,-5),1,4) = 'year','YEAR',false)) as SubType,T_Course_Fees_Details.Sem_Year,if(T_Course_Fees_Details.ProgramType = 'Y001','SEM',if(ProgramType = 'P001','REG',if(ProgramType = 'P002','LAT','FALSE'))) as Type"); + // $this->db->from('T_Students_Fees_Status'); + // $this->db->join('T_StudentDetails','T_Students_Fees_Status.StudentID=T_StudentDetails.StudentID'); + // $this->db->join('T_Course_Fees_Details','T_Students_Fees_Status.FeesType=T_Course_Fees_Details.ID'); + // $this->db->where('T_Students_Fees_Status.BatchCode',$batch['BatchCode']); + // $this->db->where('T_Students_Fees_Status.BranchCode',$branchId); + // $this->db->where('T_Students_Fees_Status.CourseID',$courseID); + // $res = $this->db->get(); + // return $res->result(); + } + + function getFeeSemesterDetails($stuid,$bcode,$branchId,$courseID) + { + $this->db->select("T_Course_Fees_Details.ID as FeesID,if(substr(substr(T_Course_Fees_Details.sem_Year,-4),1,3) = 'sem',substr(sem_Year,-1),if(substr(substr(T_Course_Fees_Details.sem_Year,-5),1,4) = 'year',substr(T_Course_Fees_Details.sem_Year,-1),false)) as SemID,if(substr(substr(T_Course_Fees_Details.sem_Year,-4),1,3) = 'sem','SEM',if(substr(substr(T_Course_Fees_Details.sem_Year,-5),1,4) = 'year','YEAR',false)) as SubType,T_Course_Fees_Details.Sem_Year,if(T_Course_Fees_Details.ProgramType = 'Y001','SEM',if(ProgramType = 'P001','REG',if(ProgramType = 'P002','LAT','FALSE'))) as Type"); + $this->db->from('T_Students_Fees_Status'); + //$this->db->join('T_StudentDetails','T_Students_Fees_Status.StudentID=T_StudentDetails.StudentID'); + $this->db->join('T_Course_Fees_Details','T_Students_Fees_Status.FeesType=T_Course_Fees_Details.ID'); + $this->db->where('T_Students_Fees_Status.BatchCode',$bcode); + $this->db->where('T_Students_Fees_Status.BranchCode',$branchId); + $this->db->where('T_Students_Fees_Status.CourseID',$courseID['CourseID']); + $this->db->where('T_Students_Fees_Status.StudentID',$stuid); + $res = $this->db->get(); + return $res->result(); + } + + public function getUniversityDetials($UID,$branchId) + { + $this->db->select('UniversityID,UniversityName,MobileNumber,EmailID,Address'); + $this->db->from('T_UniversityMaster'); + $this->db->where('T_UniversityMaster.BranchCode',$branchId); + $this->db->where('T_UniversityMaster.IsActive',1); + $this->db->where('T_UniversityMaster.UniversityID',$UID['universityID']); + $res = $this->db->get(); + return $res->result(); + + } + + //Student Details with All Corresponding Semesters and Subjects + public function getStudentDetails($UID,$courseID,$branchId,$studentIDs) + { + + foreach($studentIDs as $key1 => $id) + { + foreach($id['FeeDetails'] as $key2 => $ind) + { + // Get Normel Semester + if(strcasecmp($ind['Type'],'sem') == 0 && strcasecmp($ind['SubType'],'sem') == 0 ) + { + + $sql = "SELECT T_SemSubMap_Child.SubjectID,T_SubjectMaster.SubjectCode,T_SubjectMaster.SubjectName,T_SemSubMap_Master.SemesterID,T_Batch_Schedule_Child.ScheduleDate,T_Batch_Schedule_Child.FromTime,T_Batch_Schedule_Child.ToTime FROM T_SemSubMap_Child + JOIN T_SubjectMaster on T_SemSubMap_Child.SubjectID = T_SubjectMaster.SubjectID + JOIN T_SemSubMap_Master on T_SemSubMap_Child.MapID = T_SemSubMap_Master.MapID and T_SemSubMap_Master.UniversityID = ? and T_SemSubMap_Master.CourseID = ? and T_SemSubMap_Master.SemesterID = ? and T_SemSubMap_Master.BranchCode = ? and T_SemSubMap_Child.IsActive = 1 + LEFT JOIN T_Batch_Schedule_Master on T_Batch_Schedule_Master.UniversityID = ? and T_Batch_Schedule_Master.CourseID = ? and T_Batch_Schedule_Master.BranchCode = ? + LEFT JOIN T_Batch_Schedule_Child on T_Batch_Schedule_Master.SchId = T_Batch_Schedule_Child.SchId and T_SemSubMap_Child.SubjectID = T_Batch_Schedule_Child.SubjectID and T_Batch_Schedule_Child.IsActive = 1 + order by T_SemSubMap_Master.SemesterID"; + $res = $this->db->query($sql,array($UID['universityID'],$courseID['CourseID'],$ind['SemID'],$branchId,$UID['universityID'],$courseID['CourseID'],$branchId)); + //$id['FeeDetails'][$key2] = $res->result(); + $in = $res->result(); + //array_push($id['FeeDetails'][$key2],$ind); + array_splice($id['FeeDetails'][$key2],0,6,$in); + $studentIDs['NUMTYPE'] = 'SEM'; + //return $ind; + } + else if(strcasecmp($ind['Type'],'sem') == 0 && strcasecmp($ind['SubType'],'year') == 0) + { + //GET Year Based Semester + if($ind['SemID'] == 1)//First Year + { + for($i = 1;$i <= 2; $i++) + { + $sql = "SELECT T_SemSubMap_Child.SubjectID,T_SubjectMaster.SubjectCode,T_SubjectMaster.SubjectName,T_SemSubMap_Master.SemesterID,T_Batch_Schedule_Child.ScheduleDate,T_Batch_Schedule_Child.FromTime,T_Batch_Schedule_Child.ToTime FROM T_SemSubMap_Child + JOIN T_SubjectMaster on T_SemSubMap_Child.SubjectID = T_SubjectMaster.SubjectID + JOIN T_SemSubMap_Master on T_SemSubMap_Child.MapID = T_SemSubMap_Master.MapID and T_SemSubMap_Master.UniversityID = ? and T_SemSubMap_Master.CourseID = ? and T_SemSubMap_Master.SemesterID = ? and T_SemSubMap_Master.BranchCode = ? and T_SemSubMap_Child.IsActive = 1 + LEFT JOIN T_Batch_Schedule_Master on T_Batch_Schedule_Master.UniversityID = ? and T_Batch_Schedule_Master.CourseID = ? and T_Batch_Schedule_Master.BranchCode = ? + LEFT JOIN T_Batch_Schedule_Child on T_Batch_Schedule_Master.SchId = T_Batch_Schedule_Child.SchId and T_SemSubMap_Child.SubjectID = T_Batch_Schedule_Child.SubjectID and T_Batch_Schedule_Child.IsActive = 1 + order by T_SemSubMap_Master.SemesterID"; + $res = $this->db->query($sql,array($UID['universityID'],$courseID['CourseID'],$i,$branchId,$UID['universityID'],$courseID['CourseID'],$branchId)); + //$id['FeeDetails'][$key2] = $res->result(); + $in[] = $res->result(); + //array_push($id['FeeDetails'][$key2],$ind); + + + } + array_splice($id['FeeDetails'][$key2],0,6,$in); + + } + + else if($ind['SemID'] == 2)//Sec Year + { + for($j = 3;$j <= 4; $j++) + { + $sql = "SELECT T_SemSubMap_Child.SubjectID,T_SubjectMaster.SubjectCode,T_SubjectMaster.SubjectName,T_SemSubMap_Master.SemesterID,T_Batch_Schedule_Child.ScheduleDate,T_Batch_Schedule_Child.FromTime,T_Batch_Schedule_Child.ToTime FROM T_SemSubMap_Child + JOIN T_SubjectMaster on T_SemSubMap_Child.SubjectID = T_SubjectMaster.SubjectID + JOIN T_SemSubMap_Master on T_SemSubMap_Child.MapID = T_SemSubMap_Master.MapID and T_SemSubMap_Master.UniversityID = ? and T_SemSubMap_Master.CourseID = ? and T_SemSubMap_Master.SemesterID = ? and T_SemSubMap_Master.BranchCode = ? and T_SemSubMap_Child.IsActive = 1 + LEFT JOIN T_Batch_Schedule_Master on T_Batch_Schedule_Master.UniversityID = ? and T_Batch_Schedule_Master.CourseID = ? and T_Batch_Schedule_Master.BranchCode = ? + LEFT JOIN T_Batch_Schedule_Child on T_Batch_Schedule_Master.SchId = T_Batch_Schedule_Child.SchId and T_SemSubMap_Child.SubjectID = T_Batch_Schedule_Child.SubjectID and T_Batch_Schedule_Child.IsActive = 1 + order by T_SemSubMap_Master.SemesterID"; + $res = $this->db->query($sql,array($UID['universityID'],$courseID['CourseID'],$j,$branchId,$UID['universityID'],$courseID['CourseID'],$branchId)); + //$id['FeeDetails'][$key2] = $res->result(); + $in[] = $res->result(); + //array_push($id['FeeDetails'][$key2],$ind); + + + } + array_splice($id['FeeDetails'][$key2],0,6,$in); + } + + + else if($ind['SemID'] == 3) + { + for($k = 5;$k <= 6; $k++) + { + $sql = "SELECT T_SemSubMap_Child.SubjectID,T_SubjectMaster.SubjectCode,T_SubjectMaster.SubjectName,T_SemSubMap_Master.SemesterID,T_Batch_Schedule_Child.ScheduleDate,T_Batch_Schedule_Child.FromTime,T_Batch_Schedule_Child.ToTime FROM T_SemSubMap_Child + JOIN T_SubjectMaster on T_SemSubMap_Child.SubjectID = T_SubjectMaster.SubjectID + JOIN T_SemSubMap_Master on T_SemSubMap_Child.MapID = T_SemSubMap_Master.MapID and T_SemSubMap_Master.UniversityID = ? and T_SemSubMap_Master.CourseID = ? and T_SemSubMap_Master.SemesterID = ? and T_SemSubMap_Master.BranchCode = ? and T_SemSubMap_Child.IsActive = 1 + LEFT JOIN T_Batch_Schedule_Master on T_Batch_Schedule_Master.UniversityID = ? and T_Batch_Schedule_Master.CourseID = ? and T_Batch_Schedule_Master.BranchCode = ? + LEFT JOIN T_Batch_Schedule_Child on T_Batch_Schedule_Master.SchId = T_Batch_Schedule_Child.SchId and T_SemSubMap_Child.SubjectID = T_Batch_Schedule_Child.SubjectID and T_Batch_Schedule_Child.IsActive = 1 + order by T_SemSubMap_Master.SemesterID"; + $res = $this->db->query($sql,array($UID['universityID'],$courseID['CourseID'],$k,$branchId,$UID['universityID'],$courseID['CourseID'],$branchId)); + //$id['FeeDetails'][$key2] = $res->result(); + $in[] = $res->result(); + //array_push($id['FeeDetails'][$key2],$ind); + + + } + array_splice($id['FeeDetails'][$key2],0,6,$in); + } + + + else if($ind['SemID'] == 4) + { + for($l = 7;$l <= 8; $l++) + { + $sql = "SELECT T_SemSubMap_Child.SubjectID,T_SubjectMaster.SubjectCode,T_SubjectMaster.SubjectName,T_SemSubMap_Master.SemesterID,T_Batch_Schedule_Child.ScheduleDate,T_Batch_Schedule_Child.FromTime,T_Batch_Schedule_Child.ToTime FROM T_SemSubMap_Child + JOIN T_SubjectMaster on T_SemSubMap_Child.SubjectID = T_SubjectMaster.SubjectID + JOIN T_SemSubMap_Master on T_SemSubMap_Child.MapID = T_SemSubMap_Master.MapID and T_SemSubMap_Master.UniversityID = ? and T_SemSubMap_Master.CourseID = ? and T_SemSubMap_Master.SemesterID = ? and T_SemSubMap_Master.BranchCode = ? and T_SemSubMap_Child.IsActive = 1 + LEFT JOIN T_Batch_Schedule_Master on T_Batch_Schedule_Master.UniversityID = ? and T_Batch_Schedule_Master.CourseID = ? and T_Batch_Schedule_Master.BranchCode = ? + LEFT JOIN T_Batch_Schedule_Child on T_Batch_Schedule_Master.SchId = T_Batch_Schedule_Child.SchId and T_SemSubMap_Child.SubjectID = T_Batch_Schedule_Child.SubjectID and T_Batch_Schedule_Child.IsActive = 1 + order by T_SemSubMap_Master.SemesterID"; + $res = $this->db->query($sql,array($UID['universityID'],$courseID['CourseID'],$l,$branchId,$UID['universityID'],$courseID['CourseID'],$branchId)); + //$id['FeeDetails'][$key2] = $res->result(); + $in[] = $res->result(); + //array_push($id['FeeDetails'][$key2],$ind); + + + } + array_splice($id['FeeDetails'][$key2],0,6,$in); + } + + $studentIDs['NUMTYPE'] = 'YEAR'; + } + else if(strcasecmp($ind['Type'],'REG') == 0) + { + //Get Regular(All Semester) + for($m = 1;$m <= 8; $m++) + { + $sql = "SELECT T_SemSubMap_Child.SubjectID,T_SubjectMaster.SubjectCode,T_SubjectMaster.SubjectName,T_SemSubMap_Master.SemesterID,T_Batch_Schedule_Child.ScheduleDate,T_Batch_Schedule_Child.FromTime,T_Batch_Schedule_Child.ToTime FROM T_SemSubMap_Child + JOIN T_SubjectMaster on T_SemSubMap_Child.SubjectID = T_SubjectMaster.SubjectID + JOIN T_SemSubMap_Master on T_SemSubMap_Child.MapID = T_SemSubMap_Master.MapID and T_SemSubMap_Master.UniversityID = ? and T_SemSubMap_Master.CourseID = ? and T_SemSubMap_Master.SemesterID = ? and T_SemSubMap_Master.BranchCode = ? and T_SemSubMap_Child.IsActive = 1 + LEFT JOIN T_Batch_Schedule_Master on T_Batch_Schedule_Master.UniversityID = ? and T_Batch_Schedule_Master.CourseID = ? and T_Batch_Schedule_Master.BranchCode = ? + LEFT JOIN T_Batch_Schedule_Child on T_Batch_Schedule_Master.SchId = T_Batch_Schedule_Child.SchId and T_SemSubMap_Child.SubjectID = T_Batch_Schedule_Child.SubjectID and T_Batch_Schedule_Child.IsActive = 1 + order by T_SemSubMap_Master.SemesterID"; + $res = $this->db->query($sql,array($UID['universityID'],$courseID['CourseID'],$m,$branchId,$UID['universityID'],$courseID['CourseID'],$branchId)); + //$id['FeeDetails'][$key2] = $res->result(); + $in[] = $res->result(); + //array_push($id['FeeDetails'][$key2],$ind); + + + } + array_splice($id['FeeDetails'][$key2],0,6,$in); + $studentIDs['NUMTYPE'] = 'REG'; + } + else if(strcasecmp($ind['Type'],'LAT') == 0) + { + //Get Later Entry all semester except 1 and 2 + for($i = 3;$i <= 8; $i++) + { + $sql = "SELECT T_SemSubMap_Child.SubjectID,T_SubjectMaster.SubjectCode,T_SubjectMaster.SubjectName,T_SemSubMap_Master.SemesterID,T_Batch_Schedule_Child.ScheduleDate,T_Batch_Schedule_Child.FromTime,T_Batch_Schedule_Child.ToTime FROM T_SemSubMap_Child + JOIN T_SubjectMaster on T_SemSubMap_Child.SubjectID = T_SubjectMaster.SubjectID + JOIN T_SemSubMap_Master on T_SemSubMap_Child.MapID = T_SemSubMap_Master.MapID and T_SemSubMap_Master.UniversityID = ? and T_SemSubMap_Master.CourseID = ? and T_SemSubMap_Master.SemesterID = ? and T_SemSubMap_Master.BranchCode = ? and T_SemSubMap_Child.IsActive = 1 + LEFT JOIN T_Batch_Schedule_Master on T_Batch_Schedule_Master.UniversityID = ? and T_Batch_Schedule_Master.CourseID = ? and T_Batch_Schedule_Master.BranchCode = ? + LEFT JOIN T_Batch_Schedule_Child on T_Batch_Schedule_Master.SchId = T_Batch_Schedule_Child.SchId and T_SemSubMap_Child.SubjectID = T_Batch_Schedule_Child.SubjectID and T_Batch_Schedule_Child.IsActive = 1 + order by T_SemSubMap_Master.SemesterID"; + $res = $this->db->query($sql,array($UID['universityID'],$courseID['CourseID'],$i,$branchId,$UID['universityID'],$courseID['CourseID'],$branchId)); + //$id['FeeDetails'][$key2] = $res->result(); + $in[] = $res->result(); + //array_push($id['FeeDetails'][$key2],$ind); + + + } + array_splice($id['FeeDetails'][$key2],0,6,$in); + $studentIDs['NUMTYPE'] = 'LAT'; + } + + + } + array_splice($studentIDs[$key1]['FeeDetails'],0,10,$id['FeeDetails']) ; + + } + //print_r($studentIDs);//die(); + return $studentIDs; + } + + + + +} \ No newline at end of file diff --git a/Apollo/assets/js/config.constant.js b/Apollo/assets/js/config.constant.js index bed0c4f3..2866516f 100755 --- a/Apollo/assets/js/config.constant.js +++ b/Apollo/assets/js/config.constant.js @@ -173,6 +173,8 @@ app.constant('JS_REQUIRES', { 'sessionScheduleCtrl':'assets/js/controllers/sessionScheduleCtrl.js', // generate hall ticket 'generateHallTicketCtrl':'assets/js/controllers/generateHallTicketCtrl.js', + // generate hall ticket + 'semcoursemapCtrl':'assets/js/controllers/semcoursemapCtrl.js', //*** Filters diff --git a/Apollo/assets/js/config.router.js b/Apollo/assets/js/config.router.js index 4d46ffd9..e4565fd0 100755 --- a/Apollo/assets/js/config.router.js +++ b/Apollo/assets/js/config.router.js @@ -643,6 +643,37 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com resolve: loadSequence('ui.select','report_balfeeCtrl','ngTable', 'ladda', 'angular-ladda'), title: 'Balance Fee Report', + }).state('app.hallTicket', { + url: '/hallticket', + template: '
HALLTICKET
', + title: 'HallTicket', + ncyBreadcrumb: { + label: 'HallTicket' + } + }).state('app.hallTicket.semCourseMap', { + url: '/semcoursemap', + templateUrl: "assets/views/hallticket/semcoursemap.html", + title: ' Course Semester Mapping', + resolve: loadSequence('ladda', 'angular-ladda', 'semcoursemapCtrl','ngTable','ui.select','spin', 'ui.mask'), + ncyBreadcrumb: { + label: ' Course Semester Mapping' + } + }).state('app.hallTicket.batchSchedule', { + url: '/batchchedule', + templateUrl: "assets/views/hallticket/batchchedule.html", + title: 'Batch Schedule', + resolve: loadSequence('ladda', 'angular-ladda', 'semcoursemapCtrl','ngTable','ui.select','spin', 'ui.mask'), + ncyBreadcrumb: { + label: ' Batch Schedule' + } + }).state('app.hallTicket.generateHallTicket', { + url: '/generatehallticket', + templateUrl: "assets/views/hallticket/generatehallticket.html", + title: 'Generate HallTicket', + resolve: loadSequence('ladda', 'angular-ladda', 'generateHallTicketCtrl','ngTable','ui.select','spin', 'ui.mask'), + ncyBreadcrumb: { + label: 'Generate HallTicket' + } }); // $locationProvider.html5Mode(true); diff --git a/Apollo/assets/js/controllers/generateHallTicketCtrl.js b/Apollo/assets/js/controllers/generateHallTicketCtrl.js index 40a40307..390f1415 100755 --- a/Apollo/assets/js/controllers/generateHallTicketCtrl.js +++ b/Apollo/assets/js/controllers/generateHallTicketCtrl.js @@ -3,17 +3,29 @@ * controllers for ng-table * Simple table with sorting and filtering on AngularJS */ -app.controller('generateHallTicketCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", function ($scope,$rootScope,toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state) { +app.controller('generateHallTicketCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state","$modal","$log", function ($scope,$rootScope,toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state,$modal,$log) { $scope.myModel = { - "studentName": "", - "mobileNumber": "", "universityName":"", - "courseName":"" + "courseName":"", + "batchName":"" }; + + $scope.pdfModel = { + "universityDetails":"", + "studentDetails":"", + "batchDetails":"", + "courseDetails":"", + "centerDetails":"", + "semDataType":"" + }; $rootScope.userType = JSON.parse(localStorage.getItem('localObj')).localType; +$scope.existSemesterSubjectMapDetails = [{"UniversityID":"2","UniversityName":"TWO","CourseName":"CNAME"},{"UniversityID":"3","UniversityName":"TWO","CourseName":"CNAME"},{"UniversityID":"4","UniversityName":"TWO","CourseName":"CNAME"}]; - +$scope.isTblShow = false; +$scope.isLoader = false; +$scope.isLoaderShow = false; +$scope.isLoaderTxt = "Loading..."; // sorting function for table params $scope.sort = function(keyname){ @@ -26,23 +38,26 @@ app.controller('generateHallTicketCtrl', ["$scope","$rootScope","toaster", "$fil * created by kms * */ $scope.init = function () { + var getUniv = { method: 'POST', - url: apiPoint.url + 'getUniversityCourseForFees/', + url: apiPoint.url + 'getUniversityCourseDetails/', headers: { 'Content-Type': 'application/json' }, data: { - requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID + requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID, + branchId:JSON.parse(localStorage.getItem('localObj')).localBranchID } }; $http(getUniv).then(function (response) { if (response.data.status==200 && response.data.universityStatus) { - $scope.university=response.data.univerSityDetails; - + $scope.university = response.data.univerSityDetails; + $scope.centers = response.data.centerDetails; + //console.log( $scope.university); } else { - $scope.university=""; + $scope.university = ""; } }); @@ -54,12 +69,23 @@ app.controller('generateHallTicketCtrl', ["$scope","$rootScope","toaster", "$fil * */ $scope.studentInfo=""; $scope.getStudentDetails = function (form,myModel) { + if(myModel.universityName == null || myModel.universityName == '' || myModel.universityName == undefined){ - $scope.univId = ""; - } - else{ - $scope.univId = myModel.universityName.universityID; - } + swal('Select University','','warning'); + return false; + } + + if(myModel.courseName == '' || myModel.courseName == null || myModel.courseName == undefined){ + swal('Select Course','','warning'); + return false; + } + + if(myModel.batchName == null || myModel.batchName == '' || myModel.batchName == undefined){ + swal('Select Batch','','warning'); + return false; + } + + var firstError = null; if (form.$invalid) { @@ -77,63 +103,250 @@ app.controller('generateHallTicketCtrl', ["$scope","$rootScope","toaster", "$fil angular.element('.ng-invalid[name=' + firstError + ']').focus(); // swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error"); } else { - var getStudent = { + $scope.selectedStudentsID = []; + $scope.isLoaderShow = true; + $scope.myModel.all = false; + $scope.isTblShow = false; + var university = myModel.universityName; + var course = myModel.courseName; + var batch = myModel.batchName; + var getStudents = { method: 'POST', - url: apiPoint.url + 'getStudentListFees/', + url: apiPoint.url + 'getStudentListForHallTicket/', headers: { 'Content-Type': 'application/json' }, data: { - studentName: myModel.studentName, - mobileNumber: myModel.mobileNumber, - university: $scope.univId, - course:myModel.courseName, + university: university, + course:course, + batch:batch, requestedtBy: JSON.parse(localStorage.getItem('localObj')).localUserID, branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID, requestedDept: JSON.parse(localStorage.getItem('localObj')).localType, } }; - $http(getStudent).then(function (response) { - if (response.data.status==200 && response.data.studentStatus) { - $scope.studentInfo=response.data.details; + $http(getStudents).then(function (response) { + if (response.data.status == 200 && response.data.studentStatus) { + $scope.studentInfo = response.data.studentDetails; + $scope.isLoaderShow = false; + $scope.isTblShow = true; + // console.log('API'); + //console.log($scope.studentInfo); - } else { + } + else + { $scope.studentInfo=""; - - } - }); + $scope.isLoaderShow = true; + $scope.isTblShow = false; + $scope.isLoaderTxt = "No Records Found"; + } + },function(error){ + $scope.isLoaderShow = true; + $scope.isTblShow = false; + $scope.isLoaderTxt = "No Records Found"; + + }); } } - /* - * get course subjects details - * created by kms - * */ - $scope.getSubjectDetails = function (universityID,courseID) { - - var getsubject = { + + + $scope.selectedStudentsID = []; + $scope.isClick = function(e) + { + + //console.log(e.target.id); + + var ide = e.target; + var val = (ide.checked ? true : false); + var sid = e.target.id; + angular.forEach($scope.studentInfo,function(value,key){ + if(sid == value.StudentID) + { + sid = value; + } + }); + + var pos = $scope.selectedStudentsID.indexOf(sid); + //alert(val); + if(val) + { + if( pos == -1) + { + //console.log("PUSH"); + $scope.selectedStudentsID.push(sid); + } + + } + else + { + //console.log("POP"); + $scope.selectedStudentsID.splice(pos,1); + } + + //console.log($scope.selectedStudentsID); + + } + + + $scope.isCheckAll = function(e) + { + var val = (e.target.checked ? true : false); + //$scope.selectedStudentsID = []; + if(val) + { + var len = $scope.studentInfo.length; + var i = 0; + for(i=0;i + b.fa { + display: inline-block; + border-radius: 60px; + box-shadow: 0px 0px 2px #FF6600; + padding: 0.5em 0.6em; + + + } + b.fa1 { + display: inline-block; + border-radius: 60px; + box-shadow: 0px 0px 2px green; + padding: 0.5em 0.6em; + + + } + a { + color: #007AFF; + } + + + +
+
+
+ +

{{ mainTitle }}

+ + Generate Halltickets for Student + +
+
+
+
+ + + +
+ + +
+
+
+ Search +
+ +
+ + + + +
+
+ + + + +
+ +
+ + + + +
+ +
+ +
+ +
+ + +
+
+ +
+ + + + +
+ +
+ +
+ + +
+ +
+ + + + +
+ +
+
+

{{isLoaderTxt}}

+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Student Name + + Mobile No + + EmailID + +
{{p.Firstname}}{{p.Lastname}}{{p.MobileNumber}}{{p.EmailID}}
+ + + +
+
+
+
+
+
+ + + + + + + + + diff --git a/Apollo/assets/views/hallticket/hallTicketPDF.html b/Apollo/assets/views/hallticket/hallTicketPDF.html new file mode 100644 index 00000000..120cd44c --- /dev/null +++ b/Apollo/assets/views/hallticket/hallTicketPDF.html @@ -0,0 +1,163 @@ + + + +
+ +
+
+
+ +
+ +
+ +
+
+ + +
+
+ + + + + +
+ + + +
+ + + + + + + +
+ +
+ Not Available + + +

{{universityNamePDF}}

{{universityAddressPDF}}
{{universityEmailPDF}}
+
+ + + +
+ + + + + + + + +
ADMIT CARD   :   {{courseNamePDF}}    EXAMINATION   {{batchNamePDF}}
Not Available
Reg No :{{studentObj.EnrollmentID}}
Name : {{studentObj.Firstname}} {{studentObj.Lastname}}
Centre:      {{centerNamePDF}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Sem/
Year
Subject Code
Subject Name
Date
From Time
To Time
Invigi.
Sign
0{{sub.SemesterID}}{{sub.SubjectCode}}{{sub.SubjectName}}{{sub.ScheduleDate | date: "dd-MM-y" }}{{sub.FromTime}}{{sub.ToTime}} 
0{{sub.SemesterID}}{{sub.SubjectCode}}{{sub.SubjectName}}{{sub.ScheduleDate | date: "dd-MM-y" }}{{sub.FromTime}}{{sub.ToTime}} 
0{{sub.SemesterID}}{{sub.SubjectCode}}{{sub.SubjectName}}{{sub.ScheduleDate | date: "dd-MM-y" }}{{sub.FromTime}}{{sub.ToTime}} 
0{{sub.SemesterID}}{{sub.SubjectCode}}{{sub.SubjectName}}{{sub.ScheduleDate | date: "dd-MM-y" }}{{sub.FromTime}}{{sub.ToTime}} 
0{{sub.SemesterID}}{{sub.SubjectCode}}{{sub.SubjectName}}{{sub.ScheduleDate | date: "dd-MM-y" }}{{sub.FromTime}}{{sub.ToTime}} 
0{{sub.SemesterID}}{{sub.SubjectCode}}{{sub.SubjectName}}{{sub.ScheduleDate | date: "dd-MM-y" }}{{sub.FromTime}}{{sub.ToTime}} 
0{{sub.SemesterID}}{{sub.SubjectCode}}{{sub.SubjectName}}{{sub.ScheduleDate | date: "dd-MM-y" }}{{sub.FromTime}}{{sub.ToTime}} 
0{{sub.SemesterID}}{{sub.SubjectCode}}{{sub.SubjectName}}{{sub.ScheduleDate | date: "dd-MM-y" }}{{sub.FromTime}}{{sub.ToTime}} 
0{{sub.SemesterID}}{{sub.SubjectCode}}{{sub.SubjectName}}{{sub.ScheduleDate | date: "dd-MM-y" }}{{sub.FromTime}}{{sub.ToTime}} 
0{{sub.SemesterID}}{{sub.SubjectCode}}{{sub.SubjectName}}{{sub.ScheduleDate | date: "dd-MM-y" }}{{sub.FromTime}}{{sub.ToTime}} 
0{{sub.SemesterID}}{{sub.SubjectCode}}{{sub.SubjectName}}{{sub.ScheduleDate | date: "dd-MM-y" }}{{sub.FromTime}}{{sub.ToTime}} 
0{{sub.SemesterID}}{{sub.SubjectCode}}{{sub.SubjectName}}{{sub.ScheduleDate | date: "dd-MM-y" }}{{sub.FromTime}}{{sub.ToTime}} 
0{{sub.SemesterID}}{{sub.SubjectCode}}{{sub.SubjectName}}{{sub.ScheduleDate | date: "dd-MM-y" }}{{sub.FromTime}}{{sub.ToTime}} 
+ +
+
+ +

+

    +
  • Without Identification Card Candidates shallnot be Allowed to write examintaion.
  • +
  • For further instructions refer to the faceing sheet of the Answer book before writing examintaion.
  • +
  • Carrying Mobile Phone into the examintaion hall is strictly prohibited.
  • +
  • Attend the examintaion as per mentioned above.
  • + +
+

+

 

+
+
+ Signature of Student +
+
Controller of Examintaion
+
+
+
+
+ + + +
+ + +
+ +
+ +
+
+
+ + + diff --git a/Apollo/assets/views/hallticket/semcoursemap.html b/Apollo/assets/views/hallticket/semcoursemap.html new file mode 100644 index 00000000..3278290d --- /dev/null +++ b/Apollo/assets/views/hallticket/semcoursemap.html @@ -0,0 +1,561 @@ + + +
+
+
+ +

{{ mainTitle }}

+ + Allocate Courses to Corresponding Semesters + +
+
+
+
+ + + +
+ + + +
+
+
+

{{semDetailsLoadingTxt}}

+
+
+ +
+
+
+ +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
University ID + + University Name + + Course Name + + Action +
{{p.UniversityID}}{{p.UniversityName}}{{p.CourseName}}({{p.CourseCode}}) + +
+
+
+ + Semester Details + + +
+
+

{{viewPageSemDropDownShowLoadingTxt}}

+
+ +
+
+ + +
+ +
+ + + + + {{$item.SubjectName}} + + + {{x.SubjectName}} + + + + +
+ +
+ + + + + {{$item.SubjectName}} + + + {{x.SubjectName}} + + + + +
+
+
+
+
+ +
+ +
+ + + + + {{$item.SubjectName}} + + + {{x.SubjectName}} + + + + +
+ + + + + + +
+ + + + + {{$item.SubjectName}} + + + {{x.SubjectName}} + + + + +
+
+
+
+
+ +
+ +
+ + + + + {{$item.SubjectName}} + + + {{x.SubjectName}} + + + + +
+ +
+ + + + + {{$item.SubjectName}} + + + {{x.SubjectName}} + + + + +
+
+
+
+
+ +
+ +
+ + + + + {{$item.SubjectName}} + + + {{x.SubjectName}} + + + + +
+ +
+ + + + + {{$item.SubjectName}} + + + {{x.SubjectName}} + + + + +
+ +
+
+
+
+
+ + + + +
+
+ +
+
+
+ + + +
+ +
+ +
+
+ +
+
+
+ Search +
+ +
+ + + + +
+
+ + + + + + + {{$item.CourseName}} + + + {{x.CourseName}} + + + + +
+
+
+ + +
+ + +
+
+
+
+

Loading...

+
+ +
+ +
+ +
+ +
+ + + + + {{$item.SubjectName}} + + + {{x.SubjectName}} + + + + +
+ +
+ + + + + {{$item.SubjectName}} + + + {{x.SubjectName}} + + + + +
+
+
+ +
+
+ +
+ +
+ + + + + {{$item.SubjectName}} + + + {{x.SubjectName}} + + + + +
+ + + + + + +
+ + + + + {{$item.SubjectName}} + + + {{x.SubjectName}} + + + + +
+
+
+ +
+
+ +
+ +
+ + + + + {{$item.SubjectName}} + + + {{x.SubjectName}} + + + + +
+ +
+ + + + + {{$item.SubjectName}} + + + {{x.SubjectName}} + + + + +
+
+
+ +
+
+ +
+ +
+ + + + + {{$item.SubjectName}} + + + {{x.SubjectName}} + + + + +
+ +
+ + + + + {{$item.SubjectName}} + + + {{x.SubjectName}} + + + + +
+
+
+ +
+
+
+ + +
+
+ + +
+ + + + + +
+ + + +
+ + + + + + + diff --git a/Apollo/assets/views/partials/nav.html b/Apollo/assets/views/partials/nav.html index e3e185b6..dd96ee81 100755 --- a/Apollo/assets/views/partials/nav.html +++ b/Apollo/assets/views/partials/nav.html @@ -672,6 +672,38 @@ + +
  • + +
    +
    + +
    +
    + HALLTICKET +
    +
    +
    + + + +
  • @@ -832,6 +864,38 @@
  • + +
  • + +
    +
    + +
    +
    + HALLTICKET +
    +
    +
    + + + +