This commit is contained in:
dineshkumarkannan 2018-04-24 09:23:50 +05:30
commit ecabc61026
7 changed files with 104 additions and 69 deletions

View File

@ -169,7 +169,9 @@ class Fees_Status_Controller extends REST_Controller {
* */
public function getUniversityCourseForFees_post()
{
$getUnivDetails = $this->Fees_model->getUniversityDetails();
$requestedBy = $this->post('requestedBy');
$requestedBranch = $this->post('branchCode');
$getUnivDetails = $this->Fees_model->getUniversityDetails($requestedBy,$requestedBranch);
if ($getUnivDetails)
{
$getUnivDetails['status'] = REST_Controller::HTTP_OK;
@ -202,6 +204,7 @@ class Fees_Status_Controller extends REST_Controller {
$student['requestedBy'] = $this->post('requestedtBy');
$student['CourseID'] = $this->post('courseID');
$student['StudentID'] = $this->post('studentID');
$student['BranchCode'] = $this->post('branchCode');
$getStudentFeesDetails = $this->Fees_model->getFeesStructureAssign($student);
if ($getStudentFeesDetails)
{

View File

@ -169,6 +169,7 @@ class University_Controller extends REST_Controller {
$details['CreatedBy'] = $this->post('createdBy');
$details['CreatedOn'] = $now->format('Y-m-d H:i:s');
$details['IsActive'] = $this->post('status');
$details['BranchCode'] = $this->post('branchCode');
$jsonData=$this->post('activityStatus');
$activityDetails = $this->university_model->addActivity($details,$jsonData);// Check if the users data store contains users (in case the database result returns NULL)
if ($activityDetails) {
@ -189,7 +190,8 @@ class University_Controller extends REST_Controller {
public function getActivityDetails_post()
{
$requestedBy = $this->post('requestedBy');
$getActivity = $this->university_model->getActivity($requestedBy);
$requestedBranch = $this->post('branchCode');
$getActivity = $this->university_model->getActivity($requestedBy,$requestedBranch);
if ($getActivity)
{
$getActivity['status'] = REST_Controller::HTTP_OK;
@ -220,6 +222,7 @@ class University_Controller extends REST_Controller {
$details['IsActive'] = $this->post('status');
$details['UpdatedBy'] = $this->post('updatedBy');
$details['UpdatedOn'] = $now->format('Y-m-d H:i:s');
$details['BranchCode'] = $this->post('branchCode');
$jsonData=$this->post('activityStatus');
$activityDetails = $this->university_model->updateActivity($details,$jsonData);// Check if the users data store contains users (in case the database result returns NULL)

View File

@ -27,6 +27,8 @@ class Fees_status_model extends CI_Model
$this->db->where('STC.IsActive','1');
if($search['requestedBranch']!='All'){
$this->db->where('STC.BranchID',$search['requestedBranch']);
$this->db->where('US.BranchCode',$search['requestedBranch']);
$this->db->where('CU.BranchCode',$search['requestedBranch']);
}
if($search['MobileNumber']!=''){
$this->db->where('ST.MobileNumber',$search['MobileNumber']);
@ -78,6 +80,7 @@ class Fees_status_model extends CI_Model
* created by kms
* */
public function getStudentFeesStructure($student=null){
$this->db->distinct();
$this->db->select('CF.ID,CF.Sem_Year,CF.ProgramType,SFS.FeesID,SFS.CourseID,SFS.CourseFees,SFS.STFOrWR,SFS.Waiver,SFS.Others,SFS.RollNo,CU.PC,CU.TC,CU.DC,CU.MC,CU.OtherFees,SM.SessionName as SessionName,SM1.SessionName as ToSessionName,BA.BatchCode,BA.BatchName');
$this->db->from(STUDENTS_FEES_STATUS.' as SFS');
$this->db->join(SESSIONMASTER.' as SM', 'SM.SessionID = SFS.SessionName');
@ -87,6 +90,7 @@ class Fees_status_model extends CI_Model
$this->db->join(COURSE.' as CU', 'CU.CourseID = CF.CourseID');
$this->db->where('SFS.CourseID',$student['CourseID']);
$this->db->where('SFS.StudentID',$student['StudentID']);
$this->db->where('BA.BranchCode',$student['BranchCode']);
$enrolledFeesDetails = $this->db->get();
if($enrolledFeesDetails->result()){
$result_array['feesStatus']=true;
@ -662,11 +666,12 @@ class Fees_status_model extends CI_Model
* get university details
* created by kms
* */
public function getUniversityDetails()
public function getUniversityDetails($requestedBy=null,$requestedBranch=null)
{
$this->db->select('UniversityID,UniversityName');
$this->db->where('IsActive','1');
$this->db->order_by('UniversityID','ASC');
$this->db->where('BranchCode',$requestedBranch);
$this->db->order_by('CreatedOn','DESC');
$unviversityDetails = $this->db->get(UNIVERSITY);
if($unviversityDetails->result()){
@ -677,7 +682,7 @@ class Fees_status_model extends CI_Model
$university_array['universityID'] = $row->UniversityID;
$university_array['universityName'] = $row->UniversityName;
$university_array['courseDetails']= $this->getCourseDetails($row->UniversityID);
$university_array['courseDetails']= $this->getCourseDetails($row->UniversityID,$requestedBranch);
$result_array[]=$university_array;
}
$result_university['univerSityDetails']= $result_array;
@ -699,11 +704,12 @@ class Fees_status_model extends CI_Model
* @params university id
* created by kms
* */
public function getCourseDetails($universityID=null)
public function getCourseDetails($universityID=null,$requestedBranch=null)
{
$this->db->select('CourseID,CONCAT(CourseName, "(",CourseCode,")") AS CourseName');
$this->db->where('UniversityID',$universityID);
$this->db->where('IsActive','1');
$this->db->where('BranchCode',$requestedBranch);
$this->db->order_by('CourseID','ASC');
$courseDetails = $this->db->get(COURSE);
return $courseDetails->result();
@ -713,7 +719,6 @@ class Fees_status_model extends CI_Model
* created by kms
* */
public function getFeesStructureAssign($student=null){
$this->db->select('ID,CourseID,ProgramType,FeesAmount,Sem_Year');
$this->db->where('CourseID',$student['CourseID']);
$this->db->order_by('ProgramType');
@ -768,7 +773,7 @@ class Fees_status_model extends CI_Model
}
$batchDetails = $this->getBatchDetails($existData[0]->BatchCode,$student['CourseID'],$student['StudentID'],$row->ID);
$batchDetails = $this->getBatchDetails($existData[0]->BatchCode,$student['CourseID'],$student['StudentID'],$row->ID,$student['BranchCode']);
if($batchDetails!=false){
$fetchData['batchDetails']=$batchDetails;
}
@ -799,7 +804,7 @@ class Fees_status_model extends CI_Model
$fetchData['PayableFees']=$row->FeesAmount;
// for installment details
$fetchData['InstallmentDetails']="";
$batchDetails = $this->getBatchDetails('',$student['CourseID'],$student['StudentID'],'');
$batchDetails = $this->getBatchDetails('',$student['CourseID'],$student['StudentID'],'',$student['BranchCode']);
if($batchDetails!=false){
$fetchData['batchDetails']=$batchDetails;
}
@ -856,7 +861,7 @@ class Fees_status_model extends CI_Model
* get batch details
* created by kms
* */
public function getBatchDetails($batchCode=null,$courseID=null,$studentID=null,$feesType=null){
public function getBatchDetails($batchCode=null,$courseID=null,$studentID=null,$feesType=null,$branchCode=null){
if($batchCode=='' OR $batchCode==null){
$this->db->select('BA.BatchCode,BA.BatchName,BA.BatchDate,BA.IsDefault,US.UniversityID,US.UniversityName,BA.IsActive');
$this->db->from(COURSE.' as CU');
@ -865,6 +870,9 @@ class Fees_status_model extends CI_Model
$this->db->order_by('BA.CreatedOn','DESC');
$this->db->where('CU.CourseID',$courseID);
$this->db->where('BA.IsActive','1');
$this->db->where('BA.BranchCode',$branchCode);
$this->db->where('US.BranchCode',$branchCode);
$batchDetails = $this->db->get();
if($batchDetails->result()){
@ -887,6 +895,8 @@ class Fees_status_model extends CI_Model
$this->db->where('CU.CourseID',$courseID);
$this->db->where('STF.StudentID',$studentID);
$this->db->where('STF.FeesType',$feesType);
$this->db->where('BA.BranchCode',$branchCode);
$this->db->where('US.BranchCode',$branchCode);
$batchDetails = array();
/* $this->db->or_where('BA.IsActive','1');
@ -1602,8 +1612,11 @@ class Fees_status_model extends CI_Model
$this->db->join(UNIVERSITY.' as US', 'US.UniversityID = SD.UniversityID');
$this->db->join(COURSE.' as CU', 'CU.UniversityID = US.UniversityID');
// $this->db->where('SD.IsActive','1');
$this->db->order_by('CU.CreatedOn','DESC');
// $this->db->order_by('CU.CreatedOn','DESC');
$this->db->order_by('SM.SessionID','DESC');
$this->db->where('CU.CourseID',$details['CourseID']);
$this->db->where('US.BranchCode',$details['BranchCode']);
$this->db->where('SM.BranchCode',$details['BranchCode']);
// $this->db->group_by('SM.SessionName','DESC');
$sessionDetails = $this->db->get();
if($sessionDetails->result()){

View File

@ -94,40 +94,38 @@ class University_model extends CI_Model
public function addActivity($arrayDetails=null,$jsonData=null)
{
$this->db->select('ActivityID,ActivityName');
$this->db->where('ActivityName', $arrayDetails['ActivityName']);
$this->db->where('BranchCode', $arrayDetails['BranchCode']);
if($this->db->get(ACTIVITY)->first_row()){
$result['activityStatus'] = false;
$result['message'] = "Activity name is already exist!";
}
else{
$this->db->insert(ACTIVITY, $arrayDetails);
if($this->db->affected_rows() == '1'){
$last = $this->db->order_by('ActivityID',"desc")->limit(1)->get(ACTIVITY)->row();
$lastActivityID=$last->ActivityID;
if($this->db->get(ACTIVITY)->first_row()){
if($jsonData){
foreach ($jsonData as $srow){
$status_array["StatusName"]=$srow['id'];
$status_array["ActivityID"]=$lastActivityID;
$status_array["IsActive"]=$arrayDetails['IsActive'];
$status_array["CreatedBy"]=$arrayDetails['CreatedBy'];
$status_array["CreatedOn"]=$arrayDetails['CreatedOn'];
$this->db->insert(ACTIVITY_STATUS, $status_array);
}
}
$result['activityStatus'] = true;
$result['message'] = "Successfully activity details added";
}
else {
$result['activityStatus'] = false;
$result['message'] = "Activity name is already exist!";
}
else{
$this->db->insert(ACTIVITY, $arrayDetails);
if($this->db->affected_rows() == '1'){
$last = $this->db->order_by('ActivityID',"desc")->limit(1)->get(ACTIVITY)->row();
$lastActivityID=$last->ActivityID;
if($jsonData){
foreach ($jsonData as $srow){
$status_array["StatusName"]=$srow['id'];
$status_array["ActivityID"]=$lastActivityID;
$status_array["IsActive"]=$arrayDetails['IsActive'];
$status_array["CreatedBy"]=$arrayDetails['CreatedBy'];
$status_array["CreatedOn"]=$arrayDetails['CreatedOn'];
$this->db->insert(ACTIVITY_STATUS, $status_array);
}
}
$result['activityStatus'] = true;
$result['message'] = "Successfully activity details added";
}
else {
$result['activityStatus'] = false;
$result['message'] = "Something went wrong.please try again";
}
$result['message'] = "Something went wrong.please try again";
}
}
@ -141,11 +139,12 @@ class University_model extends CI_Model
* created by Surendiran
* */
public function getActivity()
public function getActivity($requestedBy=null,$requestedBranch=null)
{
$this->db->distinct();
$this->db->select('ActivityID,ActivityName,Description,IsActive');
$this->db->where('BranchCode',$requestedBranch);
$this->db->order_by('ActivityID','DESC');
$this->db->select('ActivityID,ActivityName,Description,IsActive');
$activityDetails=$this->db->get(ACTIVITY);
if($activityDetails->result()){
@ -172,7 +171,7 @@ class University_model extends CI_Model
$activity_result['activityStatus'] = false;
$activity_result['details'] = "No records found!";
}
$activity_result['masterStatusList']=$this->getAllStatusList('1');
$activity_result['masterStatusList']=$this->getAllStatusList('1',$requestedBranch);
return $activity_result;
}
@ -202,6 +201,7 @@ class University_model extends CI_Model
$this->db->select('ActivityName');
$this->db->where('ActivityName',$arrayDetails['ActivityName']);
$this->db->where('ActivityID !=',$arrayDetails['ActivityID']);
$this->db->where('BranchCode',$arrayDetails['BranchCode']);
if($this->db->get(ACTIVITY)->first_row()){
$result['activityStatus'] = false;
$result['message'] = "Activity name is already exist!";

View File

@ -105,7 +105,8 @@ if(myModel.status.length > 0) {
description: myModel.Description,
status: myModel.switchsetting,
activityStatus:myModel.status,
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID
}
};
$http(addactivity).then(function (response) {
@ -114,7 +115,11 @@ if(myModel.status.length > 0) {
$scope.init();
swal("","Activity details added successfully.", "success");
$state.go($state.current, {}, { reload: true });
} else {
}
else if(response.data.activityStatus==false){
swal("",response.data.message, "warning");
}
else {
$scope.ldloading[loading.replace('-', '_')] = false;
swal(" ", "Something went wrong.please try again.", "error");
}
@ -149,7 +154,8 @@ swal("Warning!", "Status are required", "warning");
'Content-Type': 'application/json'
},
data: {
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID
}
};
$http(getActivity).then(function (response) {
@ -224,7 +230,8 @@ swal("Warning!", "Status are required", "warning");
description: myModel.Description,
status: myModel.IsActive,
activityStatus:listStatus.list,
updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID
updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID
}
};
$http(update).then(function (response) {
@ -236,7 +243,11 @@ swal("Warning!", "Status are required", "warning");
$scope.editId = -1;
} else {
}
else if(response.data.activityStatus==false){
swal("",response.data.message, "warning");
}
else {
$scope.ldloading3[loading.replace('-', '_')] = false;
swal(" ","Something went wrong.please try again", "error");
}

View File

@ -95,7 +95,9 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
'Content-Type': 'application/json'
},
data: {
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID
}
};
$http(getUniv).then(function (response) {
@ -625,6 +627,7 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
installmentItems:$rootScope.updateMoreItems,
batchCode:updateModel.BatchCode,
branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID
}
};
@ -681,7 +684,8 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
ID:ID,
courseID: courseID,
studentID: studeID,
requestedtBy: JSON.parse(localStorage.getItem('localObj')).localUserID
requestedtBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID
}
};
$http(getFees).then(function (response) {
@ -741,7 +745,8 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
ID:ID,
courseID: courseID,
studentID: studeID,
requestedtBy: JSON.parse(localStorage.getItem('localObj')).localUserID
requestedtBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID
}
};
$http(setFees).then(function (response) {

View File

@ -8,52 +8,52 @@
</legend>
<div class="row">
<div class="col-md-4 form-group" ng-class="{'has-error':Form.ListCode.$dirty && Form.ListCode.$invalid, 'has-success':Form.ListCode.$valid}">
<div class="col-md-4 form-group" ng-class="{'has-error':Form.EditActivityID.$dirty && Form.EditActivityID.$invalid, 'has-success':Form.EditActivityID.$valid}">
<label>
Activity ID<span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter Activity ID" tabindex="1" class="form-control" name="ActivityID" ng-model="p.ActivityID"
<input type="text" placeholder="Enter Activity ID" tabindex="6" class="form-control" name="EditActivityID" ng-model="p.ActivityID"
readonly required/>
<span class="error text-small block" ng-if="Form.ListCode.$dirty && Form.ListCode.$error.required">Activity ID is required</span>
<span class="error text-small block" ng-if="Form.EditActivityID.$dirty && Form.EditActivityID.$error.required">Activity ID is required</span>
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.ListName.$dirty && Form.ListName.$invalid, 'has-success':Form.ListName.$valid}">
<div class="col-md-4 form-group" ng-class="{'has-error':Form.EditActivityName.$dirty && Form.EditActivityName.$invalid, 'has-success':Form.EditActivityName.$valid}">
<label>
Activity Name <span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter Activity Name" tabindex="2" class="form-control" name="ListName" ng-model="p.ActivityName"
<input type="text" placeholder="Enter Activity Name" tabindex="7" class="form-control" name="EditActivityName" ng-model="p.ActivityName"
required/>
<span class="error text-small block" ng-if="Form.ListName.$dirty && Form.ListName.$error.required">Activity name is required</span>
<span class="error text-small block" ng-if="Form.ListName.$dirty && Form.ListName.$error.pattern">Invalid activity name </span>
<span class="error text-small block" ng-if="Form.EditActivityName.$dirty && Form.EditActivityName.$error.required">Activity name is required</span>
<span class="error text-small block" ng-if="Form.EditActivityName.$dirty && Form.EditActivityName.$error.pattern">Invalid activity name </span>
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.Description.$dirty && Form.Description.$invalid, 'has-success':Form.Description.$valid}">
<div class="col-md-4 form-group" ng-class="{'has-error':Form.EditDescription.$dirty && Form.EditDescription.$invalid, 'has-success':Form.EditDescription.$valid}">
<label>
Description <span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter Description Name" tabindex="3" class="form-control" name="Description" ng-model="p.Description"
<input type="text" placeholder="Enter Description Name" tabindex="8" class="form-control" name="EditDescription" ng-model="p.Description"
required/>
<span class="error text-small block" ng-if="Form.Description.$dirty && Form.Description.$error.required">Description is required</span>
<span class="error text-small block" ng-if="Form.Description.$dirty && Form.Description.$error.pattern">Invalid description </span>
<span class="error text-small block" ng-if="Form.EditDescription.$dirty && Form.EditDescription.$error.required">Description is required</span>
<span class="error text-small block" ng-if="Form.EditDescription.$dirty && Form.EditDescription.$error.pattern">Invalid description </span>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group"
ng-class="{'has-error':Form.status.$dirty && Form.status.$invalid && viewEditStatus.list.length==0, 'has-success':Form.status.$valid}">
ng-class="{'has-error':Form.EditStatus.$dirty && Form.EditStatus.$invalid && viewEditStatus.list.length==0, 'has-success':Form.EditStatus.$valid}">
<label >
Status<span
class="symbol required"></span>
</label>
<ui-select multiple ng-model="viewEditStatus.list" tabindex="4">
<ui-select multiple ng-model="viewEditStatus.list" tabindex="9">
<ui-select-match placeholder="Select Status">
{{$item.name}}
</ui-select-match>
@ -63,11 +63,11 @@
</ui-select-choices>
</ui-select>
<input class="ng-hide" name="status"
<input class="ng-hide" name="EditStatus"
ng-model="viewEditStatus.list"
required>
<span class="error text-small block"
ng-if="Form.status.$dirty && Form.status.$error.required && viewEditStatus.list.length==0">Status is required.</span>
ng-if="Form.EditStatus.$dirty && Form.EditStatus.$error.required && viewEditStatus.list.length==0">Status is required.</span>
<!--<span class="success text-small block"-->
<!--ng-if="Form.subjects.$valid && myModel.subjects.length!=0">Thank You</span>-->
</div>
@ -97,11 +97,11 @@
<div class="row">
<div class="col-md-12">
<div class="pull-right">
<button type="submit" ladda="ldloading3.zoom_in" tabindex="5" class="btn btn-wide btn-success" data-style="zoom-in" ng-click="updateActivity(p,viewEditStatus,Form,'zoom-in')">
<button type="submit" ladda="ldloading3.zoom_in" tabindex="10" class="btn btn-wide btn-success" data-style="zoom-in" ng-click="updateActivity(p,viewEditStatus,Form,'zoom-in')">
Save
</button>
<input type="button" class="btn btn-warning btn-wide" tabindex="6" value="Cancel" ng-click="cancel();">
<input type="button" class="btn btn-warning btn-wide" tabindex="11" value="Cancel" ng-click="cancel();">
</input>
</div>