Merge remote-tracking branch 'origin/master'

This commit is contained in:
gandhimathi 2018-04-23 11:45:27 +05:30
commit f59f218958
5 changed files with 21 additions and 13 deletions

View File

@ -53,6 +53,7 @@ class Certificate_Controller extends REST_Controller {
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
$details['CertificateName'] = $this->post('certificateName');
$details['CreatedBy'] = $this->post('createdBy');
$details['BranchCode'] = $this->post('reqBrach');
$details['IsActive'] = $this->post('status');
$details['CreatedOn'] = $now->format('Y-m-d H:i:s');
$certificateDetails = $this->certificate_model->addcertificate($details);// Check if the users data store contains users (in case the database result returns NULL)

View File

@ -247,7 +247,8 @@ class University_Controller extends REST_Controller {
public function getDefaultActivityDetails_post()
{
$requestedBy = $this->post('requestedBy');
$getDefaultActivity = $this->university_model->getDefaultActivity($requestedBy);
$requestedBranch = $this->post('requestedBranch');
$getDefaultActivity = $this->university_model->getDefaultActivity($requestedBy, $requestedBranch);
if ($getDefaultActivity)
{
$getDefaultActivity['status'] = REST_Controller::HTTP_OK;
@ -269,13 +270,13 @@ class University_Controller extends REST_Controller {
public function updateDefaultActivityDetails_post()
{
$now = new DateTime();
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
$details['StudentActivityCode'] = $this->post('activityID');
$details['StatusCode'] = $this->post('activityName');
//$details['IsActive'] = $this->post('status');
$details['UpdatedBy'] = $this->post('updatedBy');
$details['BranchCode'] = $this->post('reqBranch');
$details['UpdatedOn'] = $now->format('Y-m-d H:i:s');
$jsonData=$this->post('activityStatus');
$activityDetails = $this->university_model->updateDefaultActivity($details,$jsonData);// Check if the users data store contains users (in case the database result returns NULL)

View File

@ -181,11 +181,12 @@ class University_model extends CI_Model
* created by kms
* */
public function getAllStatusList($groupName=null)
public function getAllStatusList($groupName=null, $branch = null)
{
$this->db->select('ListCode,ListName');
$this->db->where('ListGroup',$groupName);
$this->db->where('IsActive','1');
$this->db->where('BranchCode', $branch);
$this->db->order_by('ListCode','ASC');
$status = $this->db->get(PICK_LIST_DETAILS);
return $status->result();
@ -273,7 +274,7 @@ class University_model extends CI_Model
* get default activity details
* created by kms
* */
public function getDefaultActivity()
public function getDefaultActivity($reqBy, $reqBranch)
{
$arr = array('ListGroup'=>2,'ListGroup'=>6);
$this->db->distinct();
@ -296,20 +297,19 @@ class University_model extends CI_Model
$this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = DA.StatusCode');
// $this->db->where('PLD.IsActive','1');
$this->db->where('DA.IsActive','1');
$this->db->where('DA.BranchCode', $reqBranch);
// $this->db->where('PLD.BranchCode', $reqBranch);
$this->db->where('DA.StudentActivityCode',$row->ListCode);
$result_array['statusDetails']=$this->db->get()->result();
$result[]=$result_array;
}
$activity_result['details'] = $result;
}
else {
$activity_result['activityStatus'] = false;
$activity_result['details'] = "No records found!";
}
$activity_result['masterStatusList']=$this->getAllStatusList('1');
$activity_result['masterStatusList']=$this->getAllStatusList('1', $reqBranch);
return $activity_result;
}
@ -319,10 +319,11 @@ class University_model extends CI_Model
* */
public function updateDefaultActivity($arrayDetails=null,$jsonData=null) {
$branchCode = $arrayDetails['BranchCode'];
$deactiveStatus['IsActive']=false;
$deactiveStatus['UpdatedBy']=$arrayDetails['UpdatedBy'];
$deactiveStatus['UpdatedOn']=$arrayDetails['UpdatedOn'];
$this->db->where('BranchCode',$branchCode);
$this->db->where('StudentActivityCode ',$arrayDetails['StudentActivityCode']);
$updateActivityStatusDeactive = $this->db->update(DEFAULTACTIVITY, $deactiveStatus);
if($updateActivityStatusDeactive){
@ -333,6 +334,7 @@ class University_model extends CI_Model
$this->db->select('StatusCode');
$this->db->where('StatusCode',$urow);
$this->db->where('BranchCode',$branchCode);
$this->db->where('StudentActivityCode',$arrayDetails['StudentActivityCode']);
if($this->db->get(DEFAULTACTIVITY)->first_row()){
$existStatusUpdate['IsActive']=true;
@ -348,6 +350,7 @@ class University_model extends CI_Model
$update_array["IsActive"]=true;
$update_array["CreatedBy"]=$arrayDetails['UpdatedBy'];
$update_array["CreatedOn"]=$arrayDetails['UpdatedOn'];
$update_array["BranchCode"]= $branchCode;
$this->db->insert(DEFAULTACTIVITY, $update_array);
}

View File

@ -73,7 +73,8 @@ $scope.certificateForm = {
data: {
certificateName: myModel.CertificateName,
status: myModel.switchsetting,
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
reqBrach: JSON.parse(localStorage.getItem('localObj')).localBranchID
}
};

View File

@ -40,7 +40,8 @@ app.controller("studentStatusUpdateCtrl", ["$scope", "toaster", "$filter", "API_
'Content-Type': 'application/json'
},
data: {
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
requestedBranch: JSON.parse(localStorage.getItem('localObj')).localBranchID
}
};
$http(getActivity).then(function (response) {
@ -113,7 +114,6 @@ app.controller("studentStatusUpdateCtrl", ["$scope", "toaster", "$filter", "API_
* created by kms
* */
$scope.updateActivity = function (myModel,listStatus, form, loading) {
var firstError = null;
if (form.$invalid) {
var field = null, firstError = null;
@ -130,6 +130,7 @@ app.controller("studentStatusUpdateCtrl", ["$scope", "toaster", "$filter", "API_
}
angular.element('.ng-invalid[name=' + firstError + ']').focus();
} else {
$scope.ldloading3 = {};
$scope.ldloading3[loading.replace('-', '_')] = true;
@ -145,7 +146,8 @@ app.controller("studentStatusUpdateCtrl", ["$scope", "toaster", "$filter", "API_
activityID: myModel.ActivityID,
activityName: myModel.ActivityName,
activityStatus:listStatus.list,
updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID
updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
reqBranch: JSON.parse(localStorage.getItem('localObj')).localBranchID
}
};
$http(update).then(function (response) {