Esempio n. 1
0
 public function cropprofile()
 {
     $crud = new Grocery_CRUD();
     $crud->set_model('crud_model');
     $crud->set_table('crop_history')->set_theme('datatables')->columns('crop_id', 'province', 'municipality', 'barangay', 'area', 'volume', 'value', 'year')->display_as('crop_id', 'Crops')->display_as('area', 'Area planted or harvested (ha)')->display_as('volume', 'Volume of Production (metric tons)')->display_as('value', 'Value of Production (thousand php)')->set_relation('crop_id', 'crops', 'crop_species')->unset_read();
     $crud->fields('place_id', 'crop_id', 'province', 'municipality', 'barangay', 'area', 'volume', 'value');
     $crud->field_type('place_id', 'invisible');
     $crud->required_fields('province', 'crop_id');
     $crud->callback_field('province', array($this, '_callback_province'));
     $crud->callback_before_insert(array($this, '_callback_place_id'));
     $crud->callback_before_update(array($this, '_callback_place_id'));
     $this->dependent_dropdown_place($crud);
 }
Esempio n. 2
0
 public function special_discount_entry()
 {
     $crud = new Grocery_CRUD();
     $crud->set_table('special_discount');
     $crud->set_subject('special_discount');
     $crud->columns('description', 'type', 'discount_by', 'discount_amount', 'status');
     $crud->fields('description', 'type', 'discount_by', 'discount_amount', 'status');
     $crud->display_as('discount_amount', 'Descount Percentage %');
     $crud->field_type('status', 'dropdown', array('active' => 'Active', 'inactive' => 'Inactive'));
     $output = $crud->render();
     $this->load->view('admin/entry_view', $output);
 }
Esempio n. 3
0
 public function waterbodies()
 {
     $crud = new Grocery_CRUD();
     $crud->set_model('crud_model');
     $crud->set_table('water_body')->set_theme('datatables')->columns('water_name', 'water_type', 'province', 'municipality', 'barangay', 'count')->display_as('water_name', 'Name of water body')->display_as('water_type', 'Type / kind of water body')->display_as('area', 'Area planted or harvested (ha)')->display_as('area', 'Area covered (ha)')->unset_read();
     $crud->fields('water_id', 'water_name', 'water_type', 'place_id', 'province', 'municipality', 'barangay', 'count');
     $crud->field_type('place_id', 'invisible');
     $crud->field_type('water_id', 'invisible');
     $crud->required_fields('water_type', 'province');
     $crud->change_field_type('water_type', 'enum', $this->aquatic_model->get_watertype());
     $crud->callback_before_insert(array($this, '_callback_place_id'));
     $crud->callback_before_update(array($this, '_callback_place_id'));
     $crud->callback_field('province', array($this, '_callback_province'));
     $this->dependent_dropdown_place($crud, 'water_body', 'water_id');
 }
Esempio n. 4
0
 function placeprofile()
 {
     $crud = new Grocery_CRUD();
     $crud->set_model('crud_model');
     $crud->set_table('place_history');
     $crud->columns('province', 'municipality', 'barangay', 'land_area', 'population', 'year');
     $crud->unset_read();
     $crud->set_theme('datatables');
     $crud->fields('place_id', 'province', 'municipality', 'barangay', 'land_area', 'population', 'year');
     $crud->field_type('place_id', 'invisible');
     $crud->required_fields('province');
     $crud->callback_before_insert(array($this, '_callback_place_id'));
     $crud->callback_before_update(array($this, '_callback_place_id'));
     $crud->callback_field('province', array($this, '_callback_province'));
     $this->dependent_dropdown_place($crud);
     $output = $crud->render();
 }