Skip to content

Commit

Permalink
Perbaikan beberapa bug dan merapikan layout
Browse files Browse the repository at this point in the history
  • Loading branch information
komputronika committed Aug 16, 2017
1 parent 2ee4146 commit 9a7b30b
Show file tree
Hide file tree
Showing 14 changed files with 129 additions and 92 deletions.
Binary file added .phpintel/6fcfd5fcbc3d1e778214ba49b7a23148
Binary file not shown.
Binary file added .phpintel/ae74ddab5cdb013f8acee2ccabb12cad
Binary file not shown.
Binary file added .phpintel/bcc00a22c0b8ae60b7b98e308f10e836
Binary file not shown.
Binary file added .phpintel/bec282d87e9bb0ac9bfd5b0feca3391f
Binary file not shown.
Binary file added .phpintel/bf55579ba65c890b6a9d7c31908e6afd
Binary file not shown.
Binary file added .phpintel/index
Binary file not shown.
9 changes: 7 additions & 2 deletions application/helpers/notify_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,35 @@ function notify($msg,$type = 'info',$judul = '')
{
case 'info' :
$tpl = '<div class="alert alert-info fade">';
$prefix = "Info";
break;

case 'success' :
$tpl = '<div class="alert alert-success fade">';
$prefix = "Sukses";
break;

case 'warning' :
$tpl = '<div class="alert alert-warning fade">';
$prefix = "Peringatan";
break;

case 'danger' :
$tpl = '<div class="alert alert-danger fade">';
$prefix = "Bahaya";
break;
default :
$tpl = '<div class="alert alert-info fade>';
$prefix = "Info";
break;
}

$tpl .= '<button type="button" class="close" data-dismiss="alert">&times;</button>';
$tpl .= '<strong> '. (trim($judul) !='' ? ucwords($judul) : ucwords($type)) .' ! </strong> ' . $msg;
$tpl .= '<strong> '. (trim($judul) !='' ? ucwords($judul) : ucwords($prefix)) .'! </strong> ' . $msg;
$tpl .= '<script>
$(document).ready(function(){
$(".alert").delay(4000).addClass("in").fadeOut("slow");
$(".alert").delay(7500).addClass("in").fadeOut("slow");
});
</script>';
Expand Down
3 changes: 2 additions & 1 deletion application/modules/builder/libraries/Generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ private function build_form($table, $post_field)
$data = $this->php_tags();
$data['forms'] = $form;
$data['table'] = $table;
$data['table_name'] = $this->set_label($table);
//$data['php_open'] = "<?php";
//$data['php_close'] = "? >";
Expand Down Expand Up @@ -590,7 +591,7 @@ private function build_show($table = null, $post_field)
$data['primary_key'] = $all['primary_key'];
$data['table'] = $table;
$data['table_name'] = $this->set_label($table);
$source = $this->ci->parser->parse('template/_show.php', $data, true);
$source = $this->ci->parser->parse('template/show.php', $data, true);
@write_file($this->output . $table . '/views/show.php', $source);
}
Expand Down
38 changes: 0 additions & 38 deletions application/modules/builder/views/template/_show.php

This file was deleted.

