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={col_name}";
                                $text = '';
                                $attr = array("title"=>"Redirect URL");
                                $pdocrud->enqueueBtnActions("url", $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"=>"Redirect URL");
                                $pdocrud->enqueueBtnActions("btnswitch", $action, "switch",$text,"booking_status", $attr);
                                echo $pdocrud->dbTable("bookroom")->render();
                                

Bookroom

Showing 1 to 2 of 2 entries

# First name Last name No of adult No of child Booking amount Booking status Actions
1 jon Snow 2 2 100 1
2 Wallace Hathorn 1 0 34 12
Notice: Array to string conversion in /home/pdocrud5/public_html/script/classes/templates/bootstrap/template-table.php on line 100
Array
# First name Last name No of adult No of child Booking amount Booking status Actions