function ProcessRequest()
 {
     $mObj = new Anggota();
     $messenger = Messenger::Instance()->Receive(__FILE__);
     $request_data = array();
     $arr_kelompok = $mObj->getKelompok();
     $message = $style = $messengerData = NULL;
     $data_id = Dispatcher::Instance()->Decrypt($mObj->_GET['data_id']);
     $data_anggota = $mObj->getDetilAnggota($data_id);
     $request_data['kelompok'] = $data_anggota['kelompok_id'];
     $request_data['id'] = $data_anggota['id'];
     $request_data['nama'] = $data_anggota['nama'];
     $request_data['email'] = $data_anggota['email'];
     $request_data['phone'] = $data_anggota['phone'];
     $request_data['alamat'] = $data_anggota['address'];
     if ($messenger) {
         $message = $messenger[0][1];
         $style = $messenger[0][2];
         $messengerData = $messenger[0][0];
         $request_data['id'] = $messengerData['data_id'];
         $request_data['kelompok'] = $messengerData['kelompok'];
         $request_data['nama'] = $messengerData['nama'];
         $request_data['email'] = $messengerData['email'];
         $request_data['phone'] = $messengerData['phone'];
         $request_data['alamat'] = $messengerData['alamat'];
     }
     # Combobox
     Messenger::Instance()->SendToComponent('combobox', 'Combobox', 'view', 'html', 'kelompok', array('kelompok', $arr_kelompok, $request_data['kelompok'], false, 'id="cmb_kelompok"'), Messenger::CurrentRequest);
     return compact('request_data', 'message', 'style');
 }
 function ProcessRequest()
 {
     $messenger = Messenger::Instance()->Receive(__FILE__);
     $mObj = new Anggota();
     $arr_kelompok = $mObj->getKelompok();
     $request_data = array();
     $query_string = '';
     $message = $style = $message = NULL;
     if (isset($mObj->_POST['btnSearch'])) {
         $request_data['nama'] = $mObj->_POST['nama'];
         $request_data['kelompok'] = $mObj->_POST['kelompok'];
     } elseif (isset($mObj->_GET['search'])) {
         $request_data['nama'] = Dispatcher::Instance()->Decrypt($mObj->_GET['nama']);
         $request_data['kelompok'] = Dispatcher::Instance()->Decrypt($mObj->_GET['kelompok']);
     } else {
         $request_data['nama'] = '';
         $request_data['kelompok'] = '';
     }
     if (method_exists(Dispatcher::Instance(), 'getQueryString')) {
         # @param array
         $query_string = Dispatcher::instance()->getQueryString($request_data);
     } else {
         $query = array();
         foreach ($request_data as $key => $value) {
             $query[$key] = Dispatcher::Instance()->Encrypt($value);
         }
         $query_string = urldecode(http_build_query($query));
     }
     $offset = 0;
     $limit = 20;
     $page = 0;
     if (isset($_GET['page'])) {
         $page = (string) $_GET['page']->StripHtmlTags()->SqlString()->Raw();
         $offset = ($page - 1) * $limit;
     }
     #paging url
     $url = Dispatcher::Instance()->GetUrl(Dispatcher::Instance()->mModule, Dispatcher::Instance()->mSubModule, Dispatcher::Instance()->mAction, Dispatcher::Instance()->mType) . '&search=' . Dispatcher::Instance()->Encrypt(1) . '&' . $query_string;
     $destination_id = "subcontent-element";
     $data_list = $mObj->getDataAnggota($offset, $limit, $request_data);
     $total_data = $mObj->Count();
     #send data to pagging component
     Messenger::Instance()->SendToComponent('paging', 'Paging', 'view', 'html', 'paging_top', array($limit, $total_data, $url, $page, $destination_id), Messenger::CurrentRequest);
     # Combobox
     Messenger::Instance()->SendToComponent('combobox', 'Combobox', 'view', 'html', 'kelompok', array('kelompok', $arr_kelompok, $request_data['kelompok'], true, 'id="cmb_kelompok"'), Messenger::CurrentRequest);
     $start = $offset + 1;
     if ($messenger) {
         $message = $messenger[0][1];
         $style = $messenger[0][2];
     }
     return compact('request_data', 'query_string', 'start', 'data_list', 'message', 'style');
 }
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 100) as $index) {
         Anggota::create(['id' => $index, 'no_ktp' => $index, 'nama' => $faker->name($gender = null | 'male' | 'female'), 'jenis_kelamin' => $faker->boolean($chanceOfGettingTrue = 50), 'tempat_lahir' => $faker->city, 'tanggal_lahir' => $faker->date($format = 'Y-m-d', $max = 'now'), 'alamat' => $faker->address, 'no_telepon' => $faker->phoneNumber, 'created_at' => null, 'updated_at' => null]);
         $faker->unique(true);
     }
 }
 /**
  * Remove the specified anggota from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Anggota::destroy($id);
     return Redirect::route('admin.anggotas.index');
 }