当前位置: 首页>>代码示例>>PHP>>正文


PHP grocery_CRUD::set_model方法代码示例

本文整理汇总了PHP中grocery_CRUD::set_model方法的典型用法代码示例。如果您正苦于以下问题:PHP grocery_CRUD::set_model方法的具体用法?PHP grocery_CRUD::set_model怎么用?PHP grocery_CRUD::set_model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在grocery_CRUD的用法示例。


在下文中一共展示了grocery_CRUD::set_model方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index()
 {
     $crud = new grocery_CRUD();
     $crud->set_theme('datatables');
     $crud->set_model('My_Custom_model');
     $crud->set_table('ips_ordertracking', 'ips_productitems');
     $crud->set_subject('Sales Tracking');
     $crud->required_fields('NAME');
     // void set_relation_n_n( string $field_name, string $relation_table, string $selection_table, string $primary_key_alias_to_this_table, string $primary_key_alias_to_selection_table , string $title_field_selection_table [ , string $priority_field_relation ] )
     $crud->set_relation_n_n('orderdetails', 'ips_ordertracking', 'ips_productitems', 'ips_ordertracking', 'ordertrackingid', 'description', 'category');
     // $crud->set_relation('ordertrackingid','ips_productitems','description');
     // $crud->columns('ordertrackingid','fullfillment','orderdate','orderid','returnid','itemrece','caseid','product','status','Action');
     // $crud->display_as('orderdate','Order Date')->display_as('orderid','Order ID')->display_as('returnid','Sales Return ID')->display_as('itemrece','Item Received')->display_as('caseid','Case ID')->display_as('product','Product Condition')->display_as('ordertrackingid','ID');
     $crud->columns('ordertrackingid', 'orderid', 'description', 'category', 'product', 'itemrece', 'cost', 'mrp', 'Action');
     $crud->display_as('orderid', 'Order ID')->display_as('itemrece', 'Item Received')->display_as('product', 'Product Condition')->display_as('ordertrackingid', 'ID')->display_as('description', 'Product Name')->display_as('category', 'Category')->display_as('cost', 'Recovery Min')->display_as('mrp', 'Recovery Max');
     $crud->callback_column('ordertrackingid', array($this, '_callback_webpage_url'));
     $crud->callback_column('orderdate', array($this, '_callback_dateformat'));
     $crud->callback_column('fullfillment', array($this, '_callback_fullfillment'));
     // $crud->callback_column('product',array($this,'_callback_product'));
     $crud->callback_column('status', array($this, '_callback_status'));
     $crud->callback_column('itemrece', array($this, '_callback_itemrece'));
     $crud->callback_column('cost', array($this, '_callback_recovery_min'));
     $crud->callback_column('mrp', array($this, '_callback_recovery_max'));
     $crud->callback_column('Action', array($this, '_callback_viewpage_url'));
     $crud->unset_edit();
     $crud->unset_read();
     $crud->unset_delete();
     // $crud->callback_after_insert(array($this, 'fullfillmentid_generation'));
     $output = $crud->render();
     $state = $crud->getState();
     if ($state == 'add') {
         redirect('store/addtracking');
     }
     if ($state == 'view') {
         redirect('store/viewtracking');
     }
     // $this->grocery_crud->set_table('ips_login');
     // $output = $this->grocery_crud->render();
     $this->_example_output($output);
 }
开发者ID:selva316,项目名称:trackingtool,代码行数:40,代码来源:homepage.php

示例2: checkout

 public function checkout($id)
 {
     if (!($master = $this->model_proposal->getDataProposal($id))) {
         redirect('proposal');
     }
     $this->load->library('grocery_CRUD');
     $this->load->model('grocery_CRUD_Model');
     $crud = new grocery_CRUD();
     $crud->set_model('CheckoutModel');
     $crud->set_table('proposal_detail');
     //Change to your table name
     $crud->columns('name', 'brand', 'unit', 'size', 'qty', 'price', 'discount', 'discount_price', 'sub_total', 'ppn', 'final_sub_total');
     $crud->basic_model->getDataProposalDetail($id);
     $crud->callback_column('unit', array($this, '_callback_unit'));
     $crud->callback_column('price', array($this, '_callback_currency'));
     $crud->callback_column('discount', array($this, '_callback_currency'));
     $crud->callback_column('discount_price', array($this, '_callback_currency'));
     $crud->callback_column('sub_total', array($this, '_callback_currency'));
     $crud->callback_column('ppn', array($this, '_callback_currency'));
     $crud->callback_column('final_sub_total', array($this, '_callback_currency'));
     $crud->display_as('final_sub_total', 'total');
     //
     $crud->unset_add()->unset_edit()->unset_delete()->unset_print()->unset_read();
     $output = $crud->render();
     //        $this->render($output);
     $data['output'] = $output;
     $data['master'] = $master;
     $data['proposal_type'] = $this->proposal_type[$master->type];
     $data['status_ppn'] = $this->status_ppn[$master->status_ppn];
     $this->parser->parse("list_detail.tpl", $data);
     //        $data['items'] = $this->model_proposal->getDataProposalDetail($id);
     //        $this->parser->parse("proposal_checkout.tpl", $data);
 }
开发者ID:nurulimamnotes,项目名称:pos,代码行数:33,代码来源:Proposal.php


注:本文中的grocery_CRUD::set_model方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。