Added Admin Customer Statistics
This commit is contained in:
@@ -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