2 Years
Discussion Span
Last Post by 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?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.