36 lines
1.2 KiB
PHP
36 lines
1.2 KiB
PHP
|
|
<?php header('Content-type: application/json');
|
||
|
|
$em="";
|
||
|
|
if ( !defined('PATHTOINCLUDES') ) define('PATHTOINCLUDES', $_SERVER["DOCUMENT_ROOT"] . '/mailservices/includes/');
|
||
|
|
include(PATHTOINCLUDES."base.php");
|
||
|
|
$dconn=dbconnect2();
|
||
|
|
$fieldname=$_POST["fieldname"];
|
||
|
|
$fieldvalue=$_POST["fieldvalue"];
|
||
|
|
$table_name=$_POST["thetable"];
|
||
|
|
date_default_timezone_set('UTC');
|
||
|
|
$dtype=$_POST["dtype"];
|
||
|
|
$thedate=date("Y-m-d H:i:s");
|
||
|
|
// process - no special processing
|
||
|
|
if($fieldvalue=="Y")
|
||
|
|
{
|
||
|
|
$fieldvalue=1;
|
||
|
|
}
|
||
|
|
if($fieldvalue=="N")
|
||
|
|
{
|
||
|
|
$fieldvalue=0;
|
||
|
|
}
|
||
|
|
if($dtype=="notification"){
|
||
|
|
$sql="UPDATE `".$table_name."` SET `".$table_name."`.`".$fieldname."` = ".GetSQLValueString($fieldvalue, 'int')." WHERE `se_usersettings`.`usersetting_user_id` = ".$_SESSION["up_settings_uid"];
|
||
|
|
}
|
||
|
|
if($dtype=="radio")
|
||
|
|
{
|
||
|
|
$sql="UPDATE `".$table_name."` SET `".$table_name."`.`".$fieldname."` = ".GetSQLValueString($fieldvalue, 'int')." WHERE `se_users`.`user_id` = ".$_SESSION["up_settings_uid"];
|
||
|
|
}
|
||
|
|
if($dtype=="email")
|
||
|
|
{
|
||
|
|
$sql="UPDATE `".$table_name."` SET `".$table_name."`.`".$fieldname."` = ".GetSQLValueString($fieldvalue, 'text')." WHERE `se_users`.`user_id` = ".$_SESSION["up_settings_uid"];
|
||
|
|
|
||
|
|
}
|
||
|
|
$query=mysql_query($sql) or $em=$em.mysql_error();
|
||
|
|
$arr = array ('error'=>$em);
|
||
|
|
echo json_encode($arr);
|
||
|
|
?>
|