</div><!--col-md-5--> <div class="col-sm-4 col-sm-offset-2 header-statistics"> <div class="online-users relative"> <h4>Online Users</h4> <img class="online-user-image" src="<?php bloginfo('stylesheet_directory'); ?> /assets/img/icon-online-users.png" alt="Users:"> <p class="absolute online-users-absolute iCount" data-value="<?php echo getTotalUsers() + '10000'; ?> "></p> <h3 class="million">Millions</h3> </div> <hr> <div class="online-users relative"> <h4>Total Jackpots</h4> <img class="moneybag" src="<?php bloginfo('stylesheet_directory');
echo "<li class='stat-count'><span style='font-size:12px;'>" . substr(implode("", getMostUsers("descr")), 0, 29) . "...</span><span>Most User's Customer</span></li>"; } else { echo "<li class='stat-count'><span>" . substr(implode("", getMostUsers("descr")), 0, 23) . "...</span><span>Most User's Customer</span></li>"; } $usernum = "SUBSTRING_INDEX(SUBSTRING_INDEX(dbserial, '-', 2), '-', -1)"; echo " <li class='stat-percent'><span class='text-success stat-percent'>" . implode("", getMostUsers("{$usernum}")) . "</span></li>\r\n </ul>\r\n </div>\r\n </div>\r\n <div class='span3 '>\r\n <div class='stat-block'>\r\n <ul>"; if (strlen(implode("", getLongestCust("descr"))) > 10) { echo "<li class='stat-count'><span style='font-size:12px;'>" . substr(implode("", getLongestCust("descr")), 0, 29) . "...</span><span>Services from " . implode("", getLongestCust("updatefrom")) . "</span></li>"; } else { echo "<li class='stat-count'><span>" . substr(implode("", getLongestCust("descr")), 0, 23) . "...</span><span>Services from</span></li>"; } echo " <li class='stat-percent'><span class='text-success stat-percent'>" . (implode("", getLongestCust("updateto")) - implode("", getLongestCust("updatefrom"))) . "</span></li>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n <div class='row-fluid'>\r\n <div class='span9'>"; $this->beginWidget('zii.widgets.CPortlet', array('title' => '<span class="icon-picture"></span>Operations Chart', 'titleCssClass' => '')); echo " <div>\r\n <canvas id='canvas' height='275' width='1030'></canvas>\r\n </div>"; $this->endWidget(); echo " </div>\r\n <div class='span3'>\r\n <div class='summary'>\r\n <ul>\r\n <li>\r\n <span class='summary-icon'>\r\n <img src='" . $baseUrl . "/img/credit.png' width='36' height='36' alt='Monthly Income'>\r\n </span>\r\n <span class='summary-number'>" . (implode("", getActiveCustomers()) + implode("", getActiveContracts())) . "</span>\r\n <span class='summary-title'> Active Services</span>\r\n </li>\r\n <li>\r\n <span class='summary-icon'>\r\n <img src='" . $baseUrl . "/img/page_white_edit.png' width='36' height='36' alt='Open Invoices'>\r\n </span>\r\n <span class='summary-number'>" . implode("", getActiveContracts()) . "</span>\r\n <span class='summary-title'> Open Contracts</span>\r\n </li>\r\n <li>\r\n <span class='summary-icon'>\r\n <img src='" . $baseUrl . "/img/page_white_excel.png' width='36' height='36' alt='Open Quotes<'>\r\n </span>\r\n <span class='summary-number'>" . implode("", getActiveCustomers()) . "</span>\r\n <span class='summary-title'> Active Customers</span>\r\n </li>\r\n <li>\r\n <span class='summary-icon'>\r\n <img src='" . $baseUrl . "/img/group.png' width='36' height='36' alt='Active Members'>\r\n </span>\r\n <span class='summary-number'>" . implode("", getTotalUsers()) . "</span>\r\n <span class='summary-title'> Active Members</span>\r\n </li>\r\n <li>\r\n <span class='summary-icon'>\r\n <img src='" . $baseUrl . "/img/folder_page.png' width='36' height='36' alt='Recent Conversions'>\r\n </span>\r\n <span class='summary-number'>" . implode("", getAllCustomers()) . "</span>\r\n <span class='summary-title'> Total Customers</span>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n <div class='row-fluid'>\r\n <div class='span6'>"; $this->beginWidget('zii.widgets.CPortlet', array('title' => '<span class="icon-th-list"></span>Major customers with most users')); $dataProvider1 = new CActiveDataProvider('AlmabCustomers', array('criteria' => array('condition' => 'descr IS NOT NULL', 'order' => 'cast(SUBSTRING_INDEX(SUBSTRING_INDEX(dbserial, "-", 2), "-", -1)AS UNSIGNED) DESC'), 'pagination' => array('pageSize' => 20))); $this->widget('zii.widgets.grid.CGridView', array('id' => 'megaloi pelates', 'htmlOptions' => array('class' => 'table table-striped table-bordered table-condensed'), 'dataProvider' => $dataProvider1, 'template' => "{items}", 'columns' => array(array('name' => 'id', 'value' => 'CHtml::link($data->id,Yii::app()->createUrl("AlmabCustomers/view",array("id"=>$data->primaryKey)))', 'type' => 'raw'), array('name' => 'Customer Name', 'value' => '$data->descr'), 'email', array('name' => 'Expire', 'value' => 'date("M j, Y", strtotime($data->updateto))'), array('name' => 'Version', 'value' => 'substr($data->dbserial, 0, -20)')))); $this->endWidget(); echo " </div>\r\n <div class='span6'>"; $this->beginWidget('zii.widgets.CPortlet', array('title' => '<span class="icon-th-list"></span>Expiring customer service')); $dataProvider2 = new CActiveDataProvider('AlmabCustomers', array('criteria' => array('condition' => 'updateto>NOW()', 'order' => 'updateto'), 'pagination' => array('pageSize' => 20))); $this->widget('zii.widgets.grid.CGridView', array('htmlOptions' => array('class' => 'table table-striped table-bordered table-condensed'), 'dataProvider' => $dataProvider2, 'template' => "{items}", 'columns' => array(array('name' => 'id', 'value' => 'CHtml::link($data->id,Yii::app()->createUrl("AlmabCustomers/view",array("id"=>$data->primaryKey)))', 'type' => 'raw'), array('name' => 'Customer Name', 'value' => '$data->descr'), 'email', array('name' => 'Expire', 'value' => 'date("M j, Y", strtotime($data->updateto))'), array('name' => 'Version', 'value' => 'substr($data->dbserial, 0, -20)')))); $this->endWidget(); echo " </div>\r\n </div>\r\n <div class='row-fluid'>\r\n <div class='span6'>"; $this->beginWidget('zii.widgets.CPortlet', array('title' => '<span class="icon-th-large"></span>Product Sales', 'titleCssClass' => '')); echo " <div id='canvas-holder'>\r\n <canvas id='chart-area1' width='500' height='500'/>\r\n </div>"; $this->endWidget(); echo " </div>\r\n <div class='span6'>"; $this->beginWidget('zii.widgets.CPortlet', array('title' => '<span class="icon-th-list"></span>Active Product Sales', 'titleCssClass' => ''));
function registerForm($msg, $newuser) { $username = $newuser['username']; $fullnames = $newuser['fullnames']; $group = $newuser['group']; $phone = $newuser['phone']; $user_website = $newuser['user_website']; $email = $newuser['email']; $referrer = $newuser['referred_by']; $users = getTotalUsers(); $websites = getTotalWebsites(); $templates = getTotalTemplates(); include_once 'forms/register_form.php'; }
$ActiveCustomers = Yii::app()->db->createCommand()->select(array('count(*)'))->from('almab_customers')->where('updateto > NOW()')->queryRow(); return $ActiveCustomers; } //Inactive Customers function getInactiveCustomers() { $InactiveCustomers = Yii::app()->db->createCommand()->select(array('count(*)'))->from('almab_customers')->where('updateto < NOW()')->queryRow(); return $InactiveCustomers; } //Users function getTotalUsers() { $TotalUsers = Yii::app()->db->createCommand()->select(array('sum(SUBSTRING_INDEX(SUBSTRING_INDEX(dbserial, "-", 2), "-", -1))'))->from('almab_customers')->where('descr IS NOT NULL')->queryRow(); return $TotalUsers; } echo "<table class='table table-striped table-bordered'>\r\n <tbody>\r\n <tr>\r\n <td width='50%'>Bandwith Usage</td>\r\n <td>\r\n <div class='progress progress-danger'>\r\n <div class='bar' style='width: " . $speed * 100 / 4 . "%'></div>\r\n </div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>Disk Space</td>\r\n <td>\r\n <div class='progress progress-warning'>\r\n <div class='bar' style='width: " . $df * 100 / $ds . "%'></div>\r\n </div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>Memory Usage</td>\r\n <td>\r\n <div class='progress progress-success'>\r\n <div class='bar' style='width: " . $memuse * 100 / 128 . "%'></div>\r\n </div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>CPU load</td>\r\n <td>\r\n <div class='progress progress-info'>\r\n <div class='bar' style='width: " . get_server_cpu_usage() . "%'></div>\r\n </div>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table> \r\n\t<div class='well'>\r\n <dl class='dl-horizontal'>\r\n <dt>Total Customers</dt>\r\n <dd>" . implode("", getAllCustomers()) . "</dd>\r\n <dt>Ongoing Services</dt>\r\n <dd>" . implode("", getActiveCustomers()) . "</dd>\r\n <dt>Overdue Services</dt>\r\n <dd>" . implode("", getInactiveCustomers()) . "</dd>\r\n <dt>Total Users</dt>\r\n <dd>" . implode("", getTotalUsers()) . "</dd>\r\n </dl>\r\n </div>"; } ?> </div><!--/span--> <div <?php Yii::app()->user->isSuperuser ? print 'class="span9"' : (print ''); ?> > <?php if (isset($this->breadcrumbs)) { ?> <?php $this->widget('zii.widgets.CBreadcrumbs', array('links' => $this->breadcrumbs, 'homeLink' => CHtml::link('Dashboard', Yii::app()->homeUrl), 'htmlOptions' => array('class' => 'breadcrumb'))); ?> <!-- breadcrumbs -->
} else { $sort = 'username'; } if (isset($_GET['order'])) { $order = $_GET['order']; } else { $order = 'ASC'; } if (isset($_GET['page'])) { $page = $_GET['page']; } else { $page = 1; } $numrows = 20; $data = array('sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $numrows, 'limit' => $numrows); $total_user = getTotalUsers(); $users = getUsers($data); $pagination = new Pagination(); $pagination->total = $total_user; $pagination->page = $page; $pagination->limit = $numrows; $pagination->url = "user/page{page}.html"; $pagination = $pagination->render(); $url = ''; if ($order == 'ASC') { $url .= '/DESC'; } else { $url .= '/ASC'; } if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['selected'])) { foreach ($_POST['selected'] as $user_id) {