<?php
// app/api/accounts/delete

    header("Content-Type:application/json");
    include("../dbconn.php");
    include("../utils.php");
    
    // parametros obligatorios
    $parmsob = array('lang');
    if (!parametrosValidos($_GET, $parmsob))
        badEnd("400", array("msg"=>"Parametros obligatorios " . implode(", ", $parmsob)));
    
    //Declaramos e inicializamos nuestras variables
    $out = new stdClass();
    $lang = $_GET['lang'];
    
    //Consultamos los terminos y condiciones para retornarlos
    $sql = "SELECT * FROM cmspreferences LIMIT 1";
    if (!$rs=$db->query($sql))
        badEnd("500", array("msg"=>$db->error));
            
    $row = $rs->fetch_assoc();
    
    $out->terms = $row['terms'];
    
    $out->date = new stdClass();
    $out->date->canonical = date('Y-m-d H:i:s', strtotime($row['datecreated']));
    $out->date->formatted = date('d/m/Y H:i', strtotime($row['datecreated']));
    
    header("HTTP/1.1 200");
    echo (json_encode($out));
    die();
?>
