87 lines
1.4 KiB
PHP
87 lines
1.4 KiB
PHP
<?php header('Content-type: application/json');
|
|
|
|
if ( !defined('PATHTOINCLUDES') ) define('PATHTOINCLUDES', $_SERVER["DOCUMENT_ROOT"] . '/include/analytics/');
|
|
|
|
include(PATHTOINCLUDES."base.php");
|
|
|
|
$em="";
|
|
|
|
|
|
|
|
$ctp_pid=$_POST["thepid"];
|
|
|
|
$sqlpi="SELECT
|
|
|
|
`caption_this_pic`.`hcuid`,
|
|
|
|
`caption_this_pic`.`hcuname`,
|
|
|
|
`caption_this_pic`.`ctpactive`,
|
|
|
|
DATE_FORMAT(`caption_this_pic`.`thedate`,'%M %e, %Y') AS thedate,
|
|
|
|
`caption_this_pic`.`blogid`,
|
|
|
|
`caption_this_pic`.`ctpused`
|
|
|
|
FROM
|
|
|
|
`caption_this_pic`
|
|
|
|
WHERE
|
|
|
|
`caption_this_pic`.`hcidu` = ".$ctp_pid."
|
|
|
|
LIMIT 1";
|
|
|
|
$queryc=$database->database_query($sqlpi) or $em .= $database->database_error();
|
|
|
|
$row = $database->database_fetch_row($queryc);
|
|
|
|
$hcpuid=$row[0];
|
|
|
|
$hcpuname=$row[1];
|
|
|
|
$isapproved=$row[2];
|
|
|
|
$entrydate=$row[3];
|
|
|
|
$blogid=$row[4];
|
|
|
|
$ctp_used=$row[5];
|
|
|
|
$somestuff="";
|
|
|
|
if($_POST["theuid"]=="21092" || $_POST["theuid"]=="9" || $_POST["theuid"]=="8")
|
|
|
|
{
|
|
|
|
$isactive="";
|
|
|
|
if($isapproved=="yes")
|
|
|
|
{
|
|
|
|
$isactive='checked="checked"';
|
|
|
|
}
|
|
|
|
$somestuff='<span style="text-align:right;padding-right:5px;line-height:30px;">'.$entrydate.' Active<input type="checkbox" name="ctp_active" id="ctp_active" onclick="ctp_active(\''.$ctp_pid.'\',\''.$blogid.'\');" '.$isactive.' /> </span>';
|
|
|
|
if($ctp_used == "yes")
|
|
|
|
{
|
|
|
|
$somestuff.='<span style="padding-left:10px;font-weight:bold;">Used</span>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$arr = array ('error'=>$em,'entrydate'=>$entrydate,'somestuff'=>$somestuff);
|
|
|
|
echo json_encode($arr);
|
|
|
|
?>
|
|
|