Caros Menu_MealsComponents

[insert_php] $mealscomponents= new PDOCrud();//create object of PDOCrud Class
$mealscomponents->multiTableRelationDisplay(“tab”, “Meals Components”);

//dishcomponents_ingredients class object
$dishcomponents_ingredients = new PDOCrud(true);
$dishcomponents_ingredients ->crudTableCol(array(“ingredients_id”, “quantity”));

//$dishcomponents_ingredients->joinTable(“ck_ingredients”, “ck_dishcomponents_ingredients.ingredients_id=ck_ingredients.id”,”INNER JOIN”);
$dishcomponents_ingredients ->dbTable(“ck_dishcomponents_ingredients”);

$dishcomponents_ingredients ->fieldTypes(“ingredients_id”, “select”);//change type to select
$dishcomponents_ingredients->fieldDataBinding(“ingredients_id”, “ck_ingredients”, “id”, “name”, “db”);//add data using another table name country
$dishcomponents_ingredients ->tableColUsingDatasource(“ingredients_id”, “ck_ingredients” , “id”, “name”, “db”);

//ingredients class object
//$ingredients = new PDOCrud(true);
//$ingredients ->crudTableCol(array(“id”, “name”));
//$ingredients ->dbTable(“ck_ingredients”);

//first paramater is first table(object) columnn name and 2nd parameter is 2nd object column name
$mealscomponents->multiTableRelation(“id”, “dishcomponent_id”, $dishcomponents_ingredients);
$dishcomponents_ingredients->multiTableRelationDisplay(“tab”, “Dishcomponents Ingredients”);

echo $mealscomponents->dbTable(“ck_dishcomponents”)->render();

[/insert_php]

Share this post: