Merge branch 'master' of https://bitbucket.org/venbainformationtechnology/apollodec
This commit is contained in:
commit
4588e22c3f
@ -120,6 +120,7 @@ class Branch_Controller extends REST_Controller {
|
|||||||
* */
|
* */
|
||||||
public function updateBranchDetails_post()
|
public function updateBranchDetails_post()
|
||||||
{
|
{
|
||||||
|
|
||||||
$now = new DateTime();
|
$now = new DateTime();
|
||||||
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
|
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
|
||||||
$branchCode = $this->post('branchCode');
|
$branchCode = $this->post('branchCode');
|
||||||
@ -134,7 +135,9 @@ class Branch_Controller extends REST_Controller {
|
|||||||
$details['UpdatedBy'] = $this->post('createdBy');
|
$details['UpdatedBy'] = $this->post('createdBy');
|
||||||
$details['UpdatedOn'] = $now->format("Y-m-d H:i:s");
|
$details['UpdatedOn'] = $now->format("Y-m-d H:i:s");
|
||||||
$details['FeesReceiptTitle'] = $this->post('feesTitle');
|
$details['FeesReceiptTitle'] = $this->post('feesTitle');
|
||||||
|
$details['Is_StudentMobileAccessActive'] = $this->post('studentsMobileAccess') == "true" ? 1 : 0;
|
||||||
|
$details['Is_StudentWebAccessActive'] = $this->post('studnetsWebAccess') == "true" ? 1 : 0;
|
||||||
|
// print_r($details);exit();
|
||||||
$imageStat = $this->post('imageStatus');
|
$imageStat = $this->post('imageStatus');
|
||||||
|
|
||||||
$imagename = $imageStat == 1 ? $_FILES['logoEdit']['name'] : '';
|
$imagename = $imageStat == 1 ? $_FILES['logoEdit']['name'] : '';
|
||||||
|
|||||||
@ -40,9 +40,9 @@ class Login_Controller extends REST_Controller {
|
|||||||
{
|
{
|
||||||
$userMobile = $this->post('userMobile');
|
$userMobile = $this->post('userMobile');
|
||||||
$password = $this->post('password');
|
$password = $this->post('password');
|
||||||
|
$accessFrom = $this->post('accessFrom');
|
||||||
|
|
||||||
|
$loginDetails = $this->login_model->login( $userMobile, $password, $accessFrom);// Check if the users data store contains users (in case the database result returns NULL)
|
||||||
$loginDetails = $this->login_model->login( $userMobile, $password);// Check if the users data store contains users (in case the database result returns NULL)
|
|
||||||
if ($loginDetails)
|
if ($loginDetails)
|
||||||
{
|
{
|
||||||
$LoginDetails['status'] = REST_Controller::HTTP_OK;
|
$LoginDetails['status'] = REST_Controller::HTTP_OK;
|
||||||
|
|||||||
@ -46,9 +46,9 @@ class StudentView_Controller extends REST_Controller
|
|||||||
$requestedBy = $this->post('requestedBy');
|
$requestedBy = $this->post('requestedBy');
|
||||||
$requestedFrom = $this->post('requestedFrom');
|
$requestedFrom = $this->post('requestedFrom');
|
||||||
$requestedBranch = $this->post('branchCode');
|
$requestedBranch = $this->post('branchCode');
|
||||||
|
$accessFrom = $this->post('accessFrom');
|
||||||
|
|
||||||
|
$studentListDetails = $this->studentview_model->getStudentInfo($requestedBy,$requestedFrom,$requestedBranch,$accessFrom);// Check if the employee exist
|
||||||
$studentListDetails = $this->studentview_model->getStudentInfo($requestedBy,$requestedFrom,$requestedBranch);// Check if the employee exist
|
|
||||||
if ($studentListDetails) {
|
if ($studentListDetails) {
|
||||||
$studentListDetails['status'] = REST_Controller::HTTP_OK;
|
$studentListDetails['status'] = REST_Controller::HTTP_OK;
|
||||||
// Set the response and exit
|
// Set the response and exit
|
||||||
|
|||||||
@ -63,7 +63,7 @@ class Branch_model extends CI_Model {
|
|||||||
|
|
||||||
public function getBranch()
|
public function getBranch()
|
||||||
{
|
{
|
||||||
$this->db->select('BranchCode,BranchName,LogoPath,MobileNumber,AlternateNumber,LandlineNumber,Address,EmailID,CreatedOn,IsActive,FeesReceiptTitle as feesTitle');
|
$this->db->select('BranchCode,BranchName,LogoPath,MobileNumber,AlternateNumber,LandlineNumber,Address,EmailID,CreatedOn,IsActive,FeesReceiptTitle as feesTitle, Is_StudentMobileAccessActive as studentsMobileAccess, Is_StudentWebAccessActive As studnetsWebAccess');
|
||||||
$this->db->order_by('CreatedOn','DESC');
|
$this->db->order_by('CreatedOn','DESC');
|
||||||
$branchDetails = $this->db->get(BRANCH);
|
$branchDetails = $this->db->get(BRANCH);
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@ class Login_model extends CI_Model
|
|||||||
* Default login abc123 -> e99a18c428cb38d5f260853678922e03
|
* Default login abc123 -> e99a18c428cb38d5f260853678922e03
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function login($mobile = null, $password = null)
|
public function login($mobile = null, $password = null, $accessFrom = null)
|
||||||
{
|
{
|
||||||
$this->db->select('t1.MobileNumber, t1.Password,t1.ListCode,t1.UpdatedOn,t1.OTP');
|
$this->db->select('t1.MobileNumber, t1.Password,t1.ListCode,t1.UpdatedOn,t1.OTP');
|
||||||
$this->db->from('' . LOGIN . ' as t1');
|
$this->db->from('' . LOGIN . ' as t1');
|
||||||
@ -44,34 +44,72 @@ class Login_model extends CI_Model
|
|||||||
if($diff->i <= 10){
|
if($diff->i <= 10){
|
||||||
if($password == $loginDetails->OTP){
|
if($password == $loginDetails->OTP){
|
||||||
|
|
||||||
$this->db->select('LO.MobileNumber, LO.ListCode, LO.ID,ST.BranchCode, ST.LoginAccess');
|
if($accessFrom == 'Web'){
|
||||||
$this->db->from('' . LOGIN . ' as LO');
|
$this->db->select('LO.MobileNumber, LO.ListCode, LO.ID,ST.BranchCode, ST.LoginAccess');
|
||||||
$this->db->join('' . STUDENTS . ' as ST', 'LO.StaffID = ST.StudentID');
|
$this->db->from('' . LOGIN . ' as LO');
|
||||||
$this->db->where('LO.MobileNumber', $mobile);
|
$this->db->join('' . STUDENTS . ' as ST', 'LO.StaffID = ST.StudentID');
|
||||||
$this->db->where('ST.IsActive', 1);
|
$this->db->join('' . STUDENTCOURSE . ' as SC', 'SC.StudentID = ST.StudentID');
|
||||||
$responseDetails = $this->db->get()->first_row();
|
$this->db->join('' . BRANCH . ' as BR', 'BR.BranchCode = SC.BranchID');
|
||||||
|
$this->db->where('LO.MobileNumber', $mobile);
|
||||||
|
$this->db->where('ST.IsActive', 1);
|
||||||
|
$this->db->where('BR.Is_StudentWebAccessActive', 1);
|
||||||
|
$responseDetails = $this->db->get()->first_row();
|
||||||
|
|
||||||
if($responseDetails){
|
if($responseDetails){
|
||||||
|
|
||||||
$save['OTP'] = '';
|
$save['OTP'] = '';
|
||||||
$this->db->where('MobileNumber',$mobile);
|
$this->db->where('MobileNumber',$mobile);
|
||||||
$this->db->where('ListCode',STUDENT);
|
$this->db->where('ListCode',STUDENT);
|
||||||
|
|
||||||
$this->db->update('T_Login',$save);
|
$this->db->update('T_Login',$save);
|
||||||
|
|
||||||
|
|
||||||
if($responseDetails->LoginAccess == 1){
|
if($responseDetails->LoginAccess == 1){
|
||||||
$result['loginStatus'] = true;
|
$result['loginStatus'] = true;
|
||||||
$result['details'] = $responseDetails;
|
$result['details'] = $responseDetails;
|
||||||
} else {
|
} else {
|
||||||
$result['loginStatus'] = false;
|
$result['loginStatus'] = false;
|
||||||
$result['message'] = "Your login is de-activated.";
|
$result['message'] = "Your login is de-activated.";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$result['loginStatus'] = false;
|
||||||
|
$result['message'] = "Your login is de-activated.";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->db->select('LO.MobileNumber, LO.ListCode, LO.ID,ST.BranchCode, ST.LoginAccess');
|
||||||
|
$this->db->from('' . LOGIN . ' as LO');
|
||||||
|
$this->db->join('' . STUDENTS . ' as ST', 'LO.StaffID = ST.StudentID');
|
||||||
|
$this->db->join('' . STUDENTCOURSE . ' as SC', 'SC.StudentID = ST.StudentID');
|
||||||
|
$this->db->join('' . BRANCH . ' as BR', 'BR.BranchCode = SC.BranchID');
|
||||||
|
$this->db->where('LO.MobileNumber', $mobile);
|
||||||
|
$this->db->where('ST.IsActive', 1);
|
||||||
|
$this->db->where('BR.Is_StudentMobileAccessActive', 1);
|
||||||
|
$responseDetails = $this->db->get()->first_row();
|
||||||
|
|
||||||
|
if($responseDetails){
|
||||||
|
|
||||||
|
$save['OTP'] = '';
|
||||||
|
$this->db->where('MobileNumber',$mobile);
|
||||||
|
$this->db->where('ListCode',STUDENT);
|
||||||
|
|
||||||
|
$this->db->update('T_Login',$save);
|
||||||
|
|
||||||
|
|
||||||
|
if($responseDetails->LoginAccess == 1){
|
||||||
|
$result['loginStatus'] = true;
|
||||||
|
$result['details'] = $responseDetails;
|
||||||
|
} else {
|
||||||
|
$result['loginStatus'] = false;
|
||||||
|
$result['message'] = "Your login is de-activated.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$result['loginStatus'] = false;
|
||||||
|
$result['message'] = "Your login is de-activated.";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
$result['loginStatus'] = false;
|
|
||||||
$result['message'] = "Your login is de-activated.";
|
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
$result['loginStatus'] = false;
|
$result['loginStatus'] = false;
|
||||||
$result['message'] = "Please Enter Valid OTP !!";
|
$result['message'] = "Please Enter Valid OTP !!";
|
||||||
|
|||||||
@ -16,7 +16,7 @@ class Studentview_model extends CI_Model
|
|||||||
* */
|
* */
|
||||||
|
|
||||||
// get student list based on login user
|
// get student list based on login user
|
||||||
public function getStudentInfo($requestedBy=null,$requestFrom=null,$requestedBranch=null)
|
public function getStudentInfo($requestedBy=null,$requestFrom=null,$requestedBranch=null, $accessFrom=null)
|
||||||
{
|
{
|
||||||
if($requestFrom =='2'){
|
if($requestFrom =='2'){
|
||||||
$this->db->select('ST.*');
|
$this->db->select('ST.*');
|
||||||
@ -28,7 +28,7 @@ class Studentview_model extends CI_Model
|
|||||||
$result['studentStatus'] = true;
|
$result['studentStatus'] = true;
|
||||||
$result['studentDetails'] = $studentDetails;
|
$result['studentDetails'] = $studentDetails;
|
||||||
// get student course details
|
// get student course details
|
||||||
$result['courseDetails'] = $this->getStudentCourse($studentDetails->StudentID,$requestFrom,$requestedBranch);
|
$result['courseDetails'] = $this->getStudentCourseStudentLogin($studentDetails->StudentID,$requestFrom,$requestedBranch,$accessFrom);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$result['studentStatus'] = false;
|
$result['studentStatus'] = false;
|
||||||
@ -77,6 +77,59 @@ class Studentview_model extends CI_Model
|
|||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getStudentCourseStudentLogin($studentId=null,$requestFrom=null,$requestedBranch=null,$accessFrom=null){
|
||||||
|
|
||||||
|
// this sub query for avoid university duplicate id
|
||||||
|
$this->db->select('SCU.EnrollmentID,CU.CourseID,CU.CourseName,US.UniversityID,US.UniversityName,US.UniversityShortName');
|
||||||
|
$this->db->from( STUDENTCOURSE . ' as SCU');
|
||||||
|
$this->db->join( BRANCH . ' as BR', 'BR.BranchCode = SCU.BranchID');
|
||||||
|
$this->db->join( COURSE . ' as CU', 'CU.CourseID = SCU.CourseID');
|
||||||
|
$this->db->join( UNIVERSITY . ' as US', 'US.UniversityID = SCU.UniversityID AND SCU.BranchID=US.BranchCode');
|
||||||
|
$this->db->where('SCU.StudentID',$studentId);
|
||||||
|
if($accessFrom == 'Web'){
|
||||||
|
$this->db->where('BR.Is_StudentWebAccessActive', 1);
|
||||||
|
} else{
|
||||||
|
$this->db->where('BR.Is_StudentMobileAccessActive', 1);
|
||||||
|
}
|
||||||
|
$courseDetails = $this->db->get();
|
||||||
|
if($courseDetails->result()){
|
||||||
|
$studentCourseStatus['status'] = true;
|
||||||
|
foreach ($courseDetails->result() as $row){
|
||||||
|
$fetchData['CourseID']=$row->CourseID;
|
||||||
|
$fetchData['CourseName']=$row->CourseName;
|
||||||
|
$fetchData['UniversityID']=$row->UniversityID;
|
||||||
|
$fetchData['UniversityName']=$row->UniversityName;
|
||||||
|
$fetchData['UniveShortName'] = $row->UniversityShortName;
|
||||||
|
// $fetchData['SessionName']=$row->SessionName;
|
||||||
|
$fetchData['EnrollmentID']=$row->EnrollmentID;
|
||||||
|
// get student fees details
|
||||||
|
$fetchData['feesDetails']=$this->getStudentFeesDetails($studentId,$row->CourseID);
|
||||||
|
// get student boollet details
|
||||||
|
$fetchData['studyMaterialDetails']=$this->getStudentMaterialDetails($studentId,$row->CourseID);
|
||||||
|
// get application details
|
||||||
|
if($requestFrom!='2'){
|
||||||
|
$fetchData['applicationDetails']=$this->getStudentApplicationDetails($studentId,$row->CourseID);
|
||||||
|
$fetchData['answerbookletDetails']=$this->getStudentAnswerbookletDetails($studentId,$row->CourseID);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
$fetchData['certificateDetails']=$this->getStudentCertificateDetails($studentId,$row->CourseID);
|
||||||
|
$fetchData['markCardDetails']=$this->getMarkcardDetails($studentId,$row->CourseID);
|
||||||
|
|
||||||
|
$CourseArray[]=$fetchData;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
$studentCourseStatus['courseStatus'] = $CourseArray;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$studentCourseStatus['status'] = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $studentCourseStatus;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get student course details
|
* get student course details
|
||||||
* created by kms
|
* created by kms
|
||||||
|
|||||||
@ -250,7 +250,7 @@ app.controller('branchCtrl', ["$scope","toaster", "$filter", "ngTableParams", "A
|
|||||||
* created by kms
|
* created by kms
|
||||||
* */
|
* */
|
||||||
$scope.updateBranch = function (myModel, form, loading) {
|
$scope.updateBranch = function (myModel, form, loading) {
|
||||||
|
// alert(JSON.stringify(myModel));
|
||||||
var firstError = null;
|
var firstError = null;
|
||||||
if (form.$invalid) {
|
if (form.$invalid) {
|
||||||
var field = null, firstError = null;
|
var field = null, firstError = null;
|
||||||
@ -284,6 +284,8 @@ app.controller('branchCtrl', ["$scope","toaster", "$filter", "ngTableParams", "A
|
|||||||
formData.append("status", myModel.IsActive);
|
formData.append("status", myModel.IsActive);
|
||||||
formData.append("logo", myModel.LogoPath);
|
formData.append("logo", myModel.LogoPath);
|
||||||
formData.append("feesTitle", myModel.feesTitle);
|
formData.append("feesTitle", myModel.feesTitle);
|
||||||
|
formData.append("studnetsWebAccess", myModel.studnetsWebAccess);
|
||||||
|
formData.append("studentsMobileAccess", myModel.studentsMobileAccess);
|
||||||
|
|
||||||
var checkImg = logoEdit == undefined ? 0 : 1;
|
var checkImg = logoEdit == undefined ? 0 : 1;
|
||||||
formData.append("imageStatus", checkImg);
|
formData.append("imageStatus", checkImg);
|
||||||
|
|||||||
@ -55,7 +55,8 @@ app.controller('loginCtrl', ["$scope", "$http", "API_POINTS", "$state", '$rootSc
|
|||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
userMobile: $scope.myModel.userMobile,
|
userMobile: $scope.myModel.userMobile,
|
||||||
password: password
|
password: password,
|
||||||
|
accessFrom: 'Web'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$http(req).then(function (response) {
|
$http(req).then(function (response) {
|
||||||
|
|||||||
@ -20,7 +20,8 @@ app.controller('studentViewCtrl', ["$scope","$rootScope", "toaster", "$filter",
|
|||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
|
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
|
||||||
requestedFrom: 2
|
requestedFrom: 2,
|
||||||
|
accessFrom: 'Web'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$http(getcourse).then(function (response) {
|
$http(getcourse).then(function (response) {
|
||||||
|
|||||||
@ -235,7 +235,45 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<fieldset>
|
||||||
|
<legend>
|
||||||
|
Manage Student Login Access Details
|
||||||
|
</legend>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label>
|
||||||
|
Student Web Access Active/De-Active
|
||||||
|
</label>
|
||||||
|
<div ng-if="p.studnetsWebAccess==true">
|
||||||
|
|
||||||
|
<switch ng-model="p.studnetsWebAccess" ng-init="p.studnetsWebAccess = true" class="green"></switch>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div ng-if="p.studnetsWebAccess==false">
|
||||||
|
<switch ng-model="p.studnetsWebAccess" ng-init="p.studnetsWebAccess = false" class="green"></switch>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label>
|
||||||
|
Student Mobile Access Active/De-Active
|
||||||
|
</label>
|
||||||
|
<div ng-if="p.studentsMobileAccess==true">
|
||||||
|
|
||||||
|
<switch ng-model="p.studentsMobileAccess" ng-init="p.studentsMobileAccess = true" class="green"></switch>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div ng-if="p.studentsMobileAccess==false">
|
||||||
|
<switch ng-model="p.studentsMobileAccess" ng-init="p.studentsMobileAccess = false" class="green"></switch>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user