software-license-manager/admin/slm-dashboard-widgets.php
Michel Velis 27fe73fe55 upgraded jQuery ui version
fixed minor links giving 404 from jquery ui library
added: activity log for licenses api
added: woocommerce order details with license, status, and license type
added: subscribers, now you can manage licenses by subscribers
added: screen options
added: filter by tags inside the license table
added: admin stats dashboard
fixed: minor depreciation errors
bugs: fixed another minor errors and bugs
2019-06-12 10:09:54 -04:00

80 lines
No EOL
2.9 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
if (!defined('WPINC')) {
die;
}
/**
* Add a widget to the dashboard.
*
* This function is hooked into the 'wp_dashboard_setup' action below.
*/
function slm_add_dashboard_widgets()
{
wp_add_dashboard_widget(
'slm_dashboard_widget', // Widget slug.
'Software license manager', // Title.
'slm_dashboard_widget_function' // Display function.
);
}
add_action('wp_dashboard_setup', 'slm_add_dashboard_widgets');
/**
* Create the function to output the contents of our Dashboard Widget.
*/
function slm_dashboard_widget_function()
{ ?>
<ul class="slm_status_list">
<li class="total-licenses">
<a href="<?php echo admin_url('admin.php?page=slm_overview'); ?>">
<div class="icon"> <span class="dashicons dashicons-admin-network"></span> </div>
<strong>Manage licenses</strong> Total active licenses <span class="badge"> <?php echo SLM_Utility::get_total_licenses(); ?> </span>
</a> </li>
<li class="active-licenses">
<a href="<?php echo admin_url('admin.php?page=slm_overview&s=active&view=active'); ?>">
<div class="icon"><span class="dashicons dashicons-yes-alt"></span></div>
<strong> <?php echo SLM_Utility::count_licenses('active'); ?> </strong> Active licenses
</a>
</li>
<li class="pending-licenses">
<a href="<?php echo admin_url('admin.php?page=slm_overview&s=pending&view=pending'); ?>">
<div class="icon"> <span class="dashicons dashicons-warning"></span> </div>
<strong><?php echo SLM_Utility::count_licenses('pending '); ?></strong> Pending licenses
</a>
</li>
<li class=" blocked-licenses">
<a href="<?php echo admin_url('admin.php?page=slm_overview&s=blocked&view=blocked'); ?>">
<div class="icon"> <span class="dashicons dashicons-dismiss"></span> </div>
<strong><?php echo SLM_Utility::count_licenses('blocked '); ?></strong> Blocked licenses
</a>
</li>
<li class="expired-licenses">
<a href="<?php echo admin_url('admin.php?page=slm_overview&s=expired&view=expired'); ?>">
<div class="icon"> <span class="dashicons dashicons-calendar-alt"></span> </div>
<strong><?php echo SLM_Utility::count_licenses('expired'); ?></strong> Expired licenses
</a>
</li>
</ul>
<div class="table recent_licenses">
<hr>
<table>
<thead>
<tr>
<th scope="col">
Recent Licenses <a href="<?php echo admin_url('admin.php?page=slm_overview'); ?>">&nbsp;&nbsp;View All</a>
</th>
</tr>
</thead>
<tbody>
<?php SLM_Utility::slm_wp_dashboards_stats('5'); ?>
</tbody>
</table>
</div>
<?php
}
?>