library untuk membuat form management database
library untuk membuat form CRUD (Create, Read, Update, Delete) untuk database yang biasanya digunakan untuk membuat admin panel dalam mengatur data dalam database. cara pemanggilan seperti biasa yaitu $form = _lib('pea', 'nama_table_db');
maka variable $form bisa digunakan untuk mengeksekusi pilihan di bawah:
$form = _lib('pea', 'table_name'); $form->initSearch(); $form->search->addInput('keyword','keyword'); $form->search->input->keyword->addSearchField('field_names_with_comma', isFullText); $add_sql = $form->search->action(); $keyword = $form->search->keyword(); echo $form->search->getForm();
$form = _lib('pea', 'table_name'); $form->initAdd(); $form->add->setLanguage(); $form->add->addInput('header','header'); $form->add->input->header->setTitle('Add Data'); $form->add->addInput('title','text'); $form->add->input->title->setTitle('Title'); $form->add->input->title->setLanguage(); $form->add->action(); echo $form->add->getForm();
$form = _lib('pea', 'table_name'); $form->initEdit(!empty($_GET['id']) ? 'WHERE id='.$_GET['id'] : ''); $form->edit->setLanguage(); $form->edit->addInput('header','header'); $form->edit->input->header->setTitle(!empty($_GET['id']) ? 'Edit Data' : 'Add Data'); $form->edit->addInput('title','text'); $form->edit->input->title->setTitle('Title'); $form->edit->input->title->setLanguage(); $form->edit->action(); echo $form->edit->getForm();
$form = _lib('pea', 'table_name'); $form->initRoll("WHERE 1 ORDER BY id DESC"); // ORDER BY wajib digunakan demi keamanan $form->roll->setLanguage(); $form->roll->setSaveTool(true); $form->roll->addInput('title','sqlplaintext'); $form->roll->input->title->setTitle('Title'); $form->roll->input->title->setLanguage(); $form->roll->action(); echo $form->roll->getForm();
File Path: includes/lib/pea/pea.php library untuk membuat form CRUD (Create, Read, Update, Delete) untuk database yang biasanya digunakan untuk membuat admin panel dalam mengatur data dalam database. cara pemanggilan seperti biasa yaitu
$form = _lib('pea', 'nama_table_db');
0 Comment
Post Your Comment