// update / delete form $sel = $dbtable . '.*'; $r = dbSFA($sel, $dbtable . ',departemen', "W/keu_budget.replid='{$cid}' and keu_budget.id_department=departemen.replid"); // shared/db.php // $r=dbSFA("*",$dbtable.','.'departemen',"W/keu_budget.replid='$cid' and keu_budget.id_department=departemen.replid"); // shared/db.php // $r=dbSFA("*",$dbtable,"W/replid='$cid'"); // shared/db.php // $r=dbLJoin($dbtable,'replid','departemen','replid'); // shared/db.php // var_dump($r); $a = 0; // $kategorirek=kategorirek_r($a); $departemen = departemen_r($a); // print_r($departemen); } else { // opt == 'af' // add form // $r = farray('kategorirek','kode','nama','keterangan'); //shared/libraries/common.php $r = farray('tahunbuku', 'nama', 'nominal', 'keterangan', 'id_department'); //shared/libraries/common.php // $r['kategorirek'] = gpost('skategorirek'); // shared/libraries/common.php $r['id_department'] = gpost('sid_department'); // shared/libraries/common.php // $kategorirek = kategorirek_r($r['kategorirek']); //shared/libraries/modules/app/keu/rekening.php $departemen = departemen_r($r['id_department']); //shared/libraries/modules/app/keu/rekening.php // // if($r['kategorirek']!=0){ // // //$r['kode']=$r['kategorirek']; // // } // $departemen=departemen_r($a,1); //shared/libraries/obj/departmen.php (tambahan) } // $departemen=departemen_r($a,1); //shared/libraries/obj/departmen.php (tambahan) // }$departemen=departemen_r($a); //shared/libraries/obj/departmen.php $fform->dimension(400, 120);
function users($page = 'list', $index = 1) { if ($page == 'list') { // $this->users() it's the current method, $this->users is the main user object $users = $this->users->auth->list_users($group_par = FALSE, $limit = FALSE, $offset = FALSE, $include_banneds = FALSE); $this->gui->set_title(sprintf(__('Users — %s'), get('core_signature'))); $this->load->view('../modules/aauth/views/users/body', array('users' => $users)); } else { if ($page == 'edit') { if (!User::can('manage_users')) { redirect(array('dashboard?notice=access-denied')); } // permission checks // if current user matches user id if ($this->users->auth->get_user_id() == $index) { redirect(array('dashboard', 'users', 'profile')); } // User Goup $user = $this->users->auth->get_user($index); $user_group = farray($this->users->auth->get_user_groups($index)); if (!$user) { redirect(array('dashboard', 'unknow-user')); } // validation rules $this->load->library('form_validation'); $this->form_validation->set_rules('user_email', __('User Email'), 'required|valid_email'); $this->form_validation->set_rules('password', __('Password'), 'min_length[6]'); $this->form_validation->set_rules('confirm', __('Confirm'), 'matches[password]'); $this->form_validation->set_rules('userprivilege', __('User Privilege'), 'required'); // load custom rules $this->events->do_action('user_creation_rules'); if ($this->form_validation->run()) { $exec = $this->users->edit($index, $this->input->post('user_email'), $this->input->post('password'), $this->input->post('userprivilege'), $user_group); $this->notice->push_notice($this->lang->line('user-updated')); // Refresh user data $user = $this->users->auth->get_user($index); // User Goup $user_group = farray($this->users->auth->get_user_groups($index)); if (!$user) { redirect(array('dashboard', 'unknow-user')); } } // User Goup $user_group = farray($this->users->auth->get_user_groups($user->id)); // selecting groups $groups = $this->users->auth->list_groups(); $this->gui->set_title(sprintf(__('Edit user — %s'), get('core_signature'))); $this->load->view('../modules/aauth/views/users/edit', array('groups' => $groups, 'user' => $user, 'user_group' => $user_group)); } else { if ($page == 'create') { if (!User::can('manage_users')) { redirect(array('dashboard?notice=access-denied')); } // permission checks $this->load->library('form_validation'); $this->form_validation->set_rules('username', __('User Name'), 'required|min_length[5]'); $this->form_validation->set_rules('user_email', __('User Email'), 'required|valid_email'); $this->form_validation->set_rules('password', __('Password'), 'required|min_length[6]'); $this->form_validation->set_rules('confirm', __('Confirm'), 'required|matches[password]'); $this->form_validation->set_rules('userprivilege', __('User Privilege'), 'required'); // load custom rules $this->events->do_action('user_creation_rules'); if ($this->form_validation->run()) { $exec = $this->users->create($this->input->post('user_email'), $this->input->post('password'), $this->input->post('username'), $this->input->post('userprivilege')); if ($exec == 'user-created') { redirect(array('dashboard', 'users?notice=' . $exec)); exit; } $this->notice->push_notice($this->lang->line($exec)); } // selecting groups $groups = $this->users->auth->list_groups(); $this->gui->set_title(sprintf(__('Create a new user — %s'), get('core_signature'))); $this->load->view('../modules/aauth/views/users/create', array('groups' => $groups)); } else { if ($page == 'delete') { if (!User::can('manage_users')) { redirect(array('dashboard?notice=access-denied')); } // permission checks $user = $this->users->auth->user_exsist_by_id($index); if ($user) { $this->users->delete($index); redirect(array('dashboard', 'users?notice=user-deleted')); } redirect(array('dashboard', 'unknow-user')); } else { if ($page == 'profile') { $this->load->library('form_validation'); $this->form_validation->set_rules('user_email', __('User Email'), 'valid_email'); $this->form_validation->set_rules('old_pass', __('Old Pass'), 'min_length[6]'); $this->form_validation->set_rules('password', __('Password'), 'min_length[6]'); $this->form_validation->set_rules('confirm', __('Confirm'), 'matches[password]'); // Launch events for user profiles edition rules $this->events->do_action('user_profile_rules'); if ($this->form_validation->run()) { $exec = $this->users->edit($this->users->auth->get_user_id(), $this->input->post('user_email'), $this->input->post('password'), $this->input->post('userprivilege'), null, $this->input->post('old_pass'), 'profile'); $this->notice->push_notice_array($exec); } $this->gui->set_title(sprintf(__('My Profile — %s'), get('core_signature'))); $this->load->view('../modules/aauth/views/users/profile'); } } } } } }
<?php session_start(); if (!isset($_SESSION['admin'])) header("Location:../login.php"); if (isset($_REQUEST['id'])) { $id = $_REQUEST['id']; $sql = "SELECT * FROM tbl_admin WHERE id ='".$id."';"; $q = mysql_query($sql); $arr = farray($q); $user = $arr['username']; $password = $arr['password']; $email = $arr['email']; $tit = 'Edit Information of User'; $do = 'index.php?f=manager&act=editadmin&id='.$id; } ?> <p><b><?=$tit?></b></p> <form name="addadmin" id="addadmin" method="post" action="<?=$do?>"> <table width="100%" border="0" cellspacing="2" cellpadding="2" style="border: 1px solid #d8d8d8"> <tr> <td width="389">Username: *</td> <td width="579"><input name="user" type="text" id="user" value="<?=$user?>" /> </td> </tr> <tr> <td>Password : *</td> <td><input type="password" name="password" id="password" /></td> </tr> <tr> <td>Confirm: *</td>
<?php require_once(MODDIR.'xform/xform.php'); require_once(MODDIR.'control.php'); $opt=gpost('opt'); $cid=gpost('cid'); if($cid=='')$cid=0; $ssid=session_id(); dbDel("pus_tpjm","ssid='$ssid'"); $fmod='peminjaman'; $xform=new xform($fmod,$opt,$cid); if($opt=='uf'){ // Nilai field editan //$t=mysql_query("SELECT * FROM pus_katalog WHERE replid='$cid' LIMIT 0,1"); //$data=mysql_fetch_array($t); $ttl='Edit'; } else { // Nilai field default $data=farray(); $ttl='Tambah'; $data['tanggal1']=date("Y-m-d"); $data['tanggal2']=date("Y-m-d",strtotime("+7 day")); } $xform->title($ttl.' data peminjaman'); $xform->table_begin(); $xform->col_begin('50%'); $xform->set_fieldw(340); $xform->group_begin('Data Peminjam'); $s='<button title="Cari" class="btn" style="margin-right:4px" onclick="sirkulasi_member_add()"><div class="bi_srcb"> </div></button>'; $xform->fi('Peminjam',iText('smember','','width:250px;margin-right:4px','ID atau nama member','onkeyup="sirkulasi_member_cari(event)"').$s); hiddenval('member_id',0); hiddenval('member_tipe',0); hiddenval('sirkulasi_form',1);
public function __posttype_controller($namespace, $page = 'list', $id = 0, $taxonomy_arg1 = 'list', $taxonomy_arg2 = 0) { if ($this->current_posttype = riake($namespace, $this->config->item('posttypes'))) { $data['current_posttype'] = $this->current_posttype; $data['post_namespace'] = $namespace; if ($page === 'list') { $id = $id === 0 ? 1 : $id; $post_limit = 20; $post_nbr = count($this->current_posttype->get()); $pagination = pagination_helper($post_limit, $post_nbr, $id, site_url(array('dashboard', 'posttype', $namespace, 'list')), site_url(array('error', 'code', 'page-404'))); $this->config->set_item('pagination_data', $pagination); $post = $this->current_posttype->get(array(array('limit' => array('start' => riake('start', $pagination), 'end' => riake('end', $pagination))))); $data['post'] = $post; $data['post_list_label'] = $this->current_posttype->posts_list_label; $this->gui->set_title($this->current_posttype->posts_list_label); $this->load->view('../modules/post_type/views/list', $data, false); } else { if ($page === 'new') { $data['post_namespace'] = $namespace; $data['new_post_label'] = $this->current_posttype->new_post_label; $this->load->library('form_validation'); $this->form_validation->set_rules('post_title', __('Post title')); if ($this->form_validation->run()) { $return = $this->current_posttype->set($this->input->post('post_title'), $this->input->post('post_content'), riake('post_meta', $_POST, array()), riake('post_taxonomy', $_POST, array()), $this->input->post('post_status'), $this->input->post('post_parent'), $status = 'set'); if (riake('msg', $return) === 'custom-query-saved') { redirect(array('dashboard', 'posttype', $namespace, 'edit', riake('id', $return) . '?notice=' . riake('msg', $return))); } get_instance()->notice->push_notice($this->lang->line(riake('msg', $return))); } $this->gui->set_title($this->current_posttype->new_post_label); $this->load->view('../modules/post_type/views/create', $data, false); } else { if ($page === 'edit') { $this->load->library('form_validation'); $this->form_validation->set_rules('post_title', __('Post title')); if ($this->form_validation->run()) { $return = $this->current_posttype->update($this->input->post('post_title'), $this->input->post('post_content'), riake('post_meta', $_POST, array()), riake('post_taxonomy', $_POST, array()), $this->input->post('post_status'), $this->input->post('post_parent'), $status = 'publish', $id); if (riake('msg', $return) === 'custom-query-saved') { redirect(array('dashboard', 'posttype', $namespace, 'edit', riake('id', $return) . '?notice=' . riake('msg', $return))); } get_instance()->notice->push_notice($this->lang->line(riake('msg', $return))); } // print_array( get_core_vars( 'post' ) );die; $this->gui->set_title($this->current_posttype->edit_post_label); $this->load->view('../modules/post_type/views/edit', array('post_namespace' => $namespace, 'new_post_label' => $this->current_posttype->new_post_label, 'current_posttype' => $this->current_posttype, 'post' => farray($this->current_posttype->get(array(array('where' => array('id' => $id)))))), false); } else { if ($page === 'taxonomy') { // $id is taxonomy namespace here if (in_array($id, array_keys(force_array($taxonomy = $this->current_posttype->query->get_defined_taxonomies())))) { $data = array(); $data['current_taxonomy'] = $current_taxonomy = riake($id, $taxonomy); $data['taxonomy_namespace'] = $taxonomy_namespace = $id; $data['taxonomy'] = $taxonomy; $data['taxonomy_list_label'] = riake('taxonomy-list-label', $current_taxonomy); $data['post_namespace'] = $namespace; if ($taxonomy_arg1 === 'list') { $taxonomy_limit = 20; $taxonomy_arg2 = $taxonomy_arg2 === 0 ? 1 : $taxonomy_arg2; $taxonomies_nbr = count($this->current_posttype->query->get_taxonomies($taxonomy_namespace)); $pagination = pagination_helper($taxonomy_limit, $taxonomies_nbr, $taxonomy_arg2, site_url(array('dashboard', 'posttype', $namespace, $page, $id, $taxonomy_arg1)), site_url(array('error', 'code', 'page-404'))); $data['taxonomy_list_label'] = riake('taxonomy-list-label', $current_taxonomy); $data['taxonomies'] = $this->current_posttype->query->get_taxonomies($taxonomy_namespace, $pagination['start'], $pagination['end']); $data['taxonomies_nbr'] = $taxonomies_nbr; $data['pagination'] = $pagination; $data['current_taxonomy'] = $current_taxonomy; $this->gui->set_title(riake('new-taxonomy-label', $current_taxonomy)); $this->load->view('../modules/post_type/views/taxonomy-list', $data); } else { if ($taxonomy_arg1 === 'new') { $this->load->library('form_validation'); $this->form_validation->set_rules('taxonomy_title', __('Taxonomy Title'), 'required'); if ($this->form_validation->run()) { $result = $this->current_posttype->query->set_taxonomy($data['taxonomy_namespace'], $this->input->post('taxonomy_title'), $this->input->post('taxonomy_content'), in_array($this->input->post('taxonomy_parent'), array(false, ''), TRUE) ? null : $this->input->post('taxonomy_parent')); get_instance()->notice->push_notice($this->lang->line($result)); } $this->gui->set_title(riake('new-taxonomy-label', $current_taxonomy, __('New taxonomy'))); $this->load->view('../modules/post_type/views/taxonomy-create', $data, false); } else { if ($taxonomy_arg1 === 'edit') { $this->load->library('form_validation'); $this->form_validation->set_rules('taxonomy_title', __('Taxonomy Title'), 'required'); if ($this->form_validation->run()) { $result = $this->current_posttype->query->update_taxonomy($id, $this->input->post('taxonomy_title'), $this->input->post('taxonomy_content'), $taxonomy_arg2, in_array($this->input->post('taxonomy_parent'), array(false, ''), TRUE) ? null : $this->input->post('taxonomy_parent')); get_instance()->notice->push_notice($this->lang->line('taxonomy-set')); } $data['taxonomy_id'] = $taxonomy_arg2; $data['get_taxonomy'] = farray($this->current_posttype->query->get_taxonomies($taxonomy_namespace, $taxonomy_arg2, 'as_id')); $this->gui->set_title(riake('edit-taxonomy-label', $current_taxonomy, __('Edit taxonomy'))); $this->load->view('../modules/post_type/views/taxonomy-edit', $data); } } } } else { redirect(array('dashboard', 'error', 'unknow-taxonomy')); } } else { if ($page === 'comments') { if ($id === 'approve' && $taxonomy_arg1 != 0) { $exec = $this->current_posttype->query->comment_status($taxonomy_arg1, 1); if ($exec == 'comment-edited') { redirect(array('dashboard', 'posttype', $namespace, $page . '?notice=' . $exec)); } redirect(array('dashboard', 'posttype', $namespace, $page . '?notice=error-occured')); } else { if ($id === 'disapprove' && $taxonomy_arg1 != 0) { $exec = $this->current_posttype->query->comment_status($taxonomy_arg1, 4); if ($exec == 'comment-edited') { redirect(array('dashboard', 'posttype', $namespace, $page . '?notice=' . $exec)); } redirect(array('dashboard', 'posttype', $namespace, $page . '?notice=error-occured')); } else { if ($id === 'trash' && $taxonomy_arg1 != 0) { $exec = $this->current_posttype->query->comment_status($taxonomy_arg1, 3); if ($exec == 'comment-edited') { redirect(array('dashboard', 'posttype', $namespace, $page . '?notice=' . $exec)); } redirect(array('dashboard', 'posttype', $namespace, $page . '?notice=error-occured')); } else { if ($id === 'draft' && $taxonomy_arg1 != 0) { $exec = $this->current_posttype->query->comment_status($taxonomy_arg1, 0); if ($exec == 'comment-edited') { redirect(array('dashboard', 'posttype', $namespace, $page . '?notice=' . $exec)); } redirect(array('dashboard', 'posttype', $namespace, $page . '?notice=error-occured')); } else { if ($id === 'delete' && $taxonomy_arg1 != 0) { $exec = $this->current_posttype->query->delete_comment($taxonomy_arg1, 'as_id'); if ($exec == 'comment-edited') { redirect(array('dashboard', 'posttype', $namespace, $page . '?notice=' . $exec)); } redirect(array('dashboard', 'posttype', $namespace, $page . '?notice=error-occured')); } } } } } // $this->current_posttype->query->post_comment( 1 , 'Custom' , $author = false , $mode = 'create' , $comment_id = null , $author_name = 'Blair' , $author_email = '*****@*****.**' , $reply_to = false ); $id = $id === 0 ? 1 : $id; $comment_limit = 10; $comments_nbr = count($this->current_posttype->query->get_comments()); $pagination = pagination_helper($comment_limit, $comments_nbr, $id, site_url(array('dashboard', 'posttype', $namespace, 'comments')), site_url(array('error', 'code', 'page-404'))); $comments = $this->current_posttype->query->get_comments(array('limit' => array('start' => riake('start', $pagination), 'end' => riake('end', $pagination)))); $this->config->set_item('comments', $comments); $this->config->set_item('comments_list_label', $this->current_posttype->comments_list_label); $this->gui->set_title($this->current_posttype->comments_list_label); $this->load->view('../modules/post_type/views/comments-list', array('pagination_data' => $pagination, 'post_namespace' => $namespace, 'comments_list_label' => $this->current_posttype->comments_list_label, 'comments' => $comments), false); } else { if ($page === 'comment-edit') { } } } } } } } else { redirect(array('dashboard', 'error', 'unknow-post-type')); } }
$q = dbUpdate($dbtable, $inp, "replid='{$cid}'"); } else { if ($opt == 'd') { // delete $q = dbDel($dbtable, "replid='{$cid}'"); $q &= dbDel("aka_siswa", "kelas='{$cid}'"); } } } //$fform->notif($q); } else { if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); } else { $r = farray('kelas', 'tingkat', 'kapasitas', 'wali', 'keterangan'); $r['tahunajaran'] = gpost('tahunajaran'); $r['tingkat'] = gpost('tingkat'); $r['kapasitas'] = 1; } $fform->dimension(450, 100); $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form $pelajaran = pelajaran_opt(gpost('tahunajaran')); $fform->fl('Kelas', kelas_name(gpost('sks_kelas'))); $fform->fi('Mata pelajaran', iSelect('pelajaran', $pelajaran, $r['kelas'])); $s = '<button title="Cari" class="btn" style="float:left" onclick="sks_guru_formlist()"><div class="bi_srcb"> </div></button>'; $fform->fi('Guru', iText('sguru', $r['sguru'], 'float:left;margin-right:4px;width:' . ($fform->rwidth - 40) . 'px', '', 'readonly', 'onclick="sks_guru_formlist()"') . $s); hiddenval('guru', $r['guru']);
$q = dbUpdate($dbtable, $inp, "replid='{$cid}'"); } else { if ($opt == 'd') { // delete $q = dbDel($dbtable, "replid='{$cid}'"); } } } $fform->notif($q); } else { if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); $r['passwd'] = ''; } else { $r = farray('nama', 'uname', 'passwd', 'rpasswd', 'keterangan'); } $fform->dimension(450, 120); $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form $fform->fi('Nama anggota', iText('nama', $r['nama'], $fform->rwidths)); $fform->fi('User ID', iText('uname', $r['uname'], $fform->rwidths)); $fform->fi('Password', iPswd('passwd', $r['passwd'], $fform->rwidths)); $fform->fi('Konfirmasi password', iPswd('rpasswd', $r['rpasswd'], $fform->rwidths)); } else { if ($opt == 'df') { // Delete form $fform->dlg_del($r['uname']); }
if (!isset($_SESSION['admin'])) header("Location:../login.php"); $sqlad = "SELECT * FROM tbl_admin ORDER BY id ASC"; $qad = mysql_query($sqlad); ?> <p><b>Set Device Management</b></p> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="23%"><div class="mn1" align="center">Username</div></td> <td width="19%"><div class="mn1" align="center">Device 1</div></td> <td width="12%"><div class="mn1" align="center">Device 2 </div></td> <td width="12%"><div class="mn1" align="center">Camera </div></td> <td width="11%"><div class="mn1" align="center">Edit</div></td> </tr> <?php while ($arrad = farray($qad)) { ?> <tr> <td><div class="mn2" align="center"><?=$arrad['username']?></div></td> <td><div class="mn2" align="center"><? if($arrad['device1']==1) echo "Yes"; else echo "No"?></div></td> <td><div class="mn2" align="center"><? if($arrad['device2']==1) echo "Yes"; else echo "No"?></div></td> <td><div class="mn2" align="center"><? if($arrad['camera']==1) echo "Yes"; else echo "No"?></div></td> <td><div class="mn2" align="center"><a href="index.php?f=device&act=adddevice&id=<?=$arrad['id']?>"> + </a></div></td> </tr> <?php } ?> </table>
if ($opt == 'd') { // delete $q = dbDel($dbtable, "replid='{$cid}'"); } } } $fform->notif($q); } else { $a = 0; if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); $a = 0; $kategorirek = kategorirek_r($a); } else { $r = farray('kategorirek', 'kode', 'nama', 'keterangan'); $r['kategorirek'] = gpost('skategorirek'); $kategorirek = kategorirek_r($r['kategorirek']); if ($r['kategorirek'] != 0) { //$r['kode']=$r['kategorirek']; } } $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form $fform->fi('Kategori', iSelect('kategorirek', $kategorirek, $r['kategorirek'], '', 'rekening_setkode()')); $fform->fi('Kode', iText('kode', $r['kode'], 'width:80px')); $fform->fi('Rekening', iText('nama', $r['nama'], $fform->rwidths)); $fform->fa('Keterangan', iTextarea('keterangan', $r['keterangan'], $fform->rwidths, 3)); } else {
} else { if ($opt == 'd') { // delete $q = dbDel($dbtable, "replid='{$cid}'"); $q = dbDel("aka_tingkat", "tahunajaran='{$cid}'"); //$q&=dbDel("aka_siswa","aka_tahunajaran='$cid'"); } } } $fform->notif($q); } else { if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); } else { $r = farray('tahunajaran', 'tglmulai', 'tglakhir', 'keterangan'); $r['departemen'] = $inp['departemen']; $r['tahunajaran'] = date("Y") . '-' . date("Y", strtotime("+1 year")); } $fform->fwidth_del = 600; $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form $fform->fl('Departemen', departemen_name($r['departemen'])); $fform->fi('Tahun Ajaran', iText('tahunajaran', $r['tahunajaran'], $fform->rwidths)); $fform->fi('Tanggal mulai', inpDate('tglmulai', $r['tglmulai'])); $fform->fi('Tanggal akhir', inpDate('tglakhir', $r['tglakhir'])); $fform->fa('Keterangan', iTextarea('keterangan', $r['keterangan'], $fform->rwidths, 3)); if ($opt == 'af' && tahunajaran_aktif($r['departemen']) != 0) { // iCheckbox (id, name, value, label, input value, style)
/** * Delete Taxonomy * * @access : Public * * @params : Int (ID) * * @return : String/Array **/ function delete_taxonomies($id) { if (is_array($id)) { $notice = array(); foreach ($id as $_id) { $notices[] = $this->delete_taxonomies($_id); } return $notices; } else { if (($taxonomy = farray($this->taxonomy_exists($id))) == TRUE and !$this->taxonomy_is_bound($id)) { if (count($this->get_taxonomies(riake('NAMESPACE', $taxonomy))) > 1) { $this->db->where('ID', $id)->where('QUERY_NAMESPACE', $this->query_namespace)->delete('query_taxonomies'); return 'taxonomy-deleted'; } return 'cant-delete-the-latest-taxonomy'; } return 'taxonomy-not-found-or-bound'; } }
// edit $q = dbUpdate($dbtable, $inp, "replid='{$cid}'"); } else { if ($opt == 'd') { // delete $q = dbDel($dbtable, "replid='{$cid}'"); } } } $fform->notif($q); } else { if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); } else { $r = farray('bagian', 'keterangan'); } $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form $fform->fi('Nama divisi', iText('bagian', $r['bagian'], $fform->rwidths)); $fform->fa('Keterangan', iTextarea('keterangan', $r['keterangan'], $fform->rwidths, 3)); } else { if ($opt == 'df') { // Delete form $fform->dlg_delw($r['bagian'], 'Data bagian pada pegawai akan menjadi kosong.'); } } $fform->foot(); }
} else { if ($opt == 'd') { // delete $q = dbDel($dbtable, "replid='{$cid}'"); //$q&=dbDel("aka_kelas","kegiatan='$cid'"); //$q&=dbDel("aka_siswa","kegiatan='$cid'"); } } } $fform->notif($q); } else { if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); } else { $r = farray('nama', 'tanggal1', 'tanggal2', 'keterangan', 'efektif'); $r['efektif'] = 0; } $fform->ptop = 60; $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form //$fform->fl('Departemen',departemen_name($r['departemen'])); //$fform->fl('Tahun ajaran',tahunajaran_name($r['tahunajaran'])); //$fform->fi('Nama Kegiatan',iText('nama',$r['nama'],$fform->rwidths)); $fform->fi('Tanggal', inputTanggal('tanggal1', $r['tanggal1'])); $fform->fi('sampai', inputTanggal('tanggal2', $r['tanggal2'])); $fform->fi('', iCheckx('efektif', 'Hari efektif', $r['efektif'], 'margin:6px 0px')); $fform->fa('Uraian kegiatan', iTextarea('keterangan', $r['keterangan'], $fform->rwidths, 8)); } else {
$q = dbUpdate($dbtable, $inp, "replid='{$cid}'"); } else { if ($opt == 'd') { // delete $q = dbDel($dbtable, "replid='{$cid}'"); $q = dbDel("psb_calonsiswa_syarat", "syarat='{$cid}'"); } } } $fform->notif($q); } else { if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); } else { $r = farray('syarat', 'wajib', 'keterangan'); $r['wajib'] = '1'; } $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form $fform->fi('Persyaratan', iText('syarat', $r['syarat'], $fform->rwidths, '', '', $cid == '1' || $cid == '2' ? 'disabled' : '')); $fform->fi('Sifat', iSelect('wajib', array('1' => 'Wajib', '0' => 'Tidak wajib'), $r['wajib'])); $fform->fa('Keterangan', iTextarea('keterangan', $r['keterangan'], $fform->rwidths, 3)); } else { if ($opt == 'df') { // Delete form $fform->dlg_del($r['syarat']); } }
dbDel($dbtable . '_ayah', "siswa='{$cid}'"); dbDel($dbtable . '_ibu', "siswa='{$cid}'"); dbDel($dbtable . '_keluarga', "siswa='{$cid}'"); dbDel($dbtable . '_kontakdarurat', "siswa='{$cid}'"); dbDel($dbtable . '_saudara', "siswa='{$cid}'"); } } } } $fform->notif($q); } else { if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); } else { $r = farray('nis', 'nisn'); $r['departemen'] = gpost('departemen'); $r['tahunajaran'] = gpost('tahunajaran'); $r['kelas'] = gpost('kelas'); } $fform->reg['title_af'] = '<idata>'; $fform->reg['title_uf'] = 'Edit <idata>'; $fform->reg['title_df'] = 'Batalkan <idata>'; $fform->dimension(350); $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form $pros = gpost('proses'); $tp = mysql_query("SELECT angkatan FROM psb_proses WHERE replid='{$pros}'"); $rp = mysql_fetch_array($tp);
/** * Get option * * Get option from database * * @access : public * @param : string * @param : int user id * @return : var (can return null if key is not set) **/ function get($key = null, $user_id = NULL, $autoload = false) { // option general otpions can be saved on global options array for autoload parameters. User Parameters must be loaded from db. if (riake($key, $this->options) && $user_id == NULL) { return $this->options[$key]; } else { if (riake($key, $this->user_options) && $user_id === 'current_user') { return $this->user_options[$key]; } } // get only data from user if ($user_id !== NULL) { $this->db->where('user', $user_id); } if ($key !== NULL) { $this->db->where('key', $key); } if ($autoload == true) { $this->db->where('autoload', true); } // fetch data $query = $this->db->get('options'); $option = $query->result_array(); // if there is any result if ($key != null) { if ($option) { $value = riake('value', farray($option)); $value = is_array($array = json_decode($value, true)) ? $array : $value; // converting array to JSON $value = in_array($value, array('true', 'false')) ? $value === 'true' ? true : false : $value; // Converting Bool to string // Internal Cache if ($user_id == NULL) { $this->options[$key] = $value; } else { $this->user_options[$key] = $value; } return $value; } } else { $key_value = array(); foreach ($option as $_option) { $value = riake('value', $_option); $value = is_array($array = json_decode($value, true)) ? $array : $value; // converting array to JSON $value = in_array($value, array('true', 'false')) ? $value === 'true' ? true : false : $value; // Converting Bool to string $key_value[riake('key', $_option)] = $value; // Internal Cache if ($user_id == NULL) { $this->options[riake('key', $_option)] = $value; } else { if ($user_id === 'current_user') { $this->user_options[$user_id] = $value; } } } return $key_value; } return NULL; }
// edit $q = dbUpdate($dbtable, $inp, "replid='{$cid}'"); } else { if ($opt == 'd') { // delete $q = dbDel($dbtable, "replid='{$cid}'"); } } } $fform->notif($q); } else { if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); } else { $r = farray('kelompok', 'keterangan'); } $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form $fform->fi('Nama kelompok', iText('kelompok', $r['kelompok'], $fform->rwidths)); $fform->fa('Keterangan', iTextarea('keterangan', $r['keterangan'], $fform->rwidths, 3)); } else { if ($opt == 'df') { // Delete form $fform->dlg_delw($r['kelompok'], 'Data kelompok pada pegawai akan menjadi kosong.'); } } $fform->foot(); }
// edit $q = dbUpdate($dbtable, $inp, "replid='{$cid}'"); } else { if ($opt == 'd') { // delete $q = dbDel($dbtable, "replid='{$cid}'"); } } } $fform->notif($q); } else { if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); } else { $r = farray('judul', 'penyelenggara', 'tempat', 'tgl1', 'tgl2', 'pembicara', 'peserta', 'jenistraining'); } $fform->ptop = 50; $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form $fform->fi('Judul', iText('judul', $r, $fform->rwidths)); $fform->fi('Penyelenggara', iText('penyelenggara', $r, $fform->rwidths)); $fform->fi('Tempat', iText('tempat', $r, $fform->rwidths)); $fform->fi('Tanggal', inputDate('tgl1', $r)); $fform->fi('', inputDate('tgl2', $r)); $fform->fi('Pembicara', iText('pembicara', $r, $fform->rwidths)); $fform->fi('Jenis training', iSelect('jenistraining', jenistraining_r($a), $r)); $fform->fa('Peserta', iTextarea('peserta', $r, $fform->rwidths, 5)); } else {
// edit $q = dbUpdate($dbtable, $inp, "replid='{$cid}'"); } else { if ($opt == 'd') { // delete $q = dbDel($dbtable, "replid='{$cid}'"); } } } $fform->notif($q); } else { if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); } else { $r = farray('posisi', 'keterangan'); } $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form $fform->fi('Nama posisi', iText('posisi', $r['posisi'], $fform->rwidths)); $fform->fa('Keterangan', iTextarea('keterangan', $r['keterangan'], $fform->rwidths, 3)); } else { if ($opt == 'df') { // Delete form $fform->dlg_delw($r['posisi'], 'Data posisi pada pegawai akan menjadi kosong.'); } } $fform->foot(); }
// edit $q = dbUpdate($dbtable, $inp, "replid='{$cid}'"); } else { if ($opt == 'd') { // delete $q = dbDel($dbtable, "replid='{$cid}'"); } } } $fform->notif($q); } else { if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); } else { $r = farray('nama', 'keterangan'); } $fform->dimension(400, 110); $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form $fform->fi('Nama jenis barang', iText('nama', $r['nama'], $fform->rwidths)); //$fform->fa('Keterangan',iTextarea('keterangan',$r['keterangan'],$fform->rwidths,3)); } else { if ($opt == 'df') { // Delete form $fform->dlg_del($r['nama']); } } $fform->foot();
// edit $q = dbUpdate($dbtable, $inp, "replid='{$cid}'"); } else { if ($opt == 'd') { // delete $q = dbDel($dbtable, "replid='{$cid}'"); } } } $fform->notif($q); } else { if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); } else { $r = farray('status', 'reminder', 'keterangan'); } $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form $fform->fi('Nama status', iText('status', $r['status'], $fform->rwidths)); $fform->fi('Reminder', iText('reminder', $r['reminder'], $fform->rwidths)); $fform->fa('Keterangan', iTextarea('keterangan', $r['keterangan'], $fform->rwidths, 3)); } else { if ($opt == 'df') { // Delete form $fform->dlg_delw($r['status'], 'Data status pada pegawai akan menjadi kosong.'); } } $fform->foot();
public function posttype($namespace, $page = 'list', $id = 0, $taxonomy_arg1 = 'list', $taxonomy_arg2 = 0) { if ($this->current_posttype = riake($namespace, get_core_vars('posttypes'))) { set_core_vars('current_posttype', $this->current_posttype); set_core_vars('post_namespace', $namespace); if ($page === 'list') { $id = $id === 0 ? 1 : $id; $post_limit = 20; $post_nbr = count($this->current_posttype->get()); $pagination = pagination_helper($post_limit, $post_nbr, $id, get_instance()->url->site_url(array('admin', 'posttype', $namespace, 'list')), get_instance()->url->site_url(array('error', 'code', 'page-404'))); set_core_vars('pagination_data', $pagination); $post = $this->current_posttype->get(array('limit' => array('start' => riake('start', $pagination), 'end' => riake('end', $pagination)))); set_core_vars('post', $post); set_core_vars('post_list_label', $this->current_posttype->posts_list_label); set_page('title', $this->current_posttype->posts_list_label, 'Post List Label [#Unexpected error occured]'); $this->load->the_view('admin/posttypes/list', false); } else { if ($page === 'new') { set_core_vars('post_namespace', $namespace); set_core_vars('new_post_label', $this->current_posttype->new_post_label); $this->load->library('form_validation'); $this->form_validation->set_rules('post_title', __('Post title')); if ($this->form_validation->run()) { $return = $this->current_posttype->set($this->input->post('post_title'), $this->input->post('post_content'), riake('post_meta', $_POST), riake('post_taxonomy', $_POST), $this->input->post('post_status'), $this->input->post('post_parent'), $status = 'set'); if (riake('msg', $return) === 'custom-query-saved') { get_instance()->url->redirect(array('admin', 'posttype', $namespace, 'edit', riake('id', $return) . '?notice=' . riake('msg', $return))); } get_instance()->notice->push_notice(fetch_notice_output(riake('msg', $return))); } set_page('title', $this->current_posttype->new_post_label, 'Post List Label [#Unexpected error occured]'); $this->load->the_view('admin/posttypes/create', false); } else { if ($page === 'edit') { set_core_vars('post_namespace', $namespace); set_core_vars('new_post_label', $this->current_posttype->new_post_label); $this->load->library('form_validation'); $this->form_validation->set_rules('post_title', __('Post title')); if ($this->form_validation->run()) { $return = $this->current_posttype->update($this->input->post('post_title'), $this->input->post('post_content'), riake('post_meta', $_POST), riake('post_taxonomy', $_POST), $this->input->post('post_status'), $this->input->post('post_parent'), $status = 'publish', $id); if (riake('msg', $return) === 'custom-query-saved') { get_instance()->url->redirect(array('admin', 'posttype', $namespace, 'edit', riake('id', $return) . '?notice=' . riake('msg', $return))); } get_instance()->notice->push_notice(fetch_notice_output(riake('msg', $return))); } set_core_vars('post', farray($this->current_posttype->get(array('where' => array('id' => $id))))); // print_array( get_core_vars( 'post' ) );die; set_page('title', $this->current_posttype->edit_post_label, 'Post List Label [#Unexpected error occured]'); $this->load->the_view('admin/posttypes/edit', false); } else { if ($page === 'taxonomy') { // $id is taxonomy namespace here if (in_array($id, array_keys(force_array($taxonomy = $this->current_posttype->query->get_defined_taxonomies())))) { set_core_vars('current_taxonomy', $current_taxonomy = riake($id, $taxonomy)); set_core_vars('taxonomy_namespace', $taxonomy_namespace = $id); set_core_vars('taxonomy', $taxonomy); set_core_vars('taxonomy_list_label', riake('taxonomy-list-label', $current_taxonomy)); if ($taxonomy_arg1 === 'list') { $taxonomy_limit = 20; $taxonomy_arg2 = $taxonomy_arg2 === 0 ? 1 : $taxonomy_arg2; set_core_vars('taxonomies_nbr', $taxonomies_nbr = count($this->current_posttype->query->get_taxonomies($taxonomy_namespace))); set_core_vars('pagination', $pagination = pagination_helper($taxonomy_limit, $taxonomies_nbr, $taxonomy_arg2, get_instance()->url->site_url(array('admin', 'posttype', $namespace, $page, $id, $taxonomy_arg1)), get_instance()->url->site_url(array('error', 'code', 'page-404')))); set_core_vars('taxonomies', $this->current_posttype->query->get_taxonomies($pagination['start'], $pagination['end'])); set_page('title', riake('new-taxonomy-label', $current_taxonomy), 'Post List Label [#Unexpected error occured]'); $this->load->the_view('admin/posttypes/taxonomy-list', false); } else { if ($taxonomy_arg1 === 'new') { $this->load->library('form_validation'); $this->form_validation->set_rules('taxonomy_title', __('Taxonomy Title'), 'required'); if ($this->form_validation->run()) { $result = $this->current_posttype->query->set_taxonomy($id, $this->input->post('taxonomy_title'), $this->input->post('taxonomy_content'), in_array($this->input->post('taxonomy_parent'), array(false, ''), TRUE) ? null : $this->input->post('taxonomy_parent')); get_instance()->notice->push_notice(fetch_notice_output($result)); } set_page('title', riake('new-taxonomy-label', $current_taxonomy, __('New taxonomy')), 'Post List Label [#Unexpected error occured]'); $this->load->the_view('admin/posttypes/taxonomy-create', false); } else { if ($taxonomy_arg1 === 'edit') { $this->load->library('form_validation'); $this->form_validation->set_rules('taxonomy_title', __('Taxonomy Title'), 'required'); if ($this->form_validation->run()) { $result = $this->current_posttype->query->update_taxonomy($id, $this->input->post('taxonomy_title'), $this->input->post('taxonomy_content'), in_array($this->input->post('taxonomy_parent'), array(false, ''), TRUE) ? null : $this->input->post('taxonomy_parent'), $taxonomy_arg2); get_instance()->notice->push_notice(fetch_notice_output('taxonomy-set')); } set_core_vars('taxonomy_id', $taxonomy_arg2); set_core_vars('get_taxonomy', farray($this->current_posttype->query->get_taxonomies($taxonomy_namespace, $taxonomy_arg2, 'as_id'))); set_page('title', riake('edit-taxonomy-label', $current_taxonomy, __('Edit taxonomy')), 'Post List Label [#Unexpected error occured]'); $this->load->the_view('admin/posttypes/taxonomy-edit', false); } } } } else { $this->url->redirect(array('error', 'code', 'unknow-taxonomy')); } } else { if ($page === 'comments') { if ($taxonomy_arg1 == 'approve') { } else { if ($taxonomy_arg1 == 'disapprove') { } else { if ($taxonomy_arg1 == 'trash') { } else { if ($taxonomy_arg1 == 'draft') { } } } } // $this->current_posttype->query->post_comment( 1 , 'Custom' , $author = false , $mode = 'create' , $comment_id = null , $author_name = 'Blair' , $author_email = '*****@*****.**' , $reply_to = false ); $id = $id === 0 ? 1 : $id; $comment_limit = 10; $comments_nbr = count($this->current_posttype->query->get_comments()); $pagination = pagination_helper($comment_limit, $comments_nbr, $id, get_instance()->url->site_url(array('admin', 'posttype', $namespace, 'comments')), get_instance()->url->site_url(array('error', 'code', 'page-404'))); set_core_vars('pagination_data', $pagination); $comments = $this->current_posttype->query->get_comments(array('limit' => array('start' => riake('start', $pagination), 'end' => riake('end', $pagination)))); set_core_vars('comments', $comments); set_core_vars('comments_list_label', $this->current_posttype->comments_list_label); set_page('title', $this->current_posttype->comments_list_label, 'Post List Label [#Unexpected error occured]'); $this->load->the_view('admin/posttypes/comments-list', false); } else { if ($page === 'comment-edit') { } } } } } } } else { $this->url->redirect(array('error', 'code', 'unknow-post-type')); } }
// edit $q = dbUpdate($dbtable, $inp, "replid='{$cid}'"); } else { if ($opt == 'd') { // delete $q = dbDel($dbtable, "replid='{$cid}'"); } } } $fform->notif($q); } else { if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); } else { $r = farray('tingkat', 'keterangan'); } $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form $fform->fi('Nama tingkat', iText('tingkat', $r['tingkat'], $fform->rwidths)); $fform->fa('Keterangan', iTextarea('keterangan', $r['keterangan'], $fform->rwidths, 3)); } else { if ($opt == 'df') { // Delete form $fform->dlg_delw($r['tingkat'], 'Data tingkat pada pegawai akan menjadi kosong.'); } } $fform->foot(); }
// edit $q = dbUpdate($dbtable, $inp, "replid='{$cid}'"); } else { if ($opt == 'd') { // delete $q = dbDel($dbtable, "replid='{$cid}'"); } } } $fform->notif($q); } else { if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); } else { $r = farray('nama', 'kode', 'tanggal1', 'keterangan'); $r['tanggal1'] = date("Y-m-d"); } $fform->dimension(400, 120); $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form $fform->fi('Nama tahun buku', iText('nama', $r['nama'], $fform->rwidths)); hiddenval('kode', $r['kode']); //$fform->fi('Kode awalan kwitansi',iText('kode',$r['kode'],'width:80px')); $fform->fi('Tanggal mulai', inputDate('tanggal1', $r['tanggal1'])); $fform->fi('Saldo awal', iTextC('saldoawal', $r['saldoawal'], 'width:120px')); $fform->fa('Keterangan', iTextarea('keterangan', $r['keterangan'], $fform->rwidths, 3)); } else { if ($opt == 'df') {
// edit $q = dbUpdate($dbtable, $inp, "replid='{$cid}'"); } else { if ($opt == 'd') { // delete $q = dbDel($dbtable, "replid='{$cid}'"); } } } $fform->notif($q); } else { if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); } else { $r = farray('kode', 'nama', 'keterangan'); $r['kelompokbrg'] = gpost('kelompokbrg'); $r['tanggal'] = date("Y-m-d"); $r['unit'] = 1; $r['satuan'] = 'unit'; } $fform->dimension(400, 110); $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form $fform->fl('Jenis barang', kelompokbrg_name($r['kelompokbrg'])); $fform->fi('Kode', iText('kode', $r['kode'], 'width:100px')); $fform->fi('Nama barang', iText('nama', $r['nama'], $fform->rwidths)); $fform->fi('Jumlah barang', iText('unit', $r['unit'], 'width:100px') . ' satuan: ' . iText('satuan', $r['satuan'], 'width:50px')); $fform->fi('Tanggal diperoleh', inputTanggal('tanggal', $r['tanggal']));
/** * Get user By id **/ function get($user_id) { $user = $this->auth->get_user_by_id($user_id); return farray($user); }
} else { if ($opt == 'd') { // delete $q = dbDel($dbtable, "replid='{$cid}'"); $q &= dbDel("psb_kelompok", "proses='{$cid}'"); $q &= dbDel("psb_calonsiswa", "proses='{$cid}'"); } } } $fform->notif($q); } else { if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); } else { $r = farray('proses', 'kodeawalan', 'angkatan', 'tglmulai', 'tglselesai', 'kapasitas', 'departemen', 'aktif', 'keterangan'); $r['tglmulai'] = date("Y-m-d"); $r['tglselesai'] = date("Y-m-d", strtotime("+7 day")); $r['departemen'] = gpost('departemen'); $r['aktif'] = '1'; $r['kapasitas'] = 1; } $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form $fform->fl('Departemen', departemen_name($r['departemen']), $fform->rwidths); $fform->fi('Nama periode', iText('proses', $r['proses'], $fform->rwidths)); $fform->fi('Kode awalan', iText('kodeawalan', $r['kodeawalan'], "width:80px")); $fform->fi('Angkatan', iSelect('angkatan', angkatan_opt($r['departemen']), $r['angkatan'])); //$fform->fi('Tanggal dibuka',inputTanggal('tglmulai',$r['tglmulai']));
} else { if ($opt == 'd') { // delete $q = dbDel($dbtable, "replid='{$cid}'"); } } } $fform->notif($q); } else { if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); $dept = $r['departemen']; } else { // af $r = farray('uname', 'level', 'departemen'); $r['level'] = 2; $dept = 0; } $departemen = departemen_r($a, 1); $modul = array('psb' => 'Penerimaan Siswa Baru', 'aka' => 'Akademik', 'pus' => 'Perpustakaan', 'hrd' => 'Kepegawaian', 'sar' => 'Sarpras', 'keu' => 'Keuangan'); $ulevel = array(1 => 'Administrator', 2 => 'Operator', 3 => 'Guest'); $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form $fform->fi('Username', iText('uname', $r['uname'], $fform->rwidths)); $fform->fi('Level', iSelect('level', $ulevel, $r['level'])); $fform->fi('Modul', iSelect('app', $modul, $r['app'])); $fform->fi('Departemen', iSelect('departemen', $departemen, $dept)); } else {
$xform = new xform($fmod, $opt, $cid); $klasifikasi = klasifikasi_opt(); $pengarang = pengarang_opt(); $penerbit = penerbit_opt(); $bahasa = bahasa_opt(); $jenisbuku = jenisbuku_opt(); //$opf=gpost('opf'); //hiddenval('opf',$opf); if ($opt == 'uf') { // Nilai field editan $t = mysql_query("SELECT * FROM pus_katalog WHERE replid='{$cid}' LIMIT 0,1"); $data = mysql_fetch_array($t); $ttl = 'Edit'; } else { // Nilai field default $data = farray('replid', 'judul', 'klasifikasi-kode', 'klasifikasi', 'pengarang', 'penerbit', 'isbn', 'issn', 'penerjemah', 'tahunterbit', 'editor', 'photo', 'kota', 'volume', 'seri', 'bahasa', 'jenisbuku', 'deskripsi', 'callnumber'); $data['halaman'] = 1; $data['pengarang'] = '-'; //$data['tahunterbit']=date("Y"); $ttl = 'Tambah'; } $xform->title($ttl . ' katalog buku'); $xform->table_begin(); $xform->col_begin('50%'); // Kolom kiri lebar 50% $xform->set_fieldw(280); $xform->group_begin('Informasi Katalog Buku'); // Grup field $a = explode("`", $data['judul']); $xform->fi('Judul', iText('judul1', $a[0], $xform->fieldws, '', '', 'onkeyup="katalog_getcallnumber()"')); $xform->fi('', iText('judul2', $a[1], $xform->fieldws));
$q = dbUpdate($dbtable, $inp, "replid='{$cid}'"); } else { if ($opt == 'd') { // delete $q = dbDel($dbtable, "replid='{$cid}'"); } } } $fform->notif($q); } else { if ($opt == 'uf' || $opt == 'df') { // Prepocessing form $r = dbSFA("*", $dbtable, "W/replid='{$cid}'"); $r['passwd'] = ''; } else { $r = farray('nama', 'keterangan', 'ufile', 'fname'); } $fform->dimension(450, 120); $fform->head(); if ($opt == 'af' || $opt == 'uf') { require_once MODDIR . 'control.php'; // Add or Edit form $fform->fi('Judul', iText('nama', $r['nama'], $fform->rwidths)); $fform->fa('Deskripsi', iTextarea('keterangan', $r['keterangan'], $fform->rwidths, 3)); app_form_fu(); } else { if ($opt == 'df') { // Delete form $fform->dlg_del($r['nama']); } }