<?php
/**
 * Created by PhpStorm.
 * User: Jure
 * Date: 23.6.2014
 * Time: 21:07
 */

include_once('_dirinfo.php');
include_once(PATH_TO_ROOT . "init.php");
include_once(PATH_TO_ROOT . "config.php");

$db->ChangeDatabase(DB_WARPIT_WEBCATI_BASE);
$sql = "SELECT id_nfield_project,name_nfield_project FROM  _Projects WHERE is_nfield = 1";
$res = $db->SQLexecute($sql);
while ($row = $db->fetchAssoc($res)){
    $data[] = $row;
}



?>
    {
    "success": "true",
    "results": "<?php echo sizeof($data); ?>",
    "rows": <?php echo json_encode($data); ?>
    }
<?php



