Hey guys! I am using Grocery Crud Enterprise with Code igniter 3.
I have two Tables.
Table 1= Rentals (Rental_id, Product_id, Rental_type, Start_Date, End_Date)
Table 2= Products (Product_id, Product_name)
I am using $crud->setRelation('product_id','products','product_name'); so where I add a new rental there is a dropdown, so I can choose a product.
My problem is that I would like to find a way, to be able to see only the "available" products in this dropdown.
I have created a view= Available_Products, where I can see in a third table only the available products.
Where I use
$crud->setRelation('product_id','available_products','product_name');
$crud->setprimarykey('product_id','available_products');
I can see all the rentals in the table, and only the available products in the dropdown list, but when I click +Add Rental, there is an error. (Maybe because it is a view, and not a table)
is there a way to fix it? or an other way to make it work?
Thanks in advance, please save me ! :)