Viewing file: prodotti.php (3.4 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
$xcrud = Xcrud::get_instance();
$xcrud->table('prodotti');
$xcrud->table_name(' ');
$xcrud->where('id_tipologia_prodotto =', 2); //GALLERIE IMMAGINI
$table = 'prodotti';
$immagini = $xcrud->nested_table('Galleria immagini','id','galleria','id_prodotto'); // 2nd level 2
$immagini->columns('titolo, img');
$immagini->fields('titolo,img');
//$xcrud->relation('area_medica','aree_mediche','id','area');
$xcrud->button('#', "Sali", 'glyphicon glyphicon-arrow-up icon-arrow-up', 'btn xcrud-action', array(
'data-action' => 'movetop',
'data-task' => 'action',
'data-table' => ''.$table.'',
'data-primary' => '{id}'));
$xcrud->button('#', "Scendi", 'glyphicon glyphicon-arrow-down icon-arrow-down', 'btn xcrud-action', array(
'data-action' => 'movebottom',
'data-task' => 'action',
'data-table' => ''.$table.'',
'data-primary' => '{id}'));
$xcrud->create_action('movetop', 'movetop');
$xcrud->create_action('movebottom', 'movebottom');
$xcrud->create_action('publish', 'publish_action'); // action callback, function publish_action() in functions.php
$xcrud->create_action('unpublish', 'unpublish_action');
$xcrud->button('#', 'unpublished', 'icon-close glyphicon glyphicon-remove', 'xcrud-action',
array( // set action vars to the button
'data-task' => 'action',
'data-action' => 'publish',
'data-table' => ''.$table.'',
'data-primary' => '{id}'),
array( // set condition ( when button must be shown)
'pubblicato',
'!=',
'1')
);
$xcrud->button('#', 'published', 'icon-checkmark glyphicon glyphicon-ok', 'xcrud-action', array(
'data-task' => 'action',
'data-action' => 'unpublish',
'data-table' => ''.$table.'',
'data-primary' => '{id}'), array(
'pubblicato',
'=',
'1'));
//$xcrud->unset_sortable();
$xcrud->order_by('ordinamento');
$xcrud->column_width('pubblicato,img','100px');
$xcrud->highlight_row('pubblicato', '=', 0, '#FFA299');
$xcrud->validation_required('titolo_prodotto_it');
$xcrud->fields('titolo_prodotto_it, titolo_prodotto_en, titolo_prodotto_ru, titolo_prodotto_de, titolo_prodotto_jp, pubblicato', false, 'Titolo galleria');
$xcrud->fields('img,didascalia', false, 'Immagine');
$xcrud->label('img','Preview');
$xcrud->label('titolo_prodotto_it','Titolo Galleria IT');
$xcrud->label('titolo_prodotto_en','Titolo Galleria EN');
$xcrud->label('titolo_prodotto_ru','Titolo Galleria RU');
$xcrud->label('titolo_prodotto_de','Titolo Galleria DE');
$xcrud->label('titolo_prodotto_jp','Titolo Galleria JP');
$xcrud->change_type('img', 'image', '', array('width' => 1600, 'height' => 1600, 'manual_crop' => false));
$immagini->change_type('img', 'image', '');
$date = date("d.m.Y");
$xcrud->change_type('data_pubblicazione_inizio', 'datetime', $date);
$xcrud->change_type('pubblicato', 'select', '1', array('1'=>'Yes','0'=>'No'));
$xcrud->columns('img, titolo_prodotto_it, pubblicato');
$xcrud->hide_button('view');
$xcrud->unset_csv();
// TIPOLOGIA 1 E' GALLERIE IMMAGINI
$xcrud->pass_var('id_tipologia_prodotto', '2');
echo $xcrud->render();
?>
|