Hey Guys!
I have to say that GroceryCRUD is an amazing and extremely powerful tool, I'm so glad it's available for us!
I discovered CodeIgniter when designing a client's order tracking system last year and it has been continuing to evolve as I discover great software like this. My application has a login system powered by CIzACL and I've given each 'role' it's own controller which have similar functions. There are two functions, 'deals' and 'orders', which present data specifc to the logged in user, and this is where I realized had to ask question.
Here are two of my tables:
deals
-deal_id
-name
-start
-end
-url
orders
-order_id
-deal_id --> deals table (deal_id)
-mfg_id --> user table (user_id)
-courier_id --> user table (user_id)
-acpt_date
-ship_date
Say I log in as a specific user with a 'courier' role type, I am brought to the 'courier/deals' function where groceryCRUD presents a flexigrid containing a list of deals and an action to examine the orders for each deal. The 'examine orders' action points to the 'courier/orders/'.$id function which will show all orders for that 'deal_id' AND where 'courier_id' = 'user_id' (taken from session data.) This seems to work well but I noticed a behavior which I did not initially plan on and am unsure how to rectify (if even possible.)
What I am noticing is that some deals may not have any orders for a particular courier, yet the deal will still be included in the listing when they login. This is obviously normal behavior but is redundant for the courier to see this row if they have no orders for that deal. I can write a function to check how many orders they are assigned to for each deal but have no idea how I could use it to tell groceryCRUD not to display these rows and there isn't a GC 'query' function for me to write a query using an IF statement or something.
Can anyone give me some suggestions on how to accomplish this?
Thanks much!