Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.143.239.63
<?php
class process_payment
{
function __construct($aobj_context)
{
session_start();
$this->aobj_context=$aobj_context;
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$this->aobj_context=$aobj_context;
$this->ip=$_SERVER["REMOTE_ADDR"];
}
function CheckPaymentAppNo()
{
$this->app_no=trim($this->aobj_context->mobj_data["app_no"]);
$this->fdob=trim($this->aobj_context->mobj_data["fdob"]);
$get_data="select count(app_no) as cnt
from stud_det where app_no='{$this->app_no}'
and ifnull(frollno,'') <> '' and fselected = 'T'";
$obj_get_data=$this->aobj_context->mobj_db->GetRow($get_data);
$cnt=$obj_get_data['cnt'];
if($cnt==0)
{
echo $this->aobj_context->mobj_output->ToJSONEnvelope($obj_get_data,-1,"failure");
return;
}
else
{
echo $this->aobj_context->mobj_output->ToJSONEnvelope($obj_get_data,0,"success");
return;
}
}
function GetStudentDetailsForPayment()
{
$this->app_no=trim($this->aobj_context->mobj_data["app_no"]);
$get_data="select s.app_no,concat(fname,' ',fmotname,' ',ffatname) as fname,CONCAT(cat.FCATEGORY,' - ',cat.FDESCPN) as fcatcode,
fpaymode,
femail,famount,
ifnull(fextamt,0) as fextamt,
ifnull(famount,0)+ifnull(fextamt,0) as ftotal
from student s
inner join subject sub on sub.fsubcode=s.fsubcode
inner join mascategory cat on cat.FCATEGORY=s.fcatcode
where app_no='{$this->app_no}'";
$obj_get_data=$this->aobj_context->mobj_db->GetRow($get_data);
$fname=$obj_get_data['fname'];
$fcatcode=$obj_get_data['fcatcode'];
$femail=$obj_get_data['femail'];
$fpaymode=$obj_get_data['fpaymode'];
$famount=round($obj_get_data['famount'],2);
$fextamt=round($obj_get_data['fextamt']);
$ftotal=round($obj_get_data['ftotal']);
$html="";
$html.="<tr>
<td class='payment_table_td1'>Application No
</td>
<td class='payment_table_td2' id='app_no' >: {$this->app_no}
</td>
<td class='payment_table_td3' > Challan No
</td>
<td class='payment_table_td4'>: </td>
<td class='payment_table_td5a'> <input type='text' id='challan_no' />
</td>
</tr> ";
$html.="<tr>
<td class='payment_table_td1'>Name
</td>
<td class='payment_table_td2' >: {$fname}
</td>
<td class='payment_table_td3' >Bank Name
</td>
<td class='payment_table_td4'>: </td>
<td class='payment_table_td5' > <input type='text' id='bank_name' />
</td>
</tr> ";
$html.="<tr>
<td class='payment_table_td1'>Category
</td>
<td class='payment_table_td2' >: {$fcatcode}
</td>
<td class='payment_table_td3' >Date of Payment
</td>
<td class='payment_table_td4'>: </td>
<td class='payment_table_td5' > <input type='text' id='date_of_payment' />
</td>
</tr> ";
$html.="<tr>
<td class='payment_table_td1'>Email
</td>
<td class='payment_table_td2' >: {$femail}
</td>
<td class='payment_table_td3' >Amount Paid
</td>
<td class='payment_table_td4'>: </td>
<td class='payment_table_td5' align='right' style='color:#9F4F4F;font-size:14px;' > <input type='text' disabled id='amount_paid' value='{$famount}'/>
</td>
</tr> ";
if(empty($obj_get_data))
{
$data="Invalid Application No";
echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}else
{
$arr['html']=$html;
echo $this->aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
}
function DoUpdateChallan()
{
$this->app_no=trim($this->aobj_context->mobj_data["app_no"]);
$this->fchallan_amt=trim($this->aobj_context->mobj_data["fchallan_amt"]);
$this->fbank_name=trim($this->aobj_context->mobj_data["fbank_name"]);
$this->fchallan_date=trim($this->aobj_context->mobj_data["fchallan_date"]);
$this->fchallan_no=trim($this->aobj_context->mobj_data["fchallan_no"]);
$get_fapproved="select ifnull(fapproved,'F') as fapproved
from student where app_no='{$this->app_no}'";
$obj_get_fapproved=$this->aobj_context->mobj_db->GetRow($get_fapproved);
$fapproved=$obj_get_fapproved['fapproved'];
if($fapproved=="T")
{
$data="Challan is allready updated, you cannot update";
echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}
$update="update student set
fchallan_no='{$this->fchallan_no}',
fbank_name='{$this->fbank_name}',
fchallan_date='{$this->fchallan_date}',
fchallan_amt='{$this->fchallan_amt}',fapproved='T'
where app_no='{$this->app_no}'
";
$obj_get_data=$this->aobj_context->mobj_db->Execute($update);
if(!$obj_get_data)
{
$data="failed";
echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}
else
{
$data="Challan Details Update.Print the application in Print Application menu.";
echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,0,"success");
return;
}
}
}
function GetStudentDetailsForPayment($aobj_context)
{
$obj=new process_payment($aobj_context);
$obj->GetStudentDetailsForPayment();
}
function CheckPaymentAppNo($aobj_context)
{
$obj=new process_payment($aobj_context);
$obj->CheckPaymentAppNo();
} function DoUpdateChallan($aobj_context)
{
$obj=new process_payment($aobj_context);
$obj->DoUpdateChallan();
}
?>
|