0xV3NOMx
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.21.105.222


Current Path : /proc/thread-self/root/var/www/html/univadmin_bkp/univadmin/src/
Upload File :
Current File : //proc/thread-self/root/var/www/html/univadmin_bkp/univadmin/src/inward.php

<?php

function loadData($aobj_context)
{
  $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
  
  $query = "select distinct c.fcollcode, concat(c.fcollname,', ',c.ftown) as college_name from college c
  where ifnull(c.fdeleted,'') <> 'T'
  order by c.fcollname";
  $result = $aobj_context->pobj_db->GetAll($query);
  $arr['college'] = $result;

  $query = "select fid, fdescpn from masto where ftype = 'i'
  and ifnull(fdeleted,'') <> 'T'";
  $result = $aobj_context->pobj_db->GetAll($query);
  $arr['masto'] = $result;

  if ($result)
  {
    
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, "success");

  } else {
    $arr['msg'] = 'Something Went wrong';
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
  }
} 

function fromSubmitInward($aobj_context)
{
  $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
  
  $fcollcode = $aobj_context->req_body["fcollcode"];
  $fid = $aobj_context->req_body["fid"];
  $fltfrom = $aobj_context->req_body["fltfrom"];
  $fto = $aobj_context->req_body["fto"];
  $fname = $aobj_context->req_body["fname"];
  $fsubject = $aobj_context->req_body["fsubject"];
  $fregno = $aobj_context->req_body["fregno"];
  $fothers = $aobj_context->req_body["fothers"];
  $fconfi = $aobj_context->req_body["fconfi"];
  $ftype = $aobj_context->req_body["ftype"];

  $from = "";
  if($fltfrom == 'CL')
  {
    $from = $fcollcode;
  }

  if($fltfrom == 'ST')
  {
    $from = $fregno;
  }

  if($fltfrom == 'OT')
  {
    $from = $fothers;
  }

  if($fid == "")
  {  
    $query = "insert into inward(fltfrom,ffrom,faddress,fsubject,fto,fconfi,fcreated,ftype) values('{$fltfrom}','{$from}','{$fname}','{$fsubject}','{$fto}','{$fconfi}',now(),'{$ftype}')";
    $result = $aobj_context->pobj_db->Execute($query);
  }  
  //var_dump($query);
  if($fid != "")
  {
    $query = "update inward set 
    faddress = '{$fname}', 
    fto = '{$fto}',
    fconfi = '{$fconfi}',
    ffrom = '{$ffrom}',
    fsubject = '{$fsubject}',
    fupdated = now()
    where fid = '{$fid}'";
    $result = $aobj_context->pobj_db->Execute($query);
  }  

  if ($result)
  {
    $arr['msg'] = 'Updated successfully.';
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, "success");

  } else {
    $arr['msg'] = 'Something Went wrong';
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
  }

}

function getName($aobj_context)
{
  $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
  
  $value = $aobj_context->mobj_data["value"];
  $fltfrom = $aobj_context->mobj_data["fltfrom"];

  if($fltfrom == "CL")
  {
    $query = "select concat(FCOLLADD1,' ',FCOLLADD2,' ',FCOLLADD3,' ',FCOLLADD4) as fname from college c
    where fcollcode ='{$value}'";
    
  }

  if($fltfrom == "ST")
  {
    $query = "select fname from student where fregno = '{$value}'";
  }
  
  $result = $aobj_context->pobj_db->GetRow($query);

  $arr['fname'] = $result['fname'];

  if ($result)
  {
    
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, "success");

  } else {
    $arr['msg'] = 'Something Went wrong';
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
  }
} 

?>