Remove field from input/edit

1st way : $crud->unset_fields(‘serial’,’nup’); 2nd way : if ($crud->getState() == ‘add’) { $crud->field_type(‘harga_barang’, ‘hidden’); $crud->field_type(‘nup’, ‘hidden’); $crud->field_type(‘serial’, ‘hidden’); $crud->field_type(‘jumlah_disetujui’, ‘hidden’); $crud->field_type(‘tanda_terima’, ‘hidden’); } if ($crud->getState() == ‘edit’) { $crud->field_type(‘harga_barang’, ‘hidden’); $crud->field_type(‘nup’, ‘hidden’); $crud->field_type(‘serial’, ‘hidden’); $crud->field_type(‘jumlah_disetujui’, ‘hidden’); $crud->field_type(‘tanda_terima’, ‘hidden’); }

calculate with sum on field

function my_sum_function($post_array, $primary_key) { $post_array[‘total’] = $post_array[‘num_1’] + $post_array[‘num_2’] + $post_array[‘num_3’] + $post_array[‘num_4’] + $post_array[‘num_5’]; return $post_array; } then $crud->callback_before_insert(array($this,’my_sum_function’)); $crud->callback_before_update(array($this,’my_sum_function’)); callback_before_update can used fix after it  

grocery crud : Change boolean value

find assets/grocery_crud/languages/(mylang).php find $default_true_false_text, and change it  protected $default_true_false_text = array(‘inactive’ , ‘active’); $lang[‘form_inactive’] = ‘tidak aktif’;$lang[‘form_inactive’] = ‘tidak aktif’; $lang[‘form_active’] = ‘aaaaktif’;

Hide a field when editing

$crud = new grocery_CRUD(); … $crud->edit_fields(‘equip_status_id’, ‘site_id’, ‘equip_type_id’, ‘name’, ‘barcode_no’); if ($crud->getState() == ‘edit’) {      ->field_type(‘volume’, ‘disabled’) ->field_type(‘tipe’, ‘hidden’); } source

Howto change google map api in metabox wordpress

if our wordpress metabox dont provide field to change google map api, we should change it manualy : open htdocs\wordpress\wp-content\plugins\meta-box\inc\fields\map.php search this line : // Users should overwrite this key with their own key. change the ‘api_key’ line below it with your google map api : example : ‘api_key’       => ‘AIzaSyC1mUh87SGFyf133tpZQJa-s96p0tgnraQ’, change to : ‘api_key’ …

Howto change google map api in metabox wordpress Read More »

Create adminLTE sidebar menu using codeigniter 3

CRUD ( Create Read Update dan Delete ) di Codeigniter Di codeigniter menggunakan MVC (Model, View dan controller), dimana Model : untuk membuat query database, View : untuk menampilkan halaman yang kita buat, dan controller : yang menghubungkan antara model dan view. Untuk membuat form input, dan update di codeigniter yang pertama harus di buat dulu …

Create adminLTE sidebar menu using codeigniter 3 Read More »

php and map

Select you need : google map road api geocode sample Using PHP/MySQL with Google Maps Creating a Store Locator with PHP, MySQL & Google Maps Waypoints in directions Real Time GPS Tracker with Integrated Google Maps : Google Maps Geolocation Tracking in Realtime with JavaScript Geolocation Tracker (GPRS + GPS) with SIM908 over Arduino and Raspberry …

php and map Read More »

setup firephp di codeigniter

1. download firephp lib 2, copy FirePHP.class.php ke application/libraries folder (rename jadi firephp.php) 3.  jika ingin otomatis : edit autoload.php > tambahkan : $autoload[‘libraries’] = array(‘firephp’); 4. ingin di load di file tertentu : $this->load->library(‘firephp’);

First experience install composer php using windows 7

1. composer unable to load dynamic library php_bz2 Got about 20 error. search and open php.ini cari line ini : extension_dir = “xampp\php\ext” ganti dengan extension_dir = “D:\xampp\php\ext”   2.  composer cannot open browscap.ini for reading search and open php.ini change browscap = “xampp\php\extras\browscap.ini” to browscap = “D:\xampp\php\extras\browscap.ini”   3. The openssl extension is missing, which means that secure HTTPS transfers are …

First experience install composer php using windows 7 Read More »