Skip to content
Snippets Groups Projects
Commit 4082aeae authored by elvanowen's avatar elvanowen
Browse files

Everything

parent b2baa1e5
Branches
No related merge requests found
Pipeline #2787 skipped
......@@ -109,7 +109,7 @@ $di->set('router', function(){
);
$router->addGet(
"/show",
"/show/n/{nip}/y/{year}/m/{month}",
array(
"controller" => "index",
"action" => "show"
......
......@@ -14,7 +14,7 @@ class IndexController extends ControllerBase
if ($this->session->role == "admin"){
$this->response->redirect("list/y/" . date("Y") . "/m/" . date("m") . "/p/1");
} else {
$this->response->redirect("show");
$this->response->redirect("show/n/" + $this->session->nip + "/y/" . date("Y") . "/m/" . date("m"));
}
} else {
$this->view->pick("users/login");
......@@ -24,10 +24,18 @@ class IndexController extends ControllerBase
public function showAction(){
if ($this->session->role == "pegawai"){
$this->assets
->addJs('js/bootstrap-datepicker/js/bootstrap-datepicker.min.js')
->addJs('js/salaryman/look.js');
$this->assets
->addCss('css/salaryman/statistics.css')
->addCss('css/bootstrap-datepicker/bootstrap-datepicker.min.css');
$httpRequest = new HttpRequest();
$result = $httpRequest
->setUrl($this->config->services->salaryServices . "/getSalary/" . $this->session->nip)
->setUrl($this->config->services->salaryServices . "/getSalary/" . "n/" . $this->dispatcher->getParam("nip") . "/y/" . $this->dispatcher->getParam("year") . "/m/" . $this->dispatcher->getParam("month"))
->setMethod("GET")
->sendRequest();
......@@ -35,26 +43,38 @@ class IndexController extends ControllerBase
return $this->dispatcher->forward(array("controller" => "index", "action" => "notFound"));
}
$debugger = new Debugger($this);
$debugger
->stopProgram()
->addMessage($this->config->services->salaryServices . "/getSalary/" . "n/" . $this->dispatcher->getParam("nip") . "/y/" . $this->dispatcher->getParam("year") . "/m/" . $this->dispatcher->getParam("month"))
->addMessage($result)
->showMessage();
$result->data->gaji_total = number_format($result->data->gaji_total);
$result->data->gaji_pokok = number_format($result->data->gaji_pokok);
$this->view->salary = $result->data;
// $debugger = new Debugger($this);
// $debugger
// ->stopProgram()
// ->addMessage($result)
// ->showMessage();
$result = $httpRequest
->setUrl($this->config->services->rapelServices . "/getRapel/n/" . $this->session->nip)
->setMethod("GET")
->sendRequest();
// $debugger = new Debugger($this);
// $debugger
// ->stopProgram()
// ->addMessage($result)
// ->showMessage();
if ($result->status == "NOT-FOUND"){
return $this->dispatcher->forward(array("controller" => "index", "action" => "notFound"));
}
$this->view->rapel = $result->data->rapel;
$this->view->user = $this->session;
$this->view->nip = $this->dispatcher->getParam("nip");
$this->view->year = $this->dispatcher->getParam("year");
$this->view->month = $this->dispatcher->getParam("month");
$this->tag->setDefault("rapel", 0);
} else {
return $this->dispatcher->forward(array("controller" => "index", "action" => "index"));
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment