set fees delete options changes

This commit is contained in:
gandhimathi 2018-05-15 11:46:17 +05:30
parent 54da321768
commit 0b1800e29b

View File

@ -739,17 +739,20 @@ class Fees_status_model extends CI_Model
$result_array['feesStatus']=true; $result_array['feesStatus']=true;
foreach ($feesDetails->result() as $row){ foreach ($feesDetails->result() as $row){
$SNoValue=$SNoValue+1; $SNoValue=$SNoValue+1;
$this->db->select('SFS.FeesID,SFS.CourseFees,SFS.Comments,SFS.STFOrWR,SFS.Waiver,SFS.Others,SFS.SessionName,SFS.ToSessionName,SFS.RollNo,SFS.BatchCode,SM.SessionName as MasterSessionName,SM1.SessionName as MasterToSessionName'); $this->db->select('SFS.FeesID,SFS.CourseFees,SFS.Comments,SFS.STFOrWR,SFS.Waiver,SFS.Others,SFS.SessionName,SFS.ToSessionName,SFS.RollNo,SFS.BatchCode,SM.SessionName as MasterSessionName,SM1.SessionName as MasterToSessionName,SFP.ID as FeesPaidID');
$this->db->from(STUDENTS_FEES_STATUS.' as SFS'); $this->db->from(STUDENTS_FEES_STATUS.' as SFS');
$this->db->join(SESSIONMASTER.' as SM', 'SM.SessionID = SFS.SessionName'); $this->db->join(SESSIONMASTER.' as SM', 'SM.SessionID = SFS.SessionName');
$this->db->join(SESSIONMASTER.' as SM1', 'SM1.SessionID = SFS.ToSessionName','left'); $this->db->join(SESSIONMASTER.' as SM1', 'SM1.SessionID = SFS.ToSessionName','left');
$this->db->where('StudentID',$student['StudentID']); $this->db->join(STUDENTS_FEES_PAID.' as SFP', 'SFP.FeesId = SFS.FeesID','left');
$this->db->where('CourseID',$student['CourseID']); $this->db->where('SFS.StudentID',$student['StudentID']);
$this->db->where('FeesType',$row->ID); $this->db->where('SFS.CourseID',$student['CourseID']);
$this->db->where('SFS.FeesType',$row->ID);
$existFeesDetails = $this->db->get(); $existFeesDetails = $this->db->get();
if($existData=$existFeesDetails->result()){ if($existData=$existFeesDetails->result()){
$fetchData['SNo']=$SNoValue; $fetchData['SNo']=$SNoValue;
$fetchData['ExistValue']=1; $fetchData['ExistValue']=1;
$fetchData['FeesPaidID']=$existData[0]->FeesPaidID;
$fetchData['FeesAssignID']=$existData[0]->FeesID;
$fetchData['ID']=$row->ID; $fetchData['ID']=$row->ID;
$fetchData['CourseID']=$row->CourseID; $fetchData['CourseID']=$row->CourseID;
$fetchData['ProgramType']=$row->ProgramType; $fetchData['ProgramType']=$row->ProgramType;
@ -798,6 +801,8 @@ class Fees_status_model extends CI_Model
else{ else{
$fetchData['SNo']=$SNoValue; $fetchData['SNo']=$SNoValue;
$fetchData['ExistValue']=0; $fetchData['ExistValue']=0;
$fetchData['FeesPaidID']="";
$fetchData['FeesAssignID']="";
$fetchData['ID']=$row->ID; $fetchData['ID']=$row->ID;
$fetchData['CourseID']=$row->CourseID; $fetchData['CourseID']=$row->CourseID;
$fetchData['ProgramType']=$row->ProgramType; $fetchData['ProgramType']=$row->ProgramType;
@ -1005,15 +1010,18 @@ class Fees_status_model extends CI_Model
// default course fees details in student status // default course fees details in student status
foreach ($myArray as $row1){ foreach ($myArray as $row1){
$this->db->select('FeesID,CourseFees,STFOrWR,Waiver,Comments,Others,SessionName,ToSessionName,RollNo'); $this->db->select('SFS.FeesID,SFS.CourseFees,SFS.STFOrWR,SFS.Waiver,SFS.Comments,SFS.Others,SFS.SessionName,SFS.ToSessionName,SFS.RollNo,SFP.ID as FeesPaidID');
$this->db->where('StudentID',$student['StudentID']); $this->db->where('SFS.StudentID',$student['StudentID']);
$this->db->where('CourseID',$student['CourseID']); $this->db->where('SFS.CourseID',$student['CourseID']);
$this->db->where('FeesType',$row1['Sem_Year']); $this->db->where('SFS.FeesType',$row1['Sem_Year']);
$existFeesDetails = $this->db->get(STUDENTS_FEES_STATUS); $this->db->from(STUDENTS_FEES_STATUS.' as SFS');
$this->db->join(STUDENTS_FEES_PAID.' as SFP', 'SFP.FeesId = SFS.FeesID','left');
$existFeesDetails = $this->db->get();
if($existData=$existFeesDetails->result()){ if($existData=$existFeesDetails->result()){
$fetchData['Valid']=$valid; $fetchData['Valid']=$valid;
$fetchData['ExistValue']=1; $fetchData['ExistValue']=1;
$fetchData['FeesPaidID']=$existData[0]->FeesPaidID;
$fetchData['FeesAssignID']=$existData[0]->FeesID;
$fetchData['ID']=$row1['Sem_Year']; $fetchData['ID']=$row1['Sem_Year'];
$fetchData['CourseID']=$row1['CourseID']; $fetchData['CourseID']=$row1['CourseID'];
$fetchData['ProgramType']=$row1['Sem_Year']; $fetchData['ProgramType']=$row1['Sem_Year'];
@ -1049,9 +1057,9 @@ class Fees_status_model extends CI_Model
$fetchData['Valid']=$valid; $fetchData['Valid']=$valid;
$fetchData['ExistValue']=0; $fetchData['ExistValue']=0;
$fetchData['FeesPaidID']="";
$fetchData['FeesAssignID']="";
$fetchData['ID']=$row1['Sem_Year']; $fetchData['ID']=$row1['Sem_Year'];
$fetchData['CourseID']=$row1['CourseID']; $fetchData['CourseID']=$row1['CourseID'];
$fetchData['Sem_Year']=$row1['Sem_Year']; $fetchData['Sem_Year']=$row1['Sem_Year'];
$fetchData['ActualFees']=$row1['ActualFees']; $fetchData['ActualFees']=$row1['ActualFees'];
@ -1741,6 +1749,26 @@ class Fees_status_model extends CI_Model
} }
return $result; return $result;
} }
/*delete set fees details
created by kms
*/
public function deleteSetFees($details=null){
$this->db->where('FeesID', $details['FeesID']);
$this->db->delete(FEES_INSTALLMENT);
if ($this->db->affected_rows() >= '1') {
$this->db->where('FeesID', $details['FeesID']);
$this->db->delete(STUDENTS_FEES_STATUS);
$result['deleteStatus']=true;
$result['message']="Successfully Fees Details Deleted";
}
else{
$result['deleteStatus']=false;
$result['message']="Something went wrong.please try again";
}
return $result;
}
} }