diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index 0dde390c..152de088 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -198,6 +198,8 @@ $route['AllgetUniversity'] = 'Report/getAllUniversity'; $route['NewregDetails'] = 'Report/NewregDetails'; $route['feepaidDetails'] = 'Report/feepaidDetails'; +$route['getSubjectDetaillist'] = 'HallTickets_Controller/getSubjectDetaillist'; + /* Add New Contact Group */ $route['addNewGroup'] = 'Broadcast_Controller/addNewGroup'; $route['getGroups'] = 'Broadcast_Controller/getGroups'; diff --git a/Apollo/api/application/controllers/HallTickets_Controller.php b/Apollo/api/application/controllers/HallTickets_Controller.php index ab7de366..3c00659f 100755 --- a/Apollo/api/application/controllers/HallTickets_Controller.php +++ b/Apollo/api/application/controllers/HallTickets_Controller.php @@ -530,4 +530,31 @@ class HallTickets_Controller extends REST_Controller { } + + public function getSubjectDetaillist_post() + { + $sub['SubjectCode'] =$this->post('SubjectCode'); + $sub['requestedBy'] = $this->post('requestedBy'); + $sub['branchId'] = $this->post('branchCode'); + $sublistdet = $this->Hallticket_model->GetSubListDetails($sub); + if($sublistdet) + { + $sublistdet['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($sublistdet, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + $this->response([ + 'message' => 'No records found!', + '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 4edb09a2..b7ac38ed 100755 --- a/Apollo/api/application/models/Hallticket_model.php +++ b/Apollo/api/application/models/Hallticket_model.php @@ -1373,4 +1373,32 @@ class Hallticket_model extends CI_Model // } + + + public function GetSubListDetails($sub) + { + $this->db->select('SubjectCode,SubjectID,SubjectName'); + $this->db->from('T_SubjectMaster'); + $this->db->where('T_SubjectMaster.BranchCode',$sub['branchId']); + $this->db->where('T_SubjectMaster.SubjectCode',$sub['SubjectCode']); + $subDetails = $this->db->get()->result(); + + + // print_r($subDetails); + // die(); + + if($subDetails) + { + $result_array['searchst'] = true; + $result_array['details'] = $subDetails; + } + + else + { + $result_array['searchst'] = false; + $result_array['details'] = "No records found!"; + } + return $result_array; + } + } \ No newline at end of file diff --git a/Apollo/assets/js/controllers/semcoursemapCtrl.js b/Apollo/assets/js/controllers/semcoursemapCtrl.js index bb220c68..d51be1d3 100755 --- a/Apollo/assets/js/controllers/semcoursemapCtrl.js +++ b/Apollo/assets/js/controllers/semcoursemapCtrl.js @@ -89,6 +89,7 @@ app.controller('semcoursemapCtrl', ["$scope","$rootScope","toaster", "$filter", $scope.semDetailsLoadingStatus = true; $scope.semDetailsLoadingTxt = "Loading..."; + $scope.Issub=0; var getUniv = { method: 'POST', @@ -171,7 +172,13 @@ app.controller('semcoursemapCtrl', ["$scope","$rootScope","toaster", "$filter", * get course semester,subjects details * created by velz * */ + + $scope.UniID=''; + $scope.Courses=''; $scope.getSemSubDetails = function(UID,COURSES){ + $scope.Issub=0; + $scope.UniID=UID; + $scope.Courses=COURSES; var firstError = null; if (form.$invalid) { @@ -698,5 +705,226 @@ app.controller('semcoursemapCtrl', ["$scope","$rootScope","toaster", "$filter", } + + + $scope.Issub=0; + $scope.addsubject=function() + { + //alert('in'); + $scope.Issub=1; + + } + + $scope.sublist =''; + $scope.Semval=''; + $scope.Yearval=''; + + $scope.AddnewSubject=function(form, myModel) +{ + + + +if($scope.courseMode==1) +{ + //alert('year'); + $scope.Yearval =myModel.Year; + $scope.Semval=''; + + //console.log($scope.Yearval); + // return false; +} +else +{ + //alert('sem'); + $scope.Semval = myModel.Sem; + $scope.Yearval=''; + + //console.log($scope.Semval); + //return false +} + + +var subcode = myModel.SubjectCode; +var subname = myModel.SubjectName; + + + + + var addSubject = { + method: 'POST', + url: apiPoint.url + 'addSubjectDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + SubjectCode:myModel.SubjectCode, + SubjectName:myModel.SubjectName, + Status: myModel.switchsetting, + createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID, + branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID + + } + }; + + $http(addSubject).then(function (response) { + if (response.data.status==200 && response.data.SubjectStatus) { + + + swal("Success!", response.data.message, "success"); + // $scope.getSemSubDetails($scope.UniID,$scope.Courses); + + $scope.Issub=0; + // myModel.SubjectCode =''; + // myModel.SubjectName =''; + // $state.go($state.current, {}, {reload: true}); + + + + + var getsubject = { + method: 'POST', + url: apiPoint.url + 'getSemesterSubjectDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + universityID : $scope.UniID, + courseID : $scope.Courses, + requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID, + branchId:JSON.parse(localStorage.getItem('localObj')).localBranchID + } + }; + $http(getsubject).then(function (response) { + + if(response.data.status == 200) + { + $scope.semDropDownShowLoading = false; + $scope.semDropDownShow = true; + $scope.subjects = [];// For Main Dropdown + $scope.subjectsFromDBtoComapare = []; + //$scope.semesters = response.data.semesterDetails; + $scope.subjectsFromDB = response.data.subjectDetails; //Store Response Data to subjectsFromDB + + angular.forEach($scope.subjectsFromDB,function(value,key){ + $scope.subjects.push(value);// For Main Dropdown + }); + + } + + console.log('append fn'); + // console.log($scope.subjectsFromDB); + // console.log($scope.subjects); + angular.forEach($scope.subjectsFromDB,function(value,key) + { + // console.log(value.SubjectCode) + + if(value.SubjectCode == subcode) + { + //console.log('inside if') + + if($scope.courseMode==0) + { + //console.log('inside coursemode'); + //console.log($scope.Semval); + if($scope.Semval=='SEM1') + { + $scope.selectedSubjetcsSem1C.list.push(value); + $scope.removeSelectedSubjetcs(value); + } + + if($scope.Semval=='SEM2') + { + $scope.selectedSubjetcsSem2C.list.push(value); + $scope.removeSelectedSubjetcs(value); + } + + if($scope.Semval=='SEM3') + { + $scope.selectedSubjetcsSem3C.list.push(value); + $scope.removeSelectedSubjetcs(value); + } + if($scope.Semval=='SEM4') + { + $scope.selectedSubjetcsSem4C.list.push(value); + $scope.removeSelectedSubjetcs(value); + } + if($scope.Semval=='SEM5') + { + $scope.selectedSubjetcsSem5C.list.push(value); + $scope.removeSelectedSubjetcs(value); + } + if($scope.Semval=='SEM6') + { + $scope.selectedSubjetcsSem6C.list.push(value); + $scope.removeSelectedSubjetcs(value); + } + if($scope.Semval=='SEM7') + { + $scope.selectedSubjetcsSem7C.list.push(value); + $scope.removeSelectedSubjetcs(value); + } + if($scope.Semval=='SEM8') + { + $scope.selectedSubjetcsSem8C.list.push(value); + $scope.removeSelectedSubjetcs(value); + } + + } + + else if($scope.courseMode==1) + { + + console.log('else'); + if($scope.Yearval=='YEAR1') + { + console.log('y1if') + + $scope.selectedSubjetcsSem1C.list.push(value); + $scope.removeSelectedSubjetcs(value); + } + if($scope.Yearval=='YEAR2') + { + $scope.selectedSubjetcsSem3C.list.push(value); + $scope.removeSelectedSubjetcs(value); + } + if($scope.Yearval=='YEAR3') + { + $scope.selectedSubjetcsSem5C.list.push(value); + $scope.removeSelectedSubjetcs(value); + } + + if($scope.Yearval=='YEAR4') + { + $scope.selectedSubjetcsSem7C.list.push(value); + $scope.removeSelectedSubjetcs(value); + } + } + + + } + }); + + + + },function(error){ + + swal('Some Thing Went Wrong!','Try Later','error') + // $state.go($state.current, {}, {reload: true}); + }); + + + + + + + + + } else { + //$scope.ldloading1[loading.replace('-', '_')] = false; + swal("Failed!", response.data.message, "error"); + } + }); + +} }]); diff --git a/Apollo/assets/views/hallticket/semcoursemap.html b/Apollo/assets/views/hallticket/semcoursemap.html index aad606fb..3defc8b1 100755 --- a/Apollo/assets/views/hallticket/semcoursemap.html +++ b/Apollo/assets/views/hallticket/semcoursemap.html @@ -348,6 +348,165 @@ + + + + + +
+
+ Add New Subject +
+
+ +
+
+
+
+ Subject + + +
+ +
+ + + +
+ +
+ + + +
+ + + +
+ + + + Subject code is required + Enter a valid subject code + +
+
+ + + + Subject name is required + Invalid subject name +
+ + + + +
+ +
+
+ + +
+
+ + +
+ + +
+ + +
+
+ +
+ +
+ + +
+
+
+
+ + + + +
+
+
+ + + +
+
+
+
+ +
+
+ + + + + +