";
$servername = SERVERNAME;
$username = USERNAME;
$password = PASSWORD;
$dbname = "logisys3_nehu";
$conn = new mysqli($servername, $username, $password, $dbname);
for($i = 0; $i < $dataSize; $i++)
{
$information=explode('=',$decryptValues[$i]);
$response[$information[0]] = $information[1];
}
//var_dump($response['order_status']);
if($response['order_status'] === "Success")
{
$productinfo = $response['merchant_param3'];
$regno = $response['merchant_param2'];
$txnid = $response['tracking_id'];
$amt = $response['amount'];
$firstname = 'HDFC';
$typeno = substr($productinfo,0,1);
if($typeno == '1')
{
$update="update appcandsum set FPAYMENTREMARKS='{$txnid}',FPAYMENTSTATUS='success',
FPAYMENTCONFIRM='success',FACKDATE=now(),FACKUSER='{$firstname}',
FPAYGATEWAY = '{$firstname}'
where APPNO='{$productinfo}'";
$result=$conn->query($update);
$get_app_cand_det="SELECT a.FDEGREE,a.FEXAMNO,a.FCOLLCODE,
a.FREGNO,a.FSUBCODE,a.FINSERTED,a.FPRESENT,a.FYEAR,a.FEXAMTYPE,concat('Message from Bengaluru Central University : ',
' Dear ',s.fname,' (Reg. no. : ',s.fregno,' , Stud. id. : ',s.fstudid,'),',
' Rs.',FLOOR(c.FTOTALFEE),'/- is received at university. Your application no. is ',c.appno,
'. keep this information for future reference.',' Sent Time: ',time(now())) as message
FROM appcanddet a inner join student s on a.fdegree = s.fdegree
and s.fcollcode = a.fcollcode and
a.fregno = s.fregno inner join appcandsum c on a.fdegree = c.fdegree
and a.fcollcode = c.fcollcode and a.fregno = c.fregno and a.appno = c.appno
WHERE c.APPNO='{$productinfo}'";
$result = $conn->query($get_app_cand_det);
if (mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_assoc($result))
{
$collcode = $row['FCOLLCODE'];
$degree = $row['FDEGREE'];
$regno = $row['FREGNO'];
$text = $row['message'];
}
}
$update_cand_sum = "UPDATE appcandsum a,candsum c
SET
c.FEXAMFEEA=if(ifnull(c.FEXAMFEEA,0) <=0,ifnull(a.FEXAMFEEA,0),ifnull(c.FEXAMFEEA,0)),
c.FEXAMFEEB=if(ifnull(c.FEXAMFEEB,0) <=0,ifnull(a.FEXAMFEEB,0),ifnull(c.FEXAMFEEB,0)),
c.FEXAMFEEC=if(ifnull(c.FEXAMFEEC,0) <=0,ifnull(a.FEXAMFEEC,0),ifnull(c.FEXAMFEEC,0)),
c.FEXAMFEED=if(ifnull(c.FEXAMFEED,0) <=0,ifnull(a.FEXAMFEED,0),ifnull(c.FEXAMFEED,0)),
c.FEXAMFEEE=if(ifnull(c.FEXAMFEEE,0) <=0,ifnull(a.FEXAMFEEE,0),ifnull(c.FEXAMFEEE,0)),
c.FEXAMFEEF=if(ifnull(c.FEXAMFEEF,0) <=0,ifnull(a.FEXAMFEEF,0),ifnull(c.FEXAMFEEF,0)),
c.FEXAMFEEG=if(ifnull(c.FEXAMFEEG,0) <=0,ifnull(a.FEXAMFEEG,0),ifnull(c.FEXAMFEEG,0)),
c.FEXAMFEEH=if(ifnull(c.FEXAMFEEH,0) <=0,ifnull(a.FEXAMFEEH,0),ifnull(c.FEXAMFEEH,0)),
c.FEXAMFEEI=if(ifnull(c.FEXAMFEEI,0) <=0,ifnull(a.FEXAMFEEI,0),ifnull(c.FEXAMFEEI,0)),
c.FEXAMFEEJ=if(ifnull(c.FEXAMFEEJ,0) <=0,ifnull(a.FEXAMFEEJ,0),ifnull(c.FEXAMFEEJ,0)),
c.FTOTALFEE=a.FTOTALFEE,
c.frecptdate = date(now())
WHERE a.fregno=c.FREGNO
AND a.APPNO='{$productinfo}' and a.FCOLLCODE='{$collcode}'";
$result = $conn->query($update_cand_sum);
$update_cand_appCand = "update canddet c, appcanddet t
set c.finserted = t.finserted,
c.fpresent = t.fpresent
where c.fdegree = t.fdegree
and c.fexamno = t.fexamno
and c.fregno = t.fregno
and c.fsubcode = t.fsubcode
and c.fdegree = '{$degree}' and c.fregno = '{$regno}'
and t.APPNO='{$productinfo}' and ifnull(c.fpresent,'') <> 'P'";
$result = $conn->query($update_cand_appCand);
$insert_canddet ="insert into canddet(fdegree,FEXAMNO, FCOLLCODE, FREGNO, FSUBCODE, FINSERTED, FPRESENT, FYEAR, FEXAMTYPE)
select fdegree, FEXAMNO, FCOLLCODE,FREGNO, FSUBCODE,FINSERTED, FPRESENT, FYEAR,FEXAMTYPE from appcanddet where
fregno = '{$regno}' and appno ='{$productinfo}' and CONCAT(fdegree,fexamno,fregno,fsubcode)
not in(select CONCAT(fdegree,fexamno,fregno,fsubcode) from canddet where fregno = '{$regno}')
";
$result = $conn->query($insert_canddet);
$update_studfee = "update studfee s, appstudfee a
set s.famount = a.famount,
s.flogdate = a.flogdate
where s.fdegree = a.fdegree
and s.fexamno = a.fexamno
and s.fregno = a.fregno
and s.ffeecode = a.ffeecode
and s.fregno = '{$regno}'
and s.famount <= 0
and a.appno ='{$productinfo}'";
$result = $conn->query($update_studfee);
$insert_studfee = "insert into studfee(fdegree,fexamno,fcollcode,fregno,ffeecode,famount,flogdate,fyear,fexamtype)
select fdegree,fexamno,fcollcode,fregno,ffeecode,famount,flogdate,fyear,fexamtype from appstudfee where
fregno = '{$regno}' and appno ='{$productinfo}' and CONCAT(fdegree,fexamno,fregno,ffeecode)
not in(select CONCAT(fdegree,fexamno,fregno,ffeecode) from studfee where fdegree = '{$degree}'
and fregno = '{$regno}')";
$result = $conn->query($insert_studfee);
$query = "select fdegree,fexamno,fcollcode,fregno,ffeecode,famount,flogdate,fyear,fexamtype
from appstudfee where
fregno = '{$regno}' and appno ='{$productinfo}' and ffeecode = '02 Provisional Certificate'";
$result1 = $conn->query($query);
if(mysqli_num_rows($result1) > 0)
{
$query = "INSERT INTO studmiscfee (fdescpn, fregno,fremamount, forderid, fpaymentype, fpaymentstatus, fpaydate, FPAYMENTREMARKS)VALUES('PPC Fee', '{$regno}', '100', '{$txnid}', 'hdfc', 'success', now(),'{$txnid}')";
$result2 = $conn->query($query);
}
$html = "";
echo "
";
echo $html;
$html = "";
}else if($typeno == '4')
{
$status = 'success';
$html = "";
echo "
";
echo $html;
$html = "";
}
else
{
$update="update studadm set FPAYMENTREMARKS='{$txnid}', FPAYMENTSTATUS='success',
fpaymentdate=now(), FPAYMENTTYPE = '{$firstname}'
where fappno = '{$productinfo}'";
//var_dump($update);
$result=$conn->query($update);
$html = "";
echo "
";
echo $html;
$html = "";
}
}
else if($response['order_status']==="Aborted")
{
echo "
Thank you for shopping with us.We will keep you posted regarding the status of your order through e-mail"; } else if($response['order_status']==="Failure") { echo "
Thank you for shopping with us.However,the transaction has been declined."; } else { echo $response['order_status']; } echo "
"; echo "";
// for($i = 0; $i < $dataSize; $i++)
// {
// $information=explode('=',$decryptValues[$i]);
// echo '
"; echo ""; ?>
Thank You. Your order status is success
"; echo "Your Transaction ID for this transaction is ".$txnid.".
"; echo "We have received a payment of Rs. " .$amt."
"; $html="Your Transaction ID for this transaction is ".$txnid.".
"; echo "We have received a payment of Rs. " . $amt ."
"; $html="
Click here to take a PrintOut
";
echo $html;
$html = "";
$update="update studmiscfee set FPAYMENTREMARKS='{$txnid}', fpaymentstatus='{$status}', fpaydate = now()
where fappno='{$productinfo}'";
$result=$conn->query($update);
}
else if($typeno == '2')
{
$status = 'success';
$html = "";
echo "Your Transaction ID for this transaction is ".$txnid.".
"; echo "We have received a payment of Rs. " . $amt ."
"; $html="
Click here to take a PrintOut
";
echo $html;
$html = "";
$update="update res_stud set FPAYMENTREMARKS='{$txnid}',FPAYMENTSTATUS='{$status}',
FPAYMENTCONFIRM='{$status}', fackdate = current_date(), funivrecdate = current_date(),
fackuser = '{$firstname}', FCHALLANNO = '{$txnid}'
where APPNO='{$productinfo}'";
$result=$conn->query($update);
}
else if ($typeno == "3") {
$update = "update dctran set FPAYREMARKS='{$txnid}',
FPAYSTATUS='success',FPAYDATE=now(),FTRANID='{$txnid}'
where FAPPNO='{$productinfo}'";
//var_dump($update);
$result = $conn->query($update);
$html = "";
echo "Thank You. Your Payment status is success
"; echo "Your Transaction ID for this transaction is ".$txnid.".
"; echo "We have received a payment of Rs. " .$amt."
"; $html="Thank You. Your order status is success
"; echo "Your Transaction ID for this transaction is ".$txnid.".
"; echo "We have received a payment of Rs. " .$amt."
"; $html="Thank you for shopping with us.We will keep you posted regarding the status of your order through e-mail"; } else if($response['order_status']==="Failure") { echo "
Thank you for shopping with us.However,the transaction has been declined."; } else { echo $response['order_status']; } echo "
"; echo "
'.$information[0].' | '.urldecode($information[1]).' |
"; echo ""; ?>