PDOCrud Add action buttons

You can add extra action buttons to perform many operations like switch, url redirection etc. Below are example of how to add url action button and switch. URL action is for redirecting to another website with some value and switch can be used for on/off operation (like approve/disapprove, publish/unpublish).

  
                                    $pdocrud = new PDOCrud();
                                    $pdocrud->crudTableCol(array("first_name","last_name","no_of_adult","no_of_child","booking_amount","booking_status"));
                                    $action = "http://google.com/?id={pk}";//pk will be replaced by primary key value
                                    $text = '';
                                    $attr = array("title"=>"Redirect URL");
                                    $pdocrud->enqueueBtnActions("url", $action, "url",$text,"booking_status", $attr);
                                    $action = "http://yahoo.com/?id={pk}";
                                    $text = '';
                                    $attr = array("title"=>"Redirect URL");
                                    $pdocrud->enqueueBtnActions("url2", $action, "url",$text,"booking_status", $attr);
                                    $action = array("1"=>"0","0"=>"1");//action to be performed, like when value is 1 set it to 0
                                    $text = array("1" => '',"0"=>'');
                                    $attr = array("title"=>"Switch Button");
                                    $pdocrud->enqueueBtnActions("btnswitch", $action, "btnswitch",$text,"booking_status", $attr);
                                    echo $pdocrud->dbTable("bookroom")->render();
                                

Deprecated: Optional parameter $op declared before required parameter $task is implicitly treated as a required parameter in /home3/openscri/public_html/masinosinaga/pdo-crud/script/classes/PDOCrud.php on line 983

Deprecated: Creation of dynamic property PDOCrud::$langData is deprecated in /home3/openscri/public_html/masinosinaga/pdo-crud/script/classes/PDOCrud.php on line 2227

Deprecated: Optional parameter $page declared before required parameter $totalrecords is implicitly treated as a required parameter in /home3/openscri/public_html/masinosinaga/pdo-crud/script/classes/PDOCrudHelper.php on line 191

Deprecated: Optional parameter $parameters declared before required parameter $data is implicitly treated as a required parameter in /home3/openscri/public_html/masinosinaga/pdo-crud/script/classes/PDOCrudTableFormat.php on line 122

Deprecated: Creation of dynamic property PDOModel::$characterSet is deprecated in /home3/openscri/public_html/masinosinaga/pdo-crud/script/classes/PDOModel.php on line 119

Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in /home3/openscri/public_html/masinosinaga/pdo-crud/script/classes/PDOModel.php on line 1011

Deprecated: Creation of dynamic property PDOModel::$characterSet is deprecated in /home3/openscri/public_html/masinosinaga/pdo-crud/script/classes/PDOModel.php on line 119

Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in /home3/openscri/public_html/masinosinaga/pdo-crud/script/classes/PDOModel.php on line 1011

Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in /home3/openscri/public_html/masinosinaga/pdo-crud/script/classes/PDOModel.php on line 1011

Deprecated: Creation of dynamic property PDOCrud::$dataHTML is deprecated in /home3/openscri/public_html/masinosinaga/pdo-crud/script/classes/PDOCrud.php on line 2379

Deprecated: Creation of dynamic property PDOCrud::$fieldList is deprecated in /home3/openscri/public_html/masinosinaga/pdo-crud/script/classes/PDOCrud.php on line 2380

Bookroom

Showing 1 to 1 of 1 entries

# First name Last name No of adult No of child Booking amount Booking status Actions
1 jon Snow 2 2 100 0
# First name Last name No of adult No of child Booking amount Booking status Actions