Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
angls4 committed Jan 3, 2023
1 parent 2c66073 commit 32d34af
Show file tree
Hide file tree
Showing 10 changed files with 262 additions and 588 deletions.
2 changes: 1 addition & 1 deletion app/Config/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class App extends BaseConfig
*
* @var string
*/
public $baseURL = 'http://localhost:8080/';
public $baseURL = 'https://kehujanan.adnann.my.id/';

/**
* --------------------------------------------------------------------------
Expand Down
14 changes: 7 additions & 7 deletions app/Config/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class Database extends Config
*/
public $default = [
'DSN' => '',
'hostname' => 'localhost',
'username' => '',
'password' => '',
'database' => '',
'hostname' => 'iix80:3306',
'username' => 'adnannmyadmin',
'password' => 'pOPO2002!',
'database' => 'adnannmy_kehujanan',
'DBDriver' => 'MySQLi',
'DBPrefix' => '',
'pConnect' => false,
Expand All @@ -47,7 +47,7 @@ class Database extends Config
'compress' => false,
'strictOn' => false,
'failover' => [],
'port' => 3306,
'port' => '',
];

/**
Expand All @@ -59,7 +59,7 @@ class Database extends Config
public $tests = [
'DSN' => '',
'hostname' => '127.0.0.1',
'username' => '',
'username' => 'as',
'password' => '',
'database' => ':memory:',
'DBDriver' => 'SQLite3',
Expand All @@ -73,7 +73,7 @@ class Database extends Config
'compress' => false,
'strictOn' => false,
'failover' => [],
'port' => 3306,
'port' => '',
];

public function __construct()
Expand Down
2 changes: 1 addition & 1 deletion app/Controllers/Tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public function index()
{
$model = new TagsModel();
$data = [];
$tag = explode(',', 'suku,negara,bangsad');
$tag = explode(',', 'suku,negara,bangsa');

$index = 0;
foreach ($tag as $taag) {
Expand Down
13 changes: 5 additions & 8 deletions app/Controllers/Tugas.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,30 +217,27 @@ public function update($id_tugas)
]
])) {
session()->setFlashdata('pesan', 'Data tugas gagal diubah.');
return redirect()->to('/tugas/edit/' . $this->request->getVar('id_tugas'))->withInput();
// return redirect()->to('/tugas/edit/' . $this->request->getVar('id_tugas'))->withInput();
}
$this->tugasModel->updateData($id_tugas, [
'id_tugas' => $id_tugas,
'nama_tugas' => $this->request->getVar('nama_tugas'),
'deskripsi' => $this->request->getVar('deskripsi'),
'deadline' => $this->request->getVar('deadline'),
'status' => ($this->request->getVar('status'))? 1 : 0,
'status' => $this->request->getVar('status'),

]);
$tags = $this->request->getVar('tags');
$tagsDB = $this->tagsModel->where('id_tugas', $id_tugas)->findAll();
// $tugasTags = implode(",", array_column($tagsDB, 'nama_tag'));
$dataTags = [];
foreach ($tagsDB as $tDB) {
$this->tagsModel->where('nama_tag', $tDB['nama_tag'])->delete();
$this->tagsModel->where(array('id_tugas' => $id_tugas, 'nama_tag' => $$tDB['nama_tag']))->delete();
}
if ($tags != '') {
$tagsArr = explode(',', $tags);
$index = 0;
foreach ($tagsArr as $tag) {
$dataTags[$index]['id_tugas'] = $id_tugas;
$dataTags[$index]['nama_tag'] = $tag;
$index++;
array_push($dataTags,['id_tugas' => $id_tugas,'nama_tag' => $tag]);
}
// if ($tugasTags != $tags) {
// foreach ($tagsDB as $tDB) {
Expand All @@ -252,6 +249,6 @@ public function update($id_tugas)
session()->setFlashdata('pesan', 'Data tugas berhasil diubah.');
}

return redirect()->to('/tugas/index');
// return redirect()->to('/tugas/index');
}
}
2 changes: 1 addition & 1 deletion app/Models/TugasModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class TugasModel extends Model
{
protected $table = 'tugas';
protected $primaryKey = 'id_tugas';
protected $allowedFields = ['id_tugas', 'nama_tugas', 'deskripsi', 'deadline', 'id_user', 'id_matkul'];
protected $allowedFields = ['id_tugas', 'nama_tugas', 'deskripsi', 'deadline', 'id_user', 'status', 'id_matkul'];

public function getTugas($id_tugas)
{
Expand Down
7 changes: 4 additions & 3 deletions app/Views/tugas/edit.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="container">
<form id="forrm" action="/tugas/update/<?= $tugas['id_tugas']; ?>" method="POST">
<form id="forrm" action="/tugas/edit/<?= $tugas['id_tugas']; ?>" method="POST">
<?= csrf_field(); ?>
<input type="hidden" name="id_tugas" value="<?= $tugas['id_tugas']; ?>">
<input type="hidden" name="id_user" value="<?= $tugas['id_user']; ?>">
Expand Down Expand Up @@ -34,10 +34,11 @@
<?= $validation->getError('nama_tugas'); ?>
</div>

<?php $status = (old('status')) ? old('status') : $tugas['status'] ?>
<?php $status = $tugas['status'] ?>
<div class="checkbox">
<input type="hidden" name="status" value="0"/>
<label>
<input type="checkbox" name="status" checked="checked" value="1"/><i class="helper"></i>Sudah selesai
<input type="checkbox" name="status" <?php echo $status==1?'checked' : '' ?> value="1"/><i class="helper"></i>Sudah selesai
</label>
</div>
<div style="display: flex;justify-content:space-between;">
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
},
"autoload": {
"psr-4": {
"App\\": "app",
"Config\\": "app/Config"

},
"exclude-from-classmap": [
"**/Database/Migrations/**"
Expand Down
Loading

0 comments on commit 32d34af

Please sign in to comment.