12 changes: 6 additions & 6 deletions application/modules/builder/views/template/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function edit($id='')
}
else
{
$this->session->set_flashdata('notif', notify('Data tidak ditemukan','info'));
$this->session->set_flashdata('notify', notify('Data tidak ditemukan','info'));
redirect(site_url('{table}'));
}
}
Expand Down Expand Up @@ -130,7 +130,7 @@ public function save($id =NULL)
{

$this->{table}s->save();
$this->session->set_flashdata('notif', notify('Data berhasil di simpan','success'));
$this->session->set_flashdata('notify', notify('Data berhasil ditambahkan','success'));
redirect('{table}');
}
}
Expand All @@ -148,7 +148,7 @@ public function save($id =NULL)
if ($this->input->post())
{
$this->{table}s->update($id);
$this->session->set_flashdata('notif', notify('Data berhasil di update','success'));
$this->session->set_flashdata('notify', notify('Data berhasil diupdate','success'));
redirect('{table}');
}
}
Expand Down Expand Up @@ -176,7 +176,7 @@ public function show($id='')
}
else
{
$this->session->set_flashdata('notif', notify('Data tidak ditemukan','info'));
$this->session->set_flashdata('notify', notify('Data tidak ditemukan','info'));
redirect(site_url('{table}'));
}
}
Expand Down Expand Up @@ -225,12 +225,12 @@ public function destroy($id)
if ($id)
{
$this->{table}s->destroy($id);
$this->session->set_flashdata('notif', notify('Data berhasil di hapus','success'));
$this->session->set_flashdata('notify', notify('Data berhasil dihapus','success'));
redirect('{table}');
}
else
{
$this->session->set_flashdata('notif', notify('Data tidak ditemukan','warning'));
$this->session->set_flashdata('notify', notify('Data tidak ditemukan','warning'));
redirect('{table}');
}
}
Expand Down
28 changes: 19 additions & 9 deletions application/modules/builder/views/template/form.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
<div class="row">
<div class="col-lg-12 col-md-12">
{php_open}

<h2>{table_name}</h2>

{php_open}
echo $this->session->flashdata('notify');
{php_close}


<!-- <div class="row">
<div class="col-lg-12 col-md-12">
{php_open}
echo create_breadcrumb();
echo create_breadcrumb();
echo $this->session->flashdata('notify');
{php_close}
</div>
</div><!-- /.row -->
{php_close}
</div>
</div> -->

{php_open} echo form_open(site_url('{table}/' . $action),'role="form" class="form-horizontal" id="form_{table}" parsley-validate'); {php_close}
<div class="panel panel-default">
<div class="panel-heading"><i class="glyphicon glyphicon-signal"></i> </div>
<div class="panel-heading"><i class="glyphicon glyphicon-edit"></i> </div>
<div class="panel-body">
Expand All @@ -30,7 +38,9 @@
</div> <!--/ Panel Body -->
<div class="panel-footer">
<div class="row">
<div class="col-md-10 col-sm-12 col-md-offset-2 col-sm-offset-0">
<!-- <div class="col-md-10 col-sm-12 col-md-offset-2 col-sm-offset-0"> -->
<div class="col-md-12 col-sm-12 col-lg-12 text-right">
<a href="{php_open} echo site_url('{table}'); {php_close}" class="btn btn-default">
<i class="glyphicon glyphicon-chevron-left"></i> Kembali
</a>
Expand Down
53 changes: 53 additions & 0 deletions application/modules/builder/views/template/show.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@


<h2>{table_name}</h2>

{php_open}
echo $this->session->flashdata('notify');
{php_close}

<!-- <div class="row">
<div class="col-lg-12 col-md-12">
{php_open}
echo create_breadcrumb();
echo $this->session->flashdata('notify');
{php_close}
</div>
</div> -->


{php_open}
if(${table}) :
{php_close}

<div class="table-responsive">
<table id="detail" class="table table-striped table-condensed">
<tbody>
{php_open}
foreach(${table} as $table => $value) :
{php_close}
<tr>
<td width="20%" align="right"><strong>{php_open} echo ucwords(str_replace("_"," ","$table")); {php_close}</strong></td>
<td>{php_open} echo $value {php_close}</td>
</tr>
{php_open}
endforeach;
{php_close}
</tbody>
</table>
</div>


{php_open}

echo anchor(site_url('{table}'), '<span class="fa fa-chevron-left"></span> Kembali', 'class="btn btn-sm btn-default"');

{php_close}


<br /><br />

{php_open}
endif;
{php_close}

38 changes: 22 additions & 16 deletions application/modules/builder/views/template/view.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
<div class="row">
<div class="col-lg-12 col-md-12">
{php_open}

<h2>{table_name}</h2>

{php_open}
echo $this->session->flashdata('notify');
{php_close}

