daybook updates , Student model changes : kdk

This commit is contained in:
resicovenba 2018-02-26 12:04:39 +05:30
parent a938278935
commit 7bc421c8ff
7 changed files with 141 additions and 13 deletions

View File

@ -135,6 +135,8 @@ defined('SESSIONDETAILS') OR define('SESSIONDETAILS','T_SessionDetails');
defined('COURSESUBJECT') OR define('COURSESUBJECT','T_CourseSubject_Details');
defined('SESSIONSCHEDULE') OR define('SESSIONSCHEDULE','T_SessionSchedule_Master');
defined('SESSIONSCHEDULEDETAILS') OR define('SESSIONSCHEDULEDETAILS','T_SessionSchedule_Details');
defined('STUDENTDOCUMENTDETAILS') OR define('STUDENTDOCUMENTDETAILS','T_StudentDocumentsDetails');
defined('STUDENTDOCUMENTTRACKDETAILS') OR define('STUDENTDOCUMENTTRACKDETAILS','T_Student_DocumentTrack_Details');

View File

@ -203,6 +203,7 @@ $route['addDayBook'] = 'DayBook_Controller/adddaybook';
$route['updateDayBookStatusAdmin'] = 'DayBook_Controller/updateDayBookStatusAdmin';
$route['getDayBookDetailsSuperAdmin'] = 'DayBook_Controller/getDayBookDetailsSuperAdmin';
$route['empDayBookModuleAccessChk'] = 'DayBook_Controller/empDayBookModuleAccessChk';
$route['deleteDayBookFeePayableDetails'] = 'DayBook_Controller/deleteDayBookFeePayableDetails';
/* * day book master * */
$route['getDayBookMasterDetails'] = 'DayBookMaster_Controller/getDayBookMasterDetails';

View File

