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 : 18.220.110.45
Current Path : /var/www/html/dud/src/ |
| Current File : //var/www/html/dud/src/post_25102019.php |
<?php
function uploadpostnotification($aobj_context)
{
var_dump($_FILES['filepath']['name']);
}
function savepostnotification($aobj_context)
{
$label=trim($aobj_context->mobj_data["label_type"]);
$filepath=trim($aobj_context->mobj_data["filepath"]);
$fromdate=trim($aobj_context->mobj_data["post_date_from"]);
$todate=trim($aobj_context->mobj_data["post_date_to"]);
$order=trim($aobj_context->mobj_data["order_no"]);
$colour=trim($aobj_context->mobj_data["colour"]);
$colour=trim($aobj_context->mobj_data["rate_value"]);
$path = $aobj_context->main_src."/notifications/";
if(!file_exists($path))
{
mkdir($path);
}
$target_path = $path;
$target_path = $target_path . basename( $_FILES['filepath']['name']);
if(move_uploaded_file($_FILES['filepath']['tmp_name'], $target_path))
{
$filepath="notifications/".$_FILES['filepath']['name'];
$query = "insert into postnotfn(flabel, ffilepath, ffromdate, ftodate, forder, fcreatedate)
values ('{$label}','{$filepath}',date_format(STR_TO_DATE('{$fromdate}','%d/%m/%Y'),'%Y-%m-%d'),date_format(STR_TO_DATE('{$todate}','%d/%m/%Y'),'%Y-%m-%d'),'{$order}',now())";
// var_dump($query);
$up_obj = $aobj_context->mobj_db->Execute($query);
if($up_obj)
{
$arr = "Updated Successfuly";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
else
{
$arr = "Updation Failed";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failed");
return;
}
}
}
?>
|