NEW SCREEN PROMOTEBATCH :Velz
This commit is contained in:
parent
0fb0de2d65
commit
6194d3a107
@ -53,14 +53,19 @@ class Reregister_Controller extends REST_Controller {
|
||||
{
|
||||
$UID = $this->post('university');
|
||||
$batch = $this->post('batch');
|
||||
$batch = explode('###',$batch);
|
||||
$batchCode = $batch[0];
|
||||
$batchDate = $batch[1];
|
||||
$branchId = $this->post('branchId');
|
||||
|
||||
$res = $this->Reregister_model->getStudentListForPromoteBatchmodal($UID,$batch,$branchId);
|
||||
if(count($res) > 0)
|
||||
$res = $this->Reregister_model->getStudentListForPromoteBatchmodal($UID,$batchCode,$branchId,$batchDate);
|
||||
//print_r($res['studentList']);die();
|
||||
if(count($res['finalStudentList']) > 0)
|
||||
{
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
$data['studentStatus'] = true;
|
||||
$data['studentDetails'] = $res;
|
||||
$data['studentDetails'] = $res['finalStudentList'];
|
||||
$data['nextbatchDetails'] = $res['nextBatch'];
|
||||
$this->response($data, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
|
||||
@ -63,43 +63,56 @@ class Reregister_model extends CI_Model
|
||||
|
||||
|
||||
|
||||
public function getStudentListForPromoteBatchmodal($UID,$batch,$branchId)
|
||||
public function getStudentListForPromoteBatchmodal($UID,$batchCode,$branchId,$batchDate)
|
||||
{
|
||||
$this->db->select('T_StudentDetails.StudentID,T_StudentDetails.MobileNumber,T_StudentDetails.Firstname,T_StudentDetails.Lastname,T_StudentDetails.EmailID');
|
||||
$this->db->select('T_StudentDetails.StudentID,T_StudentDetails.MobileNumber,T_StudentDetails.Firstname,T_StudentDetails.Lastname,T_StudentDetails.EmailID,max(T_Course_Fees_Details.Sem_Year) as current_sem,T_CourseMaster.CourseID,T_CourseMaster.CourseCode,T_CourseMaster.CourseName,T_Session_Master.SessionID,T_Session_Master.SessionName,T_Session_Master.SessionDate');
|
||||
$this->db->from('T_Students_Fees_Status');
|
||||
$this->db->join('T_StudentDetails','T_Students_Fees_Status.StudentID=T_StudentDetails.StudentID and T_StudentDetails.IsActive = 1');
|
||||
$this->db->join('T_StudentDetails','T_Students_Fees_Status.StudentID = T_StudentDetails.StudentID and T_StudentDetails.IsActive = 1');
|
||||
$this->db->join('T_Course_Fees_Details','T_Students_Fees_Status.CourseID = T_Course_Fees_Details.CourseID and T_Students_Fees_Status.FeesType = T_Course_Fees_Details.ID and T_Course_Fees_Details.ProgramType = "Y001" and T_Course_Fees_Details.FeesType = "F002" and T_StudentDetails.IsActive = 1' );
|
||||
$this->db->where('T_Students_Fees_Status.BatchCode',$batch);
|
||||
$this->db->join('T_CourseMaster','T_Students_Fees_Status.CourseID=T_CourseMaster.CourseID');
|
||||
$this->db->join('T_SessionDetails','T_Students_Fees_Status.SessionName=T_SessionDetails.SessionID');
|
||||
$this->db->join('T_Session_Master','T_SessionDetails.SessionID = T_Session_Master.SessionID');
|
||||
$this->db->where('T_Students_Fees_Status.BatchCode',$batchCode);
|
||||
$this->db->where('T_Students_Fees_Status.BranchCode',$branchId);
|
||||
|
||||
|
||||
// $this->db->where('T_Session_Master.BranchCode',$branchId);
|
||||
// $this->db->where('T_SessionDetails.BranchID',$branchId);
|
||||
$this->db->group_by('T_StudentDetails.StudentID');
|
||||
$res = $this->db->get();
|
||||
$data = $res->result();
|
||||
return $data;
|
||||
// $result_array = array();
|
||||
// if(count($data) > 0)
|
||||
// {
|
||||
// $result_array = array();
|
||||
// $prestu = "";
|
||||
// foreach($data as $r)
|
||||
// {
|
||||
// if($prestu != $r->StudentID)
|
||||
// {
|
||||
// $studetdetails['StudentID'] = $r->StudentID;
|
||||
// $studetdetails['MobileNumber'] = $r->MobileNumber;
|
||||
// $studetdetails['Firstname'] = $r->Firstname;
|
||||
// $studetdetails['Lastname'] = $r->Lastname;
|
||||
// $studetdetails['EmailID'] = $r->EmailID;
|
||||
// $studetdetails['ProfilePicPath'] = $r->ProfilePicPath;
|
||||
// $studetdetails['EnrollmentID'] = $r->EnrollmentID;
|
||||
// $studetdetails['FeeDetails'] = $this->getFeeSemesterDetails($r->StudentID,$batch,$branchId,$courseID);
|
||||
// $result_array[] = $studetdetails;
|
||||
// $prestu = $r->StudentID;
|
||||
// }
|
||||
// }
|
||||
$data['studentListOne'] = $res->result();
|
||||
|
||||
$data['finalStudentList'] = array();
|
||||
foreach($data['studentListOne'] as $student)
|
||||
{
|
||||
$tempArray['StudentID'] = $student->StudentID;
|
||||
$tempArray['MobileNumber'] = $student->MobileNumber;
|
||||
$tempArray['Firstname'] = $student->Firstname;
|
||||
$tempArray['Lastname'] = $student->Lastname;
|
||||
$tempArray['EmailID'] = $student->EmailID;
|
||||
$tempArray['current_sem'] = $student->current_sem;
|
||||
$tempArray['CourseID'] = $student->CourseID;
|
||||
$tempArray['CourseCode'] = $student->CourseCode;
|
||||
$tempArray['CourseName'] = $student->CourseName;
|
||||
$tempArray['SessionID'] = $student->SessionID;
|
||||
$tempArray['SessionName'] = $student->SessionName;
|
||||
$tempArray['SessionDate'] = $student->SessionDate;
|
||||
|
||||
// }
|
||||
// return $result_array;
|
||||
$sqlquery ="SELECT SessionID,SessionName FROM T_Session_Master where BranchCode = ?
|
||||
and str_to_date(SessionDate,'%d-%m-%Y') > str_to_date(?,'%d-%m-%Y') order by str_to_date(SessionDate,'%d-%m-%Y') asc limit 1";
|
||||
$tempResult = $this->db->query($sqlquery,array($branchId,$tempArray['SessionDate']));
|
||||
$tempResult = $tempResult->result();
|
||||
//echo $this->db->last_query();
|
||||
$tempArray['nextSessionName'] = $tempResult[0]->SessionName;
|
||||
$tempArray['nextSessionID'] = $tempResult[0]->SessionID;
|
||||
$data['finalStudentList'][] = $tempArray;
|
||||
|
||||
}
|
||||
|
||||
$sql = "SELECT * FROM apollod4_ApolloDECDev.T_BatchMaster where UniversityID = ? and BranchCode = ? and str_to_date(BatchDate,'%d-%m-%Y') > str_to_date(?,'%d-%m-%Y') order by str_to_date(BatchDate,'%d-%m-%Y') asc limit 1";
|
||||
$res2 = $this->db->query($sql,array($UID['universityID'],$branchId,date_format(date_create($batchDate),'d-m-Y')));
|
||||
|
||||
$data['nextBatch'] = $res2->result();
|
||||
//echo $this->db->last_query();
|
||||
return $data;
|
||||
|
||||
}
|
||||
}
|
||||
@ -15,7 +15,7 @@ $scope.isTblShow = false;
|
||||
$scope.isLoader = false;
|
||||
$scope.isLoaderShow = false;
|
||||
$scope.isLoaderTxt = "Loading...";
|
||||
|
||||
$scope.isShowNxtBatch = false;
|
||||
|
||||
/*
|
||||
* init function
|
||||
@ -37,7 +37,7 @@ $scope.isLoaderTxt = "Loading...";
|
||||
$http(getUniv).then(function (response) {
|
||||
if (response.data.status==200 && response.data.universityStatus) {
|
||||
$scope.university = response.data.univerSityDetails;
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
swal('University Not Found','','error');
|
||||
@ -85,8 +85,10 @@ $scope.isLoaderTxt = "Loading...";
|
||||
$http(getStudents).then(function (response) {
|
||||
if (response.data.status == 200 && response.data.studentStatus) {
|
||||
$scope.studentInfo = response.data.studentDetails;
|
||||
$scope.nextBatchDetails = response.data.nextbatchDetails;
|
||||
$scope.isLoaderShow = false;
|
||||
$scope.isTblShow = true;
|
||||
$scope.isShowNxtBatch = true;
|
||||
|
||||
|
||||
}
|
||||
@ -96,11 +98,15 @@ $scope.isLoaderTxt = "Loading...";
|
||||
$scope.isLoaderShow = true;
|
||||
$scope.isTblShow = false;
|
||||
$scope.isLoaderTxt = "No Records Found";
|
||||
$scope.isShowNxtBatch = false;
|
||||
$scope.nextBatchDetails = "";
|
||||
}
|
||||
},function(error){
|
||||
$scope.isLoaderShow = true;
|
||||
$scope.isTblShow = false;
|
||||
$scope.isLoaderTxt = "No Records Found";
|
||||
$scope.isShowNxtBatch = false;
|
||||
$scope.nextBatchDetails = "";
|
||||
|
||||
});
|
||||
|
||||
@ -141,7 +147,7 @@ $scope.isLoaderTxt = "Loading...";
|
||||
$scope.selectedStudentsID.splice(pos,1);
|
||||
}
|
||||
|
||||
|
||||
console.log($scope.selectedStudentsID);
|
||||
|
||||
}
|
||||
|
||||
@ -162,13 +168,54 @@ $scope.isLoaderTxt = "Loading...";
|
||||
$scope.selectedStudentsID.push($scope.studentInfo[i]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$scope.selectedStudentsID = [];
|
||||
}
|
||||
|
||||
console.log($scope.selectedStudentsID);
|
||||
}
|
||||
|
||||
|
||||
$scope.promoteStudents = function()
|
||||
{
|
||||
if($scope.selectedStudentsID.length == 0 )
|
||||
{
|
||||
swal('Select Proper Details..!','University, Batch, and atleast one student','warning');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}]);
|
||||
}]);
|
||||
|
||||
|
||||
app.filter('nxtSemFormat', function() {
|
||||
return function(x) {
|
||||
// console.log('FIRST'+x);
|
||||
// console.log('FIRST'+x.length);
|
||||
x = x.replace(/ +/g, "");
|
||||
x = x.toUpperCase();
|
||||
var txt = "";
|
||||
var n = x.lastIndexOf("SEM");
|
||||
// console.log('FIRST'+n);
|
||||
if(n >= 0)
|
||||
{
|
||||
var num = x.substr(-1);
|
||||
num = parseInt(num)+1;
|
||||
txt = 'SEM'+num;
|
||||
}
|
||||
else
|
||||
{
|
||||
n = x.lastIndexOf("YEAR");
|
||||
if(n >= 0)
|
||||
{
|
||||
var num = x.substr(-1);
|
||||
num = parseInt(num)+1;
|
||||
txt = 'YEAR'+num;
|
||||
}
|
||||
}
|
||||
return txt;
|
||||
};
|
||||
});
|
||||
@ -51,40 +51,45 @@
|
||||
ng-options="i.universityName for i in university" ng-change="">
|
||||
<option value=""> Select University</option>
|
||||
</select>
|
||||
<!-- <pre>{{myModel.universityName | json}}</pre>-->
|
||||
<!-- <pre>{{myModel.universityName | json}}</pre> -->
|
||||
|
||||
</div>
|
||||
<!-- <div class="col-md-3 form-group"> -->
|
||||
<!-- <label> -->
|
||||
<!-- Course -->
|
||||
<!-- </label> -->
|
||||
<!-- <select ui-select2 class="form-control" name="course" tabindex="4" id="course" -->
|
||||
<!-- ng-model="myModel.courseName" ng-change="captureCourseName();"> -->
|
||||
<!-- <option value=""> Select Course</option> -->
|
||||
<!-- <option ng-repeat="courseDetails in myModel.universityName.courseDetails" value="{{courseDetails.CourseID}}"><span ng-show="courseDetails.CourseCode != ''"><strong>{{courseDetails.CourseName}}</strong></span></option> -->
|
||||
<!-- </select> -->
|
||||
|
||||
<!-- <pre>{{myModel.courseName|json}}</pre> -->
|
||||
<!-- </div> -->
|
||||
|
||||
|
||||
<div class="col-md-3 form-group">
|
||||
|
||||
<label>
|
||||
Batch Name
|
||||
</label>
|
||||
<select ui-select2 class="form-control" name="batch" tabindex="4" id="batch"
|
||||
ng-model="myModel.batchName" ng-change="captureBatchName()"
|
||||
<select ui-select2 class="form-control" name="batch" tabindex="2" id="batch"
|
||||
ng-model="myModel.batchName" ng-change=""
|
||||
>
|
||||
<option value=""> Select Batch</option>
|
||||
<option ng-repeat="batchDetails in myModel.universityName.batchDetails" value="{{batchDetails.BatchCode}}"><span ng-show="batchDetails.BatchCode != ''"><strong>{{batchDetails.BatchName}}</strong></span></option>
|
||||
<option ng-repeat="batchDetails in myModel.universityName.batchDetails" value="{{batchDetails.BatchCode}}###{{batchDetails.BD}}"><span ng-show="batchDetails.BatchCode != ''"><strong>{{batchDetails.BatchName}}</strong></span></option>
|
||||
</select>
|
||||
<!-- <pre>{{myModel.batchName | json}}</pre> -->
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-2 form-group" ng-if="isShowNxtBatch">
|
||||
<label>
|
||||
Next Batch Name
|
||||
</label>
|
||||
<input type = "text" class="form-control" id="nxtbatch" name = "nxtbatch" value="{{nextBatchDetails[0].BatchName}}" readonly>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-2 form-group">
|
||||
|
||||
<br>
|
||||
<button type="button" ladda="ldloading1.zoom_in" tabindex="5" class="btn btn-wide btn-info" data-style="zoom-in" ng-click="getStudentDetails();">GET STUDENTS</button>
|
||||
<button type="button" ladda="ldloading1.zoom_in" tabindex="3" class="btn btn-wide btn-info" data-style="zoom-in" ng-click="getStudentDetails();">GET STUDENTS</button>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2 form-group">
|
||||
|
||||
<br>
|
||||
<button type="button" ladda="ldloading1.zoom_in" tabindex="4" class="btn btn-wide btn-success" data-style="zoom-in" ng-click="promoteStudents();">PROMOTE</button>
|
||||
</div>
|
||||
|
||||
|
||||
@ -104,6 +109,9 @@
|
||||
<th><input type="checkbox" ng-model="myModel.all" id="all" name="all" ng-click="isCheckAll($event);" class="form-control"></th>
|
||||
<th ng-click="sort('Firstname')">Student Name
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='Firstname'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th ng-click="sort('CourseName')">Course Name
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='CourseName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<!-- <th ng-click="sort('UniversityShortName')">University Short Name -->
|
||||
<!-- <span class="glyphicon sort-icon" ng-show="sortKey=='UniversityShortName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span> -->
|
||||
@ -114,9 +122,16 @@
|
||||
<th ng-click="sort('EmailID')">EmailID
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<!-- <th>Status</th> -->
|
||||
<!-- <th style="text-align: center;"> Action -->
|
||||
<!-- </th> -->
|
||||
<th>Current Session</th>
|
||||
<th>Next Session</th>
|
||||
<th ng-click="sort('current_sem')">Current Semester/Year
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='current_sem'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th ng-click="sort('current_sem')">Next Semester/Year
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='current_sem'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody dir-paginate="p in studentInfo|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10">
|
||||
@ -124,8 +139,13 @@
|
||||
<td><input type="checkbox" ng-checked="myModel.all" id="{{p.StudentID}}" name="{{p.StudentID}}" class="form-control" ng-click="isClick($event);"></td>
|
||||
<td>{{p.Firstname}}{{p.Lastname}}</td>
|
||||
<!-- <td>{{p.UniversityShortName}}</td> -->
|
||||
<td>{{p.CourseName}}{{(p.CourseCode)}}</td>
|
||||
<td>{{p.MobileNumber}}</td>
|
||||
<td>{{p.EmailID}}</td>
|
||||
<td>{{p.SessionName}}</td>
|
||||
<td>{{p.nextSessionName}}</td>
|
||||
<td>{{p.current_sem}}</td>
|
||||
<td>{{p.current_sem | nxtSemFormat }}</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user