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.129.253.21
<?php
function replaceChars($name)
{
$spl_char = array("*","/","~","!","@","#","$","%","^","&",":",";","?","/","\\","_","-","'"," ","");
$link_name = strtolower(str_replace($spl_char,"_",$name));
return str_ireplace("__","_",$link_name);
}
function loadUploadsDetails($aobj_context)
{
session_start();
$userid = $_SESSION['userid'];
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$appno = stripslashes($aobj_context->mobj_data["appno"]);
$query = "select concat(ftype,'*',fpath) as flink from upload where fuserid = '{$userid}' and fappno = '{$appno}'";
$result = $aobj_context->mobj_db->getAll($query);
$arr['upload'] = $result;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
function savephotopath($aobj_context)
{
session_start();
$userid = $_SESSION['userid'];
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$appno = stripslashes($aobj_context->mobj_data["appno"]);
$file_file = stripslashes($aobj_context->mobj_data["file_file"]);
$data = stripslashes($aobj_context->mobj_data["path"]);
$query = "select * from upload where fuserid = '{$userid}' and fappno = '{$appno}' and ftype = '{$file_file}'";
$results = $aobj_context->mobj_db->getRow($query);
if($results)
{
$query1 = "update upload set fpath = '{$data}' where fuserid = '{$userid}' and fappno = '{$appno}' and ftype = '{$file_file}'";
$results1 = $aobj_context->mobj_db->Execute($query1);
}else
{
$query1 = "insert into upload values('{$userid}','{$appno}','{$file_file}','{$data}')";
$results1 = $aobj_context->mobj_db->Execute($query1);
}
$query = "select fpath from upload where fuserid = '{$userid}' and fappno = '{$appno}' and ftype = '{$file_file}'";
$results = $aobj_context->mobj_db->getRow($query);
//$results[fpath];
$data = "<a href = '{$results[fpath]}' target = '_blank' >Click to view</a>";
echo $aobj_context->mobj_output->ToJSONEnvelope($data,0,"success");
}
?>
|