init
Showing
1 changed file
with
15 additions
and
0 deletions
| ... | @@ -32,6 +32,10 @@ class CheckLogin | ... | @@ -32,6 +32,10 @@ class CheckLogin |
| 32 | $session->repayments = $this->getRepayment(); | 32 | $session->repayments = $this->getRepayment(); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | if (!$session->repaymentPlans) { | ||
| 36 | $session->repaymentPlans = $this->getRepaymentPlans(); | ||
| 37 | } | ||
| 38 | |||
| 35 | 39 | ||
| 36 | 40 | ||
| 37 | /*if (preg_match("/admin|base/i", uri_string())) { | 41 | /*if (preg_match("/admin|base/i", uri_string())) { |
| ... | @@ -113,4 +117,15 @@ class CheckLogin | ... | @@ -113,4 +117,15 @@ class CheckLogin |
| 113 | } | 117 | } |
| 114 | } | 118 | } |
| 115 | 119 | ||
| 120 | private function getRepaymentPlans(){ | ||
| 121 | try { | ||
| 122 | $url = $this->CI->config->item('apiBaseUrl') . 'enum/repaymentPlan/status'; | ||
| 123 | $res = json_decode(file_get_contents($url)); | ||
| 124 | $products = $res->data; | ||
| 125 | return $products; | ||
| 126 | } catch (Exception $e) { | ||
| 127 | return array(); | ||
| 128 | } | ||
| 129 | } | ||
| 130 | |||
| 116 | } | 131 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment