Added Admin Customer Statistics
This commit is contained in:
48
Layout/default/Admin/CustomerStatistics.php
Normal file
48
Layout/default/Admin/CustomerStatistics.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
|
||||
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="<?=self::getUrl("Dashboard")?>"><?=MFAPPNAME_SLUG?></a></li>
|
||||
<li class="breadcrumb-item"><a href="<?=self::getUrl("Admin")?>">Admin</a></li>
|
||||
<li class="breadcrumb-item active">Kundenstatistiken</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Kundenstatistiken</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-xl-10">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row col-6">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>Xinon Kunden gesamt:</th>
|
||||
<td><?=$xinon_active_customers_total?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Xinon Kunden Business:</th>
|
||||
<td><?=$xinon_active_customers_business?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Xinon Kunden Privat:</th>
|
||||
<td><?=$xinon_active_customers_private?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
||||
@@ -14,7 +14,20 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-xl-10">
|
||||
<h5>Backoffice</h5>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row col-12">
|
||||
<div><a href="<?=self::getUrl("Admin", "customerStatistics")?>">Kundenstatistiken</a></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-xl-10">
|
||||
|
||||
@@ -19,7 +19,36 @@ class AdminController extends mfBaseController {
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected function customerStatisticsAction() {
|
||||
$this->layout()->setTemplate("Admin/CustomerStatistics");
|
||||
|
||||
$bc_sql = "SELECT COUNT(Contract.id) as contract_count, Address.* FROM `Address`
|
||||
LEFT JOIN Contract ON (Contract.owner_id = Address.id)
|
||||
WHERE customer_number > 0 AND company <> ''
|
||||
AND (Contract.cancel_date IS NULL OR Contract.cancel_date > UNIX_TIMESTAMP())
|
||||
GROUP BY Address.id HAVING contract_count > 0";
|
||||
$bc_res = $this->db()->query($bc_sql);
|
||||
|
||||
$xinon_active_customers_business = $this->db()->num_rows($bc_res);
|
||||
$this->layout()->set("xinon_active_customers_business", $xinon_active_customers_business);
|
||||
|
||||
$pc_sql = "SELECT COUNT(Contract.id) as contract_count, Address.* FROM `Address`
|
||||
LEFT JOIN Contract ON (Contract.owner_id = Address.id)
|
||||
WHERE customer_number > 0 AND (company = '' OR company IS NULL)
|
||||
AND (Contract.cancel_date IS NULL OR Contract.cancel_date > UNIX_TIMESTAMP())
|
||||
GROUP BY Address.id HAVING contract_count > 0";
|
||||
|
||||
$pc_res = $this->db()->query($pc_sql);
|
||||
|
||||
$xinon_active_customers_private = $this->db()->num_rows($pc_res);
|
||||
$this->layout()->set("xinon_active_customers_private", $xinon_active_customers_private);
|
||||
|
||||
$xinon_active_customers_total = $xinon_active_customers_business + $xinon_active_customers_private;
|
||||
$this->layout()->set("xinon_active_customers_total", $xinon_active_customers_total);
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected function createNetworkAddressForNetowner() {
|
||||
$i = 0;
|
||||
foreach(NetworkModel::getAll() as $network) {
|
||||
@@ -80,6 +109,8 @@ class AdminController extends mfBaseController {
|
||||
}
|
||||
|
||||
protected function saveIvtImportMatchProducts() {
|
||||
$this->layout()->setFlash("disabled", "error");
|
||||
$this->redirect("Admin");
|
||||
$r = $this->request;
|
||||
//var_dump($r);exit;
|
||||
|
||||
@@ -151,7 +182,9 @@ class AdminController extends mfBaseController {
|
||||
}
|
||||
|
||||
protected function ivtContractImportAction() {
|
||||
//exit;
|
||||
$this->layout()->setFlash("disabled", "error");
|
||||
$this->redirect("Admin");
|
||||
|
||||
$doit = false;
|
||||
if($this->request->doit == 1) {
|
||||
$doit = true;
|
||||
@@ -174,6 +207,9 @@ class AdminController extends mfBaseController {
|
||||
}
|
||||
|
||||
protected function ivtCreditImportAction() {
|
||||
$this->layout()->setFlash("disabled", "error");
|
||||
$this->redirect("Admin");
|
||||
|
||||
$doit = false;
|
||||
if($this->request->doit == 1) {
|
||||
$doit = true;
|
||||
|
||||
Reference in New Issue
Block a user