batchshedule changes

This commit is contained in:
gayathri1990 2018-09-06 10:21:53 +05:30
parent 23ac03705b
commit df08f169fa
4 changed files with 83 additions and 31 deletions

View File

@ -315,7 +315,13 @@ class HallTickets_Controller extends REST_Controller {
$branchId = $this->post('branchId'); $branchId = $this->post('branchId');
$Cdate = new DateTime('now',new DateTimeZone('Asia/Kolkata')); $Cdate = new DateTime('now',new DateTimeZone('Asia/Kolkata'));
$CreatedOn = $Cdate->format('Y-m-d H:i:s'); $CreatedOn = $Cdate->format('Y-m-d H:i:s');
foreach($courseArray as $CourseDatialArray) /////////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 )
{
foreach($courseArray as $CourseDatialArray)
{ {
$course=$CourseDatialArray; $course=$CourseDatialArray;
$schedulemaster = array('UniversityID'=>$university,'CourseID'=>$course,'BranchCode'=>$branchId,'CreatedBy'=>$requestedBy,'CreatedOn'=>$CreatedOn); $schedulemaster = array('UniversityID'=>$university,'CourseID'=>$course,'BranchCode'=>$branchId,'CreatedBy'=>$requestedBy,'CreatedOn'=>$CreatedOn);
@ -345,6 +351,26 @@ class HallTickets_Controller extends REST_Controller {
], REST_Controller::HTTP_NOT_FOUND); ], REST_Controller::HTTP_NOT_FOUND);
} }
}
// else if($data['subjectDetails'] == 0)
else
{
$this->response([
'message' => 'Please Mapping the course supject!',
'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);
// }
/////////////////////
} }

View File

@ -183,19 +183,11 @@ class Hallticket_model extends CI_Model
$courseDetails = $this->db->get('T_CourseMaster'); $courseDetails = $this->db->get('T_CourseMaster');
return $courseDetails->result(); return $courseDetails->result();
} }
public function getExistDetailsfileupload($universityID,$courseIDS,$branchId)
/*
* 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);
// print_r ($courseIDS); // echo $universityID;
// die();
$i=0; $i=0;
foreach($courseIDS as $c) foreach($courseIDS as $c)
{ {
@ -203,9 +195,9 @@ class Hallticket_model extends CI_Model
// $tempCourseArray= $c['CourseID']; // $tempCourseArray= $c['CourseID'];
$this->db->select ('count(*) as count'); $this->db->select ('count(*) as count');
$this->db->from('T_Batch_Schedule_Master'); $this->db->from('T_SemSubMap_Master');
$this->db->where('UniversityID',$universityID); $this->db->where('UniversityID',$universityID);
$this->db->where('CourseID', $c); $this->db->where('CourseID',$c);
$result = $this->db->get(); $result = $this->db->get();
$res = $result->result(); $res = $result->result();
@ -221,18 +213,45 @@ class Hallticket_model extends CI_Model
} }
else else
{ {
//////////////////// return 0;
// $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'); * check existing data,only batchschedule.
// $this->db->where('T_SubjectMaster.IsActive','1'); * @params university id and CourseID
// // // $this->db->where('T_CourseSubject_Details.UniversityID',$universityID); * created by Bala
// $this->db->where_in('T_SubjectMaster.BranchCode',$branchId); * */
// $result = $this->db->get();
// //echo $this->db->last_query(); public function getExistDetails($universityID,$courseIDS,$branchId)
//return $result->result(); {
/////////////////////////
$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);
// $this->db->where('BranchCode',$branchId);
$result = $this->db->get();
$res = $result->result();
if($res[0]->count > 0 )
{
$i++;
}
}
if( $i > 0 )
{
return 1;
}
else
{
foreach($courseIDS as $c) foreach($courseIDS as $c)
{ {
$this->db->distinct(); $this->db->distinct();

View File

@ -382,9 +382,15 @@ $scope.UploadFileData = function (FileDetails,myModel,courseDetails) {
swal("", "Saved Successfully", "success"); swal("", "Saved Successfully", "success");
$state.go($state.current, {}, {reload: true}); $state.go($state.current, {}, {reload: true});
} else { } else {
swal("", "Failed", "error"); swal("", "Please Mapping the course supject", "error");
$state.go($state.current, {}, {reload: true});
} }
}); },function(error){
$scope.semDropDownShowLoading = false;
swal(error.data.message,'','error');
$state.go($state.current, {}, {reload: true});
} );
} }
// end // end

View File

@ -167,6 +167,7 @@
<fieldset> <fieldset>
<js-xls onread="readUploadBatchDetails" onerror="error"></js-xls> <js-xls onread="readUploadBatchDetails" onerror="error"></js-xls>
<br> <br>
<a href="https://www.w3schools.com/html/" target="_top">Sample Format</a>
<button type="button" class="btn btn-success btn-o" style="float: right" ng-click="UploadFileData(extractFileDetails,myModel,selectedCourseNameC)"> Submit</button> <button type="button" class="btn btn-success btn-o" style="float: right" ng-click="UploadFileData(extractFileDetails,myModel,selectedCourseNameC)"> Submit</button>
</fieldset> </fieldset>