<!-- <div class="row">
<div class="col-lg-12 col-md-12">
{php_open}
echo create_breadcrumb();
echo $this->session->flashdata('notify');
echo create_breadcrumb();
echo $this->session->flashdata('notify');
{php_close}
</div>
</div><!-- /.row -->
{php_close}
</div>
</div> -->

<section class="panel panel-default">
<header class="panel-heading">
<div class="row">
<div class="col-md-8 col-xs-3">
{php_open}
echo anchor(
site_url('{table}/add'),
'<i class="glyphicon glyphicon-plus"></i>',
'class="btn btn-success btn-sm" data-tooltip="tooltip" data-placement="top" title="Tambah Data"'
);
{php_close}
echo anchor(
site_url('{table}/add'),
'<i class="glyphicon glyphicon-plus"></i> Tambah',
'class="btn btn-success btn-sm" data-tooltip="tooltip" data-placement="top" title="Tambah Data"'
);
{php_close}
</div>
<div class="col-md-4 col-xs-9">
Expand Down Expand Up @@ -84,7 +90,7 @@
echo anchor(
site_url('{table}/destroy/' . ${table}['{primary_key}']),
'<i class="glyphicon glyphicon-trash"></i>',
'onclick="return confirm(\'Anda yakin..???\');" class="btn btn-sm btn-danger" data-tooltip="tooltip" data-placement="top" title="Hapus"'
'onclick="return confirm(\'Apakah anda yakin ingin menghapus?\');" class="btn btn-sm btn-danger" data-tooltip="tooltip" data-placement="top" title="Hapus"'
);
{php_close}
Expand Down
40 changes: 20 additions & 20 deletions assets/parsley/i18n/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ window.ParsleyConfig.i18n = window.ParsleyConfig.i18n || {};

// Define then the messages
window.ParsleyConfig.i18n.id = jQuery.extend(window.ParsleyConfig.i18n.id || {}, {
defaultMessage: "tidak valid",
defaultMessage: "Pengisian tidak benar",
type: {
email: "email tidak valid",
url: "url tidak valid",
number: "nomor tidak valid",
integer: "integer tidak valid",
digits: "harus berupa digit",
alphanum: "harus berupa alphanumeric"
email: "Format email valid",
url: "URL tidak valid",
number: "Nomor tidak valid",
integer: "Angka tidak valid",
digits: "Harus berupa digit",
alphanum: "Harus berupa kombinasi huruf dan angka"
},
notblank: "tidak boleh kosong",
required: "tidak boleh kosong",
pattern: "tidak valid",
min: "harus lebih besar atau sama dengan %s.",
max: "harus lebih kecil atau sama dengan %s.",
range: "harus dalam rentang %s dan %s.",
minlength: "terlalu pendek, minimal %s karakter atau lebih.",
maxlength: "terlalu panjang, maksimal %s karakter atau kurang.",
length: "panjang karakter harus dalam rentang %s dan %s",
mincheck: "pilih minimal %s pilihan",
maxcheck: "pilih maksimal %s pilihan",
check: "pilih antar %s dan %s pilihan",
equalto: "harus sama"
notblank: "Tidak boleh kosong",
required: "Tidak boleh kosong",
pattern: "Tidak valid",
min: "Haru lebih besar atau sama dengan %s.",
max: "Harus lebih kecil atau sama dengan %s.",
range: "Harus dalam rentang %s dan %s.",
minlength: "Terlalu pendek, minimal %s karakter atau lebih.",
maxlength: "Terlalu panjang, maksimal %s karakter atau kurang.",
length: "Panjang karakter harus dalam rentang %s dan %s",
mincheck: "Pilih minimal %s pilihan",
maxcheck: "Pilih maksimal %s pilihan",
check: "Pilih antara %s dan %s pilihan",
equalto: "Harus sama"
});

// If file is loaded after Parsley main file, auto-load locale
Expand Down

0 comments on commit 9a7b30b

Please sign in to comment.