<?php
include '../conector.php';
date_default_timezone_set('America/Bogota');

header('Content-Type: application/json');

$out = array();

$sel_anuncio="SELECT * FROM evento ORDER BY fecha_evento DESC LIMIT 50";

$result = mysql_query($sel_anuncio);
if($result){
    while($rs=mysql_fetch_array($result)){
        $cadena=substr($rs[1],0,1500);
        
        $out[] = array(
            'id' => $rs[0],
            'title' => utf8_decode($cadena),
            'url' => '',
            'class'=> 'event-warning',
            'start' => strtotime($rs[2]) . '000',
            'end' => strtotime($rs[2]) .'000'
        );
    }
}

echo json_encode(array('success' => 1, 'result' => $out));
exit;
?>