Hi there,
I follow this tutorial for my web app.
link: http://www.thesoftwareguy.in/creating-multi-user-role-based-admin-using-php-mysql-bootstrap/#comment-4583
Can anyone give me idea to do this same app using codeigniter.?
Thanks.

Member Avatar
diafol

I had a quick look at the post. It seems like a reasonable schema, although the processing looks a little over-complicated. It could certainly do with a little OOP or generalizing. The references to specific session variables is too, well, specific, heh heh.

<!-- for creating purchase function -->
<?php if (authorize($_SESSION["access"]["INVT"]["PURCHASES"]["create"])) { ?>
<button class="btn btn-sm btn-primary" type="button"><i class="fa fa-plus"></i> ADD PURCHASE</button> 
<?php } ?>

<!-- for updating purchase function -->
<?php if (authorize($_SESSION["access"]["INVT"]["PURCHASES"]["edit"])) { ?>
<button class="btn btn-sm btn-info" type="button"><i class="fa fa-edit"></i> EDIT</button> 
<?php } ?>

<!-- for view purchase function -->
<?php if (authorize($_SESSION["access"]["INVT"]["PURCHASES"]["view"])) { ?>
<button class="btn btn-sm btn-warning" type="button"><i class="fa fa-search-plus"></i> VIEW</button>
<?php } ?>

<!-- for delete purchase function -->
<?php if (authorize($_SESSION["access"]["INVT"]["PURCHASES"]["delete"])) { ?>
<button class="btn btn-sm btn-danger" type="button"><i class="fa fa-trash-o"></i> DELETE</button>
<?php } ?>

It should follow some 'modularized' naming convention, so that the above an be performed regardless of the specific subject, e.g.

echo get_buttons('INVT>PURCHASES', 'CRUD');
echo get_buttons('CHECKOUT>SHIPPING', 'CR');

Just a thought. What code do you have already?