diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml
index e7bedf3..0ed0688 100644
--- a/.idea/copyright/profiles_settings.xml
+++ b/.idea/copyright/profiles_settings.xml
@@ -1,3 +1,3 @@
-
+
\ No newline at end of file
diff --git a/.idea/cssxfire.xml b/.idea/cssxfire.xml
new file mode 100644
index 0000000..61699e7
--- /dev/null
+++ b/.idea/cssxfire.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/controllers/acaraRKS.php b/app/controllers/acaraRKS.php
index b562091..e6d4fca 100644
--- a/app/controllers/acaraRKS.php
+++ b/app/controllers/acaraRKS.php
@@ -67,9 +67,25 @@ public function detailBeritaTenderRKS(Req $req, Res $res, $args){
$rks = [
'file' => $filename,
'time' => date ("Y-m-d H:i:s"),
- 'who' => $this->session->id_user
+ 'who' => $this->session->id_user,
+ 'approval'=>[
+ 'direktur'=>[
+ 'status'=>'',
+ 'waktu'=>''
+ ],
+ 'manajer'=>[
+ 'status'=>'',
+ 'waktu'=>''
+ ],
+ ]
];
if($this->tenderModels->setRKSBeritaTender($args['id_tender'], json_encode($rks))){
+ $this->notifikasiModels->addNotification ([
+ "id_user" => $req->getAttribute ('active_user_data')[ 'id_user' ],
+ "tentang" => 'Telah Menambahkan Dokumen RKS ke "' . $this->tenderModels->getBeritaTender($args['id_tender'])[ 'judul_tender' ] . '"',
+ "waktu" => date ("Y-m-d H:i:s"),
+ "meta" => $this->router->pathFor ('detailBeritaTenderRKS', ['id_tender'=>$args['id_tender']])
+ ]);
$this->flash->addMessage ('file_saved', true);
return $res->withStatus (302)->withHeader ('Location', $this->router->pathFor ('detailBeritaTenderRKS', ['id_tender'=>$args['id_tender']]));
}
@@ -79,4 +95,59 @@ public function detailBeritaTenderRKS(Req $req, Res $res, $args){
}
}
}
+
+ public function beritaTenderAcara(Req $req, Res $res, $args){
+ if($req->isGet()){
+ $this->view->registerFunction('getNamaPenyelenggara', function($id_penyelenggara){
+ $penyelenggara = $this->penyelenggaraModels->getPenyelenggara($id_penyelenggara);
+ return $penyelenggara['nama_penyelenggara'];
+ });
+ $beritaTender = $this->tenderModels->getBeritaTender();
+ $req = $req->withAttribute('beritaTender', $beritaTender);
+ return $this->view->render ("rks-acara/acara/daftar-berita", $req->getAttributes ());
+ }
+ }
+
+ public function detailBeritaTenderAcara(Req $req, Res $res, $args){
+ if($req->isGet()){
+ $this->view->registerFunction('getNamaPenyelenggara', function($id_penyelenggara){
+ $penyelenggara = $this->penyelenggaraModels->getPenyelenggara($id_penyelenggara);
+ return $penyelenggara['nama_penyelenggara'];
+ });
+ $this->view->registerFunction('getUserUpload', function($id_user){
+ $user = $this->userModels->getUserDetail($id_user);
+ return $user;
+ });
+ $beritaTender = $this->tenderModels->getBeritaTender($args['id_tender']);
+ $req = $req->withAttribute('tender', $beritaTender);
+ $req = $req->withAttribute ('no_file', $this->flash->getMessage ('no_file'));
+ $req = $req->withAttribute ('file_saved', $this->flash->getMessage ('file_saved'));
+ return $this->view->render ("rks-acara/acara/detail-berita", $req->getAttributes ());
+ }else{
+ $files = $req->getUploadedFiles();
+ if($files['berita_acara']->getClientFilename() != null){
+ $fileinfo = pathinfo($files['berita_acara']->getClientFilename());
+ $filename = $fileinfo['filename'].'_'.time().'.'.$fileinfo['extension'];
+ $files['berita_acara']->moveTo("public/content/berita-acara/".$filename);
+ $acara = [
+ 'file' => $filename,
+ 'time' => date ("Y-m-d H:i:s"),
+ 'who' => $this->session->id_user,
+ ];
+ if($this->tenderModels->setAcaraBeritaTender($args['id_tender'], json_encode($acara))){
+ $this->notifikasiModels->addNotification ([
+ "id_user" => $req->getAttribute ('active_user_data')[ 'id_user' ],
+ "tentang" => 'Telah Menambahkan Dokumen Berita Acara ke "' . $this->tenderModels->getBeritaTender($args['id_tender'])[ 'judul_tender' ] . '"',
+ "waktu" => date ("Y-m-d H:i:s"),
+ "meta" => $this->router->pathFor ('detailBeritaTenderAcara', ['id_tender'=>$args['id_tender']])
+ ]);
+ $this->flash->addMessage ('file_saved', true);
+ return $res->withStatus (302)->withHeader ('Location', $this->router->pathFor ('detailBeritaTenderAcara', ['id_tender'=>$args['id_tender']]));
+ }
+ }else{
+ $this->flash->addMessage ('no_file', true);
+ return $res->withStatus (302)->withHeader ('Location', $this->router->pathFor ('detailBeritaTenderAcara', ['id_tender'=>$args['id_tender']]));
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/app/controllers/approval.php b/app/controllers/approval.php
index 4c152a0..f192695 100644
--- a/app/controllers/approval.php
+++ b/app/controllers/approval.php
@@ -87,7 +87,44 @@ public function beritaTenderRKS(Req $req, Res $res, $args){
});
$beritaTender = $this->tenderModels->getBeritaTender();
$req = $req->withAttribute('beritaTender', $beritaTender);
- return $this->view->render ("approval/berita-tender/daftar-berita", $req->getAttributes ());
+ return $this->view->render ("approval/rks-acara/daftar-berita", $req->getAttributes ());
+ }
+ }
+
+ public function approvalBeritaTenderRKS(Req $req, Res $res, $args){
+ if(!isset($args['status'])){
+ $this->view->registerFunction('getNamaPenyelenggara', function($id_penyelenggara){
+ $penyelenggara = $this->penyelenggaraModels->getPenyelenggara($id_penyelenggara);
+ return $penyelenggara['nama_penyelenggara'];
+ });
+ $this->view->registerFunction('getUserUpload', function($id_user){
+ $user = $this->userModels->getUserDetail($id_user);
+ return $user;
+ });
+ $beritaTender = $this->tenderModels->getBeritaTender($args['id_tender']);
+ $req = $req->withAttribute('tender', $beritaTender);
+ return $this->view->render ("approval/rks-acara/detail-berita", $req->getAttributes ());
+ }elseif(isset($args['status'])){
+ if($this->tenderModels->setApprovalRKSBeritaTender($args['id_tender'], $this->session->previledge, $args['status'])){
+ if($args['status'] == 'diterima'){
+ $this->notifikasiModels->addNotification ([
+ "id_user" => $req->getAttribute ('active_user_data')[ 'id_user' ],
+ "tentang" => 'Telah Melakukan Approve Dokumen RKS dari Berita Tender "' . $this->tenderModels->getBeritaTender($args['id_tender'])[ 'judul_tender' ] . '"',
+ "waktu" => date ("Y-m-d H:i:s"),
+ "meta" => $this->router->pathFor ('detailBeritaTender', ['id_tender'=>$args['id_tender']])
+ ]);
+ }elseif($args['status'] == 'ditolak'){
+ $this->notifikasiModels->addNotification ([
+ "id_user" => $req->getAttribute ('active_user_data')[ 'id_user' ],
+ "tentang" => 'Telah Menolak Dokumen RKS dari Berita Tender "' . $this->tenderModels->getBeritaTender($args['id_tender'])[ 'judul_tender' ] . '"',
+ "waktu" => date ("Y-m-d H:i:s"),
+ "meta" => $this->router->pathFor ('detailBeritaTender', ['id_tender'=>$args['id_tender']])
+ ]);
+ }
+ return $res->withStatus (302)->withHeader ('Location', $this->router->pathFor ('approvalRKSTender', ['id_tender'=>$args['id_tender']]));
+ }
+ }else{
+ return $res->write($args['status']);
}
}
}
\ No newline at end of file
diff --git a/app/controllers/dokumenTender.php b/app/controllers/dokumenTender.php
new file mode 100644
index 0000000..8d614c9
--- /dev/null
+++ b/app/controllers/dokumenTender.php
@@ -0,0 +1,45 @@
+container = $container;
+ $this->userModels = new \ryan\models\users($container);
+ $this->penyelenggaraModels = new \ryan\models\penyelenggara($container);
+ $this->tenderModels = new \ryan\models\tender($container);
+ $this->notifikasiModels = new \ryan\models\notifikasi($container);
+ }
+
+ public function daftarBeritaTender(Request $req, Response $res, $args){
+ if ($req->isGet ()) {
+ $this->view->registerFunction ('getNamaPenyelenggara', function ($id_penyelenggara) {
+ $penyelenggara = $this->penyelenggaraModels->getPenyelenggara ($id_penyelenggara);
+
+ return $penyelenggara[ 'nama_penyelenggara' ];
+ });
+ $beritaTender = $this->tenderModels->getBeritaTender ();
+ $req = $req->withAttribute ('beritaTender', $beritaTender);
+
+ return $this->view->render ("dokumen/daftar-berita", $req->getAttributes ());
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/app/models/dokumenTender.php b/app/models/dokumenTender.php
new file mode 100644
index 0000000..41fb1cd
--- /dev/null
+++ b/app/models/dokumenTender.php
@@ -0,0 +1,20 @@
+container = $container;
+ }
+}
\ No newline at end of file
diff --git a/app/models/tender.php b/app/models/tender.php
index fd5e8f4..8c5402a 100644
--- a/app/models/tender.php
+++ b/app/models/tender.php
@@ -82,4 +82,31 @@ public function setRKSBeritaTender($id_tender, $rks){
return $update->execute();
}
+ public function setApprovalRKSBeritaTender($id_tender, $who, $status){
+ $tender = $this->getBeritaTender($id_tender);
+ $rks = json_decode($tender['rks'], true);
+ if($who == '2'){
+ $rks['approval']['direktur'] = [
+ 'status' => $status,
+ 'waktur' => date ("Y-m-d H:i:s")
+ ];
+ }elseif($who == '3'){
+ $rks['approval']['manajer'] = [
+ 'status' => $status,
+ 'waktur' => date ("Y-m-d H:i:s")
+ ];
+ }
+ $rks = json_encode($rks);
+ $update = $this->db->prepare('update tender set rks=:rks where id_tender=:id_tender');
+ $update->bindParam(':rks', $rks);
+ $update->bindParam(':id_tender', $id_tender);
+ return $update->execute();
+ }
+
+ public function setAcaraBeritaTender($id_tender, $acara){
+ $update = $this->db->prepare('update tender set berita_acara=:acara where ID_TENDER=:id_tender');
+ $update->bindParam(':acara', $acara);
+ $update->bindParam(':id_tender', $id_tender);
+ return $update->execute();
+ }
}
diff --git a/app/route.php b/app/route.php
index be01eb5..1a8d785 100644
--- a/app/route.php
+++ b/app/route.php
@@ -1,39 +1,102 @@
untuk authentifikasi
+$app->group('/auth', function () {
+
+ // Halaman Login
+ $this->get('-login', \ryan\controllers\login::class . ':loginPage')->setName('loginPage');
+
+ // Proses Login
+ $this->post('-dologin', \ryan\controllers\login::class . ':doLogin')->setName('doLogin');
+
+ // Proses Logout
+ $this->get('-logout', \ryan\controllers\login::class . ':doLogout')->setName('doLogout');
+
+});
+
+// Group Root
+$app->group('', function () {
+
+ // Halaman Dashboard
+ $this->get('/dashboard', \ryan\controllers\dashboard::class . ':dashboardPage')->setName('DashboardPage');
+
+ // Group Menu Berita Tender
+ $this->group('/berita-tender', function () {
+
+ // Halaman Daftar Semua Berita Tender
+ $this->any('', \ryan\controllers\beritaTender::class . ':daftarBeritaTender')->setName('daftarBeritaTender');
+
+ // Halaman Untuk Menambah Berita Tender
+ $this->any('/tambah', \ryan\controllers\beritaTender::class . ':tambahBeritaTender')->setName('tambahBeritaTender');
+
+ // Halaman untuk menampilkan detail berita tender
+ $this->any('/detail/{id_tender}', \ryan\controllers\beritaTender::class . ':detailBeritaTender')->setName('detailBeritaTender');
- $app->group ('/auth', function () {
- $this->get ('-login', \ryan\controllers\login::class . ':loginPage')->setName ('loginPage');
- $this->post ('-dologin', \ryan\controllers\login::class . ':doLogin')->setName ('doLogin');
- $this->get ('-logout', \ryan\controllers\login::class . ':doLogout')->setName ('doLogout');
});
- $app->group ('', function () {
- $this->get ('/dashboard', \ryan\controllers\dashboard::class . ':dashboardPage')->setName ('DashboardPage');
- $this->group('/berita-tender', function(){
- $this->map(['GET', 'POST'], '', \ryan\controllers\beritaTender::class . ':daftarBeritaTender')->setName ('daftarBeritaTender');
- $this->map(['GET', 'POST'], '/tambah', \ryan\controllers\beritaTender::class . ':tambahBeritaTender')->setName ('tambahBeritaTender');
- $this->map(['GET', 'POST'], '/detail/{id_tender}', \ryan\controllers\beritaTender::class . ':detailBeritaTender')->setName ('detailBeritaTender');
+ //group menu RKS dan Berita Acara
+ $this->group('/acara-rks', function () {
+
+ // group rks
+ $this->group('/rks', function () {
+
+ // halaman daftar berita yang dapat di input rks
+ $this->any('', \ryan\controllers\acaraRKS::class . ':beritaTenderRKS')->setName('daftarBeritaTenderRKS');
+
+ // halaman detail berita dan upload rks
+ $this->any('/detail/{id_tender}', \ryan\controllers\acaraRKS::class . ':detailBeritaTenderRKS')->setName('detailBeritaTenderRKS');
+
});
- $this->group('/approval', function(){
- $this->group('/tender', function(){
- $this->map(['GET', 'POST'], '/berita', \ryan\controllers\approval::class . ':beritaTender')->setName ('daftarApprovalBeritaTender');
- $this->map(['GET', 'POST'], '/detail/{id_tender}[/{status}]', \ryan\controllers\approval::class . ':approvalBeritaTender')->setName ('approvalBeritaTender');
- });
+ //group berita acara
+ $this->group('/acara', function () {
+
+ //halaman daftar berita yang dapat di input berita acara
+ $this->any('', \ryan\controllers\acaraRKS::class . ':beritaTenderAcara')->setName('daftarBeritaTenderAcara');
+ // halaman detail berita dan upload berita acara
+ $this->any('/detail/{id_tender}', \ryan\controllers\acaraRKS::class . ':detailBeritaTenderAcara')->setName('detailBeritaTenderAcara');
+
});
- $this->group('/acara-RKS', function(){
- $this->group('/RKS', function(){
- $this->map(['GET', 'POST'], '', \ryan\controllers\acaraRKS::class . ':beritaTenderRKS')->setName ('daftarBeritaTenderRKS');
- $this->map(['GET', 'POST'], '/detail/{id_tender}', \ryan\controllers\acaraRKS::class . ':detailBeritaTenderRKS')->setName ('detailBeritaTenderRKS');
- });
+ });
+
+ //group approval
+ $this->group('/approval', function () {
+
+ $this->group('/tender', function () {
+
+ $this->any('/berita', \ryan\controllers\approval::class . ':beritaTender')->setName('daftarApprovalBeritaTender');
+
+ $this->any('/detail/{id_tender}[/{status}]', \ryan\controllers\approval::class . ':approvalBeritaTender')->setName('approvalBeritaTender');
+
+ });
+
+ $this->group('/acara-rks', function () {
+
+ $this->any('/berita', \ryan\controllers\approval::class . ':beritaTenderRKS')->setName('daftarApprovalRKSTender');
+
+ $this->any('/detail/{id_tender}[/{status}]', \ryan\controllers\approval::class . ':approvalBeritaTenderRKS')->setName('approvalRKSTender');
+
});
- })->add( new \ryan\controllers\login($container));
-
- $app->group('/api', function(){
- $this->post ('/tambah-penyelenggara', \ryan\controllers\api::class . ':addPenyelenggara')->setName ('apiAddPenyelenggara');
- $this->get ('/penyelenggara[/{id}]', \ryan\controllers\api::class . ':getPenyelenggara')->setName ('apiGetPenyelenggara');
- $this->get ('/dokumen-master[/{id}]', \ryan\controllers\api::class . ':getDokumenMaster')->setName ('apiGetDokumenMaster');
- $this->get ('/syarat-dokumen-tender[/{id}]', \ryan\controllers\api::class . ':getDokumenList')->setName ('apiGetDokumenTender');
- $this->get ('/detail-berita-tender[/{id}]', \ryan\controllers\api::class . ':getDetailTender')->setName ('apiGetDetailBeritaTender');
+
});
+})->add(new \ryan\controllers\login($container));
+
+$app->group('/api', function () {
+
+ $this->post('/tambah-penyelenggara', \ryan\controllers\api::class . ':addPenyelenggara')->setName('apiAddPenyelenggara');
+
+ $this->get('/penyelenggara[/{id}]', \ryan\controllers\api::class . ':getPenyelenggara')->setName('apiGetPenyelenggara');
+
+ $this->get('/dokumen-master[/{id}]', \ryan\controllers\api::class . ':getDokumenMaster')->setName('apiGetDokumenMaster');
+
+ $this->get('/syarat-dokumen-tender[/{id}]', \ryan\controllers\api::class . ':getDokumenList')->setName('apiGetDokumenTender');
+
+ $this->get('/detail-berita-tender[/{id}]', \ryan\controllers\api::class . ':getDetailTender')->setName('apiGetDetailBeritaTender');
+
+});
+
diff --git a/app/views/approval/berita-tender/berita-tender.phtml b/app/views/approval/berita-tender/berita-tender.phtml
index 5930fdf..dfbb47b 100644
--- a/app/views/approval/berita-tender/berita-tender.phtml
+++ b/app/views/approval/berita-tender/berita-tender.phtml
@@ -28,7 +28,7 @@
-
+
= $i ?>
= $tender['judul_tender'] ?>
@@ -40,7 +40,7 @@
diff --git a/app/views/approval/berita-tender/daftar-berita.phtml b/app/views/approval/berita-tender/daftar-berita.phtml
index f84ff41..cdcc6cd 100644
--- a/app/views/approval/berita-tender/daftar-berita.phtml
+++ b/app/views/approval/berita-tender/daftar-berita.phtml
@@ -24,7 +24,19 @@ Daftar Approval Berita Tender
- info! Klik judul berita tender untuk melihat detail berita tender
+ info! Status Aprroval
+
+
+
+stop();
+$this->start('js');
+?>
+
+
+
+
+stop() ?>
\ No newline at end of file
diff --git a/app/views/dokumen/daftar-berita.phtml b/app/views/dokumen/daftar-berita.phtml
new file mode 100644
index 0000000..db2817c
--- /dev/null
+++ b/app/views/dokumen/daftar-berita.phtml
@@ -0,0 +1,132 @@
+ $active_user_data,
+ 'active_notification_list' => $active_notification_list
+];
+$this->layout('base', $parent_data);
+$this->start('style');
+?>
+
+
+stop();
+$this->start('page-title');
+?>
+Daftar RKS Berita Tender
+stop();
+$this->start('contents');
+?>
+
+
+
+
+
+ info! Daftar tender yang tampil adalah tender yang telah terdapat dokumen RKS dan dokumen RKS tersebut yang telah disetujui oleh direktur dan manajer
+
+
+
+ info! Daftar tender yang tampil adalah tender yang telah terdapat dokumen RKS dan dokumen RKS tersebut yang telah disetujui oleh direktur dan manajer
+
+
+ Gagal Menyimpan! Anda belum memilih file RKS.
+
+
+
+
+
+
+
+
+ Berhasil! File RKS berhasil disimpan
+
+
+
+
+
+
+
+
+
+stop();
+$this->start('js');
+?>
+
+
+
+
+stop() ?>
\ No newline at end of file
diff --git a/app/views/rks-acara/rks/daftar-berita.phtml b/app/views/rks-acara/rks/daftar-berita.phtml
index 3657b1a..e3dd433 100644
--- a/app/views/rks-acara/rks/daftar-berita.phtml
+++ b/app/views/rks-acara/rks/daftar-berita.phtml
@@ -24,7 +24,7 @@ $this->start ('contents');
- info! Klik judul berita tender untuk melihat detail berita tender
+ info! Daftar tender yang tampil adalah tender yang telah disetujui oleh direktur dan manajer