batchshedule duplicate avoided
This commit is contained in:
parent
77ddc147e3
commit
44a53ee513
@ -295,6 +295,7 @@ $route['updateSessionScheduleDetails'] = 'SessionSchedule_Controller/updateSessi
|
|||||||
/// halltickets and Exam Attendance
|
/// halltickets and Exam Attendance
|
||||||
$route['getUniversityCourseDetails'] = 'HallTickets_Controller/getUniversityCourseDetails';
|
$route['getUniversityCourseDetails'] = 'HallTickets_Controller/getUniversityCourseDetails';
|
||||||
$route['getSemesterSubjectDetails'] = 'HallTickets_Controller/getSemesterSubjectDetails';
|
$route['getSemesterSubjectDetails'] = 'HallTickets_Controller/getSemesterSubjectDetails';
|
||||||
|
$route['getExistingMapping'] = 'HallTickets_Controller/getExistingMapping';
|
||||||
$route['saveAllSemSubMapping'] = 'HallTickets_Controller/saveAllSemesterSubjectMapping';
|
$route['saveAllSemSubMapping'] = 'HallTickets_Controller/saveAllSemesterSubjectMapping';
|
||||||
$route['getAllSemSubjects'] = 'HallTickets_Controller/getAllSemesterSubjects';
|
$route['getAllSemSubjects'] = 'HallTickets_Controller/getAllSemesterSubjects';
|
||||||
$route['getIndividualCourseSemMappingDetails'] = 'HallTickets_Controller/getIndividualCourseSemMappingDetails';
|
$route['getIndividualCourseSemMappingDetails'] = 'HallTickets_Controller/getIndividualCourseSemMappingDetails';
|
||||||
|
|||||||
@ -25,6 +25,7 @@ class HallTickets_Controller extends REST_Controller {
|
|||||||
$this->methods['getUniversityCourseDetails_post']['limit'] = 500; // 500 requests per hour per user/key
|
$this->methods['getUniversityCourseDetails_post']['limit'] = 500; // 500 requests per hour per user/key
|
||||||
$this->methods['updateSheduleDetails_post']['limit'] = 500; // 500 requests per hour per user/key
|
$this->methods['updateSheduleDetails_post']['limit'] = 500; // 500 requests per hour per user/key
|
||||||
|
|
||||||
|
|
||||||
// load the model
|
// load the model
|
||||||
$this->load->model('Hallticket_model', 'Hallticket_model');
|
$this->load->model('Hallticket_model', 'Hallticket_model');
|
||||||
|
|
||||||
@ -133,7 +134,7 @@ class HallTickets_Controller extends REST_Controller {
|
|||||||
* get semester and subjects list for sem course mapping
|
* get semester and subjects list for sem course mapping
|
||||||
* created by velz
|
* created by velz
|
||||||
* */
|
* */
|
||||||
public function getSemesterSubjectDetails_post()
|
public function getSemesterSubjectDetails_post()
|
||||||
{
|
{
|
||||||
$universityID = $this->post('universityID');
|
$universityID = $this->post('universityID');
|
||||||
$courseIDS = $this->post('courseID');
|
$courseIDS = $this->post('courseID');
|
||||||
@ -168,6 +169,56 @@ class HallTickets_Controller extends REST_Controller {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* get semester and subjects list for sem course mapping
|
||||||
|
* created by Bala
|
||||||
|
* */
|
||||||
|
public function getExistingMapping_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->getExistDetails($universityID,$tempCourseArray,$branchId);
|
||||||
|
// print_r( $data['subjectDetails']);
|
||||||
|
// die();
|
||||||
|
//$data['semesterDetails'] = $this->Hallticket_model->getSemesterDetails($universityID,$tempCourseArray);
|
||||||
|
//1000 it means already data exist http sents 1000//
|
||||||
|
|
||||||
|
if($data['subjectDetails'] == 1 )
|
||||||
|
{
|
||||||
|
$this->response([
|
||||||
|
'message' => 'Already Exist',
|
||||||
|
'status' => REST_Controller::HTTP_NOT_FOUND
|
||||||
|
], REST_Controller::HTTP_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
|
else 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 getBatchAndCenterDetails_post()
|
public function getBatchAndCenterDetails_post()
|
||||||
{
|
{
|
||||||
$requestedBy = $this->post('requestedBy');
|
$requestedBy = $this->post('requestedBy');
|
||||||
|
|||||||
@ -181,6 +181,56 @@ class Hallticket_model extends CI_Model
|
|||||||
return $courseDetails->result();
|
return $courseDetails->result();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* check existing data,only batchschedule.
|
||||||
|
* @params university id and CourseID
|
||||||
|
* created by Bala
|
||||||
|
* */
|
||||||
|
|
||||||
|
public function getExistDetails($universityID,$courseIDS,$branchId)
|
||||||
|
{
|
||||||
|
// echo $universityID;
|
||||||
|
// //foreach()
|
||||||
|
// print_r ($courseIDS);
|
||||||
|
// die();
|
||||||
|
$i=0;
|
||||||
|
foreach($courseIDS as $c)
|
||||||
|
{
|
||||||
|
|
||||||
|
// $tempCourseArray= $c['CourseID'];
|
||||||
|
|
||||||
|
$this->db->select ('count(*) as count');
|
||||||
|
$this->db->from('T_Batch_Schedule_Master');
|
||||||
|
$this->db->where('UniversityID',$universityID);
|
||||||
|
$this->db->where('CourseID', $c);
|
||||||
|
$result = $this->db->get();
|
||||||
|
$res = $result->result();
|
||||||
|
|
||||||
|
if($res[0]->count > 0 )
|
||||||
|
{
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( $i > 0 )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$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_CourseSubject_Details.UniversityID',$universityID);
|
||||||
|
$this->db->where_in('T_SubjectMaster.BranchCode',$branchId);
|
||||||
|
$result = $this->db->get();
|
||||||
|
//echo $this->db->last_query();
|
||||||
|
return $result->result();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get subject details
|
* get subject details
|
||||||
* @params university id and CourseID
|
* @params university id and CourseID
|
||||||
|
|||||||
@ -178,7 +178,7 @@ app.controller('schCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableP
|
|||||||
$scope.semDropDownShowLoading = true;
|
$scope.semDropDownShowLoading = true;
|
||||||
var getsubject = {
|
var getsubject = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: apiPoint.url + 'getSemesterSubjectDetails/',
|
url: apiPoint.url + 'getExistingMapping/',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
@ -190,7 +190,7 @@ app.controller('schCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableP
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
$http(getsubject).then(function (response) {
|
$http(getsubject).then(function (response) {
|
||||||
|
console.log(response);
|
||||||
if(response.data.status == 200)
|
if(response.data.status == 200)
|
||||||
{
|
{
|
||||||
$scope.semDropDownShowLoading = false;
|
$scope.semDropDownShowLoading = false;
|
||||||
@ -220,7 +220,7 @@ app.controller('schCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableP
|
|||||||
|
|
||||||
},function(error){
|
},function(error){
|
||||||
$scope.semDropDownShowLoading = false;
|
$scope.semDropDownShowLoading = false;
|
||||||
swal('No Subjetcs Found','','error');
|
swal('Already Exist','','error');
|
||||||
|
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user