Create New Item
×
Item Type
File
Folder
Item Name
×
Search file in folder and subfolders...
File Manager
/
wp-content
/
plugins
/
custom-dbx
/
modules
/
afiliere
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php add_action('wp_dashboard_setup', 'prefix_add_dashboard_widget'); function prefix_add_dashboard_widget() { wp_add_dashboard_widget('dbx_aff_widget', 'DBX - Statistici Afiliere', 'dbx_aff_widget_callback'); } function dbx_aff_widget_callback() { $azi = date("Y-m-d"); $old = date('Y-m-d', strtotime('-7 days')); $result = dbx_aff_get_today_data(); $i = 0; foreach ($result as $row) { $site = $row['site']; $data = unserialize($row['data']); foreach ($data as $_d) { if ($_d['country'] != 'RO') { continue; } $i++; } } $last_7 = dbx_aff_get_last_7_days(); $j = 0; foreach ($last_7 as $row) { $site = $row['site']; $data = unserialize($row['data']); foreach ($data as $_d) { if ($_d['country'] != 'RO') { continue; } $j++; } } ?> <div class="dbx_w top"> <h3>Click-uri</h3> </div> <div class="dbx_all"> <div class="dbx_w"> <h3>Azi</h3> <p class="dbx_c"><?php echo $i; ?></p> <a class="dbx_btn" href="#">Vezi detalii</a> </div> <div class="dbx_w"> <h3>Ultimile 7 zile</h3> <p class="dbx_c"><?php echo $j; ?></p> <a class="dbx_btn" href="#">Vezi detalii</a> </div> </div> <style> .dbx_all { display: inline-flex; width: 100%; gap: 15px; } .dbx_w { background: #f3f3f3; text-align: center; padding: 15px; border-radius: 0.375em; color: #000; width: 50%; } .dbx_w h3 { color: #000!important; font-size: 22px!important; margin-bottom: 0!important; } p.dbx_c { margin: 0; font-size: 24px; color: red; font-weight: 550; margin-bottom: 10px; } .dbx_w.top{ width: 92%; margin-bottom: 15px; margin-right: 15px; } a.dbx_btn { background: #2271b1; color: #fff; padding: 3px 5px; text-decoration: none; border-radius: 0.375em; margin-top: 15px; } </style> <?php }