Add New Column dynamically on CRUD Table New Column addition dynamically on CRUD Table

You can add new table column dynamically based on two columns value for example you want to show order total based on order sub total and tax. You can also merge two columns to generate a new column for example you can merge first name and last name to generate new column "Full Name". By default, new column is added at the last. Since it is dynamic column, so it doesn't support search/sort/export function.

  
                                 $pdocrud = new PDOCrud();
                                    //Add new column total which is calculated as sum of two columns (you can pass any no. of columns)
                                    $pdocrud->tableColAddition("Total", "sum",array("product_sell_price","tax"));
                                     //Add new colum Profit which is calculated as subtraction of two columns
                                    $pdocrud->tableColAddition("Profit", "subtract",array("product_price","product_sell_price"));
                                    //Add new colum Sell/price which is calculated as division of two columns
                                    $pdocrud->tableColAddition("Sell/price", "divide",array("product_sell_price","product_price"));
                                    //Merge column to generate a new column ( you can pass any no. of columns)
                                    $pdocrud->tableColAddition("Product Info", "merge",array("product_id","product_name"));
                                    $pdocrud->crudTableCol(array("product_name","product_id", "product_price","product_sell_price","tax","product_discount"));
                                    $pdocrud->crudRemoveCol(array("product_name","product_id"));
                                    echo $pdocrud->dbTable("products")->render();
                            

Add new table column


Deprecated: Required parameter $field follows optional parameter $op in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 924

Deprecated: Required parameter $task follows optional parameter $op in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 924

Deprecated: Required parameter $totalrecords follows optional parameter $page in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrudHelper.php on line 191

Products

Showing 1 to 5 of 108 entries

# Product price Product sell price Tax Product discount Total Profit Sell/price Random Product Info Actions
1 50.00 214.30 0 0 214.3 164.3 0.23331777881475 10715 S10_1949 1952 Alpine Renault 1300
2 85.68 136.00 0 0 136 50.32 0.63 11652.48 S10_4757 1972 Alfa Romeo GTA
3 103.42 147.74 0 0 147.74 44.32 0.70001353729525 15279.2708 S10_4962 1962 LanciaA Delta 16V
4 95.34 194.57 0 0 194.57 99.23 0.49000359767693 18550.3038 S12_1099 1968 Ford Mustang
5 95.59 207.80 0 0 207.8 112.21 0.46000962463908 19863.602 S12_1108 2001 Ferrari Enzo
# Product price Product sell price Tax Product discount Total Profit Sell/price Random Product Info Actions