public function updater()
 {
     $id = TextP::postP("id", "");
     $name = TextP::postP("name", "");
     $lvl = TextP::postP("lvl", "");
     $org = TextP::postP("org", "");
     $role = TextP::postP("role", "");
     $json = array();
     $json['post'] = $_POST;
     $json['isi'][] = $role;
     $json['isi'][] = $name;
     $json['isi'][] = $lvl;
     $json['isi'][] = $org;
     $json['isi'][] = $id;
     $json['bool'] = 0;
     if ($id == "" || $name == "" || $lvl == "" || $org == "" || $role == "") {
         $json['err'] = Lang::t('Please provide all data');
         die(json_encode($json));
     }
     $acc = new Account();
     $acc->getByID($id);
     $acc->admin_nama_depan = urldecode($name);
     $acc->admin_role = urldecode($role);
     $acc->load = 1;
     $suc = $acc->save();
     $json['isi'][] = $suc;
     //if($suc){
     //update role2acc
     $role2acc = new Role2Account();
     $arrR2c = $role2acc->getWhere("role_admin_id = '{$id}' LIMIT 0,1");
     $role2acc->getByID($arrR2c[0]->rc_id);
     $role2acc->role_id = $role;
     $role2acc->load = 1;
     $suc2 = $role2acc->save();
     $json['isi'][] = $suc2;
     //if($suc2){
     //update lvl dan org
     $am = new AccountMeta();
     $arrMeta = $am->getWhere("account_id = {$id}");
     if (count($arrMeta) < 1) {
         //create new
         $am2 = new AccountMeta();
         $am2->account_id = $id;
         $am2->meta_key = "RoleLevel";
         $am2->meta_value = $lvl;
         $am2->save();
         //create new
         $am2 = new AccountMeta();
         $am2->account_id = $id;
         $am2->meta_key = "RoleOrganization";
         $am2->meta_value = $org;
         $am2->save();
     } else {
         foreach ($arrMeta as $mt) {
             if ($mt->meta_key == "RoleLevel") {
                 $am2 = new AccountMeta();
                 $am2->getByID($mt->meta_id);
                 $am2->meta_value = $lvl;
                 $am2->load = 1;
                 $am2->save();
             }
             if ($mt->meta_key == "RoleOrganization") {
                 $am2 = new AccountMeta();
                 $am2->getByID($mt->meta_id);
                 $am2->meta_value = $org;
                 $am2->load = 1;
                 $am2->save();
             }
         }
     }
     // }
     $json['bool'] = $suc2;
     //}
     die(json_encode($json));
 }