ronknight / InventorySystem

🖥️Create an open-source Inventory Management System using CodeIgniter web framework, Php and MySQL. Original source code from an Online Inventory Management Software found on https://codersfolder.com/2018/02/stock-management-system-v2-codeigniter/.
MIT License
341 stars 143 forks source link

Stat boxes not showing #1

Closed ronknight closed 3 years ago

ronknight commented 5 years ago

Stat boxes only shows up when using the default user. Need to enable stat boxes for Admin Group.

GregsGrog commented 5 years ago

Do you have any more information about this bug?

demartini commented 5 years ago

Hi,

I believe this is not a bug, it is a condition.

At line 20 of the InventorySystem/application/views/dashboard.php file.

https://github.com/ronknight/InventorySystem/blob/b53d2ece1e876394c2c6952a73fa1e5607230175/application/views/dashboard.php#L20

We have a variable saying that if the user is admin to display the content, if not they will not display anything.

ronknight commented 4 years ago

Yes it is indeed based on a value that is stored on the database. I tried changing the database value of a regular user to the same value that a administrator would have but the stat boxes still don't show up even if the regular user is already converted to an admin.

nitorplus commented 3 years ago

At line 32 of the InventorySystem/application/controllers/Dashboard.php file.

$is_admin = ($user_id == 1) ? true :false;

Only user with user_id 1 is ever set to admin.

ronknight commented 3 years ago

good catch @nitorplus. Thanks