f0ska

f0ska does not currently provide support for this item.

2634 comments found.

@etattva , $xcrud->unset_csv(); $xcrud->unset_print();

Hi, I need Print Layout in View / Edit Mode Page. How can i create a print-button to print the view or edit page with fields and there content in other created Page for Example in “print.php” page? Thank you for your helph. Best regards TUGEM

I want to create a edit link on column {service} but don’t work, when click edit view is empty. thank you

$xcrud->column_pattern(‘service’, ‘{value}‘);

Hello can you tell me how can i rename value? I mean if for example operator id = 3 change 3>Smith if Operator id = 2 rename 2> John…

@buiglishvili $xcrud->column_pattern(‘name’, ‘{id} > {name}‘);

@ZillionG Your column_pattern is not OK You need to put your link in this with the xcrud-action edit $xcrud->column_pattern('service', '<a href="#" class="xcrud-action" data-task="edit" data-primary="{your_ID}">{value}</a>');

@Tugem You have to modify the xcrud_detail_view.php. I used jQuery.print.js for that.

<script type="text/javascript" src="js/jQuery.print.js"></script>
<?php echo $this->render_table_name($mode); ?>
<div class="xcrud-top-actions btn-group">
    <?php
    echo $mode == 'view' ? "<button type='button' id='cmd' class='btn btn-primary'><span class="glyphicon glyphicon-print" aria-hidden="true" /> Print</button>":"";
    echo $this->render_button('save_return','save','list','btn btn-primary','','create,edit');
    echo $this->render_button('save_new','save','create','btn btn-default','','create,edit');
    echo $this->render_button('save_edit','save','edit','btn btn-default','','create,edit');
    echo $this->render_button('return','list','','btn btn-warning'); ?>
</div>
<div class="xcrud-view">
<?php echo $mode == 'view' ? $this->render_fields_list($mode,array('tag'=>'table','class'=>'table')) : $this->render_fields_list($mode,'div','div','label','div'); ?>
</div>
<div class="xcrud-nav">
    <?php echo $this->render_benchmark(); ?>
</div>

<script type="text/javascript">
    $('#cmd').click(function () {
        //console.log( "ready!" );
        $('.xcrud').print({
            //Use Global styles
            globalStyles : true,
            //Add link with attrbute media=print
            mediaPrint : false,
            //Custom stylesheet
            stylesheet : "http://fonts.googleapis.com/css?family=Inconsolata",
            //Print in a hidden iframe
            iframe : false,
            //Don't print this
            noPrintSelector : ".btn",
            //Add this at top
            prepend : "",
            //Add this on bottom
            append : "",
            //Log to console when printing is done via a deffered callback
            deferred: $.Deferred().done(function() { console.log('Printing done', arguments); })
        });
    });
</script>

here bootbox confirmation for delete on xcrud:

change \plugins\xcrud.js on line 1068 c.a. (latest version)

replace :
$(".xcrud").on("click", ".xcrud-action", function() {
            var confirm_text = $(this).data('confirm');
            if (confirm_text && !window.confirm(confirm_text)) {
                return;
            } else {
                var container = Xcrud.get_container(this);
                var data = Xcrud.list_data(container, this);
                if ($(this).hasClass('xcrud-in-new-window')) {
                    Xcrud.new_window_request(container, data);
                } else {
                    if (data.task == 'save') {
                        if (!Xcrud.validation_error) {
                            Xcrud.unique_check(container, data, function(container) {
                                data.task = 'save';
                                Xcrud.request(container, data);
                            });
                        } else {
                            Xcrud.show_message(container, Xcrud.lang('validation_error'), 'error');
                        }
                    } else {
                        Xcrud.request(container, data);
                    }
                }
            }
            return false;
        });

with :

         $(".xcrud").on("click", ".xcrud-action", function() {

            var confirm_title = "Conferma Cancellazione";
            var confirm_message = "Vuoi cancellare l'elemento <br />selezionato?";
            var yess = "Si";
            var nooo = "No";
            var confirm_text = $(this).data('confirm');
            var to_delete = $(this);
            if (confirm_text) {

             bootbox.confirm({
                       size: "small",
                       title: confirm_title,
                    message: confirm_message,
                buttons: {
                    confirm: {
                    label: yess,
                //className: 'btn-success'
                    },
                    cancel: {
                    label: nooo,
            //className: 'btn-danger'
        }
    },
    callback: function (result) {
         //alert(result)
    if (result) {       
    // return;

    xcrud_action_execution(to_delete);
         }

    }
}); 

            }

    else {
               xcrud_action_execution(this); 
            }
            return false;
        });  

        function xcrud_action_execution(xcrud_button_object) {
                var container = Xcrud.get_container(xcrud_button_object);
                var data = Xcrud.list_data(container, xcrud_button_object);
                if ($(xcrud_button_object).hasClass('xcrud-in-new-window')) {
                    Xcrud.new_window_request(container, data);
                } else {
                    if (data.task == 'save') {
                        if (!Xcrud.validation_error) {
                            Xcrud.unique_check(container, data, function(container) {
                                data.task = 'save';
                                Xcrud.request(container, data);
                            });
                        } else {
                            Xcrud.show_message(container, Xcrud.lang('validation_error'), 'error');
                        }
                    } else {
                        Xcrud.request(container, data);
                    }
                }            
        }

