Last active
May 30, 2018 15:14
-
-
Save AppGiniCourse/361bed27743dd0fc73b60def28f53e04 to your computer and use it in GitHub Desktop.
Customizing AppGini web application - Section 3 - Lesson 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * You can add custom links in the home page by appending them here ... | |
| * The format for each link is: | |
| $homeLinks[] = array( | |
| 'url' => 'path/to/link', | |
| 'title' => 'Link title', | |
| 'description' => 'Link text', | |
| 'groups' => array('group1', 'group2'), // groups allowed to see this link, use '*' if you want to show the link to all groups | |
| 'grid_column_classes' => '', // optional CSS classes to apply to link block. See: http://getbootstrap.com/css/#grid | |
| 'panel_classes' => '', // optional CSS classes to apply to panel. See: http://getbootstrap.com/components/#panels | |
| 'link_classes' => '', // optional CSS classes to apply to link. See: http://getbootstrap.com/css/#buttons | |
| 'icon' => 'path/to/icon' // optional icon to use with the link | |
| ); | |
| */ | |
| /* http://localhost/demo/orders_view.php?SortField=&SortDirection=&FilterAnd%5B1%5D=&FilterField%5B1%5D=6&FilterOperator%5B1%5D=is-empty&FilterValue%5B1%5D= */ | |
| $homeLinks[] = array( | |
| 'url' => 'http://localhost/demo/orders_view.php?SortField=&SortDirection=&FilterAnd%5B1%5D=&FilterField%5B1%5D=6&FilterOperator%5B1%5D=is-empty&FilterValue%5B1%5D=', | |
| 'title' => 'UNSHIPPED ORDERS', | |
| 'description' => 'Show all orders that are not yet shipped.', | |
| 'groups' => array('*'), // groups allowed to see this link, use '*' if you want to show the link to all groups | |
| 'grid_column_classes' => 'col-md-4 col-lg-3', // optional CSS classes to apply to link block. See: http://getbootstrap.com/css/#grid | |
| 'panel_classes' => 'panel-danger', // optional CSS classes to apply to panel. See: http://getbootstrap.com/components/#panels | |
| 'link_classes' => 'btn-danger', // optional CSS classes to apply to link. See: http://getbootstrap.com/css/#buttons | |
| 'icon' => '' // optional icon to use with the link | |
| ); | |
| /* get the count of orders */ | |
| $orders_count = sqlValue("select count(*) from " . get_sql_from('orders')); | |
| // echo "Orders count: {$orders_count}"; | |
| ?> | |
| <script> | |
| $j(function(){ | |
| $j('a.btn[href="orders_view.php"]').html('<img src="resources/table_icons/cash_register.png"><strong>Orders (<?php echo $orders_count; ?>)</strong>'); | |
| }); | |
| </script> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The source code above is part of our online course on customizing AppGini web applications. The course takes you step-by-step into expanding your applications to fit your business needs. No programming experience is assumed ... we'll explain each line in an easy to follow pace. Learn more and get 10% off the course here: https://www.udemy.com/customizing-appgini-web-applications/?couponCode=TENOFF