<?php
        $xcrud = Xcrud::get_instance();  
        $xcrud->table('foods');
      //  $xcrud->columns('datum,maincategorie,subcategorie,cost,comment');
        $xcrud->duplicate_button();
        $xcrud->change_type('simple_upload', 'file', '', array('not_rename'=>true, 'path' => '../uploads/foods'));
        $xcrud->change_type('image', 'image', false, array(
                                                    'width' => 450,
                                                    'path' => '../uploads/foods',
                                                    'thumbs' => array(array(
                                                            'height' => 55,
                                                            'width' => 120,
                                                            'crop' => true,
                                                            'marker' => '_th'))));
        $xcrud->benchmark(true);
    /*    $xcrud->label(array(
            'maincategorie' => 'Főkategória', 
            'subcategorie' => 'Alkategória',
            'datum' => 'Dátum',
            'created' => 'Rögzítve',
            'cost' => 'Költség',
            'comment' => 'Megjegyzés',
        ));
       $xcrud->highlight_row('cost', '<=', -500, '#8DED79');
    $xcrud->highlight('priceEach', '>', -300, '#9ADAFF');
        $xcrud->pass_default('datum', date('Y-m-d'));
        $xcrud->pass_default('created', date('Y-m-d H:i:s'));
       $xcrud->before_list('chart_data', 'functions.php');
        $xcrud->field_callback('maincategorie','cat_input');
        $xcrud->field_callback('subcategorie','cat_input');
       //$grid_data = $xcrud->chart_data( 'functions.php');
        $xcrud->change_type('cost', 'text', '', array('maxlength'=>100));
        $xcrud->before_insert('math_input', 'functions.php');
        $xcrud->before_update('math_input', 'functions.php');
        //$xrcud->before_list_callback($grid_data, $xcrud);
       //print_r($xcrud->result);
        //$xcrud->change_type('created', 'hidden', false);
        $xcrud->sum('cost', 'align-center', 'Total {value}');
        $xcrud->create_action('my_action','my_function'); */
     echo Xcrud::load_css();
        echo Xcrud::load_js();    
    ?>
    <button class="xcrud-action" data-task="action" data-action="my_action">GO!</button> 
    <button onclick="Xcrud.request('.xcrud-ajax',Xcrud.list_data('.xcrud-ajax',{task:'list',primary:270}))">Edit entry </button>
    
<!-- Resources -->
<?echo $xcrud->render();?>
<div class="row">
   
</div>