note : you have to have bootbox javascript in your page

change bootobox parameters as you need.

update : (correct confirmation message) tags : ajax modal confirm
//conferma eliminazione
         $(".xcrud").on("click", ".xcrud-action", function() {

            var confirm_title = "Conferma Cancellazione";
            var confirm_message = "Vuoi cancellare l'elemento <br />selezionato?";
            var yess = "Si";
            var nooo = "No";
            var confirm_text = $(this).data('confirm');
            var to_delete = $(this);
            if (confirm_text) {

             bootbox.confirm({
                       size: "small",
                       title: confirm_title,
                    message: confirm_message,
                buttons: {
                    confirm: {
                    label: yess,
                //className: 'btn-success'
                    },
                    cancel: {
                    label: nooo,
            //className: 'btn-danger'
        }
    },
    callback: function (result) {
         //alert(result)
    if (result) {       
    // return;

    xcrud_action_execution(to_delete);
         }

    }
}); 

            }

    else {
               xcrud_action_execution(this); 
            }
            return false;
        });  

        function xcrud_action_execution(xcrud_button_object) {
                var container = Xcrud.get_container(xcrud_button_object);
                var data = Xcrud.list_data(container, xcrud_button_object);
                if ($(xcrud_button_object).hasClass('xcrud-in-new-window')) {
                    Xcrud.new_window_request(container, data);
                } else {
                    if (data.task == 'save') {
                        if (!Xcrud.validation_error) {
                            Xcrud.unique_check(container, data, function(container) {
                                data.task = 'save';
                                Xcrud.request(container, data);
                            });
                        } else {
                            Xcrud.show_message(container, Xcrud.lang('validation_error'), 'error');
                        }
                    } else {
                        Xcrud.request(container, data);
                    }
                }            
        }
        //fine conferma eliminazione

I want to make a link to a crud and directly edit one record without javascript, with post or get method. Coldn’t sucseed, anyone did?

I love the format and function of $xcrud it saves a lot of time and code. However, I am new to callback functions and I having trouble with $xcrud_button. I am trying to add a button the will format a view of an Invoice and allow print and send of the view. At the present time I have three DB tables (customer, work orders, hardware). The nested view is fine for normal view, edit, remove.

When the new button is executed it is calling a new page, which at the present time has only HTML code which simulates an Invoice view. The page displays but all the CSS formatting is gone and the menu bar does not function. Also. I have tried to insert a “Return” button on the new page, it displays but nothing happens. I have also tried $xcrud_load_view, but get same results.

So my question is: Do you have any sample code for an a alternate view that demonstrates what has to be done in a new page to make it work properly with $xcrud.

Thanks in advance for your help

rordahl

rordahl Purchased

Found problem: Passing ? token caused CSS to not be used in new page. Removed ? token and it now works fine.

JinRoh

JinRoh Purchased

@sbscan

Why not use XCRUD, check AJAX ACTION and JS TRICKS demos…

brownd92

brownd92 Purchased

I have a legacy database which has spaces and characters in the colum names. I am using this in the php:

include('xcrud/xcrud.php');
$xcrud = Xcrud::get_instance();
$xcrud->table('ZINummer');
$xcrud->columns('{Artikelnummer: ZI-nummer`,`Artikelomschrijving: naam`,`Gm.: productnaam: GPK=generiek (code)`,`Naam: productverantwoordelijke`,VGZ,MENZIS,CZ,IDEA');

However I get the error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’: ZI-nummer`` AS `ZINummer.`Artikelnummer: ZI-nummer`` ,`ZINummer`.`[Artikelom’ at line 1

SELECT `ZINummer`.``Artikelnummer: ZI-nummer`` AS `ZINummer.`Artikelnummer: ZI-nummer`` ,`ZINummer`.`[Artikelomschrijving: naam]` AS `ZINummer.[Artikelomschrijving: naam]` ,`[Gm`.`: productnaam: GPK=generiek (code)]` AS `[Gm.: productnaam: GPK=generiek (code)]` ,`ZINummer`.`[Naam: productverantwoordelijke]` AS `ZINummer.[Naam: productverantwoordelijke]` ,`ZINummer`.`VGZ` AS `ZINummer.VGZ` ,`ZINummer`.`MENZIS` AS `ZINummer.MENZIS` ,`ZINummer`.`CZ` AS `ZINummer.CZ` ,`ZINummer`.`IDEA` AS `ZINummer.IDEA` ,`ZINummer`.`zNummerID` AS `primary_key`

FROM `ZINummer`
LIMIT 0,10

I cannot change the colum names. I need a solution for this as the sql query works ok in mySqlWorkbench.

THanks

brownd92

brownd92 Purchased

Any idea?

Was thinking about purchasing this but it doesn’t seem its very well supported from the comments?

I’m looking to develop a simple Product Management System, but I need a custom page for approving products, and also have it automatically provide update dates, etc. How difficult would that be to do with this program?

How would you parse data to the add/insert form?

sbscan

sbscan Purchased

On products table, I want to link suppler column to suppliers table and edit that supplier. Please help, tried a lot but can’t succeed.

JinRoh

JinRoh Purchased

@sbscan : see JS tricks and Ajax action examples

by
by
by
by
by
by