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
Current Path : /var/www/html/ibm/src/ |
| Current File : /var/www/html/ibm/src/applicationStatus.php |
<?php
function getApplicationDetails($aobj_context)
{
//var_dump($aobj_context);
$status = trim($aobj_context->mobj_data["status"]);
$fromdate = trim($aobj_context->mobj_data["fromdate"]);
$todate = trim($aobj_context->mobj_data["todate"]);
$fromroll = trim($aobj_context->mobj_data["fromroll"]);
$toroll = trim($aobj_context->mobj_data["toroll"]);
$servcode = trim($aobj_context->mobj_data["servcode"]);
$paystatus = trim($aobj_context->mobj_data["paystatus"]);
$user = $_SESSION['username'];
$usertype = $_SESSION['usertype'];
$lstrserv = "and st.fservcode='{$servcode}'";
$paystatus="success";
if($servcode=="all")
$lstrserv="";
if($usertype == 'adm' ){
if($status == 'Verified' && $usertype == 'adm'){
$lstrstatus = "AND IFNULL(st.fverifystatus,'') = 'Verified' ";
}else if($status == 'pending'){
$lstrstatus = "AND IFNULL(st.fverifystatus,'') <> 'Verified'";
}
if($status == 'all'){
// $lstrstatus = "AND IFNULL(st.fverifystatus,'') = 'Verified'";
}
if($usertype != 'adm'){
if($status=="all")
$lstrstatus="";
if($lstrpaystatus == 'success'){
$lstrpaystatus = "and st.fpaystatus='{$paystatus}'";
}else if($lstrpaystatus == 'pending'){
$lstrpaystatus = "AND IFNULL(st.fpaystatus,'') <> 'success'";
}
if($paystatus == "all")
$lstrpaystatus = "";
}
}else if($usertype == 'usr' ){
if($status == 'Verified' && $usertype == 'usr'){
$lstrstatus = "AND IFNULL(st.fverifystatus,'') = '' ";
}else if($status == 'pending'){
$lstrstatus = "AND IFNULL(st.fverifystatus,'') <> 'Verified'";
}
if($usertype == 'usr'){
if($status=="all")
$lstrstatus="AND IFNULL(st.fverifystatus,'') <> 'Verified'";
$lstrpaystatus = "and st.fpaystatus='{$paystatus}'";
if($paystatus == "all")
$lstrpaystatus = "";
}
}
if($usertype == 'adm')
{
$applist = "and 1=1";
$disabled = "";
}else
{
//$applist = "and FAPPASSIGN = '{$user}'";
$applist = "and 1=1";
$disabled = "disabled";
}
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$query = "SELECT st.fappno,DATE_FORMAT(fappdate,'%d/%m/%Y') AS fappdate,ifnull(st.FAPPASSIGN,'') as FAPPASSIGN, st.fregno, st.fname, st.fcategory, st.ftotal, st.fpaystatus,
s.fservname,IFNULL(st.fverifystatus,'') AS fverifystatus, DATE_FORMAT(st.fverifydate,'%d/%m/%Y') as fverifydate FROM servtran st INNER JOIN servtype s ON
s.fservcode = st.fservcode
WHERE left(st.fappdate,10) BETWEEN DATE_FORMAT(str_to_date('{$fromdate}','%d/%m/%Y'),'%Y-%m-%d')
AND DATE_FORMAT(str_to_date('{$todate}','%d/%m/%Y'),'%Y-%m-%d')
AND st.fregno BETWEEN '{$fromroll}' AND '{$toroll}' {$lstrserv} {$lstrstatus} {$applist} AND fpaystatus ='success'
order by st.fappno, st.fregno";
// var_dump($query);
$result = $aobj_context->mobj_db->GetAll($query);
$i=1;
//$table .= "<tbody id="trecords">";
foreach($result as $key => $value)
{
$sem = array("A"=>"I semiser", "B"=>"II Second Semister", "C"=>"III semister");
$table.="<tr style='cursor:pointer;' id='tr$value[fappno]' onclick='loadStudDet($value[fappno])'>";
$table.="<td>
<span><center>{$i}</center></span>
</td>";
$table.="<td id='appno' >
{$value['fappno']}
</td>";
$table.="<td id='appno' >
{$value['fappdate']}
</td>";
$table.="<td >
{$value['fregno']}
</td>";
$table.="<td >
{$value['fname']}
</td>";
$table.="<td >
{$value['fcategory']}
</td>";
$table.="<td >
{$value['fservname']}
</td>";
$table.="<td >
<span style='float : right;'>{$value['ftotal']}</span>
</td>";
$table.="</tr>";
$i++;
}
//$table .= "</tbody>";
if($result)
{
$arr['table'] = $table;
$arr['appdet'] = $result;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}else
{
$arr = '';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
return;
}
}
function getVerifyList($aobj_context)
{
//var_dump($aobj_context);
$fromdate = trim($aobj_context->mobj_data["fromdate"]);
$todate = trim($aobj_context->mobj_data["todate"]);
$fromroll = trim($aobj_context->mobj_data["fromroll"]);
$toroll = trim($aobj_context->mobj_data["toroll"]);
$servcode = trim($aobj_context->mobj_data["servcode"]);
$lstrserv = "and st.fservcode='{$servcode}'";
//var_dump($fromdate);
$query="SELECT st.fappno,DATE_FORMAT(fappdate,'%d/%m/%Y') AS fappdate,IFNULL(st.FAPPASSIGN,'') AS FAPPASSIGN, st.fregno, st.fname, st.fcategory, st.ftotal,
st.femail,st.fmobile,st.fpaystatus, st.fverifyuser,
s.fservname,IFNULL(st.fverifystatus,'') AS fverifystatus, IFNULL(DATE_FORMAT(st.fverifydate,'%d/%m/%Y'),'') AS fverifydate FROM servtran st INNER JOIN servtype s ON
s.fservcode = st.fservcode
WHERE LEFT(st.fappdate,10) BETWEEN DATE_FORMAT(STR_TO_DATE('$fromdate','%d/%m/%Y'),'%Y-%m-%d')
AND DATE_FORMAT(STR_TO_DATE('$todate','%d/%m/%Y'),'%Y-%m-%d')
AND st.fregno BETWEEN '{$fromroll}' AND '{$toroll}' AND st.fservcode='KS06' AND IFNULL(st.fverifystatus,'') = 'Verified' AND 1=1 AND fpaystatus ='success'
ORDER BY st.fappno, st.fregno";
$result = $aobj_context->mobj_db->GetAll($query);
$i=1;
$sl_no=1;
foreach($result as $key => $value)
{
$table.="<tr style='cursor:pointer;' id='tr$value[fappno]'>";
$table.="<td>
<span><center>{$i}</center></span>
</td>";
// $table.="<td>
// <span><center>{$sl_no}</center></span>
// </td>";
$table.="<td id='{$value['fappno']}' >
{$value['fappno']}
</td>";
$table.="<td >
{$value['fappdate']}
</td>";
$table.="<td >
{$value['fregno']}
</td>";
$table.="<td >
{$value['fname']}
</td>";
$table.="<td >
{$value['fcategory']}
</td>";
$table.="<td >
{$value['ftotal']}
</td>";
$table.="<td >
{$value['femail']}
</td>";
$table.="<td >
{$value['fmobile']}
</td>";
$table.="<td >
{$value['fverifyuser']}
</td>";
$table.="<td >
{$value['fverifydate']}
</td>";
$table.="<td >
<button type='button' class='btn btn-primary waves-effect m-l-10' onclick='getDownload({$value['fappno']})'>
DOWNLOAD
</button>
</td>";
$table.="</tr>";
$i++;
$sl_no++;
}
if($result)
{
$arr['table'] = $table;
$arr['appdet'] = $result;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}else
{
$arr = '';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
return;
}
}
function saveassigneduser($aobj_context)
{
$appno = trim($aobj_context->mobj_data["appno"]);
$user1 = trim($aobj_context->mobj_data["user"]);
$query = "update servtran set FAPPASSIGN = '{$user1}' where fappno = '{$appno}'";
$result = $aobj_context->mobj_db->Execute($query);
if($result)
{
$arr = "Updated Successfully";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}else
{
$arr = "Updation Failure";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
return;
}
}
|