diff --git a/Apollo/api/application/controllers/HallTickets_Controller.php b/Apollo/api/application/controllers/HallTickets_Controller.php index 33906862..5a9be8a7 100644 --- a/Apollo/api/application/controllers/HallTickets_Controller.php +++ b/Apollo/api/application/controllers/HallTickets_Controller.php @@ -16,7 +16,7 @@ class HallTickets_Controller extends REST_Controller { function __construct() { - // Construct the parent class + // Construct the parent class parent::__construct(); // Configure limits on our controller methods @@ -320,13 +320,27 @@ class HallTickets_Controller extends REST_Controller { $branchId = $this->post('branchId'); $Cdate = new DateTime('now',new DateTimeZone('Asia/Kolkata')); $CreatedOn = $Cdate->format('Y-m-d H:i:s'); -/////////check semcoursemapping//// - // $data['subjectDetails'] = $this->Hallticket_model->getSubjectDetails($universityID,$tempCourseArray,$branchId); - $data['subjectDetails'] = $this->Hallticket_model->getExistDetailsfileupload($university,$courseArray,$branchId); - // print_r( $data['subjectDetails']); - if($data['subjectDetails'] == 1 ) + $fileArray = array(); + foreach($filedetails as $filedetailsarray) + { + $fileArray[]=$filedetailsarray['SubjectID']; + } + + $data['subjectDetails'] = $this->Hallticket_model->getExistDetailsfileupload($university,$courseArray,$branchId); + // print_r( $data['subjectDetails']); + if($data['subjectDetails'] == 1 ) { - foreach($courseArray as $CourseDatialArray) + + $data['SubjectMappingDetails'] = $this->Hallticket_model->getSubjectMappingDetails($university,$courseArray,$branchId); + $maparray=array(); + foreach ( $data['SubjectMappingDetails'] as $object) + { + $maparray[]=$object->SubjectCode; + } + if ($fileArray == $maparray) + { + + foreach($courseArray as $CourseDatialArray) { $course=$CourseDatialArray; $schedulemaster = array('UniversityID'=>$university,'CourseID'=>$course,'BranchCode'=>$branchId,'CreatedBy'=>$requestedBy,'CreatedOn'=>$CreatedOn); @@ -355,28 +369,35 @@ class HallTickets_Controller extends REST_Controller { 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); - } + } + } + else + { + $this->response([ + 'message' => 'Records Do Not Match With Mapped Subjects!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); + } } // else if($data['subjectDetails'] == 0) else { $this->response([ - 'message' => 'Please Mapping the course supject!', + 'message' => ' Course Mapping for the Subject Not Found !', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); } - // else{ - - // $this->response([ - // 'message' => 'No records found!', - // 'status' => REST_Controller::HTTP_NOT_FOUND - // ], REST_Controller::HTTP_NOT_FOUND); - - // } -///////////////////// - + + + + + + + + + } public function SaveAllBatchSchedule_post() diff --git a/Apollo/api/application/models/Hallticket_model.php b/Apollo/api/application/models/Hallticket_model.php index a11cd9b0..4c17cf0e 100644 --- a/Apollo/api/application/models/Hallticket_model.php +++ b/Apollo/api/application/models/Hallticket_model.php @@ -10,7 +10,7 @@ class Hallticket_model extends CI_Model { - + /* * get university details * created by velz @@ -122,7 +122,7 @@ class Hallticket_model extends CI_Model and bsm.CourseID=semmaster.CourseID LEFT JOIN T_Batch_Schedule_Child bsc ON bsc.SchId = bsm.SchId and bsc.SubjectID=semchild.SubjectID LEFT JOIN T_SubjectMaster sm ON sm.SubjectID=semchild.SubjectID -WHERE semchild.isActive = '1' and bsm.SchId='".$mapid."' +WHERE semchild.isActive = '1' and bsm.SchId='".$mapid."' group by semchild.SubjectID,semchild.MapID"; $b=$this->db->query($sql); //print_r($b); @@ -135,8 +135,8 @@ group by semchild.SubjectID,semchild.MapID"; $this->db->select('T_Batch_Schedule_Child.SchId,T_Batch_Schedule_Child.SubjectID,T_Batch_Schedule_Child.ScheduleDate,T_Batch_Schedule_Child.FromTime,T_Batch_Schedule_Child.ToTime,T_Batch_Schedule_Child.SchChildId,T_Batch_Schedule_Child.SchId'); $this->db->from('T_Batch_Schedule_Master SCM'); $this->db->join('T_Batch_Schedule_Child','T_Batch_Schedule_Child.SchId = SCM.SchId'); - //$this->db->where('SCM.BranchCode',$branchcode); - // $this->db->where('T_Batch_Schedule_Child.SchId',$mapid); + $this->db->where('SCM.BranchCode',$branchcode); + $this->db->where('T_Batch_Schedule_Child.SchId',$mapid); $this->db->where('T_Batch_Schedule_Child.SubjectID',$row->SubjectID); $existsheduledetails = $this->db->get(); //print_r($existsheduledetails); @@ -200,16 +200,16 @@ group by semchild.SubjectID,semchild.MapID"; public function getExistDetailsfileupload($universityID,$courseIDS,$branchId) { -// print_r($courseIDS); -// echo $universityID; + $i=0; foreach($courseIDS as $c) { // $tempCourseArray= $c['CourseID']; - $this->db->select ('count(*) as count'); + $this->db->select ('count(*) as count,T_SemSubMap_Child.SubjectID'); $this->db->from('T_SemSubMap_Master'); + $this->db->join('T_SemSubMap_Child','T_SemSubMap_Child.MapID=T_SemSubMap_Master.MapID'); $this->db->where('UniversityID',$universityID); $this->db->where('CourseID',$c); $result = $this->db->get(); @@ -235,6 +235,35 @@ public function getExistDetailsfileupload($universityID,$courseIDS,$branchId) * @params university id and CourseID * created by Bala * */ +public function getSubjectMappingDetails($universityID,$courseIDS,$branchId) + { + + + + foreach($courseIDS as $c) + { + + // $tempCourseArray= $c['CourseID']; + + $this->db->select ('T_SubjectMaster.SubjectCode'); + $this->db->from('T_SemSubMap_Master'); + $this->db->join('T_SemSubMap_Child','T_SemSubMap_Child.MapID=T_SemSubMap_Master.MapID'); + $this->db->join('T_SubjectMaster','T_SubjectMaster.SubjectID=T_SemSubMap_Child.SubjectID'); + $this->db->where('T_SemSubMap_Master.UniversityID',$universityID); + $this->db->where('T_SemSubMap_Master.CourseID',$c); + $this->db->where('T_SubjectMaster.BranchCode',$branchId); + $result = $this->db->get(); + + + } + return $result->result(); + + } + /* + * check existing data,only batchschedule. + * @params university id and CourseID + * created by Bala + * */ public function getExistDetails($universityID,$courseIDS,$branchId) { diff --git a/Apollo/assets/js/controllers/entrycorrectionCtrl.js b/Apollo/assets/js/controllers/entrycorrectionCtrl.js index 63cdf1a3..1f08ced5 100644 --- a/Apollo/assets/js/controllers/entrycorrectionCtrl.js +++ b/Apollo/assets/js/controllers/entrycorrectionCtrl.js @@ -146,6 +146,10 @@ $scope.universitySearchData = ''; $scope.OpenWindowStatus = false; $scope.editId = -1; + $scope.courselist =''; + $scope.loadfee=''; + $scope.feecheck=false; + $scope.setEditId = function (P) { //alert(JSON.stringify(P)); @@ -173,11 +177,16 @@ $scope.universitySearchData = ''; $scope.feeInfo=response.data.details; console.log($scope.feeInfo); $scope.editId = P.ID; + $scope.courselist =true; + $scope.feecheck=false; + } else { $scope.feeInfo=""; $scope.loadfee = "No Records Found"; - + $scope.courselist =false; + $scope.feecheck=true; + $scope.editId = P.ID; } }); diff --git a/Apollo/assets/js/controllers/schCtrl.js b/Apollo/assets/js/controllers/schCtrl.js index 8f5bd0a3..bacbd138 100644 --- a/Apollo/assets/js/controllers/schCtrl.js +++ b/Apollo/assets/js/controllers/schCtrl.js @@ -14,7 +14,7 @@ app.controller('schCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableP $scope.myModelAdd = { "date": "", - "periodStart": "", + "periodStart": "", "periodEnd":"", }; @@ -384,7 +384,7 @@ $scope.UploadFileData = function (FileDetails,myModel,courseDetails) { swal("", "Saved Successfully", "success"); $state.go($state.current, {}, {reload: true}); } else { - swal("", "Please Mapping the course supject", "error"); + swal("",response.data.message, "error"); $state.go($state.current, {}, {reload: true}); } },function(error){ diff --git a/Apollo/assets/js/controllers/studentCtrl.js b/Apollo/assets/js/controllers/studentCtrl.js index 368406f3..9efa8d26 100755 --- a/Apollo/assets/js/controllers/studentCtrl.js +++ b/Apollo/assets/js/controllers/studentCtrl.js @@ -721,12 +721,15 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", $scope.editId = -1; $scope.editCourseId = -1; $scope.setEditId = function (unique_id, id) { + + // alert() $scope.editId = unique_id; $scope.editCourseId = -1; $scope.studentViewPage = -1; } $scope.setEditCourseId = function (unique_id,id) { + $scope.list = false; $scope.getStudentCourseList(id); $scope.currentStudentId = id; @@ -837,6 +840,8 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", // get Student Course List $scope.getStudentCourseList = function (studentId) { + + console.log('in') $scope.courseEditLoading = true; $scope.list = true; $scope.courseEdit = false; @@ -1740,11 +1745,15 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl $scope.editId = -1; $scope.editCourseId = -1; $scope.setEditId = function (uniqe_id ,id) { + + // alert() $scope.editId = uniqe_id; $scope.editCourseId = -1; } $scope.setEditCourseId = function (uniqe_id ,id) { + + //alert('1'); $scope.list = false; $scope.getStudentCourseList(id); $scope.currentStudentId = id; @@ -1752,6 +1761,7 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl $scope.editCourseId = uniqe_id; $scope.editId = -1; $scope.courseEditLoading = true; + $scope.courselist = true; } @@ -1879,6 +1889,9 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl $scope.studentCourseList = response.data.course_details; // $scope.stucour = $scope.studentCourse[0]; } else { + + $scope.courselist = false; + $scope.courseEditLoading=''; } }); } diff --git a/Apollo/assets/views/edit_course.html b/Apollo/assets/views/edit_course.html index 2abf1c2e..c4aff4fd 100644 --- a/Apollo/assets/views/edit_course.html +++ b/Apollo/assets/views/edit_course.html @@ -1,6 +1,8 @@