55 lines
1015 B
PHP
55 lines
1015 B
PHP
<?php header('Content-type: application/json');
|
|
|
|
if ( !defined('PATHTOINCLUDES') ) define('PATHTOINCLUDES', $_SERVER["DOCUMENT_ROOT"] . '/include/analytics/');
|
|
|
|
include(PATHTOINCLUDES."base.php");
|
|
|
|
$args = array(
|
|
|
|
'activate' => FILTER_SANITIZE_STRING
|
|
|
|
);
|
|
|
|
$sanitizeinputs = filter_input_array(INPUT_POST, $args);
|
|
|
|
$em="";
|
|
|
|
$active=$_GET["activate"];
|
|
|
|
|
|
|
|
$autodeactivate="N";
|
|
|
|
$csql="SELECT
|
|
|
|
`cp_sitemessage`.`cp_sitemsg`
|
|
|
|
FROM `cp_sitemessage` WHERE `cp_sitemessage`.`cp_id` = 1";
|
|
|
|
$cresult=$database->database_query($csql) or $em=$em.$database->database_error();
|
|
|
|
$cp=$database->database_fetch_assoc($cresult);
|
|
|
|
$sl=strlen($cp["cp_sitemsg"]);
|
|
|
|
if($sl < 20)
|
|
|
|
{
|
|
|
|
$active="N";
|
|
|
|
$autodeactivate="Y";
|
|
|
|
}
|
|
|
|
|
|
|
|
$sql="UPDATE `cp_sitemessage` SET `cp_sitemessage`.`cp_active` = '".$active."' WHERE `cp_sitemessage`.`cp_id` = 1";
|
|
|
|
$query=$database->database_query($sql) or $em=$em.$database->database_error();
|
|
|
|
$arr = array ('error' => $em,'autodeactivate' => $autodeactivate, 'sl' => $sl);
|
|
|
|
echo json_encode($arr);
|
|
|
|
?>
|