<?php
define("_VALID_PHP", true);
require_once("../../init.php");
?>
<?php
$koje = $user->name;
$level = $user->userlevel;
$lokal = $user->fname;
$korisnik = $user->username;
//echo "U fazi testa!"; 
$page = basename($_SERVER["PHP_SELF"]);
$heder = "Sugestije";
$mali = " > upućene centrali";
include('../../xcrud/xcrud.php');
Xcrud_config::$jquery_no_conflict = true; // jquery conflicts with SyntaxHighlighter
//odavde idu komnade ka xcrud-u
$xcrud = Xcrud::get_instance();
$xcrud->table('suggest');
$xcrud->table_name('Sugestije');
$xcrud->relation('category_id','games','game_id','name','games.status = 1');
$xcrud->columns('site,category_id,body,author,image,created');
$xcrud->fields('author,category_id,body,image');
//$xcrud->fields('body,author,created');
//$xcrud->mass_alert_create('users','email','newsletter = 1 AND userlevel IN ({prima})','Obaveštenje za korisnike','{body}');
$xcrud->label(array('body' => 'Poruka','category_id' => 'Odeljenju','image' => 'Slika','site' => 'Objekat','author' => 'Ime i prezime','created' => 'Kreirana'));
$xcrud->pass_var('site', $lokal);
$xcrud->no_editor('body');
$xcrud->modal('image');
$xcrud->change_type('image', 'image', false, array(
        'width' => 450,
        'path' => 'images',//nalazi se u xcrud root folderu
        'thumbs' => array(array(
                'height' => 55,
                'width' => 120,
                'crop' => true,
                'marker' => '_th','folder'=>$lokal))));//slike se slazu u foldere od lokala
$xcrud->validation_required('author')->validation_required('category_id')->validation_required('body');				
$xcrud->unset_remove();
$xcrud->unset_edit();
if ($level == 1){
//$xcrud->hide_button('save_new');
$xcrud->hide_button('save_return');
$xcrud->hide_button('return');
echo $xcrud->render('create');
}
else
{
echo $xcrud->render();	
}
?>