<?php
define("_VALID_PHP", true);
require_once("../../init.php");
?>
<?php
$koje = $user->name;
//echo "U fazi testa!"; 
$page = basename($_SERVER["PHP_SELF"]);
$heder = "Obaveštenja";
$mali = " > upućena korisnicima";
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('newsletter');
$xcrud->table_name('Obaveštenja');
$xcrud->change_type('prima','multiselect','',array (2 => 'Serviser', 3 => 'Manager', 9 =>'Super Admin'));
$xcrud->pass_var('author',$koje);
$xcrud->columns('body,author,created');
$xcrud->fields('body,prima,created');
$xcrud->mass_alert_create('users','email','newsletter = 1 AND userlevel IN ({prima})','Obaveštenje za korisnike','{body}');
$xcrud->label(array('body' => 'Poruka','author' => 'Autor','created' => 'Kreirana'));
$xcrud->unset_remove();
echo $xcrud->render();
?>