EXAM ATTENDANCE

This commit is contained in:
velz 2018-06-28 11:19:21 +05:30
parent 4a1cf4667f
commit 23a7124e0f
5 changed files with 103 additions and 7 deletions

View File

@ -401,7 +401,7 @@ class HallTickets_Controller extends REST_Controller {
$centerName = $this->post('centerName');
$res['UniversityDetails'] = $this->Hallticket_model->getUniversityDetials($UID,$branchId);
$res['studentDetails'] = $this->Hallticket_model->getStudentDetails($UID,$courseID,$branchId,$studentIDs);
$res['studentDetails'] = $this->Hallticket_model->getStudentDetails($UID,$courseID,$branchId,$studentIDs,$centerName,$batch,$requestedBy);
if(count($res['UniversityDetails']) != 0 || count($res['studentDetails']) != 0 )

View File

@ -757,7 +757,7 @@ class Hallticket_model extends CI_Model
}
//Student Details with All Corresponding Semesters and Subjects
public function getStudentDetails($UID,$courseID,$branchId,$studentIDs)
public function getStudentDetails($UID,$courseID,$branchId,$studentIDs,$centerName,$batch,$requestedBy)
{
foreach($studentIDs as $key1 => $id)
@ -918,12 +918,102 @@ class Hallticket_model extends CI_Model
array_splice($studentIDs[$key1]['FeeDetails'],0,10,$id['FeeDetails']) ;
}
//print_r($studentIDs);//die();
//print_r($studentIDs);die();
$this->saveHallTicketDataForExamAttendance($UID,$courseID,$branchId,$studentIDs,$centerName,$batch,$requestedBy);
return $studentIDs;
}
public function saveHallTicketDataForExamAttendance($UID,$courseID,$branchId,$studentIDs,$centerName,$batch,$requestedBy)
{
$MASTERID = '00';
$this->db->select('HallTicket_ID');
$this->db->from('T_Hallticket_Master');
$this->db->where('UniversityID',$UID['universityID']);
$this->db->where('CourseID',$courseID);
$this->db->where('BatchCode',$batch);
$this->db->where('CenterID',$centerName['CenterID']);
$this->db->where('BranchCode',$branchId);
$isExist = $this->db->get();
$isExist = $isExist->result_array();
//print_r($isExist);die();
if(!empty($isExist[0]['HallTicket_ID']))
{
$MASTERID = $isExist[0]['HallTicket_ID'];
$this->db->trans_start();
$this->db->where('HallTicket_ID',$MASTERID);
$this->db->update('T_Hallticket_Master',array('UpdatedBy'=>$requestedBy));
$this->db->trans_complete();
$this->db->trans_start();
$this->db->select('HallTicket_Student_ID');
$this->db->from('T_Hallticket_Student_Details');
$this->db->where('`HallTicket_ID',$MASTERID);
$existStudentID = $this->db->get();
$existStudentID = $existStudentID->result_array();
$this->db->trans_complete();
$finalExistStudentID = array();
foreach($existStudentID as $exist)
{
$finalExistStudentID[] = $exist['HallTicket_Student_ID'];
}
$this->db->trans_start();
$this->db->where_in('HallTicket_ID',$MASTERID);
$this->db->delete('T_Hallticket_Student_Details');
$this->db->trans_complete();
$this->db->trans_start();
$this->db->where_in('HallTicket_Student_ID',$finalExistStudentID);
$this->db->delete('T_Hallticket_Subject_Details');
$this->db->trans_complete();
}
else
{
$masterArray = array('UniversityID'=>$UID['universityID'],'CourseID'=>$courseID,'BatchCode'=>$batch,'BranchCode'=>$branchId,'CreatedBy'=>$requestedBy,'CenterID'=>$centerName['CenterID']);
$this->db->trans_start();
$this->db->insert('T_Hallticket_Master',$masterArray);
$MASTERID = $this->db->insert_id();
$this->db->trans_complete();
}
//Save University,Course,Batch,BranchCode, and Center ID
foreach($studentIDs as $student)
{
//print_r($student);echo "</br>";
if(!empty($student['FeeDetails']))
{
foreach($student['FeeDetails'] as $key => $fees)
{
//print_r($fees);
$tempArray = array('Hallticket_ID'=>$MASTERID,'StudentID'=>$student['StudentID'],'EnrollmentID'=>$student['EnrollmentID'],'Sem_Year'=>('SEM'.($key + 1)));
$this->db->trans_start();
$this->db->insert('T_Hallticket_Student_Details',$tempArray);
$HallTicketStudentID = $this->db->insert_id();
$this->db->trans_complete();
foreach($fees as $subject)
{
//echo $subject->SubjectCode;echo "</br>";
$tempSubjectArray = array('HallTicket_Student_ID'=>$HallTicketStudentID,'SubjectCode'=>$subject->SubjectCode,'ExamDate'=>$subject->ScheduleDate,'FromTime'=>$subject->FromTime,'EndTime'=>$subject->ToTime);
$this->db->trans_start();
$this->db->insert('T_Hallticket_Subject_Details',$tempSubjectArray);
$this->db->trans_complete();
}
}
}
}
}
public function AddBatchScheduleMaster($schedulemaster,$detailArray)
{

View File

@ -26,6 +26,8 @@ $scope.isTblShow = false;
$scope.isLoader = false;
$scope.isLoaderShow = false;
$scope.isLoaderTxt = "Loading...";
$scope.generateButtonTxt = "GENERATE";
$scope.generateButtonStatus = false;
// sorting function for table params
$scope.sort = function(keyname){
@ -234,7 +236,8 @@ $scope.isLoaderTxt = "Loading...";
var university = $scope.myModel.universityName;
var course = $scope.myModel.courseName;
var batch = $scope.myModel.batchName;
$scope.generateButtonTxt = "Please Wait...";
$scope.generateButtonStatus = true;
var dataForHallTicket = {
method: 'POST',
url: apiPoint.url + 'getHallTicket/',
@ -263,6 +266,9 @@ $scope.isLoaderTxt = "Loading...";
$scope.pdfModel.semDataType =response.data.semDataType;
$scope.open($scope.pdfModel);
$scope.generateButtonTxt = "GENERATE";
$scope.generateButtonStatus = false;
}
},function(error){ swal('No Records Found','',error); });
}

View File

@ -71,7 +71,7 @@
</div>
<div class="col-md-2 form-group">
<label>
Batch Name
</label>

View File

@ -110,7 +110,7 @@
<div class="col-md-3 form-group">
<!-- <div class="pull-right"> -->
<br>
<button type="button" ladda="ldloading1.zoom_in" tabindex="6" class="btn btn-wide btn-success" data-style="zoom-in" ng-click="generateHallTicket();">GENERATE</button>
<button type="button" ladda="ldloading1.zoom_in" tabindex="6" class="btn btn-wide btn-success" data-style="zoom-in" ng-diabled = "{{generateButtonStatus}}"ng-click="generateHallTicket();">{{generateButtonTxt}}</button>
<!-- </div> -->
</div>