├── ligatcode ├── core │ ├── settingjson.cfg │ ├── helper.php │ ├── fileRequest.json │ ├── create_view_layout_sidebar.php │ ├── create_pdf_library.php │ ├── create_exportexcel_helper.php │ ├── create_view_read.php │ ├── Pager.php │ ├── create_config_pagination.php │ ├── create_model.php │ ├── create_view_layout_ligatcode_pagination.php │ ├── getfield.php │ ├── create_view_list_pdf.php │ ├── create_view_list_doc.php │ ├── create_view_list.php │ ├── connection.php │ ├── create_view_form.php │ ├── setting.php │ ├── ligatcode.php │ ├── process.php │ ├── create_view_list_datatables.php │ ├── create_controller.php │ └── create_libraries_datatables.php ├── output │ ├── views │ │ ├── index.php │ │ ├── siswa │ │ │ ├── siswa_read.php │ │ │ ├── siswa_form.php │ │ │ └── siswa_list.php │ │ ├── jurusan │ │ │ ├── read_jurusan.php │ │ │ ├── jurusan_read.php │ │ │ ├── form_jurusan.php │ │ │ ├── jurusan_form.php │ │ │ ├── index_jurusan.php │ │ │ └── jurusan_list.php │ │ ├── groups │ │ │ ├── groups_read.php │ │ │ ├── groups_form.php │ │ │ └── groups_list.php │ │ ├── menu │ │ │ ├── read_menu.php │ │ │ ├── index_menu.php │ │ │ └── form_menu.php │ │ └── layout │ │ │ └── ligatcode_pagination.php │ └── config │ │ └── index.php ├── views │ └── layout │ │ ├── header.php │ │ ├── footer.php │ │ ├── template.php │ │ ├── navbar.php │ │ └── ligatcode_pagination.php ├── .gitignore ├── getfield.php └── index.php ├── assets ├── datatables │ ├── images │ │ ├── sort_asc.png │ │ ├── sort_both.png │ │ ├── sort_desc.png │ │ ├── sort_asc_disabled.png │ │ └── sort_desc_disabled.png │ ├── dataTables.bootstrap.css │ └── dataTables.bootstrap.js └── bootstrap │ ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 │ ├── js │ └── npm.js │ └── css │ └── bootstrap-theme.min.css ├── .htaccess ├── app ├── Views │ └── layout │ │ ├── sidebar.php │ │ ├── header.php │ │ ├── footer.php │ │ ├── template.php │ │ ├── navbar.php │ │ └── ligatcode_pagination.php └── Config │ └── Pager.php ├── LICENSE └── README.md /ligatcode/core/settingjson.cfg: -------------------------------------------------------------------------------- 1 | { 2 | "target": "../app/", 3 | "copyassets": "0" 4 | } -------------------------------------------------------------------------------- /assets/datatables/images/sort_asc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irev/ci4-ligatcode/HEAD/assets/datatables/images/sort_asc.png -------------------------------------------------------------------------------- /assets/datatables/images/sort_both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irev/ci4-ligatcode/HEAD/assets/datatables/images/sort_both.png -------------------------------------------------------------------------------- /assets/datatables/images/sort_desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irev/ci4-ligatcode/HEAD/assets/datatables/images/sort_desc.png -------------------------------------------------------------------------------- /assets/datatables/images/sort_asc_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irev/ci4-ligatcode/HEAD/assets/datatables/images/sort_asc_disabled.png -------------------------------------------------------------------------------- /assets/datatables/images/sort_desc_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irev/ci4-ligatcode/HEAD/assets/datatables/images/sort_desc_disabled.png -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Deny from all 6 | 7 | -------------------------------------------------------------------------------- /assets/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irev/ci4-ligatcode/HEAD/assets/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /assets/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irev/ci4-ligatcode/HEAD/assets/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /assets/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irev/ci4-ligatcode/HEAD/assets/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /assets/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irev/ci4-ligatcode/HEAD/assets/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /app/Views/layout/sidebar.php: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /ligatcode/output/views/index.php: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /ligatcode/output/config/index.php: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /assets/bootstrap/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /app/Views/layout/header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | <?= $AttributePage['title'] ?> 11 | 12 | 13 | -------------------------------------------------------------------------------- /ligatcode/views/layout/header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | <?= $AttributePage['title'] ?> 11 | 12 | 13 | -------------------------------------------------------------------------------- /ligatcode/output/views/siswa/siswa_read.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | harviacode.com - codeigniter crud generator 5 | 6 | 11 | 12 | 13 |

Siswa Read

14 | 15 | 16 |
Cancel
17 | 18 | -------------------------------------------------------------------------------- /ligatcode/output/views/jurusan/read_jurusan.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | harviacode.com - codeigniter crud generator 5 | 6 | 11 | 12 | 13 |

Jurusan Read

14 | 15 | 16 |
Cancel
17 | 18 | -------------------------------------------------------------------------------- /ligatcode/core/helper.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ligatcode/output/views/jurusan/jurusan_read.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | harviacode.com - codeigniter crud generator 5 | 6 | 11 | 12 | 13 |

Jurusan Read

14 | 15 | 16 | 17 |
Jurusan
Cancel
18 | 19 | -------------------------------------------------------------------------------- /app/Views/layout/footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ligatcode/views/layout/footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ligatcode/output/views/siswa/siswa_form.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | harviacode.com - codeigniter crud generator 5 | 6 | 11 | 12 | 13 | 14 |

Siswa

15 |
16 | 17 | 18 | Cancel 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /ligatcode/output/views/groups/groups_read.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | harviacode.com - codeigniter crud generator 5 | 6 | 11 | 12 | 13 |

Groups Read

