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() {
|
public function getStudentCourseDetails_post() {
|
||||||
$studentID = $this->post('studentID');
|
$studentCourseID = $this->post('studentcourseId');
|
||||||
$studentCourse = $this->student_model->get_student_course( $studentID );// Check if the employee exist
|
$studentCourse = $this->student_model->get_student_course( $studentCourseID );// Check if the employee exist
|
||||||
if ($studentCourse)
|
if ($studentCourse)
|
||||||
{
|
{
|
||||||
$studentCourse['status'] = REST_Controller::HTTP_OK;
|
$studentCourse['status'] = REST_Controller::HTTP_OK;
|
||||||
|
|||||||
@ -111,10 +111,10 @@ class Student_model extends CI_Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get student course details
|
// get student course details
|
||||||
public function get_student_course($studentId) {
|
public function get_student_course($studentcourseId) {
|
||||||
$this->db->select('*');
|
$this->db->select('*');
|
||||||
$this->db->from(STUDENTCOURSE);
|
$this->db->from(STUDENTCOURSE);
|
||||||
$this->db->where('StudentID', $studentId);
|
$this->db->where('ID', $studentcourseId);
|
||||||
$courseDetails = $this->db->get();
|
$courseDetails = $this->db->get();
|
||||||
$checkArr = $courseDetails->result();
|
$checkArr = $courseDetails->result();
|
||||||
if (count($checkArr) > 0) {
|
if (count($checkArr) > 0) {
|
||||||
|
|||||||
@ -70,6 +70,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$scope.getStudentList = function () {
|
$scope.getStudentList = function () {
|
||||||
$scope.loader = true;
|
$scope.loader = true;
|
||||||
var empListreq = {
|
var empListreq = {
|
||||||
@ -102,7 +103,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
|
|||||||
}
|
}
|
||||||
|
|
||||||
$scope.setEditCourseId = function (id) {
|
$scope.setEditCourseId = function (id) {
|
||||||
$scope.stucour = '';
|
|
||||||
$scope.list = false;
|
$scope.list = false;
|
||||||
$scope.getStudentCourseList(id);
|
$scope.getStudentCourseList(id);
|
||||||
// $scope.getStudentCourseDetails(id);
|
// $scope.getStudentCourseDetails(id);
|
||||||
@ -119,6 +120,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
|
|||||||
|
|
||||||
$scope.getStudentCourseList = function(studentId) {
|
$scope.getStudentCourseList = function(studentId) {
|
||||||
$scope.list = true;
|
$scope.list = true;
|
||||||
|
$scope.courseEdit = false;
|
||||||
var req = {
|
var req = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: apiPoint.url + 'getStudentCourseList/',
|
url: apiPoint.url + 'getStudentCourseList/',
|
||||||
@ -133,13 +135,14 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
|
|||||||
if (response.data.stuCourseDetails) {
|
if (response.data.stuCourseDetails) {
|
||||||
$scope.courseEditLoading = false;
|
$scope.courseEditLoading = false;
|
||||||
$scope.studentCourseList = response.data.course_details;
|
$scope.studentCourseList = response.data.course_details;
|
||||||
$scope.stucour = $scope.studentCourse[0];
|
// $scope.stucour = $scope.studentCourse[0];
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.getStudentCourseDetails = function (studentId) {
|
$scope.getStudentCourseDetails = function (studentcourseID) {
|
||||||
|
$scope.stucour = '';
|
||||||
$scope.list = false;
|
$scope.list = false;
|
||||||
$scope.courseEdit = true;
|
$scope.courseEdit = true;
|
||||||
var req = {
|
var req = {
|
||||||
@ -149,7 +152,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
|
|||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
studentID: studentId
|
studentcourseId: studentcourseID
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$http(req).then(function (response) {
|
$http(req).then(function (response) {
|
||||||
@ -157,15 +160,6 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
|
|||||||
$scope.courseEditLoading = false;
|
$scope.courseEditLoading = false;
|
||||||
$scope.studentCourse = response.data.course_details;
|
$scope.studentCourse = response.data.course_details;
|
||||||
$scope.stucour = $scope.studentCourse[0];
|
$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 {
|
} else {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -14,33 +14,42 @@
|
|||||||
<!--list of course details : start-->
|
<!--list of course details : start-->
|
||||||
<div ng-if='list === true'>
|
<div ng-if='list === true'>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>University
|
<th>University
|
||||||
</th>
|
</th>
|
||||||
<th>Course
|
<th>Course
|
||||||
</th>
|
</th>
|
||||||
<th>Batch
|
<th>Batch
|
||||||
</th>
|
</th>
|
||||||
<th>Date of Join
|
<th>Date of Join
|
||||||
</th>
|
</th>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody ng-repeat="s in studentCourseList">
|
<tbody ng-repeat="s in studentCourseList">
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{s.UniversityName}}</td>
|
<td>{{s.UniversityName}}</td>
|
||||||
<td>{{s.CourseName}}</td>
|
<td>{{s.CourseName}}</td>
|
||||||
<td>{{s.BatchName}}</td>
|
<td>{{s.BatchName}}</td>
|
||||||
<td>{{s.DOJ}}</td>
|
<td>{{s.DOJ}}</td>
|
||||||
<td ng-click="getStudentCourseDetails(s.StudentID)">Edit</td>
|
<td ng-click="getStudentCourseDetails(s.ID)">Edit</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</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>
|
</div>
|
||||||
<!--list of course details : end-->
|
<!--list of course details : end-->
|
||||||
|
|
||||||
<pre> {{studentCourse | json }} </pre>
|
<!--<pre> {{studentCourse | json }} </pre>-->
|
||||||
<!--Edit course details : Start-->
|
<!--Edit course details : Start-->
|
||||||
<div ng-if='courseEdit === true'>
|
<div ng-if='courseEdit === true'>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user