loan data
This commit is contained in:
+10
-10
@@ -28,8 +28,8 @@ class BkoDash extends BaseController
|
|||||||
// FROM applications a
|
// FROM applications a
|
||||||
// LEFT JOIN customers c ON c.uid = a.customer_uid LIMIT 10");
|
// LEFT JOIN customers c ON c.uid = a.customer_uid LIMIT 10");
|
||||||
|
|
||||||
$dash_data["active_loans"] = 0;
|
$dash_data["active_loans"] = $this->applicationCount(5)["app_count"];;
|
||||||
$dash_data["applications"] = $this->applicationCount(1);
|
$dash_data["applications"] = $this->applicationCount(1)["app_count"];
|
||||||
$dash_data["today_application"] = 0;
|
$dash_data["today_application"] = 0;
|
||||||
|
|
||||||
$dash_data["curr_month"] = date('F');
|
$dash_data["curr_month"] = date('F');
|
||||||
@@ -40,9 +40,9 @@ class BkoDash extends BaseController
|
|||||||
|
|
||||||
$dash_data["recent_applications"] = [];
|
$dash_data["recent_applications"] = [];
|
||||||
|
|
||||||
$dash_data["ready_loans"] = 0;
|
$dash_data["ready_loans"] = $this->applicationCount(2)["amount"];
|
||||||
$dash_data["verified_loans"] = 0;
|
$dash_data["verified_loans"] = $this->applicationCount(4)["amount"];
|
||||||
$dash_data["approved_loans"] = 0;
|
$dash_data["approved_loans"] = $this->applicationCount(5)["amount"];
|
||||||
|
|
||||||
|
|
||||||
$query = $this->db->query("SELECT c.firstname AS firstname, c.lastname AS lastname, a.uid,a.loan_amount,
|
$query = $this->db->query("SELECT c.firstname AS firstname, c.lastname AS lastname, a.uid,a.loan_amount,
|
||||||
@@ -69,14 +69,14 @@ class BkoDash extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function applicationCount($applicationStatus){
|
private function applicationCount($applicationStatus){
|
||||||
$count_status = 0;
|
//$status_result = 0;
|
||||||
$mysqA = "select count(id) AS app_count from applications WHERE status= ".$applicationStatus;
|
$mysqlA = "select count(id) AS app_count, sum(loan_amount) AS amount from applications WHERE status= ".$applicationStatus;
|
||||||
$query2 = $this->db->query($mysqA);
|
$query2 = $this->db->query($mysqlA);
|
||||||
$row2 = $query2->getResult('array');
|
$row2 = $query2->getResult('array');
|
||||||
if ($row2 && count($row2)> 0 ){
|
if ($row2 && count($row2)> 0 ){
|
||||||
$count_status = $row2[0]["app_count"];
|
return $row2[0];
|
||||||
}
|
}
|
||||||
return $count_status;
|
return ["app_count"=> 0, "amount"=> 0 ];
|
||||||
}
|
}
|
||||||
public function pendingApplication() :ResponseInterface
|
public function pendingApplication() :ResponseInterface
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user