14 | 15 | 16 | 17 | 18 |
Name
Description
Cancel
19 | 20 | -------------------------------------------------------------------------------- /app/Views/layout/template.php: -------------------------------------------------------------------------------- 1 | include('layout/header'); ?> 2 | include('layout/navbar'); ?> 3 | 4 |
5 |
6 |
7 |
8 | 9 |
10 | include('layout/sidebar'); ?> 11 |
12 | 13 | 14 |
15 |
16 | 17 | renderSection('content') ?> 18 | 19 |
20 |
21 | 22 |
23 |
24 |
25 |
26 | 27 | include('layout/footer'); ?> -------------------------------------------------------------------------------- /ligatcode/views/layout/template.php: -------------------------------------------------------------------------------- 1 | include('layout/header'); ?> 2 | include('layout/navbar'); ?> 3 | 4 |
5 |
6 |
7 |
8 | 9 |
10 | include('layout/sidebar'); ?> 11 |
12 | 13 | 14 |
15 |
16 | 17 | renderSection('content') ?> 18 | 19 |
20 |
21 | 22 |
23 |
24 |
25 |
26 | 27 | include('layout/footer'); ?> -------------------------------------------------------------------------------- /ligatcode/core/fileRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "app/Config/":{ 3 | "Pager.php": "app/Config/Pager.php" 4 | }, 5 | "app/Views/layout/": { 6 | "header.php": "app/Views/layout/header.php", 7 | "footer.php": "app/Views/layout/footer.php", 8 | "navbar.php": "app/Views/layout/navbar.php", 9 | "sidebar.php": "app/Views/layout/sidebar.php", 10 | "template.php": "app/Views/layout/template.php", 11 | "ligatcode_pagination.php": "app/Views/layout/ligatcode_pagination.php" 12 | }, 13 | "ligatcode":{ 14 | "Controler": "create_controller.php", 15 | "Model": "create_model.php", 16 | "View_Form": "create_view_form.php", 17 | "View_List": "create_view_list.php", 18 | "View_Read": "create_view_Read.php", 19 | "ligatcode_pagination": "Pager.php" 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /ligatcode/output/views/menu/read_menu.php: -------------------------------------------------------------------------------- 1 | extend('layout/template'); ?> 2 | section('content'); ?> 3 | 4 |
5 |

6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
Name:
Link:
Icon:
Is Active:
Is Parent:
16 |
17 | back 18 |
19 | endSection(); ?> -------------------------------------------------------------------------------- /ligatcode/core/create_view_layout_sidebar.php: -------------------------------------------------------------------------------- 1 | table_list(); 5 | foreach ($table_list as $table) { 6 | $string .= '[\''. $table['table_name'].'\', \''. $table['table_name'].'\'],'; 7 | } 8 | 9 | $string .=" 10 | ]; 11 | ?> 12 | "; 19 | 20 | $string .= "\n\n\n\n"; 26 | 27 | 28 | $result_view_layout_sidebar = createFile($string, $target. "views/layout/sidebar.php"); -------------------------------------------------------------------------------- /ligatcode/output/views/jurusan/form_jurusan.php: -------------------------------------------------------------------------------- 1 | extend('layout/template'); ?> 2 | section('content'); ?> 3 | 4 | 5 |
6 |

7 |
8 |

Jurusan

9 | < action="" method="post"> 10 | 11 | 12 | Cancel 13 | 14 |
15 |
16 | Cencel 17 | 18 |
19 |
20 | 21 | 22 | 23 | 24 | endSection(); ?> -------------------------------------------------------------------------------- /ligatcode/core/create_pdf_library.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/Views/layout/navbar.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ligatcode/views/layout/navbar.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ligatcode/output/views/jurusan/jurusan_form.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | harviacode.com - codeigniter crud generator 5 | 6 | 11 | 12 | 13 | 14 |

Jurusan

15 |
16 |
17 | 19 | 21 |
22 | 23 | 24 | Cancel 25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /ligatcode/core/create_exportexcel_helper.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Meedun 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ligatcode/.gitignore: -------------------------------------------------------------------------------- 1 | ### CodeIgniter ### 2 | */config/development 3 | */logs/log-*.php 4 | !*/logs/index.html 5 | */cache/* 6 | !*/cache/index.html 7 | !*/cache/.htaccess 8 | 9 | user_guide_src/build/* 10 | user_guide_src/cilexer/build/* 11 | user_guide_src/cilexer/dist/* 12 | user_guide_src/cilexer/pycilexer.egg-info/* 13 | 14 | #codeigniter 3 15 | application/logs/* 16 | !application/logs/index.html 17 | !application/logs/.htaccess 18 | /vendor/ 19 | 20 | ### CodeIgniter Patch ### 21 | 22 | ### VisualStudioCode ### 23 | .vscode/* 24 | !.vscode/settings.json 25 | !.vscode/tasks.json 26 | !.vscode/launch.json 27 | !.vscode/extensions.json 28 | *.code-workspace 29 | 30 | ### VisualStudioCode Patch ### 31 | # Ignore all local history of files 32 | .history 33 | 34 | ### Windows ### 35 | # Windows thumbnail cache files 36 | Thumbs.db 37 | Thumbs.db:encryptable 38 | ehthumbs.db 39 | ehthumbs_vista.db 40 | 41 | # Dump file 42 | *.stackdump 43 | 44 | # Folder config file 45 | [Dd]esktop.ini 46 | 47 | # Recycle Bin used on file shares 48 | $RECYCLE.BIN/ 49 | 50 | # Windows Installer files 51 | *.cab 52 | *.msi 53 | *.msix 54 | *.msm 55 | *.msp 56 | 57 | # Windows shortcuts 58 | *.lnk 59 | -------------------------------------------------------------------------------- /ligatcode/core/create_view_read.php: -------------------------------------------------------------------------------- 1 | extend('layout/template'); ?> 3 | section('content'); ?> 4 | 5 |
6 |

7 |
8 | 9 | "; 10 | 11 | foreach ($non_pk as $row) { 12 | if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 13 | { 14 | $string .= "\n\t "; 15 | } 16 | if(isset($_POST['generateall'])) //meedun code selected filed 17 | { 18 | $string .= "\n\t "; 19 | } 20 | } 21 | $string .=" 22 | 23 |
".label($row["column_name"]).": \t
".label($row["column_name"]).": \t
24 |
25 | \">back 26 |
27 | endSection(); ?>"; 28 | 29 | $result_view_read = createFile($string, $target."views/" . $c_url . "/" . $v_read_file); 30 | 31 | ?> -------------------------------------------------------------------------------- /app/Views/layout/ligatcode_pagination.php: -------------------------------------------------------------------------------- 1 | setSurroundCount(5); 8 | ?> 9 | -------------------------------------------------------------------------------- /ligatcode/views/layout/ligatcode_pagination.php: -------------------------------------------------------------------------------- 1 | 2 | setSurroundCount(1); 8 | ?> 9 | -------------------------------------------------------------------------------- /ligatcode/output/views/layout/ligatcode_pagination.php: -------------------------------------------------------------------------------- 1 | 2 | setSurroundCount(1); 8 | ?> 9 | -------------------------------------------------------------------------------- /ligatcode/output/views/groups/groups_form.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | harviacode.com - codeigniter crud generator 5 | 6 | 11 | 12 | 13 | 14 |

Groups

15 |
16 |
17 | 19 | 21 |
22 |
23 | 25 | 27 |
28 | 29 | 30 | Cancel 31 |
32 | 33 | 34 | -------------------------------------------------------------------------------- /ligatcode/core/Pager.php: -------------------------------------------------------------------------------- 1 | 'CodeIgniter\Pager\Views\default_full', 22 | 'default_simple' => 'CodeIgniter\Pager\Views\default_simple', 23 | 'default_head' => 'CodeIgniter\Pager\Views\default_head', 24 | //------------------------- ligatcode_pagination ----------------- 25 | 'ligatcode_pagination' => 'App\Views\layout\ligatcode_pagination' 26 | //------------------------- ligatcode_pagination ----------------- 27 | ]; 28 | 29 | /* 30 | |-------------------------------------------------------------------------- 31 | | Items Per Page 32 | |-------------------------------------------------------------------------- 33 | | 34 | | The default number of results shown in a single page. 35 | | 36 | */ 37 | public $perPage = 20; 38 | } 39 | -------------------------------------------------------------------------------- /app/Config/Pager.php: -------------------------------------------------------------------------------- 1 | 'CodeIgniter\Pager\Views\default_full', 24 | 'default_simple' => 'CodeIgniter\Pager\Views\default_simple', 25 | 'default_head' => 'CodeIgniter\Pager\Views\default_head', 26 | //-------------------- using ligatcode ---------------------------- 27 | 'ligatcode_pagination' => 'App\Views\layout\ligatcode_pagination' 28 | //-------------------- using ligatcode ---------------------------- 29 | ]; 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Items Per Page 34 | |-------------------------------------------------------------------------- 35 | | 36 | | The default number of results shown in a single page. 37 | | 38 | */ 39 | public $perPage = 20; 40 | } 41 | -------------------------------------------------------------------------------- /ligatcode/core/create_config_pagination.php: -------------------------------------------------------------------------------- 1 | '; 14 | 15 | \$config['first_link'] = 'First'; 16 | \$config['first_tag_open'] = '
  • '; 17 | \$config['first_tag_close'] = '
  • '; 18 | 19 | \$config['last_link'] = 'Last'; 20 | \$config['last_tag_open'] = '
  • '; 21 | \$config['last_tag_close'] = '
  • '; 22 | 23 | \$config['next_link'] = 'Next'; 24 | \$config['next_tag_open'] = '
  • '; 25 | \$config['next_tag_close'] = '
  • '; 26 | 27 | \$config['prev_link'] = 'Prev'; 28 | \$config['prev_tag_open'] = '
  • '; 29 | \$config['prev_tag_close'] = '
  • '; 30 | 31 | \$config['cur_tag_open'] = '
  • '; 32 | \$config['cur_tag_close'] = '
  • '; 33 | 34 | \$config['num_tag_open'] = '
  • '; 35 | \$config['num_tag_close'] = '
  • '; 36 | 37 | 38 | /* End of file pagination.php */ 39 | /* Location: ./application/config/pagination.php */ 40 | /* Please DO NOT modify this information : */ 41 | /* Generated by Harviacode Codeigniter CRUD Generator ".date('Y-m-d H:i:s')." */ 42 | /* http://harviacode.com */"; 43 | 44 | 45 | 46 | $result_config_pagination = createFile($string, $target."config/pagination.php"); 47 | 48 | ?> -------------------------------------------------------------------------------- /ligatcode/core/create_model.php: -------------------------------------------------------------------------------- 1 | findAll(); 37 | } 38 | return \$this->db->where(\$this->primaryKey, \$id)->first(); 39 | } 40 | "; 41 | $string .= "\n\n}\n\n/* End of file $m_file */ 42 | /* Location: ./app/models/$m_file */ 43 | /* Please DO NOT modify this information : */ 44 | /* Generated by Ligatcode Codeigniter 4 CRUD Generator ".date('Y-m-d H:i:s')." */"; 45 | 46 | 47 | $result_model = createFile($string, $target."models/" . $m_file); -------------------------------------------------------------------------------- /ligatcode/core/create_view_layout_ligatcode_pagination.php: -------------------------------------------------------------------------------- 1 | setSurroundCount(1); 9 | ?> 10 | "; 37 | 38 | $result_view_layout_ligatcode_pagination = createFile($string, $target . "views/layout/ligatcode_pagination.php"); 39 | -------------------------------------------------------------------------------- /ligatcode/output/views/menu/index_menu.php: -------------------------------------------------------------------------------- 1 | 2 | extend('layout/template'); ?> 3 | section('content'); ?> 4 | 5 |
    6 |

    7 |
    8 |
    9 |
    10 | CREATE 11 |
    12 |
    13 | 14 | getFlashdata('message')): ?> 15 | 18 | 19 | 20 |
    21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 47 | 48 | 49 |
    NoNameLinkIconIs ActiveIs ParentAction
    41 | 42 | READ 43 | EDITE 44 | DELETE 45 | 46 |
    50 | 51 | links('paging', 'ligatcode_pagination') ?> 52 |
    53 | endSection(); ?> -------------------------------------------------------------------------------- /ligatcode/core/getfield.php: -------------------------------------------------------------------------------- 1 | 27 August 220 12 | * @author meedun 13 | * @link http://blog.simeedun.com 14 | */ 15 | ################################################################ 16 | echo "
    "; 17 | echo "
    Please select the fields to be displayed
    This feature only affects the Generator button,
    ignored in Generate All

    "; 18 | $table_all_field = isset( $_POST['table_name'])? $hc->all_field($_POST['table_name']) : ''; 19 | //var_dump($table_all_field); 20 | //echo'Show All
    '; 21 | foreach ($table_all_field as $field) { 22 | $check = $_POST['field_'.$field['column_name']] == '1' ? "checked" :''; 23 | echo $_POST['table_name']; 24 | if(isset($_POST['field_'.$field['column_name']])) 25 | { 26 | echo' 27 |
    31 | '; 32 | }else{ 33 | echo' 34 |
    38 | '; 39 | } 40 | } 41 | ?> 42 |
    43 |

    Features added by Meedun

    44 |
    45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /ligatcode/getfield.php: -------------------------------------------------------------------------------- 1 | 27 August 220 12 | * @author meedun 13 | * @link http://blog.simeedun.com 14 | */ 15 | ################################################################ 16 | echo "
    "; 17 | echo "
    Please select the fields to be displayed
    This feature only affects the Generator button,
    ignored in Generate All

    "; 18 | $table_all_field = isset( $_POST['table_name'])? $ligat->all_field($_POST['table_name']) : ''; 19 | foreach ($table_all_field as $field) { 20 | if(isset($_POST['field_' . $field['column_name']])){ 21 | $fld = $_POST['field_' . $field['column_name']]; 22 | }else{ 23 | $fld = 'field_'.$field['column_name']; 24 | } 25 | $check = ($fld == '1')? "checked" :''; 26 | echo $_POST['table_name']; 27 | if(isset($_POST['field_'.$field['column_name']])) 28 | { 29 | echo' 30 |
    34 | '; 35 | }else{ 36 | echo' 37 |
    41 | '; 42 | } 43 | } 44 | ?> 45 |
    46 |

    Features added by Meedun

    47 |
    48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /ligatcode/core/create_view_list_pdf.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | harviacode.com - codeigniter crud generator 7 | \"/> 8 | 19 | 20 | 21 |

    ".ucfirst($table_name)." List

    22 | 23 | 24 | "; 25 | foreach ($non_pk as $row) { 26 | if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 27 | { 28 | $string .= "\n\t\t"; 29 | } 30 | if(isset($_POST['generateall'])) //meedun code selected filed 31 | { 32 | $string .= "\n\t\t"; 33 | } 34 | } 35 | $string .= "\n\t\t 36 | "; 37 | $string .= " 41 | "; 42 | 43 | $string .= "\n\t\t "; 44 | 45 | foreach ($non_pk as $row) { 46 | if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 47 | { 48 | $string .= "\n\t\t "; 49 | } 50 | if(isset($_POST['generateall'])) //meedun code selected filed 51 | { 52 | $string .= "\n\t\t "; 53 | } 54 | } 55 | 56 | $string .= "\t 57 | 58 | 61 |
    No" . label($row['column_name']) . "" . label($row['column_name']) . "
    ". $row['column_name'] . " ?>". $row['column_name'] . " ?>
    62 | 63 | "; 64 | 65 | 66 | $result_view_pdf = createFile($string, $target."views/" . $c_url . "/" . $v_pdf_file); 67 | 68 | ?> -------------------------------------------------------------------------------- /ligatcode/core/create_view_list_doc.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | harviacode.com - codeigniter crud generator 7 | \"/> 8 | 21 | 22 | 23 | 24 |

    ".ucfirst($table_name)." List

    25 | 26 | 27 | "; 28 | foreach ($non_pk as $row) { 29 | if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 30 | { 31 | $string .= "\n\t\t"; 32 | } 33 | if(isset($_POST['generateall'])) //meedun code selected filed 34 | { 35 | $string .= "\n\t\t"; 36 | } 37 | } 38 | $string .= "\n\t\t 39 | "; 40 | $string .= " 44 | "; 45 | 46 | $string .= "\n\t\t "; 47 | 48 | foreach ($non_pk as $row) { 49 | if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 50 | { 51 | $string .= "\n\t\t "; 52 | } 53 | if(isset($_POST['generateall'])) //meedun code selected filed 54 | { 55 | $string .= "\n\t\t "; 56 | } 57 | } 58 | 59 | $string .= "\t 60 | 61 | 64 |
    No" . label($row['column_name']) . "" . label($row['column_name']) . "
    ". $row['column_name'] . " ?>". $row['column_name'] . " ?>
    65 | 66 | 67 | "; 68 | 69 | 70 | $result_view_doc = createFile($string, $target."views/" . $c_url . "/" . $v_doc_file); 71 | 72 | ?> -------------------------------------------------------------------------------- /ligatcode/output/views/menu/form_menu.php: -------------------------------------------------------------------------------- 1 | extend('layout/template'); ?> 2 | section('content'); ?> 3 | 4 | 5 |
    6 |

    7 |
    8 |

    Menu

    9 |
    10 |
    11 | 13 | 15 |
    16 |
    17 | 19 | 21 |
    22 |
    23 | 25 | 27 |
    28 |
    29 | 31 | 33 |
    34 |
    35 | 37 | 39 |
    40 | 41 | 42 |
    43 |
    44 | Cencel 45 | 46 |
    47 |
    48 |
    49 | 50 | 51 | 52 | endSection(); ?> -------------------------------------------------------------------------------- /ligatcode/core/create_view_list.php: -------------------------------------------------------------------------------- 1 | extend('layout/template'); ?> 4 | section('content'); ?> 5 | 6 |
    7 |

    8 |
    9 | 14 | 15 | getFlashdata('message')): ?> 16 |
    17 | getFlashdata('message') ?> 18 |
    19 | 20 | 21 |
    22 | 23 | 24 | 25 | "; 26 | foreach ($non_pk as $row) { 27 | if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 28 | { 29 | $string .= "\n\t\t"; 30 | } 31 | if(isset($_POST['generateall'])) //meedun code selected filed 32 | { 33 | $string .= "\n\t\t"; 34 | } 35 | } 36 | $string .= "\n\t\t 37 | 38 | 39 | "; 40 | 41 | 42 | $string .= " 43 | "; 44 | 45 | $string .= "\n\t\t\t"; 46 | foreach ($non_pk as $row) { 47 | if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 48 | { 49 | $string .= "\n\t\t\t"; 50 | } 51 | if(isset($_POST['generateall'])) //meedun code selected filed 52 | { 53 | $string .= "\n\t\t\t"; 54 | } 55 | } 56 | 57 | 58 | $string .= " 65 | 66 | 67 |
    No" . label($row['column_name']) . "" . label($row['column_name']) . "Action
    59 | 60 | \">READ 61 | \">EDITE 62 | \" onclick=\"javascript: return confirm('Delete \\nAre You Sure ?')\">DELETE 63 | 64 |
    68 | 69 | links('paging', 'ligatcode_pagination') ?> 70 |
    71 | endSection(); ?>"; 72 | 73 | $result_view_list = createFile($string, $target."views/" . $c_url . "/" . $v_list_file); 74 | 75 | -------------------------------------------------------------------------------- /ligatcode/output/views/siswa/siswa_list.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | harviacode.com - codeigniter crud generator 5 | 6 | 11 | 12 | 13 | 14 |

    Siswa List

    15 |
    16 |
    17 | 18 |
    19 |
    20 |
    21 | session->userdata('message') <> '' ? $this->session->userdata('message') : ''; ?> 22 |
    23 |
    24 |
    25 |
    26 |
    27 |
    28 |
    29 | 30 | 31 | '') 33 | { 34 | ?> 35 | Reset 36 | 39 | 40 | 41 |
    42 |
    43 |
    44 |
    45 | 46 | 47 | 48 | 49 | 53 | 54 | 55 | 64 | 65 | 68 |
    NoAction
    56 | id),'Read'); 58 | echo ' | '; 59 | echo anchor(site_url('siswa/update/'.$siswa->id),'Update'); 60 | echo ' | '; 61 | echo anchor(site_url('siswa/delete/'.$siswa->id),'Delete','onclick="javasciprt: return confirm(\'Are You Sure ?\')"'); 62 | ?> 63 |
    69 |
    70 |
    71 | Total Record : 72 | 73 |
    74 |
    75 | 76 |
    77 |
    78 | 79 | 80 | -------------------------------------------------------------------------------- /ligatcode/output/views/jurusan/index_jurusan.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | harviacode.com - codeigniter crud generator 5 | 6 | 11 | 12 | 13 | 14 |

    Jurusan List

    15 |
    16 |
    17 | 18 |
    19 |
    20 |
    21 | session->userdata('message') <> '' ? $this->session->userdata('message') : ''; ?> 22 |
    23 |
    24 |
    25 |
    26 |
    27 |
    28 |
    29 | 30 | 31 | '') 33 | { 34 | ?> 35 | Reset 36 | 39 | 40 | 41 |
    42 |
    43 |
    44 |
    45 | 46 | 47 | 48 | 49 | 53 | 54 | 55 | 64 | 65 | 68 |
    NoAction
    56 | id_jurusan),'Read'); 58 | echo ' | '; 59 | echo anchor(site_url('jurusan/update/'.$jurusan->id_jurusan),'Update'); 60 | echo ' | '; 61 | echo anchor(site_url('jurusan/delete/'.$jurusan->id_jurusan),'Delete','onclick="javasciprt: return confirm(\'Are You Sure ?\')"'); 62 | ?> 63 |
    69 |
    70 |
    71 | Total Record : 72 | 73 |
    74 |
    75 | 76 |
    77 |
    78 | 79 | 80 | -------------------------------------------------------------------------------- /ligatcode/output/views/jurusan/jurusan_list.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | harviacode.com - codeigniter crud generator 5 | 6 | 11 | 12 | 13 | 14 |

    Jurusan List

    15 |
    16 |
    17 | 18 |
    19 |
    20 |
    21 | session->userdata('message') <> '' ? $this->session->userdata('message') : ''; ?> 22 |
    23 |
    24 |
    25 |
    26 |
    27 |
    28 |
    29 | 30 | 31 | '') 33 | { 34 | ?> 35 | Reset 36 | 39 | 40 | 41 |
    42 |
    43 |
    44 |
    45 | 46 | 47 | 48 | 49 | 50 | 54 | 55 | 56 | 57 | 66 | 67 | 70 |
    NoJurusanAction
    jurusan ?> 58 | id_jurusan),'Read'); 60 | echo ' | '; 61 | echo anchor(site_url('jurusan/update/'.$jurusan->id_jurusan),'Update'); 62 | echo ' | '; 63 | echo anchor(site_url('jurusan/delete/'.$jurusan->id_jurusan),'Delete','onclick="javasciprt: return confirm(\'Are You Sure ?\')"'); 64 | ?> 65 |
    71 |
    72 |
    73 | Total Record : 74 | 75 |
    76 |
    77 | 78 |
    79 |
    80 | 81 | 82 | -------------------------------------------------------------------------------- /ligatcode/core/connection.php: -------------------------------------------------------------------------------- 1 | '', 34 | 'hostname' => 'localhost', 35 | 'username' => 'root', 36 | 'password' => '', 37 | 'database' => 'elsa', 38 | 'DBDriver' => 'MySQLi', 39 | 'DBPrefix' => '', 40 | 'pConnect' => false, 41 | 'DBDebug' => (ENVIRONMENT !== 'production'), 42 | 'cacheOn' => false, 43 | 'cacheDir' => '', 44 | 'charset' => 'utf8', 45 | 'DBCollat' => 'utf8_general_ci', 46 | 'swapPre' => '', 47 | 'encrypt' => false, 48 | 'compress' => false, 49 | 'strictOn' => false, 50 | 'failover' => [], 51 | 'port' => 3306, 52 | ]; 53 | 54 | /** 55 | * This database connection is used when 56 | * running PHPUnit database tests. 57 | * 58 | * @var array 59 | */ 60 | public $tests = [ 61 | 'DSN' => '', 62 | 'hostname' => '127.0.0.1', 63 | 'username' => '', 64 | 'password' => '', 65 | 'database' => ':memory:', 66 | 'DBDriver' => 'SQLite3', 67 | 'DBPrefix' => 'db_', // Needed to ensure we're working correctly with prefixes live. DO NOT REMOVE FOR CI DEVS 68 | 'pConnect' => false, 69 | 'DBDebug' => (ENVIRONMENT !== 'production'), 70 | 'cacheOn' => false, 71 | 'cacheDir' => '', 72 | 'charset' => 'utf8', 73 | 'DBCollat' => 'utf8_general_ci', 74 | 'swapPre' => '', 75 | 'encrypt' => false, 76 | 'compress' => false, 77 | 'strictOn' => false, 78 | 'failover' => [], 79 | 'port' => 3306, 80 | ]; 81 | 82 | //-------------------------------------------------------------------- 83 | 84 | public function __construct() 85 | { 86 | parent::__construct(); 87 | 88 | // Ensure that we always set the database group to 'tests' if 89 | // we are currently running an automated test suite, so that 90 | // we don't overwrite live data on accident. 91 | if (ENVIRONMENT === 'testing') 92 | { 93 | $this->defaultGroup = 'tests'; 94 | 95 | // Under Travis-CI, we can set an ENV var named 'DB_GROUP' 96 | // so that we can test against multiple databases. 97 | if ($group = getenv('DB')) 98 | { 99 | if (is_file(TESTPATH . 'travis/Database.php')) 100 | { 101 | require TESTPATH . 'travis/Database.php'; 102 | 103 | if (! empty($dbconfig) && array_key_exists($group, $dbconfig)) 104 | { 105 | $this->tests = $dbconfig[$group]; 106 | } 107 | } 108 | } 109 | } 110 | } 111 | 112 | //-------------------------------------------------------------------- 113 | 114 | } 115 | -------------------------------------------------------------------------------- /ligatcode/output/views/groups/groups_list.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | harviacode.com - codeigniter crud generator 5 | 6 | 11 | 12 | 13 | 14 |

    Groups List

    15 |
    16 |
    17 | 18 |
    19 |
    20 |
    21 | session->userdata('message') <> '' ? $this->session->userdata('message') : ''; ?> 22 |
    23 |
    24 |
    25 |
    26 |
    27 |
    28 |
    29 | 30 | 31 | '') 33 | { 34 | ?> 35 | Reset 36 | 39 | 40 | 41 |
    42 |
    43 |
    44 |
    45 | 46 | 47 | 48 | 49 | 50 | 51 | 55 | 56 | 57 | 58 | 59 | 68 | 69 | 72 |
    NoNameDescriptionAction
    name ?>description ?> 60 | id),'Read'); 62 | echo ' | '; 63 | echo anchor(site_url('groups/update/'.$groups->id),'Update'); 64 | echo ' | '; 65 | echo anchor(site_url('groups/delete/'.$groups->id),'Delete','onclick="javasciprt: return confirm(\'Are You Sure ?\')"'); 66 | ?> 67 |
    73 |
    74 |
    75 | Total Record : 76 | 77 |
    78 |
    79 | 80 |
    81 |
    82 | 83 | 84 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ci4-ligatcode 2 | [![](https://badgen.net/badge/icon/Website?icon=chrome&label)](https://blog.simeedun.com) 3 | [![](https://badgen.net/badge/license/MIT/blue)](https://github.com/irev/ci4-ligatcode/blob/master/LICENSE) 4 | ![](https://badgen.net/github/commits/irev/ci4-ligatcode) 5 | ![](https://badgen.net/github/last-commit/irev/ci4-ligatcode) 6 | ![](https://badgen.net/github/status/irev/ci4-ligatcode/master) 7 | 8 | ### Codeigniter 4 CRUD Generator 1.0 (only Codeigniter 4) 9 | About : 10 | Codeigniter 4 CRUD Generator is a simple tool to automatically generate models, controllers and views from your tables. This tool is re-designed from the previous generator tool, Harviacode works for codeigniter 3. This tool will improve your writing code. This CRUD generator will perform complete CRUD operations, pagination, search, form *, ~~form validation, export to excel, and export to word~~. This CRUD generator uses bootstrap 4 style. You will still need to change the result code for more customization. 11 | 12 | ## TASK lISH :clock10: 13 | - [x] CRUD Generator 14 | - [x] MODEL, VIEW, CONTROLER 15 | - [x] Tabel Paging 16 | - [ ] form validation 17 | - [ ] \(Optional) export excel :soon: 18 | - [ ] \(Optional) export word :soon: 19 | - [ ] \(Optional) export pdf :soon: 20 | 21 | # 22 | 23 | * generate textarea and text input only 24 | :fire: Codeigniter 4 CRUD Generator Please visit and like [blog.simeedun.com](blog.simeedun.com) for more info and PHP tutorials. 25 | * :fire: Codeigniter 3 CRUD Generator Please visit and like [harviacode.com](harviacode.com) for more info and PHP tutorials. 26 | 27 | ## Preparation before using this Codeigniter 4 CRUD Generator (Important) : 28 | 29 | On Controller `app/Controller/BaseController.php` , load `database library`, `session library` and `url helper` 30 | 31 | ``` 32 | protected $helpers = ['html','text','form','session']; 33 | ``` 34 | 35 | On file `.env` setting DATABASE, Find `CTR+F` 36 | 37 | 38 | ``` 39 | database.default.hostname = localhost 40 | database.default.database = database 41 | database.default.username = username 42 | database.default.password = password 43 | database.default.DBDriver = MySQLi 44 | ``` 45 | 46 | #### Using this CRUD Generator : 47 | 48 | Simply put 'Ligatcode' folder,view folder, 'asset' folder and .htaccess file into your project root folder. 49 | Open http://localhost/{yourprojectname}/ligatcode. 50 | Select table and push generate button. 51 | FAQ : 52 | 53 | Select table show no data. Make sure you have correct database configuration on application/config/database.php and load database library on autoload. 54 | Error chmod on mac and linux. Please change your application folder and harviacode folder chmod to 777 55 | Error cannot Read, Update, Delete. Make sure your table have primary key. 56 | 57 | #### Update Codeigniter 4 CRUD Generator 58 | 59 | ##### V.1.0 (meedun) - 30 August 2020 60 | * Add the displayed database field selector 61 | * construct (model, view and controller) for Codeigniter framework version 4.0.4 62 | * Support custom page layout, built-in features of Codeigniter 4 This feature only affects the Generator button, ignored in Generate All button 63 | # 64 | 65 | `las't named \*harviacode\* to \*ligatcode\*` 66 | 67 | @radenrap/aci-harviacode What do you think about these updates? 68 | 69 | # 70 | © 2020-2020 blog.simeedun.com 71 | -------------------------------------------------------------------------------- /ligatcode/core/create_view_form.php: -------------------------------------------------------------------------------- 1 | extend('layout/template'); ?> 3 | section('content'); ?>"; 4 | 5 | $string .=" 6 | \n\n
    7 |

    8 |
    9 |

    ".ucfirst($table_name)."

    10 |
    \" method=\"post\">"; 11 | foreach ($non_pk as $row) { 12 | if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 13 | { 14 | if ($row["data_type"] == 'text') 15 | { 16 | $string .= "\n\t
    17 | 19 | 21 |
    "; 22 | } else 23 | { 24 | $string .= "\n\t
    25 | 27 | \" /> 29 |
    "; 30 | } 31 | } 32 | if(isset($_POST['generateall'])) //meedun code selected filed 33 | { 34 | if ($row["data_type"] == 'text') 35 | { 36 | $string .= "\n\t
    37 | 39 | 41 |
    "; 42 | } else 43 | { 44 | $string .= "\n\t
    45 | 47 | \" /> 49 |
    "; 50 | } 51 | } 52 | 53 | } 54 | $string .= "\n\t \"> "; 55 | $string .= "\n\t"; 56 | 57 | $string .= " 58 |
    59 |
    60 | \">Cencel 61 | 62 |
    63 |
    64 |
    65 | \n\n 66 | endSection(); ?>"; 67 | 68 | 69 | 70 | 71 | 72 | 73 | $result_view_form = createFile($string, $target."views/" . $c_url . "/" . $v_form_file); 74 | 75 | ?> -------------------------------------------------------------------------------- /ligatcode/core/setting.php: -------------------------------------------------------------------------------- 1 | Setting Updated

    '; 17 | } 18 | ?> 19 | 20 | 21 | 22 | 23 | LigatCode Codeigniter 4 CRUD Generator 24 | 25 | 30 | 31 | 32 | 33 |
    34 |
    35 | 36 |
    37 | 38 |
    39 | 40 |
    41 | target; ?> 42 |
    43 |
    44 | 48 |
    49 |
    50 |
    51 |
    52 | 56 |
    57 |
    58 |
    59 |
    60 | 61 | 62 | Back 63 |
    64 |
    65 |
    66 | Checking Required Files 67 | $nam) { 71 | if ($folder != 'ligatcode') { 72 | echo "

    " . $folder . ""; 73 | foreach ($nam as $key => $value) { 74 | if (file_exists('../../' . $value)) { 75 | echo '
    ' . $key . ' - ' . '' . $value . ' ok'; 76 | } else { 77 | echo '
    ' . $key . ' - ' . '' . $value . ' file not found'; 78 | } 79 | } 80 | } 81 | } 82 | ?> 83 |
    84 |
    85 | Checking Generate Files 86 | $nam) { 89 | if ($folder == 'ligatcode') { 90 | echo "

    " . $folder . ""; 91 | foreach ($nam as $key => $value) { 92 | if (file_exists($value)) { 93 | echo '
    ' . $key . ' - ' . '' . $value . ' ok'; 94 | } else { 95 | echo '
    ' . $key . ' - ' . '' . $value . ' file not found'; 96 | } 97 | } 98 | } 99 | } 100 | ?> 101 |
    102 |
    103 | 104 | 105 | -------------------------------------------------------------------------------- /ligatcode/core/ligatcode.php: -------------------------------------------------------------------------------- 1 | connection(); 15 | } 16 | 17 | function connection() 18 | { 19 | if(!parse_ini_file("../.env")){ 20 | echo "


    Environment Codeigniter 4 file .env not found or not configuration. please check this file in your root folder.

    "; 21 | echo "

    Please set this line:"; 22 | echo "
    database.default.hostname"; 23 | echo "
    database.default.database"; 24 | echo "
    database.default.username"; 25 | echo "
    database.default.password"; 26 | echo "
    database.default.hostname"; 27 | echo "
    "; 28 | exit(); 29 | } 30 | $_ENV = parse_ini_file("../.env"); 31 | $this->host = $_ENV["database.default.hostname"]; // ['hostname']; 32 | $this->user = $_ENV ["database.default.username"]; //['username']; 33 | $this->password = $_ENV ["database.default.password"]; //['password']; 34 | $this->database = $_ENV["database.default.database"]; 35 | 36 | $this->sql = new \mysqli($this->host, $this->user, $this->password, $this->database); 37 | if ($this->sql->connect_error) 38 | { 39 | echo $this->sql->connect_error . ", please check 'app/Config/database.php'."; 40 | die(); 41 | } 42 | } 43 | 44 | function table_list() 45 | { 46 | $query = "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=?"; 47 | $stmt = $this->sql->prepare($query) OR die("Error code :" . $this->sql->errno . " (not_primary_field)"); 48 | $stmt->bind_param('s', $this->database); 49 | $stmt->bind_result($table_name); 50 | $stmt->execute(); 51 | while ($stmt->fetch()) { 52 | $fields[] = array('table_name' => $table_name); 53 | } 54 | return $fields; 55 | $stmt->close(); 56 | $this->sql->close(); 57 | } 58 | 59 | function primary_field($table) 60 | { 61 | $query = "SELECT COLUMN_NAME,COLUMN_KEY FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA=? AND TABLE_NAME=? AND COLUMN_KEY = 'PRI'"; 62 | $stmt = $this->sql->prepare($query) OR die("Error code :" . $this->sql->errno . " (primary_field)"); 63 | $stmt->bind_param('ss', $this->database, $table); 64 | $stmt->bind_result($column_name, $column_key); 65 | $stmt->execute(); 66 | $stmt->fetch(); 67 | return $column_name; 68 | $stmt->close(); 69 | $this->sql->close(); 70 | } 71 | 72 | function not_primary_field($table) 73 | { 74 | $query = "SELECT COLUMN_NAME,COLUMN_KEY,DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA=? AND TABLE_NAME=? AND COLUMN_KEY <> 'PRI'"; 75 | $stmt = $this->sql->prepare($query) OR die("Error code :" . $this->sql->errno . " (not_primary_field)"); 76 | $stmt->bind_param('ss', $this->database, $table); 77 | $stmt->bind_result($column_name, $column_key, $data_type); 78 | $stmt->execute(); 79 | while ($stmt->fetch()) { 80 | $fields[] = array('column_name' => $column_name, 'column_key' => $column_key, 'data_type' => $data_type); 81 | } 82 | return $fields; 83 | $stmt->close(); 84 | $this->sql->close(); 85 | } 86 | 87 | function all_field($table) 88 | { 89 | $query = "SELECT COLUMN_NAME,COLUMN_KEY,DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA=? AND TABLE_NAME=?"; 90 | $stmt = $this->sql->prepare($query) OR die("Error code :" . $this->sql->errno . " (not_primary_field)"); 91 | $stmt->bind_param('ss', $this->database, $table); 92 | $stmt->bind_result($column_name, $column_key, $data_type); 93 | $stmt->execute(); 94 | while ($stmt->fetch()) { 95 | $fields[] = array('column_name' => $column_name, 'column_key' => $column_key, 'data_type' => $data_type); 96 | } 97 | return $fields; 98 | $stmt->close(); 99 | $this->sql->close(); 100 | } 101 | 102 | } 103 | 104 | ?> -------------------------------------------------------------------------------- /assets/datatables/dataTables.bootstrap.css: -------------------------------------------------------------------------------- 1 | div.dataTables_length label { 2 | font-weight: normal; 3 | float: left; 4 | text-align: left; 5 | } 6 | 7 | div.dataTables_length select { 8 | width: 75px; 9 | } 10 | 11 | div.dataTables_filter label { 12 | font-weight: normal; 13 | float: right; 14 | } 15 | 16 | div.dataTables_filter input { 17 | width: 16em; 18 | } 19 | 20 | div.dataTables_info { 21 | padding-top: 8px; 22 | } 23 | 24 | div.dataTables_paginate { 25 | float: right; 26 | margin: 0; 27 | } 28 | 29 | div.dataTables_paginate ul.pagination { 30 | margin: 2px 0; 31 | white-space: nowrap; 32 | } 33 | 34 | table.dataTable, 35 | table.dataTable td, 36 | table.dataTable th { 37 | -webkit-box-sizing: content-box; 38 | -moz-box-sizing: content-box; 39 | box-sizing: content-box; 40 | } 41 | 42 | 43 | table.dataTable { 44 | clear: both; 45 | margin-top: 6px !important; 46 | margin-bottom: 6px !important; 47 | max-width: none !important; 48 | } 49 | 50 | table.dataTable thead .sorting, 51 | table.dataTable thead .sorting_asc, 52 | table.dataTable thead .sorting_desc, 53 | table.dataTable thead .sorting_asc_disabled, 54 | table.dataTable thead .sorting_desc_disabled { 55 | cursor: pointer; 56 | } 57 | 58 | table.dataTable thead .sorting { background: url('images/sort_both.png') no-repeat center right; } 59 | table.dataTable thead .sorting_asc { background: url('images/sort_asc.png') no-repeat center right; } 60 | table.dataTable thead .sorting_desc { background: url('images/sort_desc.png') no-repeat center right; } 61 | 62 | table.dataTable thead .sorting_asc_disabled { background: url('images/sort_asc_disabled.png') no-repeat center right; } 63 | table.dataTable thead .sorting_desc_disabled { background: url('images/sort_desc_disabled.png') no-repeat center right; } 64 | 65 | table.dataTable th:active { 66 | outline: none; 67 | } 68 | 69 | /* Scrolling */ 70 | div.dataTables_scrollHead table { 71 | margin-bottom: 0 !important; 72 | border-bottom-left-radius: 0; 73 | border-bottom-right-radius: 0; 74 | } 75 | 76 | div.dataTables_scrollHead table thead tr:last-child th:first-child, 77 | div.dataTables_scrollHead table thead tr:last-child td:first-child { 78 | border-bottom-left-radius: 0 !important; 79 | border-bottom-right-radius: 0 !important; 80 | } 81 | 82 | div.dataTables_scrollBody table { 83 | border-top: none; 84 | margin-top: 0 !important; 85 | margin-bottom: 0 !important; 86 | } 87 | 88 | div.dataTables_scrollBody tbody tr:first-child th, 89 | div.dataTables_scrollBody tbody tr:first-child td { 90 | border-top: none; 91 | } 92 | 93 | div.dataTables_scrollFoot table { 94 | margin-top: 0 !important; 95 | border-top: none; 96 | } 97 | 98 | 99 | 100 | 101 | /* 102 | * TableTools styles 103 | */ 104 | .table tbody tr.active td, 105 | .table tbody tr.active th { 106 | background-color: #08C; 107 | color: white; 108 | } 109 | 110 | .table tbody tr.active:hover td, 111 | .table tbody tr.active:hover th { 112 | background-color: #0075b0 !important; 113 | } 114 | 115 | .table tbody tr.active a { 116 | color: white; 117 | } 118 | 119 | .table-striped tbody tr.active:nth-child(odd) td, 120 | .table-striped tbody tr.active:nth-child(odd) th { 121 | background-color: #017ebc; 122 | } 123 | 124 | table.DTTT_selectable tbody tr { 125 | cursor: pointer; 126 | } 127 | 128 | div.DTTT .btn { 129 | color: #333 !important; 130 | font-size: 12px; 131 | } 132 | 133 | div.DTTT .btn:hover { 134 | text-decoration: none !important; 135 | } 136 | 137 | ul.DTTT_dropdown.dropdown-menu { 138 | z-index: 2003; 139 | } 140 | 141 | ul.DTTT_dropdown.dropdown-menu a { 142 | color: #333 !important; /* needed only when demo_page.css is included */ 143 | } 144 | 145 | ul.DTTT_dropdown.dropdown-menu li { 146 | position: relative; 147 | } 148 | 149 | ul.DTTT_dropdown.dropdown-menu li:hover a { 150 | background-color: #0088cc; 151 | color: white !important; 152 | } 153 | 154 | div.DTTT_collection_background { 155 | z-index: 2002; 156 | } 157 | 158 | /* TableTools information display */ 159 | div.DTTT_print_info.modal { 160 | height: 150px; 161 | margin-top: -75px; 162 | text-align: center; 163 | } 164 | 165 | div.DTTT_print_info h6 { 166 | font-weight: normal; 167 | font-size: 28px; 168 | line-height: 28px; 169 | margin: 1em; 170 | } 171 | 172 | div.DTTT_print_info p { 173 | font-size: 14px; 174 | line-height: 20px; 175 | } 176 | 177 | 178 | 179 | /* 180 | * FixedColumns styles 181 | */ 182 | div.DTFC_LeftHeadWrapper table, 183 | div.DTFC_LeftFootWrapper table, 184 | div.DTFC_RightHeadWrapper table, 185 | div.DTFC_RightFootWrapper table, 186 | table.DTFC_Cloned tr.even { 187 | background-color: white; 188 | } 189 | 190 | div.DTFC_RightHeadWrapper table , 191 | div.DTFC_LeftHeadWrapper table { 192 | margin-bottom: 0 !important; 193 | border-top-right-radius: 0 !important; 194 | border-bottom-left-radius: 0 !important; 195 | border-bottom-right-radius: 0 !important; 196 | } 197 | 198 | div.DTFC_RightHeadWrapper table thead tr:last-child th:first-child, 199 | div.DTFC_RightHeadWrapper table thead tr:last-child td:first-child, 200 | div.DTFC_LeftHeadWrapper table thead tr:last-child th:first-child, 201 | div.DTFC_LeftHeadWrapper table thead tr:last-child td:first-child { 202 | border-bottom-left-radius: 0 !important; 203 | border-bottom-right-radius: 0 !important; 204 | } 205 | 206 | div.DTFC_RightBodyWrapper table, 207 | div.DTFC_LeftBodyWrapper table { 208 | border-top: none; 209 | margin-bottom: 0 !important; 210 | } 211 | 212 | div.DTFC_RightBodyWrapper tbody tr:first-child th, 213 | div.DTFC_RightBodyWrapper tbody tr:first-child td, 214 | div.DTFC_LeftBodyWrapper tbody tr:first-child th, 215 | div.DTFC_LeftBodyWrapper tbody tr:first-child td { 216 | border-top: none; 217 | } 218 | 219 | div.DTFC_RightFootWrapper table, 220 | div.DTFC_LeftFootWrapper table { 221 | border-top: none; 222 | } 223 | 224 | -------------------------------------------------------------------------------- /ligatcode/core/process.php: -------------------------------------------------------------------------------- 1 | '') 17 | { 18 | // set data 19 | $table_name = $table_name; 20 | $c = $controller <> '' ? ucfirst($controller) : ucfirst($table_name); 21 | $m = $model <> '' ? ucfirst($model) : ucfirst($table_name) . 'Models'; 22 | $v_list = 'index_'.$table_name; 23 | $v_read = 'read_'.$table_name; 24 | $v_form = 'form_'.$table_name; 25 | $v_doc = $table_name . "_doc"; 26 | $v_pdf = $table_name . "_pdf"; 27 | 28 | // url 29 | $c_url = strtolower($c); 30 | 31 | // filename 32 | $c_file = $c . '.php'; 33 | $m_file = $m . '.php'; 34 | $v_list_file = $v_list . '.php'; 35 | $v_read_file = $v_read . '.php'; 36 | $v_form_file = $v_form . '.php'; 37 | $v_doc_file = $v_doc . '.php'; 38 | $v_pdf_file = $v_pdf . '.php'; 39 | 40 | // read setting 41 | $get_setting = readJSON('core/settingjson.cfg'); 42 | $target = $get_setting->target; 43 | 44 | if (!file_exists($target . "views/" . $c_url)) 45 | { 46 | mkdir($target . "views/" . $c_url, 0777, true); 47 | } 48 | 49 | 50 | 51 | $pk = $ligat->primary_field($table_name); 52 | $non_pk = $ligat->not_primary_field($table_name); 53 | $all = $ligat->all_field($table_name); 54 | 55 | // generate 56 | //include 'core/create_config_pagination.php'; 57 | include 'core/create_controller.php'; 58 | include 'core/create_model.php'; 59 | if ($jenis_tabel == 'reguler_table') { 60 | include 'core/create_view_list.php'; 61 | } else { 62 | include 'core/create_view_list_datatables.php'; 63 | include 'core/create_libraries_datatables.php'; 64 | } 65 | include 'core/create_view_form.php'; 66 | include 'core/create_view_read.php'; 67 | 68 | $structure = 'views/layout'; 69 | if (!file_exists('views/layout/')) { 70 | if (!mkdir($structure, 0777, true)) { 71 | die('Failed to create folders...'); 72 | } 73 | //mkdir($target . "views/layout/", 0700); 74 | } 75 | if(!is_dir($target."views/layout/")){ 76 | !mkdir($target . "views/layout/", 0700); 77 | include 'core/create_view_layout_sidebar.php'; 78 | include 'core/create_view_layout_ligatcode_pagination.php'; 79 | }else{ 80 | include 'core/create_view_layout_sidebar.php'; 81 | include 'core/create_view_layout_ligatcode_pagination.php'; 82 | } 83 | 84 | $export_excel == 1 ? include 'core/create_exportexcel_helper.php' : ''; 85 | $export_word == 1 ? include 'core/create_view_list_doc.php' : ''; 86 | $export_pdf == 1 ? include 'core/create_pdf_library.php' : ''; 87 | $export_pdf == 1 ? include 'core/create_view_list_pdf.php' : ''; 88 | 89 | $result[] = $result_controller; 90 | $result[] = $result_model; 91 | $result[] = $result_view_list; 92 | $result[] = $result_view_form; 93 | $result[] = $result_view_read; 94 | $result[] = $result_view_layout_sidebar; 95 | $result[] = $result_view_layout_ligatcode_pagination; 96 | //$result[] = $result_view_doc; 97 | //$result[] = $result_view_pdf; 98 | //$result[] = $result_config_pagination; 99 | //$result[] = $result_exportexcel; 100 | //$result[] = $result_pdf; 101 | } else 102 | { 103 | $result[] = 'No table selected.'; 104 | } 105 | } 106 | 107 | if (isset($_POST['generateall'])) 108 | { 109 | 110 | $jenis_tabel = safe(isset($_POST['jenis_tabel'])); 111 | $export_excel = safe(isset($_POST['export_excel'])); 112 | $export_word = safe(isset($_POST['export_word'])); 113 | $export_pdf = safe(isset($_POST['export_pdf'])); 114 | 115 | $table_list = $ligat->table_list(); 116 | foreach ($table_list as $row) { 117 | 118 | $table_name = $row['table_name']; 119 | $c = ucfirst($table_name); 120 | $m = ucfirst($table_name) . 'Model'; 121 | $v_list = "index_".$table_name; 122 | $v_read = "read_".$table_name ; 123 | $v_form = "form_".$table_name ; 124 | $v_doc = $table_name . "_doc"; 125 | $v_pdf = $table_name . "_pdf"; 126 | 127 | // url 128 | $c_url = strtolower($c); 129 | 130 | // filename 131 | $c_file = $c . '.php'; 132 | $m_file = $m . '.php'; 133 | $v_list_file = $v_list . '.php'; 134 | $v_read_file = $v_read . '.php'; 135 | $v_form_file = $v_form . '.php'; 136 | $v_doc_file = $v_doc . '.php'; 137 | $v_pdf_file = $v_pdf . '.php'; 138 | 139 | // read setting 140 | $get_setting = readJSON('core/settingjson.cfg'); 141 | $target = $get_setting->target; 142 | if (!file_exists($target . "views/" . $c_url)) 143 | { 144 | mkdir($target . "views/" . $c_url, 0777, true); 145 | } 146 | 147 | $pk = $ligat->primary_field($table_name); 148 | $non_pk = $ligat->not_primary_field($table_name); 149 | $all = $ligat->all_field($table_name); 150 | 151 | // generate 152 | include 'core/create_config_pagination.php'; 153 | include 'core/create_controller.php'; 154 | include 'core/create_model.php'; 155 | if ($jenis_tabel == 'reguler_table') { 156 | include 'core/create_view_list.php'; 157 | } else { 158 | include 'core/create_view_list_datatables.php'; 159 | include 'core/create_libraries_datatables.php'; 160 | } 161 | include 'core/create_view_form.php'; 162 | include 'core/create_view_read.php'; 163 | include 'core/create_views_layout_sidebar.php'; 164 | 165 | $export_excel == 1 ? include 'core/create_exportexcel_helper.php' : ''; 166 | $export_word == 1 ? include 'core/create_view_list_doc.php' : ''; 167 | $export_pdf == 1 ? include 'core/create_pdf_library.php' : ''; 168 | $export_pdf == 1 ? include 'core/create_view_list_pdf.php' : ''; 169 | 170 | $result[] = $result_controller; 171 | $result[] = $result_model; 172 | $result[] = $result_view_list; 173 | $result[] = $result_view_form; 174 | $result[] = $result_view_read; 175 | $result[] = $result_view_layout_sidebar; 176 | $result[] = $result_view_doc; 177 | } 178 | $result[] = $result_config_pagination; 179 | $result[] = $result_exportexcel; 180 | $result[] = $result_pdf; 181 | } 182 | ?> -------------------------------------------------------------------------------- /ligatcode/core/create_view_list_datatables.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | harviacode.com - codeigniter crud generator 7 | \"/> 8 | \" /> 9 | \" /> 10 | 32 | 33 | 34 | 35 |
    36 |
    37 |

    ".ucfirst($table_name)." List

    38 |
    39 |
    40 |
    41 | session->userdata('message') <> '' ? \$this->session->userdata('message') : ''; ?> 42 |
    43 |
    44 |
    45 | "; 46 | if ($export_excel == '1') { 47 | $string .= 48 | "\n\t\t"; 49 | } 50 | if ($export_word == '1') { 51 | $string .= "\n\t\t"; 52 | } 53 | if ($export_pdf == '1') { 54 | $string .= "\n\t\t"; 55 | } 56 | $string .= "\n\t
    57 |
    58 |
    59 | 60 | 61 | 62 | "; 63 | foreach ($non_pk as $row) { 64 | //$string .= "\n\t\t "; //Original Haviacode 65 | //Edit by Meedun 66 | if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 67 | { 68 | if($_POST['field_'.$row['column_name']]==1){ 69 | $string .= "\n\t\t "; 70 | } 71 | 72 | } 73 | if(isset($_POST['generateall'])) //meedun code selected filed 74 | { 75 | $string .= "\n\t\t "; 76 | } 77 | //Edit by Meedun 78 | } 79 | $string .= "\n\t\t 80 | 81 | "; 82 | 83 | $column_non_pk = array(); 84 | foreach ($non_pk as $row) { 85 | //$column_non_pk[] .= "{\"data\": \"".$row['column_name']."\"}"; ////Original Haviacode 86 | //Edit by Meedun 87 | if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 88 | { 89 | if($_POST['field_'.$row['column_name']]==1){ 90 | $column_non_pk[] .= "{\"data\": \"".$row['column_name']."\"}"; 91 | } 92 | 93 | } 94 | if(isset($_POST['generateall'])) //meedun code selected filed 95 | { 96 | $column_non_pk[] .= "{\"data\": \"".$row['column_name']."\"}"; 97 | } 98 | //Edit by Meedun 99 | } 100 | $col_non_pk = implode(',', $column_non_pk); 101 | 102 | $string .= "\n\t 103 |
    No" . label($row['column_name']) . "" . label($row['column_name']) . "" . label($row['column_name']) . "Action
    104 |
    105 | 107 | 108 | 109 | 165 | 166 | "; 167 | 168 | 169 | $result_view_list = createFile($string, $target."views/" . $c_url . "/" . $v_list_file); 170 | 171 | ?> -------------------------------------------------------------------------------- /assets/datatables/dataTables.bootstrap.js: -------------------------------------------------------------------------------- 1 | /* Set the defaults for DataTables initialisation */ 2 | $.extend(true, $.fn.dataTable.defaults, { 3 | "sDom": "<'row'<'col-sm-6'l><'col-sm-6'f>r>" + "t" + "<'row'<'col-sm-6'i><'col-sm-6'p>>", 4 | "oLanguage": { 5 | "sLengthMenu": "_MENU_ records per page" 6 | } 7 | }); 8 | 9 | 10 | /* Default class modification */ 11 | $.extend($.fn.dataTableExt.oStdClasses, { 12 | "sWrapper": "dataTables_wrapper form-inline", 13 | "sFilterInput": "form-control input-sm", 14 | "sLengthSelect": "form-control input-sm" 15 | }); 16 | 17 | // In 1.10 we use the pagination renderers to draw the Bootstrap paging, 18 | // rather than custom plug-in 19 | if ($.fn.dataTable.Api) { 20 | $.fn.dataTable.defaults.renderer = 'bootstrap'; 21 | $.fn.dataTable.ext.renderer.pageButton.bootstrap = function(settings, host, idx, buttons, page, pages) { 22 | var api = new $.fn.dataTable.Api(settings); 23 | var classes = settings.oClasses; 24 | var lang = settings.oLanguage.oPaginate; 25 | var btnDisplay, btnClass; 26 | 27 | var attach = function(container, buttons) { 28 | var i, ien, node, button; 29 | var clickHandler = function(e) { 30 | e.preventDefault(); 31 | if (e.data.action !== 'ellipsis') { 32 | api.page(e.data.action).draw(false); 33 | } 34 | }; 35 | 36 | for (i = 0, ien = buttons.length; i < ien; i++) { 37 | button = buttons[i]; 38 | 39 | if ($.isArray(button)) { 40 | attach(container, button); 41 | } else { 42 | btnDisplay = ''; 43 | btnClass = ''; 44 | 45 | switch (button) { 46 | case 'ellipsis': 47 | btnDisplay = '…'; 48 | btnClass = 'disabled'; 49 | break; 50 | 51 | case 'first': 52 | btnDisplay = lang.sFirst; 53 | btnClass = button + (page > 0 ? 54 | '' : ' disabled'); 55 | break; 56 | 57 | case 'previous': 58 | btnDisplay = lang.sPrevious; 59 | btnClass = button + (page > 0 ? 60 | '' : ' disabled'); 61 | break; 62 | 63 | case 'next': 64 | btnDisplay = lang.sNext; 65 | btnClass = button + (page < pages - 1 ? 66 | '' : ' disabled'); 67 | break; 68 | 69 | case 'last': 70 | btnDisplay = lang.sLast; 71 | btnClass = button + (page < pages - 1 ? 72 | '' : ' disabled'); 73 | break; 74 | 75 | default: 76 | btnDisplay = button + 1; 77 | btnClass = page === button ? 78 | 'active' : ''; 79 | break; 80 | } 81 | 82 | if (btnDisplay) { 83 | node = $('
  • ', { 84 | 'class': classes.sPageButton + ' ' + btnClass, 85 | 'aria-controls': settings.sTableId, 86 | 'tabindex': settings.iTabIndex, 87 | 'id': idx === 0 && typeof button === 'string' ? settings.sTableId + '_' + button : null 88 | }) 89 | .append($('', { 90 | 'href': '#' 91 | }) 92 | .html(btnDisplay) 93 | ) 94 | .appendTo(container); 95 | 96 | settings.oApi._fnBindAction( 97 | node, { 98 | action: button 99 | }, clickHandler 100 | ); 101 | } 102 | } 103 | } 104 | }; 105 | 106 | attach( 107 | $(host).empty().html('
      ').children('ul'), 108 | buttons 109 | ); 110 | } 111 | } else { 112 | // Integration for 1.9- 113 | $.fn.dataTable.defaults.sPaginationType = 'bootstrap'; 114 | 115 | /* API method to get paging information */ 116 | $.fn.dataTableExt.oApi.fnPagingInfo = function(oSettings) { 117 | return { 118 | "iStart": oSettings._iDisplayStart, 119 | "iEnd": oSettings.fnDisplayEnd(), 120 | "iLength": oSettings._iDisplayLength, 121 | "iTotal": oSettings.fnRecordsTotal(), 122 | "iFilteredTotal": oSettings.fnRecordsDisplay(), 123 | "iPage": oSettings._iDisplayLength === -1 ? 0 : Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength), 124 | "iTotalPages": oSettings._iDisplayLength === -1 ? 0 : Math.ceil(oSettings.fnRecordsDisplay() / oSettings._iDisplayLength) 125 | }; 126 | }; 127 | 128 | /* Bootstrap style pagination control */ 129 | $.extend($.fn.dataTableExt.oPagination, { 130 | "bootstrap": { 131 | "fnInit": function(oSettings, nPaging, fnDraw) { 132 | var oLang = oSettings.oLanguage.oPaginate; 133 | var fnClickHandler = function(e) { 134 | e.preventDefault(); 135 | if (oSettings.oApi._fnPageChange(oSettings, e.data.action)) { 136 | fnDraw(oSettings); 137 | } 138 | }; 139 | 140 | $(nPaging).append( 141 | '' 145 | ); 146 | var els = $('a', nPaging); 147 | $(els[0]).bind('click.DT', { 148 | action: "previous" 149 | }, fnClickHandler); 150 | $(els[1]).bind('click.DT', { 151 | action: "next" 152 | }, fnClickHandler); 153 | }, 154 | 155 | "fnUpdate": function(oSettings, fnDraw) { 156 | var iListLength = 5; 157 | var oPaging = oSettings.oInstance.fnPagingInfo(); 158 | var an = oSettings.aanFeatures.p; 159 | var i, ien, j, sClass, iStart, iEnd, iHalf = Math.floor(iListLength / 2); 160 | 161 | if (oPaging.iTotalPages < iListLength) { 162 | iStart = 1; 163 | iEnd = oPaging.iTotalPages; 164 | } else if (oPaging.iPage <= iHalf) { 165 | iStart = 1; 166 | iEnd = iListLength; 167 | } else if (oPaging.iPage >= (oPaging.iTotalPages - iHalf)) { 168 | iStart = oPaging.iTotalPages - iListLength + 1; 169 | iEnd = oPaging.iTotalPages; 170 | } else { 171 | iStart = oPaging.iPage - iHalf + 1; 172 | iEnd = iStart + iListLength - 1; 173 | } 174 | 175 | for (i = 0, ien = an.length; i < ien; i++) { 176 | // Remove the middle elements 177 | $('li:gt(0)', an[i]).filter(':not(:last)').remove(); 178 | 179 | // Add the new list items and their event handlers 180 | for (j = iStart; j <= iEnd; j++) { 181 | sClass = (j == oPaging.iPage + 1) ? 'class="active"' : ''; 182 | $('
    • ' + j + '
    • ') 183 | .insertBefore($('li:last', an[i])[0]) 184 | .bind('click', function(e) { 185 | e.preventDefault(); 186 | oSettings._iDisplayStart = (parseInt($('a', this).text(), 10) - 1) * oPaging.iLength; 187 | fnDraw(oSettings); 188 | }); 189 | } 190 | 191 | // Add / remove disabled classes from the static elements 192 | if (oPaging.iPage === 0) { 193 | $('li:first', an[i]).addClass('disabled'); 194 | } else { 195 | $('li:first', an[i]).removeClass('disabled'); 196 | } 197 | 198 | if (oPaging.iPage === oPaging.iTotalPages - 1 || oPaging.iTotalPages === 0) { 199 | $('li:last', an[i]).addClass('disabled'); 200 | } else { 201 | $('li:last', an[i]).removeClass('disabled'); 202 | } 203 | } 204 | } 205 | } 206 | }); 207 | } 208 | 209 | 210 | /* 211 | * TableTools Bootstrap compatibility 212 | * Required TableTools 2.1+ 213 | */ 214 | if ($.fn.DataTable.TableTools) { 215 | // Set the classes that TableTools uses to something suitable for Bootstrap 216 | $.extend(true, $.fn.DataTable.TableTools.classes, { 217 | "container": "DTTT btn-group", 218 | "buttons": { 219 | "normal": "btn btn-default", 220 | "disabled": "disabled" 221 | }, 222 | "collection": { 223 | "container": "DTTT_dropdown dropdown-menu", 224 | "buttons": { 225 | "normal": "", 226 | "disabled": "disabled" 227 | } 228 | }, 229 | "print": { 230 | "info": "DTTT_print_info modal" 231 | }, 232 | "select": { 233 | "row": "active" 234 | } 235 | }); 236 | 237 | // Have the collection use a bootstrap compatible dropdown 238 | $.extend(true, $.fn.DataTable.TableTools.DEFAULTS.oTags, { 239 | "collection": { 240 | "container": "ul", 241 | "button": "li", 242 | "liner": "a" 243 | } 244 | }); 245 | } 246 | -------------------------------------------------------------------------------- /ligatcode/core/create_controller.php: -------------------------------------------------------------------------------- 1 | Model = new $m(); //Set Default Models Of this Controler 21 | \$this->PageData = \$this->attributePage(); //Attribute Of Page 22 | \$pager = \Config\Services::pager(); 23 | } 24 | 25 | //ATRIBUTE THIS PAGE 26 | private function attributePage() 27 | { 28 | return [ 29 | 'title' => 'LigatCode | $c', 30 | 'app' => 'LigatCode', 31 | ]; 32 | } 33 | 34 | //INDEX 35 | public function index() 36 | { 37 | \$data = [ 38 | 'AttributePage' =>\$this->PageData, 39 | 'content' => 'Create Pages', 40 | 'data' => \$this->Model->paginate(5, 'paging'), 41 | 'pager' => \$this->Model->pager 42 | ]; 43 | return view('$c_url/$v_list', \$data); 44 | } 45 | 46 | //READ 47 | public function read(\$id) 48 | { 49 | \$data = [ 50 | 'AttributePage' => \$this->PageData, 51 | 'content' => 'Read Pages', 52 | 'data' => \$this->Model->find(\$id) //find on data 53 | ]; 54 | return view('$c_url/$v_read', \$data); 55 | } 56 | 57 | //CREATE 58 | public function create() 59 | { 60 | \$data = [ 61 | 'AttributePage' => \$this->PageData, 62 | 'content' => 'Create Pages', 63 | 'action' => site_url('$c/create_action'), 64 | 'data' => ["; 65 | //'$c' => set_value('$c'), 66 | 67 | foreach ($all as $row) { 68 | if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 69 | { 70 | $string .= "\n\t\t\t\t\t '" . $row['column_name'] . "' => set_value('" . $row['column_name'] . "'),"; 71 | } 72 | if(isset($_POST['generateall'])) //meedun code 73 | { 74 | $string .= "\n\t\t\t\t\t '" . $row['column_name'] . "' => set_value('" . $row['column_name'] . "'),"; 75 | } 76 | } 77 | $string .=" 78 | ] 79 | ]; 80 | return view('$c_url/$v_form', \$data); 81 | } 82 | 83 | //ACTION CREATE 84 | public function create_action() 85 | { 86 | \$data =["; 87 | foreach ($all as $row) { 88 | if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 89 | { 90 | $string .= "\n\t\t\t\t '" . $row['column_name'] . "' => \$this->request->getVar('" . $row['column_name'] . "'),"; 91 | } 92 | if(isset($_POST['generateall'])) //meedun code 93 | { 94 | $string .= "\n\t\t\t\t '" . $row['column_name'] . "' => \$this->request->getVar('" . $row['column_name'] . "'),"; 95 | } 96 | } 97 | $string.=" 98 | \n\t\t\t\t]; 99 | \$this->Model->save(\$data); 100 | session()->setFlashdata('message', 'Create Record Success'); 101 | return redirect()->to(base_url('/$c')); 102 | } 103 | 104 | //UPDATE 105 | public function update(\$id) 106 | { 107 | \$dataFind = \$this->Model->find(\$id); 108 | if(\$dataFind == false){ 109 | return redirect()->to(base_url('/$c')); 110 | } 111 | \$data = [ 112 | 'AttributePage' => \$this->PageData, 113 | 'content' => 'Edite Pages', 114 | 'action' => '$c_url/update_action', 115 | 'data' => \$this->Model->find(\$id), 116 | ]; 117 | session()->setFlashdata('message', 'Update Record Success'); 118 | return view('$c_url/$v_form', \$data); 119 | } 120 | 121 | //ACTION UPDATE 122 | public function update_action() 123 | { 124 | \$id = \$this->request->getVar('$pk'); 125 | \$row = \$this->Model->find(['$pk' => \$id]); 126 | 127 | \$data =["; 128 | foreach ($all as $row) { 129 | if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 130 | { 131 | $string .= "\n\t\t\t\t '" . $row['column_name'] . "' => \$this->request->getVar('" . $row['column_name'] . "'),"; 132 | } 133 | if(isset($_POST['generateall'])) //meedun code 134 | { 135 | $string .= "\n\t\t\t\t '" . $row['column_name'] . "' => \$this->request->getVar('" . $row['column_name'] . "'),"; 136 | } 137 | } 138 | $string .=" 139 | ]; 140 | \$this->Model->save(\$data); 141 | session()->setFlashdata('message', 'Update Record Success'); 142 | 143 | return redirect()->to(base_url('$c_url')); 144 | 145 | } 146 | 147 | //DELETE 148 | public function delete(\$id) 149 | { 150 | \$row = \$this->Model->find(['$pk' => \$id]); 151 | if (\$row) { 152 | \$this->Model->delete(\$id); 153 | session()->setFlashdata('message', 'Delete Record Success'); 154 | return redirect()->to(base_url('/$c_url')); 155 | } else { 156 | session()->setFlashdata('message', 'Record Not Found'); 157 | return redirect()->to(base_url('/$c_url')); 158 | } 159 | 160 | } 161 | 162 | //RULES 163 | public function _rules() 164 | {"; 165 | foreach ($non_pk as $row) { 166 | if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 167 | { 168 | $int = $row['data_type'] == 'int' || $row['data_type'] == 'double' || $row['data_type'] == 'decimal' ? '|numeric' : ''; 169 | $string .= "\n\t\$this->form_validation->set_rules('".$row['column_name']."', '". strtolower(label($row['column_name']))."', 'trim|required$int');"; 170 | } 171 | if(isset($_POST['generateall'])) //meedun code 172 | { 173 | $int = $row['data_type'] == 'int' || $row['data_type'] == 'double' || $row['data_type'] == 'decimal' ? '|numeric' : ''; 174 | $string .= "\n\t\$this->form_validation->set_rules('".$row['column_name']."', '". strtolower(label($row['column_name']))."', 'trim|required$int');"; 175 | } 176 | } 177 | $string .= "\n\n\t\$this->form_validation->set_rules('$pk', '$pk', 'trim');"; 178 | $string .= "\n\t\$this->form_validation->set_error_delimiters('', ''); 179 | }"; 180 | 181 | 182 | /////////////////////////////////////////////////// 183 | /////////////////////////////////////////////////// 184 | /////////////////////////////////////////////////// 185 | 186 | // function __construct() 187 | // { 188 | // parent::__construct(); 189 | // \$this->load->model('$m'); 190 | // \$this->load->library('form_validation');"; 191 | 192 | // if ($jenis_tabel <> 'reguler_table') { 193 | // $string .= " \n\t\$this->load->library('datatables');"; 194 | // } 195 | 196 | // $string .= " 197 | // }"; 198 | 199 | // if ($jenis_tabel == 'reguler_table') { 200 | 201 | // $string .= "\n\n public function index() 202 | // { 203 | // \$q = urldecode(\$this->input->get('q', TRUE)); 204 | // \$start = intval(\$this->input->get('start')); 205 | 206 | // if (\$q <> '') { 207 | // \$config['base_url'] = base_url() . '$c_url/index.html?q=' . urlencode(\$q); 208 | // \$config['first_url'] = base_url() . '$c_url/index.html?q=' . urlencode(\$q); 209 | // } else { 210 | // \$config['base_url'] = base_url() . '$c_url/index.html'; 211 | // \$config['first_url'] = base_url() . '$c_url/index.html'; 212 | // } 213 | 214 | // \$config['per_page'] = 10; 215 | // \$config['page_query_string'] = TRUE; 216 | // \$config['total_rows'] = \$this->" . $m . "->total_rows(\$q); 217 | // \$$c_url = \$this->" . $m . "->get_limit_data(\$config['per_page'], \$start, \$q); 218 | 219 | // \$this->load->library('pagination'); 220 | // \$this->pagination->initialize(\$config); 221 | 222 | // \$data = array( 223 | // '" . $c_url . "_data' => \$$c_url, 224 | // 'q' => \$q, 225 | // 'pagination' => \$this->pagination->create_links(), 226 | // 'total_rows' => \$config['total_rows'], 227 | // 'start' => \$start, 228 | // ); 229 | // \$this->load->view('$c_url/$v_list', \$data); 230 | // }"; 231 | 232 | // } else { 233 | 234 | // $string .="\n\n public function index() 235 | // { 236 | // \$this->load->view('$c_url/$v_list'); 237 | // } 238 | 239 | // public function json() { 240 | // header('Content-Type: application/json'); 241 | // echo \$this->" . $m . "->json(); 242 | // }"; 243 | 244 | // } 245 | 246 | // $string .= "\n\n public function read(\$id) 247 | // { 248 | // \$row = \$this->" . $m . "->get_by_id(\$id); 249 | // if (\$row) { 250 | // \$data = array("; 251 | // foreach ($all as $row) { 252 | // if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 253 | // { 254 | // $string .= "\n\t\t'" . $row['column_name'] . "' => \$row->" . $row['column_name'] . ","; 255 | // } 256 | // if(isset($_POST['generateall'])) //meedun code 257 | // { 258 | // $string .= "\n\t\t'" . $row['column_name'] . "' => \$row->" . $row['column_name'] . ","; 259 | // } 260 | // } 261 | // $string .= "\n\t ); 262 | // \$this->load->view('$c_url/$v_read', \$data); 263 | // } else { 264 | // \$this->session->set_flashdata('message', 'Record Not Found'); 265 | // redirect(site_url('$c_url')); 266 | // } 267 | // } 268 | 269 | // public function create() 270 | // { 271 | // \$data = array( 272 | // 'button' => 'Create', 273 | // 'action' => site_url('$c_url/create_action'),"; 274 | // foreach ($all as $row) { 275 | // if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 276 | // { 277 | // $string .= "\n\t '" . $row['column_name'] . "' => set_value('" . $row['column_name'] . "'),"; 278 | // } 279 | // if(isset($_POST['generateall'])) //meedun code 280 | // { 281 | // $string .= "\n\t '" . $row['column_name'] . "' => set_value('" . $row['column_name'] . "'),"; 282 | // } 283 | // } 284 | // $string .= "\n\t); 285 | // \$this->load->view('$c_url/$v_form', \$data); 286 | // } 287 | 288 | // public function create_action() 289 | // { 290 | // \$this->_rules(); 291 | 292 | // if (\$this->form_validation->run() == FALSE) { 293 | // \$this->create(); 294 | // } else { 295 | // \$data = array("; 296 | // foreach ($non_pk as $row) { 297 | // if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 298 | // { 299 | // $string .= "\n\t\t'" . $row['column_name'] . "' => \$this->input->post('" . $row['column_name'] . "',TRUE),"; 300 | // } 301 | // if(isset($_POST['generateall'])) //meedun code 302 | // { 303 | // $string .= "\n\t\t'" . $row['column_name'] . "' => \$this->input->post('" . $row['column_name'] . "',TRUE),"; 304 | // } 305 | // } 306 | // $string .= "\n\t ); 307 | 308 | // \$this->".$m."->insert(\$data); 309 | // \$this->session->set_flashdata('message', 'Create Record Success'); 310 | // redirect(site_url('$c_url')); 311 | // } 312 | // } 313 | 314 | // public function update(\$id) 315 | // { 316 | // \$row = \$this->".$m."->get_by_id(\$id); 317 | 318 | // if (\$row) { 319 | // \$data = array( 320 | // 'button' => 'Update', 321 | // 'action' => site_url('$c_url/update_action'),"; 322 | // foreach ($all as $row) { 323 | // if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 324 | // { 325 | // $string .= "\n\t\t'" . $row['column_name'] . "' => set_value('" . $row['column_name'] . "', \$row->". $row['column_name']."),"; 326 | // } 327 | // if(isset($_POST['generateall'])) //meedun code 328 | // { 329 | // $string .= "\n\t\t'" . $row['column_name'] . "' => set_value('" . $row['column_name'] . "', \$row->". $row['column_name']."),"; 330 | // } 331 | // } 332 | // $string .= "\n\t ); 333 | // \$this->load->view('$c_url/$v_form', \$data); 334 | // } else { 335 | // \$this->session->set_flashdata('message', 'Record Not Found'); 336 | // redirect(site_url('$c_url')); 337 | // } 338 | // } 339 | 340 | // public function update_action() 341 | // { 342 | // \$this->_rules(); 343 | 344 | // if (\$this->form_validation->run() == FALSE) { 345 | // \$this->update(\$this->input->post('$pk', TRUE)); 346 | // } else { 347 | // \$data = array("; 348 | // foreach ($non_pk as $row) { 349 | // if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 350 | // { 351 | // $string .= "\n\t\t'" . $row['column_name'] . "' => \$this->input->post('" . $row['column_name'] . "',TRUE),"; 352 | // } 353 | // if(isset($_POST['generateall'])) //meedun code 354 | // { 355 | // $string .= "\n\t\t'" . $row['column_name'] . "' => \$this->input->post('" . $row['column_name'] . "',TRUE),"; 356 | // } 357 | // } 358 | // $string .= "\n\t ); 359 | 360 | // \$this->".$m."->update(\$this->input->post('$pk', TRUE), \$data); 361 | // \$this->session->set_flashdata('message', 'Update Record Success'); 362 | // redirect(site_url('$c_url')); 363 | // } 364 | // } 365 | 366 | // public function delete(\$id) 367 | // { 368 | // \$row = \$this->".$m."->get_by_id(\$id); 369 | 370 | // if (\$row) { 371 | // \$this->".$m."->delete(\$id); 372 | // \$this->session->set_flashdata('message', 'Delete Record Success'); 373 | // redirect(site_url('$c_url')); 374 | // } else { 375 | // \$this->session->set_flashdata('message', 'Record Not Found'); 376 | // redirect(site_url('$c_url')); 377 | // } 378 | // } 379 | 380 | // public function _rules() 381 | // {"; 382 | // foreach ($non_pk as $row) { 383 | // if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 384 | // { 385 | // $int = $row['data_type'] == 'int' || $row['data_type'] == 'double' || $row['data_type'] == 'decimal' ? '|numeric' : ''; 386 | // $string .= "\n\t\$this->form_validation->set_rules('".$row['column_name']."', '". strtolower(label($row['column_name']))."', 'trim|required$int');"; 387 | // } 388 | // if(isset($_POST['generateall'])) //meedun code 389 | // { 390 | // $int = $row['data_type'] == 'int' || $row['data_type'] == 'double' || $row['data_type'] == 'decimal' ? '|numeric' : ''; 391 | // $string .= "\n\t\$this->form_validation->set_rules('".$row['column_name']."', '". strtolower(label($row['column_name']))."', 'trim|required$int');"; 392 | // } 393 | // } 394 | // $string .= "\n\n\t\$this->form_validation->set_rules('$pk', '$pk', 'trim');"; 395 | // $string .= "\n\t\$this->form_validation->set_error_delimiters('', ''); 396 | // }"; 397 | 398 | // if ($export_excel == '1') { 399 | // $string .= "\n\n public function excel() 400 | // { 401 | // \$this->load->helper('exportexcel'); 402 | // \$namaFile = \"$table_name.xls\"; 403 | // \$judul = \"$table_name\"; 404 | // \$tablehead = 0; 405 | // \$tablebody = 1; 406 | // \$nourut = 1; 407 | // //penulisan header 408 | // header(\"Pragma: public\"); 409 | // header(\"Expires: 0\"); 410 | // header(\"Cache-Control: must-revalidate, post-check=0,pre-check=0\"); 411 | // header(\"Content-Type: application/force-download\"); 412 | // header(\"Content-Type: application/octet-stream\"); 413 | // header(\"Content-Type: application/download\"); 414 | // header(\"Content-Disposition: attachment;filename=\" . \$namaFile . \"\"); 415 | // header(\"Content-Transfer-Encoding: binary \"); 416 | 417 | // xlsBOF(); 418 | 419 | // \$kolomhead = 0; 420 | // xlsWriteLabel(\$tablehead, \$kolomhead++, \"No\");"; 421 | // foreach ($non_pk as $row) { 422 | // if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 423 | // { 424 | // $column_name = label($row['column_name']); 425 | // $string .= "\n\txlsWriteLabel(\$tablehead, \$kolomhead++, \"$column_name\");"; 426 | // } 427 | // if(isset($_POST['generateall'])) //meedun code 428 | // { 429 | // $column_name = label($row['column_name']); 430 | // $string .= "\n\txlsWriteLabel(\$tablehead, \$kolomhead++, \"$column_name\");"; 431 | // } 432 | // } 433 | // $string .= "\n\n\tforeach (\$this->" . $m . "->get_all() as \$data) { 434 | // \$kolombody = 0; 435 | 436 | // //ubah xlsWriteLabel menjadi xlsWriteNumber untuk kolom numeric 437 | // xlsWriteNumber(\$tablebody, \$kolombody++, \$nourut);"; 438 | // foreach ($non_pk as $row) { 439 | // if(isset($_POST['field_'.$row['column_name']]) && isset($_POST['generate'])) //meedun code selected filed 440 | // { 441 | // $column_name = $row['column_name']; 442 | // $xlsWrite = $row['data_type'] == 'int' || $row['data_type'] == 'double' || $row['data_type'] == 'decimal' ? 'xlsWriteNumber' : 'xlsWriteLabel'; 443 | // $string .= "\n\t " . $xlsWrite . "(\$tablebody, \$kolombody++, \$data->$column_name);"; 444 | // } 445 | // if(isset($_POST['generateall'])) //meedun code 446 | // { 447 | // $column_name = $row['column_name']; 448 | // $xlsWrite = $row['data_type'] == 'int' || $row['data_type'] == 'double' || $row['data_type'] == 'decimal' ? 'xlsWriteNumber' : 'xlsWriteLabel'; 449 | // $string .= "\n\t " . $xlsWrite . "(\$tablebody, \$kolombody++, \$data->$column_name);"; 450 | // } 451 | // } 452 | // $string .= "\n\n\t \$tablebody++; 453 | // \$nourut++; 454 | // } 455 | 456 | // xlsEOF(); 457 | // exit(); 458 | // }"; 459 | // } 460 | 461 | // if ($export_word == '1') { 462 | // $string .= "\n\n public function word() 463 | // { 464 | // header(\"Content-type: application/vnd.ms-word\"); 465 | // header(\"Content-Disposition: attachment;Filename=$table_name.doc\"); 466 | 467 | // \$data = array( 468 | // '" . $table_name . "_data' => \$this->" . $m . "->get_all(), 469 | // 'start' => 0 470 | // ); 471 | 472 | // \$this->load->view('" . $c_url ."/". $v_doc . "',\$data); 473 | // }"; 474 | // } 475 | 476 | // if ($export_pdf == '1') { 477 | // $string .= "\n\n function pdf() 478 | // { 479 | // \$data = array( 480 | // '" . $table_name . "_data' => \$this->" . $m . "->get_all(), 481 | // 'start' => 0 482 | // ); 483 | 484 | // ini_set('memory_limit', '32M'); 485 | // \$html = \$this->load->view('" . $c_url ."/". $v_pdf . "', \$data, true); 486 | // \$this->load->library('pdf'); 487 | // \$pdf = \$this->pdf->load(); 488 | // \$pdf->WriteHTML(\$html); 489 | // \$pdf->Output('" . $table_name . ".pdf', 'D'); 490 | // }"; 491 | // } 492 | 493 | $string .= "\n\n}\n\n/* End of file $c_file */ 494 | /* Location: ./app/controllers/$c_file */ 495 | /* Please DO NOT modify this information : */ 496 | /* Generated by Ligatcode Codeigniter 4 CRUD Generator ".date('Y-m-d H:i:s')." */"; 497 | 498 | $result_controller = createFile($string, $target . "controllers/" . $c_file); 499 | 500 | ?> -------------------------------------------------------------------------------- /ligatcode/core/create_libraries_datatables.php: -------------------------------------------------------------------------------- 1 | 14 | * @author Vincent Bambico 15 | * Yusuf Ozdemir 16 | * @link http://ellislab.com/forums/viewthread/160896/ 17 | */ 18 | class Datatables 19 | { 20 | /** 21 | * Global container variables for chained argument results 22 | * 23 | */ 24 | private \$ci; 25 | private \$table; 26 | private \$distinct; 27 | private \$group_by = array(); 28 | private \$select = array(); 29 | private \$joins = array(); 30 | private \$columns = array(); 31 | private \$where = array(); 32 | private \$or_where = array(); 33 | private \$where_in = array(); 34 | private \$like = array(); 35 | private \$or_like = array(); 36 | private \$filter = array(); 37 | private \$add_columns = array(); 38 | private \$edit_columns = array(); 39 | private \$unset_columns = array(); 40 | /** 41 | * Copies an instance of CI 42 | */ 43 | public function __construct() 44 | { 45 | \$this->ci =& get_instance(); 46 | } 47 | /** 48 | * If you establish multiple databases in config/database.php this will allow you to 49 | * set the database (other than \$active_group) - more info: http://ellislab.com/forums/viewthread/145901/#712942 50 | */ 51 | public function set_database(\$db_name) 52 | { 53 | \$db_data = \$this->ci->load->database(\$db_name, TRUE); 54 | \$this->ci->db = \$db_data; 55 | } 56 | /** 57 | * Generates the SELECT portion of the query 58 | * 59 | * @param string \$columns 60 | * @param bool \$backtick_protect 61 | * @return mixed 62 | */ 63 | public function select(\$columns, \$backtick_protect = TRUE) 64 | { 65 | foreach(\$this->explode(',', \$columns) as \$val) 66 | { 67 | \$column = trim(preg_replace('/(.*)\s+as\s+(\w*)/i', '\$2', \$val)); 68 | \$column = preg_replace('/.*\.(.*)/i', '\$1', \$column); // get name after `.` 69 | \$this->columns[] = \$column; 70 | \$this->select[\$column] = trim(preg_replace('/(.*)\s+as\s+(\w*)/i', '\$1', \$val)); 71 | } 72 | \$this->ci->db->select(\$columns, \$backtick_protect); 73 | return \$this; 74 | } 75 | /** 76 | * Generates the DISTINCT portion of the query 77 | * 78 | * @param string \$column 79 | * @return mixed 80 | */ 81 | public function distinct(\$column) 82 | { 83 | \$this->distinct = \$column; 84 | \$this->ci->db->distinct(\$column); 85 | return \$this; 86 | } 87 | /** 88 | * Generates a custom GROUP BY portion of the query 89 | * 90 | * @param string \$val 91 | * @return mixed 92 | */ 93 | public function group_by(\$val) 94 | { 95 | \$this->group_by[] = \$val; 96 | \$this->ci->db->group_by(\$val); 97 | return \$this; 98 | } 99 | /** 100 | * Generates the FROM portion of the query 101 | * 102 | * @param string \$table 103 | * @return mixed 104 | */ 105 | public function from(\$table) 106 | { 107 | \$this->table = \$table; 108 | return \$this; 109 | } 110 | /** 111 | * Generates the JOIN portion of the query 112 | * 113 | * @param string \$table 114 | * @param string \$fk 115 | * @param string \$type 116 | * @return mixed 117 | */ 118 | public function join(\$table, \$fk, \$type = NULL) 119 | { 120 | \$this->joins[] = array(\$table, \$fk, \$type); 121 | \$this->ci->db->join(\$table, \$fk, \$type); 122 | return \$this; 123 | } 124 | /** 125 | * Generates the WHERE portion of the query 126 | * 127 | * @param mixed \$key_condition 128 | * @param string \$val 129 | * @param bool \$backtick_protect 130 | * @return mixed 131 | */ 132 | public function where(\$key_condition, \$val = NULL, \$backtick_protect = TRUE) 133 | { 134 | \$this->where[] = array(\$key_condition, \$val, \$backtick_protect); 135 | \$this->ci->db->where(\$key_condition, \$val, \$backtick_protect); 136 | return \$this; 137 | } 138 | /** 139 | * Generates the WHERE portion of the query 140 | * 141 | * @param mixed \$key_condition 142 | * @param string \$val 143 | * @param bool \$backtick_protect 144 | * @return mixed 145 | */ 146 | public function or_where(\$key_condition, \$val = NULL, \$backtick_protect = TRUE) 147 | { 148 | \$this->or_where[] = array(\$key_condition, \$val, \$backtick_protect); 149 | \$this->ci->db->or_where(\$key_condition, \$val, \$backtick_protect); 150 | return \$this; 151 | } 152 | 153 | /** 154 | * Generates the WHERE IN portion of the query 155 | * 156 | * @param mixed \$key_condition 157 | * @param string \$val 158 | * @param bool \$backtick_protect 159 | * @return mixed 160 | */ 161 | public function where_in(\$key_condition, \$val = NULL) 162 | { 163 | \$this->where_in[] = array(\$key_condition, \$val); 164 | \$this->ci->db->where_in(\$key_condition, \$val); 165 | return \$this; 166 | } 167 | /** 168 | * Generates the WHERE portion of the query 169 | * 170 | * @param mixed \$key_condition 171 | * @param string \$val 172 | * @param bool \$backtick_protect 173 | * @return mixed 174 | */ 175 | public function filter(\$key_condition, \$val = NULL, \$backtick_protect = TRUE) 176 | { 177 | \$this->filter[] = array(\$key_condition, \$val, \$backtick_protect); 178 | return \$this; 179 | } 180 | /** 181 | * Generates a %LIKE% portion of the query 182 | * 183 | * @param mixed \$key_condition 184 | * @param string \$val 185 | * @param bool \$backtick_protect 186 | * @return mixed 187 | */ 188 | public function like(\$key_condition, \$val = NULL, \$side = 'both') 189 | { 190 | \$this->like[] = array(\$key_condition, \$val, \$side); 191 | \$this->ci->db->like(\$key_condition, \$val, \$side); 192 | return \$this; 193 | } 194 | /** 195 | * Generates the OR %LIKE% portion of the query 196 | * 197 | * @param mixed \$key_condition 198 | * @param string \$val 199 | * @param bool \$backtick_protect 200 | * @return mixed 201 | */ 202 | public function or_like(\$key_condition, \$val = NULL, \$side = 'both') 203 | { 204 | \$this->or_like[] = array(\$key_condition, \$val, \$side); 205 | \$this->ci->db->or_like(\$key_condition, \$val, \$side); 206 | return \$this; 207 | } 208 | /** 209 | * Sets additional column variables for adding custom columns 210 | * 211 | * @param string \$column 212 | * @param string \$content 213 | * @param string \$match_replacement 214 | * @return mixed 215 | */ 216 | public function add_column(\$column, \$content, \$match_replacement = NULL) 217 | { 218 | \$this->add_columns[\$column] = array('content' => \$content, 'replacement' => \$this->explode(',', \$match_replacement)); 219 | return \$this; 220 | } 221 | /** 222 | * Sets additional column variables for editing columns 223 | * 224 | * @param string \$column 225 | * @param string \$content 226 | * @param string \$match_replacement 227 | * @return mixed 228 | */ 229 | public function edit_column(\$column, \$content, \$match_replacement) 230 | { 231 | \$this->edit_columns[\$column][] = array('content' => \$content, 'replacement' => \$this->explode(',', \$match_replacement)); 232 | return \$this; 233 | } 234 | /** 235 | * Unset column 236 | * 237 | * @param string \$column 238 | * @return mixed 239 | */ 240 | public function unset_column(\$column) 241 | { 242 | \$column=explode(',',\$column); 243 | \$this->unset_columns=array_merge(\$this->unset_columns,\$column); 244 | return \$this; 245 | } 246 | /** 247 | * Builds all the necessary query segments and performs the main query based on results set from chained statements 248 | * 249 | * @param string \$output 250 | * @param string \$charset 251 | * @return string 252 | */ 253 | public function generate(\$output = 'json', \$charset = 'UTF-8') 254 | { 255 | if(strtolower(\$output) == 'json') 256 | \$this->get_paging(); 257 | \$this->get_ordering(); 258 | \$this->get_filtering(); 259 | return \$this->produce_output(strtolower(\$output), strtolower(\$charset)); 260 | } 261 | /** 262 | * Generates the LIMIT portion of the query 263 | * 264 | * @return mixed 265 | */ 266 | private function get_paging() 267 | { 268 | \$iStart = \$this->ci->input->post('start'); 269 | \$iLength = \$this->ci->input->post('length'); 270 | if(\$iLength != '' && \$iLength != '-1') 271 | \$this->ci->db->limit(\$iLength, (\$iStart)? \$iStart : 0); 272 | } 273 | /** 274 | * Generates the ORDER BY portion of the query 275 | * 276 | * @return mixed 277 | */ 278 | private function get_ordering() 279 | { 280 | \$Data = \$this->ci->input->post('columns'); 281 | if (\$this->ci->input->post('order')) 282 | foreach (\$this->ci->input->post('order') as \$key) 283 | if(\$this->check_cType()) 284 | \$this->ci->db->order_by(\$Data[\$key['column']]['data'], \$key['dir']); 285 | else 286 | \$this->ci->db->order_by(\$this->columns[\$key['column']] , \$key['dir']); 287 | } 288 | /** 289 | * Generates a %LIKE% portion of the query 290 | * 291 | * @return mixed 292 | */ 293 | private function get_filtering() 294 | { 295 | \$mColArray = \$this->ci->input->post('columns'); 296 | \$sWhere = ''; 297 | \$search = \$this->ci->input->post('search'); 298 | \$sSearch = \$this->ci->db->escape_like_str(trim(\$search['value'])); 299 | \$columns = array_values(array_diff(\$this->columns, \$this->unset_columns)); 300 | if(\$sSearch != '') 301 | for(\$i = 0; \$i < count(\$mColArray); \$i++) 302 | if (\$mColArray[\$i]['searchable'] == 'true' && !array_key_exists(\$mColArray[\$i]['data'], \$this->add_columns)) 303 | if(\$this->check_cType()) 304 | \$sWhere .= \$this->select[\$mColArray[\$i]['data']] . \" LIKE '%\" . \$sSearch . \"%' OR \"; 305 | else 306 | \$sWhere .= \$this->select[\$this->columns[\$i]] . \" LIKE '%\" . \$sSearch . \"%' OR \"; 307 | \$sWhere = substr_replace(\$sWhere, '', -3); 308 | if(\$sWhere != '') 309 | \$this->ci->db->where('(' . \$sWhere . ')'); 310 | // TODO : sRangeSeparator 311 | foreach(\$this->filter as \$val) 312 | \$this->ci->db->where(\$val[0], \$val[1], \$val[2]); 313 | } 314 | /** 315 | * Compiles the select statement based on the other functions called and runs the query 316 | * 317 | * @return mixed 318 | */ 319 | private function get_display_result() 320 | { 321 | return \$this->ci->db->get(\$this->table); 322 | } 323 | /** 324 | * Builds an encoded string data. Returns JSON by default, and an array of aaData if output is set to raw. 325 | * 326 | * @param string \$output 327 | * @param string \$charset 328 | * @return mixed 329 | */ 330 | private function produce_output(\$output, \$charset) 331 | { 332 | \$aaData = array(); 333 | \$rResult = \$this->get_display_result(); 334 | if(\$output == 'json') 335 | { 336 | \$iTotal = \$this->get_total_results(); 337 | \$iFilteredTotal = \$this->get_total_results(TRUE); 338 | } 339 | foreach(\$rResult->result_array() as \$row_key => \$row_val) 340 | { 341 | \$aaData[\$row_key] = (\$this->check_cType())? \$row_val : array_values(\$row_val); 342 | foreach(\$this->add_columns as \$field => \$val) 343 | if(\$this->check_cType()) 344 | \$aaData[\$row_key][\$field] = \$this->exec_replace(\$val, \$aaData[\$row_key]); 345 | else 346 | \$aaData[\$row_key][] = \$this->exec_replace(\$val, \$aaData[\$row_key]); 347 | foreach(\$this->edit_columns as \$modkey => \$modval) 348 | foreach(\$modval as \$val) 349 | \$aaData[\$row_key][(\$this->check_cType())? \$modkey : array_search(\$modkey, \$this->columns)] = \$this->exec_replace(\$val, \$aaData[\$row_key]); 350 | \$aaData[\$row_key] = array_diff_key(\$aaData[\$row_key], (\$this->check_cType())? \$this->unset_columns : array_intersect(\$this->columns, \$this->unset_columns)); 351 | if(!\$this->check_cType()) 352 | \$aaData[\$row_key] = array_values(\$aaData[\$row_key]); 353 | } 354 | if(\$output == 'json') 355 | { 356 | \$sOutput = array 357 | ( 358 | 'draw' => intval(\$this->ci->input->post('draw')), 359 | 'recordsTotal' => \$iTotal, 360 | 'recordsFiltered' => \$iFilteredTotal, 361 | 'data' => \$aaData 362 | ); 363 | if(\$charset == 'utf-8') 364 | return json_encode(\$sOutput); 365 | else 366 | return \$this->jsonify(\$sOutput); 367 | } 368 | else 369 | return array('aaData' => \$aaData); 370 | } 371 | /** 372 | * Get result count 373 | * 374 | * @return integer 375 | */ 376 | private function get_total_results(\$filtering = FALSE) 377 | { 378 | if(\$filtering) 379 | \$this->get_filtering(); 380 | foreach(\$this->joins as \$val) 381 | \$this->ci->db->join(\$val[0], \$val[1], \$val[2]); 382 | foreach(\$this->where as \$val) 383 | \$this->ci->db->where(\$val[0], \$val[1], \$val[2]); 384 | foreach(\$this->or_where as \$val) 385 | \$this->ci->db->or_where(\$val[0], \$val[1], \$val[2]); 386 | 387 | foreach(\$this->where_in as \$val) 388 | \$this->ci->db->where_in(\$val[0], \$val[1]); 389 | foreach(\$this->group_by as \$val) 390 | \$this->ci->db->group_by(\$val); 391 | foreach(\$this->like as \$val) 392 | \$this->ci->db->like(\$val[0], \$val[1], \$val[2]); 393 | foreach(\$this->or_like as \$val) 394 | \$this->ci->db->or_like(\$val[0], \$val[1], \$val[2]); 395 | if(strlen(\$this->distinct) > 0) 396 | { 397 | \$this->ci->db->distinct(\$this->distinct); 398 | \$this->ci->db->select(\$this->columns); 399 | } 400 | \$query = \$this->ci->db->get(\$this->table, NULL, NULL, FALSE); 401 | return \$query->num_rows(); 402 | } 403 | /** 404 | * Runs callback functions and makes replacements 405 | * 406 | * @param mixed \$custom_val 407 | * @param mixed \$row_data 408 | * @return string \$custom_val['content'] 409 | */ 410 | private function exec_replace(\$custom_val, \$row_data) 411 | { 412 | \$replace_string = ''; 413 | 414 | // Go through our array backwards, else \$1 (foo) will replace \$11, \$12 etc with foo1, foo2 etc 415 | \$custom_val['replacement'] = array_reverse(\$custom_val['replacement'], true); 416 | if(isset(\$custom_val['replacement']) && is_array(\$custom_val['replacement'])) 417 | { 418 | //Added this line because when the replacement has over 10 elements replaced the variable \"\$1\" first by the \"\$10\" 419 | \$custom_val['replacement'] = array_reverse(\$custom_val['replacement'], true); 420 | foreach(\$custom_val['replacement'] as \$key => \$val) 421 | { 422 | \$sval = preg_replace(\"/(? \$args_val) 428 | { 429 | \$args_val = preg_replace(\"/(?columns))? (\$row_data[(\$this->check_cType())? \$args_val : array_search(\$args_val, \$this->columns)]) : \$args_val; 431 | } 432 | \$replace_string = call_user_func_array(\$func, \$args); 433 | } 434 | elseif(in_array(\$sval, \$this->columns)) 435 | \$replace_string = \$row_data[(\$this->check_cType())? \$sval : array_search(\$sval, \$this->columns)]; 436 | else 437 | \$replace_string = \$sval; 438 | \$custom_val['content'] = str_ireplace('\$' . (\$key + 1), \$replace_string, \$custom_val['content']); 439 | } 440 | } 441 | return \$custom_val['content']; 442 | } 443 | /** 444 | * Check column type -numeric or column name 445 | * 446 | * @return bool 447 | */ 448 | private function check_cType() 449 | { 450 | \$column = \$this->ci->input->post('columns'); 451 | if(is_numeric(\$column[0]['data'])) 452 | return FALSE; 453 | else 454 | return TRUE; 455 | } 456 | /** 457 | * Return the difference of open and close characters 458 | * 459 | * @param string \$str 460 | * @param string \$open 461 | * @param string \$close 462 | * @return string \$retval 463 | */ 464 | private function balanceChars(\$str, \$open, \$close) 465 | { 466 | \$openCount = substr_count(\$str, \$open); 467 | \$closeCount = substr_count(\$str, \$close); 468 | \$retval = \$openCount - \$closeCount; 469 | return \$retval; 470 | } 471 | /** 472 | * Explode, but ignore delimiter until closing characters are found 473 | * 474 | * @param string \$delimiter 475 | * @param string \$str 476 | * @param string \$open 477 | * @param string \$close 478 | * @return mixed \$retval 479 | */ 480 | private function explode(\$delimiter, \$str, \$open = '(', \$close=')') 481 | { 482 | \$retval = array(); 483 | \$hold = array(); 484 | \$balance = 0; 485 | \$parts = explode(\$delimiter, \$str); 486 | foreach(\$parts as \$part) 487 | { 488 | \$hold[] = \$part; 489 | \$balance += \$this->balanceChars(\$part, \$open, \$close); 490 | if(\$balance < 1) 491 | { 492 | \$retval[] = implode(\$delimiter, \$hold); 493 | \$hold = array(); 494 | \$balance = 0; 495 | } 496 | } 497 | if(count(\$hold) > 0) 498 | \$retval[] = implode(\$delimiter, \$hold); 499 | return \$retval; 500 | } 501 | /** 502 | * Workaround for json_encode's UTF-8 encoding if a different charset needs to be used 503 | * 504 | * @param mixed \$result 505 | * @return string 506 | */ 507 | private function jsonify(\$result = FALSE) 508 | { 509 | if(is_null(\$result)) 510 | return 'null'; 511 | if(\$result === FALSE) 512 | return 'false'; 513 | if(\$result === TRUE) 514 | return 'true'; 515 | if(is_scalar(\$result)) 516 | { 517 | if(is_float(\$result)) 518 | return floatval(str_replace(',', '.', strval(\$result))); 519 | if(is_string(\$result)) 520 | { 521 | static \$jsonReplaces = array(array('\\', \'/', '\n', '\t', '\r', '\b', '\f', '\"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"')); 522 | return '\"' . str_replace(\$jsonReplaces[0], \$jsonReplaces[1], \$result) . '\"'; 523 | } 524 | else 525 | return \$result; 526 | } 527 | \$isList = TRUE; 528 | for(\$i = 0, reset(\$result); \$i < count(\$result); \$i++, next(\$result)) 529 | { 530 | if(key(\$result) !== \$i) 531 | { 532 | \$isList = FALSE; 533 | break; 534 | } 535 | } 536 | \$json = array(); 537 | if(\$isList) 538 | { 539 | foreach(\$result as \$value) 540 | \$json[] = \$this->jsonify(\$value); 541 | return '[' . join(',', \$json) . ']'; 542 | } 543 | else 544 | { 545 | foreach(\$result as \$key => \$value) 546 | \$json[] = \$this->jsonify(\$key) . ':' . \$this->jsonify(\$value); 547 | return '{' . join(',', \$json) . '}'; 548 | } 549 | } 550 | 551 | /** 552 | * returns the sql statement of the last query run 553 | * @return type 554 | */ 555 | public function last_query() 556 | { 557 | return \$this->ci->db->last_query(); 558 | } 559 | } 560 | /* End of file Datatables.php */ 561 | /* Location: ./application/libraries/Datatables.php */ 562 | /* Please DO NOT modify this information : */ 563 | /* Generated by Harviacode Codeigniter CRUD Generator ".date('Y-m-d H:i:s')." */ 564 | /* http://harviacode.com */"; 565 | 566 | 567 | 568 | $result_config_pagination = createFile($string, $target."libraries/Datatables.php"); 569 | 570 | ?> -------------------------------------------------------------------------------- /assets/bootstrap/css/bootstrap-theme.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.4.1 (https://getbootstrap.com/) 3 | * Copyright 2011-2019 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */.btn-danger,.btn-default,.btn-info,.btn-primary,.btn-success,.btn-warning{text-shadow:0 -1px 0 rgba(0,0,0,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075)}.btn-danger.active,.btn-danger:active,.btn-default.active,.btn-default:active,.btn-info.active,.btn-info:active,.btn-primary.active,.btn-primary:active,.btn-success.active,.btn-success:active,.btn-warning.active,.btn-warning:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-danger.disabled,.btn-danger[disabled],.btn-default.disabled,.btn-default[disabled],.btn-info.disabled,.btn-info[disabled],.btn-primary.disabled,.btn-primary[disabled],.btn-success.disabled,.btn-success[disabled],.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-danger,fieldset[disabled] .btn-default,fieldset[disabled] .btn-info,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-success,fieldset[disabled] .btn-warning{-webkit-box-shadow:none;box-shadow:none}.btn-danger .badge,.btn-default .badge,.btn-info .badge,.btn-primary .badge,.btn-success .badge,.btn-warning .badge{text-shadow:none}.btn.active,.btn:active{background-image:none}.btn-default{background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-o-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#e0e0e0));background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#dbdbdb;text-shadow:0 1px 0 #fff;border-color:#ccc}.btn-default:focus,.btn-default:hover{background-color:#e0e0e0;background-position:0 -15px}.btn-default.active,.btn-default:active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-default.disabled,.btn-default.disabled.active,.btn-default.disabled.focus,.btn-default.disabled:active,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled],.btn-default[disabled].active,.btn-default[disabled].focus,.btn-default[disabled]:active,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default,fieldset[disabled] .btn-default.active,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:active,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#e0e0e0;background-image:none}.btn-primary{background-image:-webkit-linear-gradient(top,#337ab7 0,#265a88 100%);background-image:-o-linear-gradient(top,#337ab7 0,#265a88 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#265a88));background-image:linear-gradient(to bottom,#337ab7 0,#265a88 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#245580}.btn-primary:focus,.btn-primary:hover{background-color:#265a88;background-position:0 -15px}.btn-primary.active,.btn-primary:active{background-color:#265a88;border-color:#245580}.btn-primary.disabled,.btn-primary.disabled.active,.btn-primary.disabled.focus,.btn-primary.disabled:active,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled],.btn-primary[disabled].active,.btn-primary[disabled].focus,.btn-primary[disabled]:active,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-primary.active,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:active,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#265a88;background-image:none}.btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#419641));background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#3e8f3e}.btn-success:focus,.btn-success:hover{background-color:#419641;background-position:0 -15px}.btn-success.active,.btn-success:active{background-color:#419641;border-color:#3e8f3e}.btn-success.disabled,.btn-success.disabled.active,.btn-success.disabled.focus,.btn-success.disabled:active,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled],.btn-success[disabled].active,.btn-success[disabled].focus,.btn-success[disabled]:active,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success,fieldset[disabled] .btn-success.active,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:active,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#419641;background-image:none}.btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#2aabd2));background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#28a4c9}.btn-info:focus,.btn-info:hover{background-color:#2aabd2;background-position:0 -15px}.btn-info.active,.btn-info:active{background-color:#2aabd2;border-color:#28a4c9}.btn-info.disabled,.btn-info.disabled.active,.btn-info.disabled.focus,.btn-info.disabled:active,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled],.btn-info[disabled].active,.btn-info[disabled].focus,.btn-info[disabled]:active,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info,fieldset[disabled] .btn-info.active,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:active,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#2aabd2;background-image:none}.btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#eb9316));background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#e38d13}.btn-warning:focus,.btn-warning:hover{background-color:#eb9316;background-position:0 -15px}.btn-warning.active,.btn-warning:active{background-color:#eb9316;border-color:#e38d13}.btn-warning.disabled,.btn-warning.disabled.active,.btn-warning.disabled.focus,.btn-warning.disabled:active,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled],.btn-warning[disabled].active,.btn-warning[disabled].focus,.btn-warning[disabled]:active,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning,fieldset[disabled] .btn-warning.active,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:active,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#eb9316;background-image:none}.btn-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c12e2a));background-image:linear-gradient(to bottom,#d9534f 0,#c12e2a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#b92c28}.btn-danger:focus,.btn-danger:hover{background-color:#c12e2a;background-position:0 -15px}.btn-danger.active,.btn-danger:active{background-color:#c12e2a;border-color:#b92c28}.btn-danger.disabled,.btn-danger.disabled.active,.btn-danger.disabled.focus,.btn-danger.disabled:active,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled],.btn-danger[disabled].active,.btn-danger[disabled].focus,.btn-danger[disabled]:active,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger,fieldset[disabled] .btn-danger.active,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:active,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#c12e2a;background-image:none}.img-thumbnail,.thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x;background-color:#e8e8e8}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x;background-color:#2e6da4}.navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-o-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#f8f8f8));background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075)}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.open>a{background-image:-webkit-linear-gradient(top,#dbdbdb 0,#e2e2e2 100%);background-image:-o-linear-gradient(top,#dbdbdb 0,#e2e2e2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dbdbdb),to(#e2e2e2));background-image:linear-gradient(to bottom,#dbdbdb 0,#e2e2e2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.075);box-shadow:inset 0 3px 9px rgba(0,0,0,.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-o-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#3c3c3c),to(#222));background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);border-radius:4px}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.open>a{background-image:-webkit-linear-gradient(top,#080808 0,#0f0f0f 100%);background-image:-o-linear-gradient(top,#080808 0,#0f0f0f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#080808),to(#0f0f0f));background-image:linear-gradient(to bottom,#080808 0,#0f0f0f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.25);box-shadow:inset 0 3px 9px rgba(0,0,0,.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.navbar-fixed-bottom,.navbar-fixed-top,.navbar-static-top{border-radius:0}@media (max-width:767px){.navbar .navbar-nav .open .dropdown-menu>.active>a,.navbar .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}}.alert{text-shadow:0 1px 0 rgba(255,255,255,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05)}.alert-success{background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#c8e5bc));background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);background-repeat:repeat-x;border-color:#b2dba1}.alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#b9def0));background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);background-repeat:repeat-x;border-color:#9acfea}.alert-warning{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#f8efc0));background-image:linear-gradient(to bottom,#fcf8e3 0,#f8efc0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);background-repeat:repeat-x;border-color:#f5e79e}.alert-danger{background-image:-webkit-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-o-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#e7c3c3));background-image:linear-gradient(to bottom,#f2dede 0,#e7c3c3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);background-repeat:repeat-x;border-color:#dca7a7}.progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#ebebeb),to(#f5f5f5));background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x}.progress-bar{background-image:-webkit-linear-gradient(top,#337ab7 0,#286090 100%);background-image:-o-linear-gradient(top,#337ab7 0,#286090 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#286090));background-image:linear-gradient(to bottom,#337ab7 0,#286090 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0);background-repeat:repeat-x}.progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#449d44));background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);background-repeat:repeat-x}.progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#31b0d5));background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);background-repeat:repeat-x}.progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#ec971f));background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);background-repeat:repeat-x}.progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c9302c));background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);background-repeat:repeat-x}.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{text-shadow:0 -1px 0 #286090;background-image:-webkit-linear-gradient(top,#337ab7 0,#2b669a 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2b669a 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2b669a));background-image:linear-gradient(to bottom,#337ab7 0,#2b669a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);background-repeat:repeat-x;border-color:#2b669a}.list-group-item.active .badge,.list-group-item.active:focus .badge,.list-group-item.active:hover .badge{text-shadow:none}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#d0e9c6));background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);background-repeat:repeat-x}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#c4e3f3));background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);background-repeat:repeat-x}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#faf2cc));background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);background-repeat:repeat-x}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-o-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#ebcccc));background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);background-repeat:repeat-x}.well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#e8e8e8),to(#f5f5f5));background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x;border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)} 6 | /*# sourceMappingURL=bootstrap-theme.min.css.map */ -------------------------------------------------------------------------------- /ligatcode/index.php: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | LigatCode Codeigniter 4 CRUD Generator 12 | 13 | 50 | 51 | 52 | 53 |
      54 | 55 |
      56 |
      57 |
      58 |
      59 | 60 | 72 |
      73 |
      74 | 75 | 76 |
      77 | 78 |
      79 |
      80 | "; 86 | echo "List Filed Of Table " . $_POST['table_name'] . "
      Please select the fields to be displayed
      This feature only affects the Generator button,
      ignored in Generate All

      "; 87 | $table_all_field = isset($_POST['table_name']) ? $ligat->all_field($_POST['table_name']) : ''; 88 | //var_dump($table_all_field); 89 | //echo'Show All
      '; 90 | foreach ($table_all_field as $field) { 91 | $check = $_POST['field_' . $field['column_name']] == '1' ? "checked" : ''; 92 | if (isset($_POST['field_' . $field['column_name']])) { 93 | echo ' 94 |
      98 | '; 99 | } else { 100 | echo ' 101 |
      105 | '; 106 | } 107 | } 108 | echo '
      109 |

      Features added by Meedun

      110 |
      '; 111 | } 112 | ################################################################ 113 | # Meedun 2020 Agust 27 blog.simeedun.com 114 | ################################################################ 115 | ?> 116 | 117 |
      118 |
      119 |
      120 |
      121 |
      122 | 123 |
      124 |
      125 | 129 |
      130 |
      131 |
      132 |
      133 | 137 |
      138 |
      139 |
      140 |
      141 |
      142 |
      143 | Export Menu: (not yet supported) 144 |
      145 |
      146 |
      147 | 148 | 152 |
      153 |
      154 | 155 |
      156 |
      157 | 158 | 162 |
      163 |
      164 |
      165 | 181 | 182 |
      183 |
      184 | 185 | 186 |
      187 |
      188 | 189 | 190 |
      191 |
      192 |
      193 | 194 | 196 | Setting 197 |
      198 | 199 |
      200 |
      201 | 202 | 203 |
      204 | 205 | 0) : ?> 206 | File Results 207 |
      208 | ' . $h . '

      '; 211 | } 212 | ?> 213 |
      214 | 215 | 216 |

      Codeigniter 4 CRUD Generator 1.0 (only Codeigniter 4)

      217 |

      About : github: irev/ci4-ligatcode

      218 |

      219 | Codeigniter 4 CRUD Generator is a simple tool to automatically generate models, controllers and views from your tables. This tool is re-designed 220 | from the previous generator tool, Harviacode works for codeigniter 3. This tool will improve your writing code. This CRUD generator will perform 221 | complete CRUD operations, pagination, search, form *, form validation, export to excel, and export to word. This CRUD generator uses bootstrap 4 style. 222 | You will still need to change the result code for more customization. 223 |

      224 | * generate textarea and text input only 225 |
        226 |
      • 227 | Codeigniter 4 CRUD Generator Please visit and like blog.simeedun.com for more info and PHP tutorials. 228 |
      • 229 |
      • 230 | Codeigniter 3 CRUD Generator Please visit and like harviacode.com for more info and PHP tutorials. 231 |
      • 232 |
      233 |

      Preparation before using this Codeigniter 4 CRUD Generator (Important) :

      234 |
        235 |
      • On Controller app/Controller/BaseController.php, load database library, session library and url helper 236 |
          237 |
        • protected $helpers = ['html','text','form','session'];
        • 238 |
        239 |
      • 240 |
      • On file .env, set :. 241 |
          242 |
        • Find CTR+F DATABASE
        • 243 |
        • database.default.hostname = localhost
        • 244 |
        • database.default.database = database
        • 245 |
        • database.default.username = username
        • 246 |
        • database.default.password = password
        • 247 |
        • database.default.DBDriver = MySQLi
        • 248 |
        249 |
      • 250 |
      251 |

      Using this CRUD Generator :

      252 |
        253 |
      • Simply put 'Ligatcode' folder,view folder, 'asset' folder and .htaccess file into your project root folder.
      • 254 |
      • Open http://localhost/({yourprojectname}/ligatcode.
      • 255 |
      • Select table and push generate button.
      • 256 |
      257 |

      FAQ :

      258 |
        259 |
      • Select table show no data. Make sure you have correct database configuration on application/config/database.php and load database library on autoload.
      • 260 |
      • Error chmod on mac and linux. Please change your application folder and harviacode folder chmod to 777
      • 261 | 265 |
      • Error cannot Read, Update, Delete. Make sure your table have primary key.
      • 266 |
      267 |
      268 | 269 |

      Update Codeigniter 4 CRUD Generator

      270 | 271 |
        272 |
      • V.1.0 (meedun) - 30 August 2020 273 |
          274 |
        • Add the displayed database field selector 275 |
            276 |
          • construct (model, view and controller) for Codeigniter framework version 4.0.4
          • 277 |
          • Support custom page layout, built-in features of Codeigniter 4
          • 278 |
          • This feature only affects the Generator button, ignored in Generate All button
          • 279 |
          280 |
        • 281 |
        282 |
      • 283 | 284 |
      285 | 286 |

      © 2020- blog.simeedun.com

      287 | 288 |
      289 | 290 | 291 | 292 | 414 | 415 | 416 | --------------------------------------------------------------------------------