student details add course
This commit is contained in:
parent
90732920e5
commit
bc1a10306f
@ -82,8 +82,8 @@ class Student_Controller extends REST_Controller {
|
||||
}
|
||||
|
||||
public function getStudentCourseDetails_post() {
|
||||
$studentID = $this->post('studentID');
|
||||
$studentCourse = $this->student_model->get_student_course( $studentID );// Check if the employee exist
|
||||
$studentCourseID = $this->post('studentcourseId');
|
||||
$studentCourse = $this->student_model->get_student_course( $studentCourseID );// Check if the employee exist
|
||||
if ($studentCourse)
|
||||
{
|
||||
$studentCourse['status'] = REST_Controller::HTTP_OK;
|
||||
|
||||
@ -111,10 +111,10 @@ class Student_model extends CI_Model
|
||||
}
|
||||
|
||||
// get student course details
|
||||
public function get_student_course($studentId) {
|
||||
public function get_student_course($studentcourseId) {
|
||||
$this->db->select('*');
|
||||
$this->db->from(STUDENTCOURSE);
|
||||
$this->db->where('StudentID', $studentId);
|
||||
$this->db->where('ID', $studentcourseId);
|
||||
$courseDetails = $this->db->get();
|
||||
$checkArr = $courseDetails->result();
|
||||
if (count($checkArr) > 0) {
|
||||
|
||||
@ -70,6 +70,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$scope.getStudentList = function () {
|
||||
$scope.loader = true;
|
||||
var empListreq = {
|
||||
@ -102,7 +103,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
|
||||
}
|
||||
|
||||
$scope.setEditCourseId = function (id) {
|
||||
$scope.stucour = '';
|
||||
|
||||
$scope.list = false;
|
||||
$scope.getStudentCourseList(id);
|
||||
// $scope.getStudentCourseDetails(id);
|
||||
@ -119,6 +120,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
|
||||
|
||||
$scope.getStudentCourseList = function(studentId) {
|
||||
$scope.list = true;
|
||||
$scope.courseEdit = false;
|
||||
var req = {
|
||||
method: 'POST',
|
||||
url: apiPoint.url + 'getStudentCourseList/',
|
||||
@ -133,13 +135,14 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
|
||||
if (response.data.stuCourseDetails) {
|
||||
$scope.courseEditLoading = false;
|
||||
$scope.studentCourseList = response.data.course_details;
|
||||
$scope.stucour = $scope.studentCourse[0];
|
||||
// $scope.stucour = $scope.studentCourse[0];
|
||||
} else {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$scope.getStudentCourseDetails = function (studentId) {
|
||||
$scope.getStudentCourseDetails = function (studentcourseID) {
|
||||
$scope.stucour = '';
|
||||
$scope.list = false;
|
||||
$scope.courseEdit = true;
|
||||
var req = {
|
||||
@ -149,7 +152,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: {
|
||||
studentID: studentId
|
||||
studentcourseId: studentcourseID
|
||||
}
|
||||
};
|
||||
$http(req).then(function (response) {
|
||||
@ -157,15 +160,6 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
|
||||
$scope.courseEditLoading = false;
|
||||
$scope.studentCourse = response.data.course_details;
|
||||
$scope.stucour = $scope.studentCourse[0];
|
||||
// $scope.branchArr = [];
|
||||
// angular.forEach($scope.empBranchs, function (item, index) {
|
||||
// // alert(item.BranchName);
|
||||
// $scope.branchArr.push(item.BranchName);
|
||||
// });
|
||||
// $scope.empBranchDetails = {
|
||||
// arr: $scope.branchArr,
|
||||
// }
|
||||
// $scope.empRoleDetail = response.data.role_details[0];
|
||||
} else {
|
||||
}
|
||||
});
|
||||
|
||||
@ -14,33 +14,42 @@
|
||||
<!--list of course details : start-->
|
||||
<div ng-if='list === true'>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>University
|
||||
</th>
|
||||
<th>Course
|
||||
</th>
|
||||
<th>Batch
|
||||
</th>
|
||||
<th>Date of Join
|
||||
</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody ng-repeat="s in studentCourseList">
|
||||
<tr>
|
||||
<td>{{s.UniversityName}}</td>
|
||||
<td>{{s.CourseName}}</td>
|
||||
<td>{{s.BatchName}}</td>
|
||||
<td>{{s.DOJ}}</td>
|
||||
<td ng-click="getStudentCourseDetails(s.StudentID)">Edit</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>University
|
||||
</th>
|
||||
<th>Course
|
||||
</th>
|
||||
<th>Batch
|
||||
</th>
|
||||
<th>Date of Join
|
||||
</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody ng-repeat="s in studentCourseList">
|
||||
<tr>
|
||||
<td>{{s.UniversityName}}</td>
|
||||
<td>{{s.CourseName}}</td>
|
||||
<td>{{s.BatchName}}</td>
|
||||
<td>{{s.DOJ}}</td>
|
||||
<td ng-click="getStudentCourseDetails(s.ID)">Edit</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="pull-right">
|
||||
<button type="reset" class="btn btn-warning btn-wide" tabindex="9" ng-click="cancel()">
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--list of course details : end-->
|
||||
|
||||
<pre> {{studentCourse | json }} </pre>
|
||||
<!--<pre> {{studentCourse | json }} </pre>-->
|
||||
<!--Edit course details : Start-->
|
||||
<div ng-if='courseEdit === true'>
|
||||
<div class="row">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user