本文整理汇总了PHP中grocery_CRUD类的典型用法代码示例。如果您正苦于以下问题:PHP grocery_CRUD类的具体用法?PHP grocery_CRUD怎么用?PHP grocery_CRUD使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了grocery_CRUD类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_table('store')->columns('name', 'owner', 'address', 'zipcode', 'city', 'state', 'country', 'telp1', 'telp2', 'fax', 'npwp', 'note')->display_as('npwp', 'NPWP')->display_as('zipcode', 'Zip Code')->display_as('telp1', 'Telp 1')->display_as('telp2', 'Telp 2')->fields('name', 'owner', 'address', 'zipcode', 'city', 'state', 'country', 'telp1', 'telp2', 'fax', 'npwp', 'note')->required_fields('name', 'owner', 'address', 'zipcode', 'city', 'state', 'country', 'telp1')->unset_read()->unset_add()->unset_delete()->callback_field('note', array($this, 'setTextarea'));
$output = $crud->render();
$this->render($output);
}
示例2: index
public function index($nombre_tabla = null)
{
$this->is_login();
$id_grupo_usuario = (array) reset($this->ion_auth->get_users_groups($this->user->id)->result());
// donde 1 es admin, 2 es ministerio, 3 el coordinador, 4 digitador, 5 externo
if (in_array($id_grupo_usuario['id'], array(1, 2, 3, 4))) {
if (!empty($nombre_tabla)) {
// correr el procedimiento almacenado
$this->load->model('tabla_model');
$this->tabla_model->correr_procedimiento_almacenado($nombre_tabla);
try {
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid-inline-edit');
$crud->set_table($nombre_tabla);
// $crud->unset_edit();
$crud->unset_delete();
$output = $crud->render();
$this->_example_output($output);
} catch (Exception $e) {
echo "el nombre de tabla no es valida";
}
} else {
redirect('/', 'refresh');
}
} else {
redirect('/', 'refresh');
}
}
示例3: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_table('store')->columns('name', 'owner', 'address', 'zipcode', 'city', 'state', 'country', 'telp1', 'telp2', 'fax', 'npwp', 'note')->display_as('name', 'Nama Toko')->display_as('owner', 'Nama Pemilik')->display_as('address', 'Alamat')->display_as('zipcode', 'Kode Pos')->display_as('city', 'Kota')->display_as('state', 'Provinsi')->display_as('country', 'Negara')->display_as('npwp', 'NPWP')->display_as('note', 'Keterangan')->display_as('telp1', 'Telp 1')->display_as('telp2', 'Telp 2')->fields('name', 'owner', 'address', 'zipcode', 'city', 'state', 'country', 'telp1', 'telp2', 'fax', 'npwp', 'note')->required_fields('name', 'owner', 'address', 'zipcode', 'city', 'state', 'country', 'telp1')->unset_read()->unset_add()->unset_delete()->callback_field('note', array($this, 'setTextarea'));
$output = $crud->render();
$this->render($output);
}
示例4: productPlacing
public function productPlacing()
{
$crud = new grocery_CRUD();
$crud->set_table('warehouse_rack_detail')->display_as('id_rack', 'Rack Name')->display_as('id_product', 'Product Name')->columns('id_rack', 'id_product', 'stock')->set_relation('id_rack', 'warehouse_rack', 'name')->set_relation('id_product', 'product', 'name')->unset_fields('total')->callback_column('stock', array($this, 'addProductStockColumn'))->required_fields('id_rack', 'id_product')->unset_read();
$output = $crud->render();
$this->render($output);
}
示例5: category
public function category()
{
$crud = new grocery_CRUD();
$crud->set_table('category');
$output = $crud->render();
$this->_example_output($output);
}
示例6: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_table('retail')->columns('id_retail', 'date', 'id_staff', 'dpp', 'ppn', 'discount_price', 'grand_total', 'paid')->display_as('id_retail', 'No Nota Retail')->display_as('id_staff', 'Staff')->display_as('dpp', 'DPP')->display_as('ppn', 'PPN')->display_as('date', 'Tanggal Transaksi')->display_as('discount_price', 'Diskon')->display_as('pain', 'Jumlah Bayar')->display_as('grand_total', 'Grand Total')->callback_column('dpp', array($this, 'currencyFormat'))->callback_column('ppn', array($this, 'currencyFormat'))->callback_column('discount_price', array($this, 'currencyFormat'))->callback_column('grand_total', array($this, 'currencyFormat'))->callback_column('paid', array($this, 'currencyFormat'))->set_relation('id_staff', 'staff', 'name')->add_action('Detail', '', '', 'read-icon', array($this, 'checkout'))->unset_read()->unset_add()->unset_edit()->unset_delete()->order_by('id_retail', 'desc');
$output = $crud->render();
$this->render($output);
}
示例7: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_table('customer')->columns('name', 'alias_name1', 'alias_name2', 'owner', 'npwp', 'address', 'zipcode', 'city', 'state', 'country', 'plafond', 'telp1', 'telp2')->display_as('npwp', 'NPWP')->display_as('name', 'Nama Konsumen')->display_as('alias_name1', 'Nama Faktur 1')->display_as('alias_name2', 'Nama Faktur 2')->display_as('address', 'Alamat')->display_as('zipcode', 'Kode Pos')->display_as('city', 'Kota')->display_as('state', 'Provinsi')->display_as('country', 'Negara')->display_as('telp1', 'Telp 1')->display_as('plafond', 'Plafon')->callback_column('plafond', array($this, 'currencyFormat'))->display_as('telp1', 'Telp 1')->display_as('telp2', 'Telp 2')->display_as('owner', 'Direktur')->fields('name', 'alias_name1', 'alias_name2', 'owner', 'npwp', 'address', 'zipcode', 'city', 'state', 'country', 'plafond', 'telp1', 'telp2')->required_fields('name', 'address', 'city', 'state', 'country', 'plafond', 'telp1')->unset_read();
$output = $crud->render();
$this->render($output);
}
示例8: index
public function index()
{
try {
// General
$crud = new grocery_CRUD();
$crud->set_language("french");
$crud->set_theme('bootstrap');
$crud->set_table('sos_gen_frequence');
$crud->set_subject('Fréquence');
//relations
//Master/child relations
//Visual
$crud->columns('name_frequence');
$crud->display_as('name_frequence', 'Fréquence');
$crud->order_by('name_frequence', 'desc');
//unsets
//Requireds
$crud->required_fields('name_frequence');
//Callbacks
//field Types
// Actions
// Renders
$output = $crud->render();
$menu = new stdClass();
$menu->n1 = true;
$menu->lien3_3_1 = false;
$menu->status = $this->session->userdata('status');
$header = $this->navigation->home_f($menu);
$data = array('output' => $output, 'header' => $header);
$this->_example_output($data);
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例9: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_table('sales_order_return')->columns('id_sales_order_return', 'date', 'id_staff', 'id_sales_order')->display_as('id_sales_order', 'No Faktur Jual')->display_as('id_staff', 'Staff')->display_as('date', 'Tanggal Transaksi')->display_as('id_sales_order_return', 'No Faktur Retur')->set_relation('id_staff', 'staff', 'name')->add_action('Detail', '', '', 'read-icon', array($this, 'checkout'))->unset_read()->unset_add()->unset_edit()->unset_delete()->order_by('id_sales_order_return', 'desc');
$output = $crud->render();
$this->render($output);
}
示例10: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_table('principal')->columns('name', 'email', 'address', 'zipcode', 'city', 'state', 'country', 'telp1', 'telp2', 'npwp', 'siup', 'pbf', 'pbak', 'fak')->display_as('npwp', 'NPWP')->display_as('name', 'Nama Prinsipal')->display_as('address', 'Alamat')->display_as('zipcode', 'Kode Pos')->display_as('city', 'Kota')->display_as('state', 'Provinsi')->display_as('country', 'Negara')->display_as('telp1', 'Telp 1')->display_as('telp2', 'Telp 2')->display_as('siup', 'SIUP')->display_as('pbf', 'PBF')->display_as('pbak', 'PBAK')->display_as('fak', 'FAK')->fields('name', 'email', 'address', 'zipcode', 'city', 'state', 'country', 'telp1', 'telp2', 'npwp', 'siup', 'pbf', 'pbak', 'fak')->required_fields('name', 'address', 'city', 'state', 'country', 'telp1')->set_rules('email', 'Email', 'valid_email')->unset_read();
$output = $crud->render();
$this->render($output);
}
示例11: generate_crud
protected function generate_crud($table, $subject = '')
{
// create CRUD object
$this->load->library('Grocery_CRUD');
$crud = new grocery_CRUD();
$crud->set_table($table);
// auto-generate subject
if (empty($subject)) {
$crud->set_subject(humanize(singular($table)));
}
// load settings from: application/config/grocery_crud.php
$this->load->config('grocery_crud');
$this->mCrudUnsetFields = $this->config->item('grocery_crud_unset_fields');
if ($this->config->item('grocery_crud_unset_jquery')) {
$crud->unset_jquery();
}
if ($this->config->item('grocery_crud_unset_jquery_ui')) {
$crud->unset_jquery_ui();
}
if ($this->config->item('grocery_crud_unset_print')) {
$crud->unset_print();
}
if ($this->config->item('grocery_crud_unset_export')) {
$crud->unset_export();
}
if ($this->config->item('grocery_crud_unset_read')) {
$crud->unset_read();
}
foreach ($this->config->item('grocery_crud_display_as') as $key => $value) {
$crud->display_as($key, $value);
}
// other custom logic to be done outside
$this->mCrud = $crud;
return $crud;
}
示例12: old
public function old()
{
$crud = new grocery_CRUD();
$crud->set_table('sales_order')->columns('id_sales_order', 'id_proposal', 'id_customer', 'id_staff', 'date', 'due_date', 'dpp', 'ppn', 'discount_price', 'grand_total', 'status_ppn', 'paid')->display_as('id_sales_order', 'No Faktur')->display_as('id_proposal', 'No Proposal')->display_as('id_customer', 'Nama Konsumen')->display_as('id_staff', 'Staff')->display_as('date', 'Tanggal Transaksi')->display_as('due_date', 'Jatuh Tempo')->display_as('discount_price', 'Diskon')->display_as('grand_total', 'Grand Total')->display_as('status_ppn', 'Status PPN')->display_as('dpp', 'DPP')->display_as('ppn', 'PPN')->display_as('pain', 'Terbayar')->callback_column('dpp', array($this, 'currencyFormat'))->callback_column('ppn', array($this, 'currencyFormat'))->callback_column('discount_price', array($this, 'currencyFormat'))->callback_column('grand_total', array($this, 'currencyFormat'))->callback_column('paid', array($this, 'currencyFormat'))->callback_column('status_ppn', array($this, '_callback_status_ppn'))->set_relation('id_customer', 'customer', 'name')->set_relation('id_staff', 'staff', 'name')->add_action('Detail', '', '', 'read-icon', array($this, 'checkout'))->where('active', '0')->unset_read()->unset_add()->unset_edit()->unset_delete()->order_by('id_sales_order', 'desc');
$output = $crud->render();
$this->render($output);
}
示例13: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_table('bank_info')->columns('id_principal', 'bank_name', 'bank_account', 'bank_beneficiary_name', 'bank_city', 'bank_branch')->display_as('id_principal', 'Principal Name')->display_as('bank_name', 'Bank Name')->display_as('bank_account', 'Bank Account')->display_as('bank_beneficiary_name', 'Bank Beneficiary Name')->display_as('bank_city', 'Bank City')->display_as('bank_branch', 'Bank Branch')->set_relation('id_principal', 'principal', 'name')->fields('id_principal', 'bank_name', 'bank_account', 'bank_beneficiary_name', 'bank_city', 'bank_branch')->required_fields('id_principal', 'bank_account', 'bank_beneficiary_name')->unset_read();
$output = $crud->render();
$this->render($output);
}
示例14: categorias
function categorias()
{
$crud = new grocery_CRUD();
$crud->set_table('categorias');
$output = $crud->render();
$this->load->view('main/ventas', $output);
}
示例15: group
public function group()
{
$crud = new grocery_CRUD();
$crud->set_table('staff_group')->columns('name_group', 'note', 'jml_user')->fields('name_group', 'note')->display_as('name_group', 'Group Name')->display_as('jml_user', 'Jumlah User')->required_fields('name_group')->callback_column('jml_user', array($this, 'countJmlUser'))->callback_field('note', array($this, 'setTextarea'))->add_action('Update Role', '', '', 'read-icon', array($this, 'addUpdateRoleAction'))->unset_read();
$output = $crud->render();
$this->renderGroup($output);
}