@ -118,6 +118,28 @@ class DayBook_Controller extends REST_Controller {
}
}
public function deleteDayBookFeePayableDetails_post() {
$reqData = $this->post('data');
$reqbyData = $this->post('requestDetails');
// print_r($reqbyData);exit();
$deletedayBookFeePayableDetails = $this->daybook_model->delete_dayBookFeePayableDetails($reqData);// Check if the employee exist
if ($deletedayBookFeePayableDetails)
{
$deletedayBookFeePayableDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($deletedayBookFeePayableDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
// Set the response and exit
$this->response([
'message' => 'No list were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
public function updateDayBookDetails_post() {
$reqData = $this->post('data');
$reqbyData = $this->post('localReqDetails');

View File

@ -36,6 +36,7 @@ class DayBook_model extends CI_Model
return $results;
}
public function emp_day_book_AccessChk($arr) {
$id = $arr['localUserID'];
$sql1 = "SELECT t1.FinanceModuleAccess FROM ".STAFF." as t1 LEFT JOIN ".LOGIN." as t2 ON t2.StaffID = t1.StaffID WHERE t2.id = $id";
@ -48,6 +49,7 @@ class DayBook_model extends CI_Model
return $result;
}
// get the daybook details list
public function get_Daybook_Details_List($reqData, $reqDataBy) {
if($reqData['date'] != '' && $reqData['dateTo'] != '') {
@ -95,6 +97,7 @@ class DayBook_model extends CI_Model
return $results;
}
// delete the daybook details
public function delete_dayBookDetails($id) {
$sql1 = " DELETE FROM ".DAYBOOKMASTER." WHERE ID ='$id'";
@ -109,6 +112,65 @@ class DayBook_model extends CI_Model
return $result;
}
// delete the daybook fees entry details
public function delete_dayBookFeePayableDetails($id) {
// echo $id;exit();
$this->db->select('FeesPaymentID');
$this->db->from(DAYBOOKMASTER);
$this->db->where('ID', $id);
$typeDetails = $this->db->get();
$typeStateDetails = $typeDetails->result();
// print_r($typeStateDetails);exit();
$getID = $typeStateDetails[0]->FeesPaymentID;
// if($getID != '' || $getID != null ) {
// $sql1 = " DELETE FROM T_Students_Fees_PaidDetails WHERE ID ='$getID'";
// // update branch to staff_branch table
// if ($this->db->query($sql1) == '1') {
// $sql2 = " DELETE FROM ".DAYBOOKMASTER." WHERE ID ='$id'";
// if ($this->db->query($sql2) == '1') {
// $result['deletedStatus'] = true;
// $result['message'] = "Entry is Deleted";
// }else{
// $result['deletedStatus'] = false;
// $result['message'] = "Something went wrong.please try again";
// }
// } else {
// $result['deletedStatus'] = false;
// $result['message'] = "Something went wrong.please try again";
// }
// return $result;
// } else {
// $sql1 = " DELETE FROM ".DAYBOOKMASTER." WHERE ID ='$id'";
// // update branch to staff_branch table
// if ($this->db->query($sql1) == '1') {
// $result['deletedStatus'] = true;
// $result['message'] = "Entry is Deleted";
// } else {
// $result['deletedStatus'] = false;
// $result['message'] = "Something went wrong.please try again";
// }
// return $result;
// }
try {
$sql1 = " DELETE FROM ".STUDENTS_FEES_PAID." WHERE ID ='$getID'";
$this->db->query($sql1);
} catch(Exception $e) {
echo 'error';
} finally {
$sql1 = " DELETE FROM ".DAYBOOKMASTER." WHERE ID ='$id'";
// update branch to staff_branch table
if ($this->db->query($sql1) == '1') {
$result['deletedStatus'] = true;
$result['message'] = "Entry is Deleted";
} else {
$result['deletedStatus'] = false;
$result['message'] = "Something went wrong.please try again";
}
}
return $result;
}
// update existing daybook details
public function update_dayBookDetails($Arr, $upFor) {
$this->db->where('ID', $upFor);
$this->db->update(DAYBOOKMASTER, $Arr);
@ -137,6 +199,7 @@ class DayBook_model extends CI_Model
return $result;
}
// approve/reject status updation for the daybook expense details
public function update_status_admin($arr) {
$Approval_By = $arr[0]['Approval_By'];
@ -167,6 +230,7 @@ class DayBook_model extends CI_Model
return $result;
}
// daybook full details for super admin view
public function get_Daybook_Details_List_superAdmin($reqData, $reqDataBy){
if($reqData['date'] != '' && $reqData['dateTo'] != '') {

View File

@ -880,7 +880,7 @@ class Student_model extends CI_Model
{
$this->db->select('*');
$this->db->order_by('CreatedOn', 'DESC');
$this->db->from('T_StudentDocumentsDetails');
$this->db->from(STUDENTDOCUMENTDETAILS);
$this->db->where('StudentID', $stuId);
$getDocDetails = $this->db->get();
$documentDetails = $getDocDetails->result();
@ -892,18 +892,17 @@ class Student_model extends CI_Model
$results['docListStatus'] = false;
$results['message'] = 'No record found';
}
return $results;
}
public function deleteStu_doc_details($stuId, $docId)
{
$sql1 = "SELECT * FROM T_StudentDocumentsDetails WHERE StudentID = '" . $stuId . "' AND ID = '" . $docId . "'";
$sql1 = "SELECT * FROM ".STUDENTDOCUMENTDETAILS." WHERE StudentID = '" . $stuId . "' AND ID = '" . $docId . "'";
$resultSql1 = $this->db->query($sql1)->result();
if(count($resultSql1) > 0){
// print_r($resultSql1);
// echo $resultSql1[0]->DocumentStorePath;exit();
$sql = "DELETE FROM T_StudentDocumentsDetails WHERE StudentID = '" . $stuId . "' AND ID = '" . $docId . "'";
$sql = "DELETE FROM ".STUDENTDOCUMENTDETAILS." WHERE StudentID = '" . $stuId . "' AND ID = '" . $docId . "'";
if ($this->db->query($sql)) {
try{
if(!file_exists('../images/' . $resultSql1[0]->DocumentStorePath)) {
@ -954,7 +953,7 @@ class Student_model extends CI_Model
// echo $docCreatadOn;exit();
// ".STAFF_BRANCH."
$sql1 = "INSERT INTO T_StudentDocumentsDetails (StudentID, DocumentName, Status, DocumentStorePath, Comments, CreatedBy, CreatedOn)
$sql1 = "INSERT INTO ".STUDENTDOCUMENTDETAILS." (StudentID, DocumentName, Status, DocumentStorePath, Comments, CreatedBy, CreatedOn)
VALUES ('$stuId', '$docTypeName', '$docStatus', '$strPath', '$docComments', '$docCreatedBy', '$docCreatadOn')";
// update branch to staff_branch table
@ -999,7 +998,7 @@ class Student_model extends CI_Model
public function getStudent_PendingDoc_Details($stuID) {
$this->db->select('*');
$this->db->order_by('CreatedOn', 'DESC');
$this->db->from('T_Student_DocumentTrack_Details');
$this->db->from(STUDENTDOCUMENTTRACKDETAILS);
$this->db->where('StudentID', $stuID);
$getPendDocDetails = $this->db->get();
$documentPendingDetails = $getPendDocDetails->result();
@ -1018,7 +1017,7 @@ class Student_model extends CI_Model
public function addStu_PendingDoc_Details($reqData) {
// echo "model";
// print_r($reqData);exit();
$this->db->insert('T_Student_DocumentTrack_Details', $reqData);
$this->db->insert(STUDENTDOCUMENTTRACKDETAILS, $reqData);
if ($this->db->affected_rows() > 0) {
$results['AddStuPendingDocStatus'] = true;
$results['message'] = "Added Successfully.";

View File

@ -3,7 +3,7 @@
* daybook details capturing
*
*/
app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", 'ipCookie', '$window', function ($scope, $rootScope, toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state, ipCookie, $window) {
app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", 'ipCookie', '$window','SweetAlert', function ($scope, $rootScope, toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state, ipCookie, $window, SweetAlert) {
// get local client details
var localDetail = JSON.parse(localStorage.getItem('localObj'));
@ -30,8 +30,6 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng
$window.localStorage.clear();
$state.go('login.signin');
}
}
$scope.dayBookApprovalAccess = '';
@ -215,6 +213,45 @@ $scope.dayBookApprovalAccess = '';
}
}
//delete the income entry From the fees payable
$scope.deleteFeePayableEntry = function (id) {
// alert(id);
SweetAlert.swal({
title: "Warning!",
text: "Do you want to Delete this Entry ?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#007aff",
confirmButtonText: "Yes!"
}, function (res) {
if (res === true) {
// alert(id);
// alert(stuId);
var deleteFeePayableDetails = {
method: 'POST',
url: apiPoint.url + 'deleteDayBookFeePayableDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
data: id,
requestDetails: localDetails
}
};
$http(deleteFeePayableDetails).then(function (response) {
if (response.data.deletedStatus) {
swal(" ", "Deleted Successfully.", "success");
$scope.getDayBookList();
} else {
swal(" ", response.data.message, "error");
}
});
}
});
}
// delete the income/expense list row
$scope.deleEditEntry = function (id) {
swal({

View File

@ -133,7 +133,9 @@
<td>{{p.ListName}}</td>
<td>{{p.VoucherNumber}}</td>
<td>{{p.PaidTo}}</td>
<td>{{p.TypeName}}</td>
<td>
<span ng-if=" p.PaymentStatus == 1 ">{{p.TypeName}}</span>
<span tooltip="Fees Updation" ng-if=" p.PaymentStatus == 0 " style="color:chocolate">{{p.TypeName}}</span></td>
<td>{{p.Amount}}</td>
<!--<td class="center" tooltip="{{p.Approval_Comments}}" ng-if="p.ListName == 'Income'">
@ -143,8 +145,9 @@
<span ng-if="p.Status == 'Rejected'" style="text-transform: uppercase; text-shadow: 1px 1px rgb(167, 88, 15); color: rgba(236, 24, 24, 0.98823529);">{{p.Status}}</span>
</td>
<td class="center" ng-if="p.Status != 'Pending' && p.ListName != 'Income' ">-</td>
<td class="center" ng-if="p.ListName == 'Income' && p.PaymentStatus == 1 ">
<span> <i tooltip="EDIT" class="glyphicon glyphicon-pencil" ng-click="setEditId(p.ID)"></i> </span>
<td class="center" ng-if="p.ListName == 'Income' ">
<span ng-if=" p.PaymentStatus == 1 "> <i tooltip="EDIT" class="glyphicon glyphicon-pencil" ng-click="setEditId(p.ID)"></i> </span>
<span ng-if=" p.PaymentStatus == 0 "> <i tooltip="DELETE" class="glyphicon glyphicon-remove" ng-click="deleteFeePayableEntry(p.ID)"></i> </span>
</td>
<td class="center" ng-if="p.Status == 'Pending'">
<span> <i tooltip="EDIT" class="glyphicon glyphicon-pencil" ng-click="setEditId(p.ID)"></i> </span>