function data($id = '') { $this->form_validation->set_rules('db_nis', 'NIS', 'required'); $this->form_validation->set_rules('db_kelas', 'Kelas', 'callback_cek_kelas'); if ($this->form_validation->run() === FALSE) { if (isset($id) && trim($id) !== '') { $this->data['q'] = $this->kelas->get_detail_kelas($id); } $this->LoadView('kelas/form', $this->data); } else { if (isset($_POST['j_action']) and $_POST['j_action'] !== '') { if ($_POST['j_action'] == 'update_param' and trim($id) !== '') { $d = parseForm($_POST); $this->db->update('kelas', $d, array('id' => $_POST['id_param'])); $this->data['msg'] = setMessage('update', 'kelas'); $this->LoadView('template/msg', $this->data); } else { $d = parseForm($_POST); $this->db->insert('kelas', $d); $this->data['msg'] = setMessage('insert', 'kelas'); $this->LoadView('template/msg', $this->data); } } } }
function view() { $this->form_validation->set_rules('db_nama_sekolah', 'Nama Sekolah', 'required'); $this->form_validation->set_rules('db_alamat', 'Alamat', 'required'); $this->form_validation->set_rules('db_telp', 'No. Telp', 'required'); if ($this->form_validation->run() === FALSE) { $this->data['row'] = $this->profile->get_data_profile(); $this->LoadView('profile/view', $this->data); } else { $d = parseForm($_POST); $this->db->update('profilakademik', $d); $this->LoadView('profile/view', $this->data); } }
function _view() { $this->form_validation->set_rules('db_biayapotong', 'Biaya Potongan', 'required'); if ($this->form_validation->run() === FALSE) { $a = $this->db->get_where('potonganpulsa', array('id' => '1')); $this->data['row'] = $a->row(); $this->LoadView('profile/potongpulsa', $this->data); } else { $d = parseForm($_POST); if (!isset($_POST['db_stat_potong_pulsa'])) { $d['stat_potong_pulsa'] = '0'; } else { $d['stat_potong_pulsa'] = '1'; } $this->db->update('potonganpulsa', $d, array('id' => '1')); redirect('potongpulsa'); } }
function data($id = '') { $this->form_validation->set_rules('db_NIS', 'NIS', 'required|callback_cek_deposit'); if ($this->form_validation->run() === FALSE) { $this->LoadView('voucher/form', $this->data); } else { if (isset($_POST['j_action']) and $_POST['j_action'] !== '') { if ($_POST['j_action'] == 'add_param') { $d = parseForm($_POST); $d['TGLAWAL'] = date('Y-m-d'); $d['SISAPULSA'] = $_POST['db_PULSA']; $this->db->insert('pulsa', $d); $this->data['msg'] = setMessage('insert', 'voucher'); $this->LoadView('template/msg', $this->data); } } else { redirect('voucher'); } } }
function data($id = '') { $this->form_validation->set_rules('db_tanggal', 'Tanggal', 'required'); $this->form_validation->set_rules('db_NIS', 'NIS', 'required'); if ($this->form_validation->run() === FALSE) { $this->load->model('referensi_model', 'ref'); $this->data['ta'] = $this->ref->get_ta_aktif(); $this->data['sem'] = $this->ref->get_sem_aktif(); $this->LoadView('absensi/form', $this->data); } else { if (isset($_POST['j_action']) and $_POST['j_action'] !== '') { if ($_POST['j_action'] == 'add_param') { $d = parseForm($_POST); $this->db->insert('absensi', $d); $this->data['msg'] = setMessage('insert', 'absensi'); $this->LoadView('template/msg', $this->data); } } else { redirect('absensi'); } } }
function data($id = '') { $this->load->model('referensi_model', 'ref'); $this->form_validation->set_rules('db_kelas', 'Kelas', 'required'); $this->form_validation->set_rules('db_walikls', 'Wali Kelas', 'required|callback_cek_walikelas'); if ($this->form_validation->run() === FALSE) { $this->data['sem'] = $this->ref->get_sem_aktif(); $this->data['tahunajaran'] = $this->refkelas->get_tahun_ajaran(); $this->data['tingkat'] = array('0' => '-- Silakan Pilih --', '1' => '1', '2' => '2', '3' => '3'); $this->data['program'] = array('0' => '-- Silakan Pilih --', '-' => '-', 'IPA' => 'IPA', 'IPS' => 'IPS'); $this->LoadView('refkelas/form', $this->data); } else { if (isset($_POST['j_action']) and $_POST['j_action'] !== '') { if ($_POST['j_action'] == 'add_param') { $d = parseForm($_POST); $this->db->insert('refkelas', $d); $this->data['msg'] = setMessage('insert', 'refkelas'); $this->LoadView('template/msg', $this->data); } } else { redirect('refkelas'); } } }
* @author Jin Cong<*****@*****.**> */ define('LOAD_TEMPLATE', true); define('LOAD_FORM', true); define('LOAD_MYSQL', true); define('IN_ADMIN', true); require '../cm_includes/entry.php'; isset($_GET['id']) ? $id = (int) $_GET['id'] : header("Location: " . CM_ROOT . '/cm_admin/'); if (isset($_GET['delete']) && $_GET['delete'] == 1) { $tpl->assign('tooltip', tableParser('profiles', 'delete', array('id' => $id)) ? 'You have successfuly delete the profile.<br />Check out more profiles <a href="' . CM_URL . '/cm_admin/list.php">here</a>.' : 'Delete the profile resulted failed.'); } else { $frm = new SpoonForm('profile'); $get_user = tableParser('profiles', 'getProf', array('id' => $id)); if (empty($get_user)) { $tpl->assign('tooltip', 'Profile not available'); } else { //set form value $pf = parseForm($frm, 'profile', $get_user); $update = $pf[0] == 3 ? tableParser('profiles', 'update', array_merge($pf[1], array('id' => $id))) : false; //set profile image & attachment path isset($get_user['photo']) && strlen($get_user['photo']) > 0 && $tpl->assign('photo_path', CM_URL . '/cm_api/images.php?thumbnail=1&id=' . $id); isset($get_user['attachment']) && strlen($get_user['attachment']) > 0 && $tpl->assign('attach_path', CM_URL . '/cm_api/attachments.php?id=' . $id); $tpl->assign('id', $id); $tpl->assign('lastupdate', date(DATE_RFC822, $get_user['lastupdate'])); if ($pf[0] == 3) { $tpl->assign('tooltip', $update ? 'You have successfuly edit the profile.<br />' : 'Edit the profile resulted failed.'); } $frm->parse($tpl); } } $tpl->display(tpl_path('admin_edit.tpl.php'));
$Path[site] = $Raiz[local] . $cfg[path_site]; // Prepara archivos de apoyo require_once $Raiz[local] . $cfg[php_functions]; require_once $Raiz[local] . $cfg[php_mysql]; require_once $Raiz[local] . $cfg[php_postgres]; require_once $Raiz[local] . $cfg[php_tpl]; require_once $Raiz[local] . $cfg[path_php] . 'inc.constructHtml.php'; // Parametros de URL encriptados o legibles if ($cfg[encrypt_onoff]) { $parm = $var; } else { foreach ($var as $llave => $valor) { $parm[$llave] = strtolower($llave); } } // Parsea parámetros obtenidos por URL y los pone en arrays: $in[] y $ins[] parseFormSanitizer($_GET, $_POST); # $ins[] parseForm($_GET, $_POST); # $in[] # Diccionario de idioma $idioma = !isset($_SESSION[idioma]) ? strtoupper($cfg[idioma]) : strtoupper($_SESSION[idioma]); if ($idioma == 'EN') { $dicFile = $cfg[path_dic_en]; } else { $dicFile = $cfg[path_dic_es]; } diccionario($Raiz[local] . $dicFile); } else { include_once $_SESSION['header_path']; }
public function baru() { $this->form_validation->set_rules('db_nama_debitur', 'Nama Debitur', 'required|max_length[255]'); // $this->form_validation->set_rules('db_key_person', 'Key Person', 'required|max_length[255]'); // $this->form_validation->set_rules('db_alamat_usaha', 'Alamat Usaha', 'required|max_length[255]'); // $this->form_validation->set_rules('db_alamat_rumah', 'Alamat Rumah', 'required|max_length[255]'); // $this->form_validation->set_rules('db_nomor_ktp', 'Nomor KTP', 'required|max_length[255]'); // $this->form_validation->set_rules('masa_berlaku_ktp', 'Masa Berlaku KTP', ''); // $this->form_validation->set_rules('db_bidang_usaha', 'Bidang Usaha', 'required|max_length[255]'); // $this->form_validation->set_rules('db_sektor_ekonomi', 'Sektor Ekonomi', 'required|max_length[255]'); // $this->form_validation->set_rules('db_npwp', 'NPWP', 'required|max_length[255]'); // $this->form_validation->set_rules('db_akta_pendirian', 'Akta Pendirian', 'required|max_length[255]'); // $this->form_validation->set_rules('db_situ', 'SITU', 'required|max_length[255]'); // $this->form_validation->set_rules('db_siup', 'SIUP', 'required|max_length[255]'); // $this->form_validation->set_rules('db_siuug', 'SIUUG', 'required|max_length[255]'); // $this->form_validation->set_rules('db_tdp', 'TDP', 'required|max_length[255]'); // $this->form_validation->set_rules('db_maksimum_kredit', 'Maksimum Kredit', 'required|max_length[255]'); // $this->form_validation->set_rules('db_keperluan_kredit', 'Keperluan Kredit', 'required|max_length[255]'); // $this->form_validation->set_rules('db_jangka_waktu_kredit', 'Jangka Waktu Kredit', 'required|max_length[255]'); // $this->form_validation->set_rules('db_nomor_surat_permohonan_kredit', 'Nomor Surat Permohonan Kredit', 'required|max_length[255]'); // $this->form_validation->set_rules('tanggal_surat_permohonan_kredit', 'Tanggal Surat Permohonan Kredit', ''); // $this->form_validation->set_rules('db_produk_yang_dijual', 'Produk yang dijual', 'required|max_length[255]'); // $this->form_validation->set_rules('db_rata_rata_penjualan_perbulan', 'Rata - rata Penjualan Perbulan', 'required|max_length[255]'); // $this->form_validation->set_rules('db_rata_pembelian_bahan_baku', 'Rata Pembelian Bahan Baku', 'required|max_length[255]'); // $this->form_validation->set_rules('db_laba_kotor_perbulan', 'Laba Kotor Perbulan', 'required|max_length[255]'); // $this->form_validation->set_rules('db_biaya_operasional_per_bulan', 'Biaya Operasional Per Bulan', 'required|max_length[255]'); // $this->form_validation->set_rules('db_biaya_hidup_per_bulan', 'Biaya Hidup Per Bulan', 'required|max_length[255]'); // $this->form_validation->set_rules('db_biaya_lain_lain', 'Biaya Lain Lain', 'required|max_length[255]'); // $this->form_validation->set_rules('db_total_biaya', 'Total Biaya', 'required|max_length[255]'); // $this->form_validation->set_rules('db_laba_bersih_per_bulan', 'Laba Bersih Per Bulan', 'required|max_length[255]'); // $this->form_validation->set_rules('db_rata_rata_laba_bersih', 'Rata - Rata Laba Bersih', 'required|max_length[255]'); // $this->form_validation->set_rules('db_lama_usaha', 'Lama Usaha', 'required|max_length[11]'); // $this->form_validation->set_rules('db_legalitas_usaha', 'Legalitas Usaha', 'required|max_length[255]'); // $this->form_validation->set_rules('db_legalitas_agunan', 'Legalitas Agunan', 'required|max_length[255]'); // $this->form_validation->set_rules('db_jenis_agunan', 'Jenis Agunan', 'required|max_length[255]'); // $this->form_validation->set_rules('db_luas_tanah', 'Luas Tanah', 'required|max_length[255]'); // $this->form_validation->set_rules('db_luas_bangunan', 'Luas Bangunan', 'required|max_length[255]'); // $this->form_validation->set_rules('db_shm', 'Nomor SHM', 'required|max_length[255]'); // $this->form_validation->set_rules('db_imb', 'Nomor IMB', 'required|max_length[255]'); // $this->form_validation->set_rules('db_alamat', '', 'required|max_length[255]'); // $this->form_validation->set_rules('db_harga_pasar_tanah', 'Harga Pasar Tanah (/m2)', 'required|max_length[255]'); // $this->form_validation->set_rules('db_harga_pasar_bangunan', 'Harga Pasar Bangunan (/m2)', 'required|max_length[255]'); if ($this->form_validation->run() === FALSE) { $this->template->load('index', 'nasabah_baru', $this->data); } else { $q = explode('/', $this->input->post('masa_berlaku_ktp')); $w = explode('/', $this->input->post('tanggal_surat_permohonan_kredit')); $d = array(); $d = parseForm($this->input->post()); $d['masa_berlaku_ktp'] = @$q[2] . '-' . @$q[0] . '-' . @$q[1]; $d['tanggal_surat_permohonan_kredit'] = @$w[2] . '-' . @$w[0] . '-' . @$w[1]; $d['pendapatan_perbulan'] = str_replace('.', '', $this->input->post('pendapatan_perbulan')); $d['pendapatan_lain'] = str_replace('.', '', $this->input->post('pendapatan_lain')); $d['laba_kotor_perbulan'] = str_replace('.', '', $this->input->post('laba_kotor_perbulan')); $d['biaya_hidup_per_bulan'] = str_replace('.', '', $this->input->post('biaya_hidup_per_bulan')); $d['biaya_lain_lain'] = str_replace('.', '', $this->input->post('biaya_lain_lain')); $d['total_pendapatan'] = str_replace('.', '', $this->input->post('total_pendapatan')); $d['pendapatan_bersih_per_bulan'] = str_replace('.', '', $this->input->post('pendapatan_bersih_per_bulan')); $d['rata_rata_pendapatan_bersih'] = str_replace('.', '', $this->input->post('rata_rata_pendapatan_bersih')); $d['harga_pasar_bangunan'] = str_replace('.', '', $this->input->post('harga_pasar_bangunan')); $d['harga_pasar_tanah'] = str_replace('.', '', $this->input->post('harga_pasar_tanah')); $d['maksimum_kredit'] = str_replace('.', '', $this->input->post('maksimum_kredit')); if ($this->db->insert('elos_nasabah_konsumen', $d)) { redirect('ak'); } } }
<?php define('LOAD_TEMPLATE', true); define('LOAD_FORM', true); define('LOAD_MYSQL', true); define('IN_ADMIN', true); define('IN_SEARCH', true); require '../cm_includes/entry.php'; $tpl->assign('isSearch', true); $frm = new SpoonForm('profile', NULL, 'get'); $pf = parseForm($frm, 'profile'); if ($pf[0] == 3) { $query = tableParser('profiles', 'searchLimit', $frm->getValues('form', 'submit', '_utf8')); if (count($query) > 0) { $tpl->assign('isResult', true); foreach ($query as $key => $value) { if (isset($value['photo'])) { $query[$key]['photo'] = '<img src="' . CM_URL . '/cm_api/images.php?id=' . $value['id'] . '&thumbnail=1" />'; } $query[$key]['action'] = '<a href="' . CM_URL . '/cm_admin/edit.php?id=' . $value['id'] . '" target="_blank">Edit</a><br /><a href="' . CM_URL . '/cm_admin/profile.php?id=' . $value['id'] . '" target="_blank">Print</a><br /><a href="" id="' . $value['id'] . '" class="delProfile">Delete</a>'; if (isset($query[$key]['attachment']) && strlen($query[$key]['attachment']) > 0) { $query[$key]['action'] .= '<br /><a href="' . CM_URL . '/cm_api/attachments.php?id=' . $value['id'] . '" target="_blank">Attach</a>'; } } //datagrid, generating results table $grid = new SpoonDataGridSourceArray($query); $datagrid = new SpoonDatagrid($grid); $datagrid->setColumnsHidden('id', 'attachment'); $datagrid->setCompileDirectory(COMPILE_PATH); $url = $_SERVER['QUERY_STRING'] ? cleanQuery($_SERVER['QUERY_STRING']) . 'offset=[offset]&order=[order]&sort=[sort]' : '?offset=[offset]&order=[order]&sort=[sort]'; $datagrid->setURL($url);
function data($id = '') { $tingkat = array('0' => '-- Silakan Pilih --', '1' => '1', '2' => '2', '3' => '3'); $program = array('0' => '-- Silakan Pilih --', '-' => '-', 'IPA' => 'IPA', 'IPS' => 'IPS', 'BAHASA' => 'BAHASA'); $this->form_validation->set_rules('db_KDMP', 'Kode Mata Pelajaran', 'required'); $this->form_validation->set_rules('db_MP', 'Mata Pelajaran', 'required'); $this->form_validation->set_rules('db_ALIAS', 'Tempat Lahir', 'required'); if ($this->form_validation->run() === FALSE) { if (isset($id) && trim($id) !== '') { $this->data['row'] = $this->mapel->get_detail_mapel($id); } $this->data['tingkat'] = $tingkat; $this->data['program'] = $program; $this->data['nip'] = $this->mapel->get_guru_mp(); $this->LoadView('mapel/form', $this->data); } else { if (isset($_POST['j_action']) and $_POST['j_action'] !== '') { if ($_POST['j_action'] == 'update_param' and trim($id) !== '') { $d = parseForm($_POST); $this->db->update('mp', $d, array('ID' => $_POST['id_param'])); $this->data['msg'] = setMessage('update', 'mapel'); $this->LoadView('template/msg', $this->data); } else { $d = parseForm($_POST); $this->db->insert('mp', $d); $this->data['msg'] = setMessage('insert', 'mapel'); $this->LoadView('template/msg', $this->data); } } } }
function parseForm() { if (!isset($_GET['date'])) { echo '<p>Form has not yet been submitted.</p>'; return; } if (!preg_match('|^(\\d{2})/(\\d{2})/(\\d{4})$|', $_GET['date'], $matches)) { echo '<p>Incorrectly formed input.</p>'; return; } $year = $matches[3]; $month = $matches[1]; $day = $matches[2]; if (!checkdate($month, $day, $year)) { echo '<p>Date not in valid range.</p>'; return; } $date = getdate(mktime(0, 0, 0, $month, $day, $year)); $day_offset = (7 + $date['wday'] - 1) % 7; // All issues are published on Monday. $mon_tstamp = mktime(0, 0, 0, $month, $day - $day_offset, $year); $mon_string = date('m/d/Y', $mon_tstamp); $mon_url = htmlspecialchars("http://img.timeinc.net/time/magazine/archive/covers/" . date('Y/1101ymd', $mon_tstamp) . "_400.jpg"); echo "<figure>" . " <img" . " src='{$mon_url}'" . " alt='{$mon_string}'" . " />" . " <figcaption>" . " Time U.S. cover for the issue published on {$mon_string}." . " </figcaption>" . "</figure>"; } date_default_timezone_set('UTC'); parseForm(); ?> </body> </html>
$bcc .= ",{$bcc_to_test}"; } } } // prepare the content $sent_at = date('F jS, Y') . ' at ' . date('h:iA (T).'); $content .= "The following was submitted on " . $sent_at . "\n"; $content .= "and processed by the NewTek server." . $_SERVER['REMOTE_ADDR'] . " - " . $_SERVER['HTTP_REFERER'] . "\n\n"; // Set the mail subject. $subject = getPostValue('subject'); if ($subject == '') { $subject = $config->getDirective('subject'); } $content .= "Subject: {$subject}\n"; $sendBlank = $config->getDirective('send_blank_fields'); $content .= parseForm($sendBlank); $required_list = $config->getDirective('required_fields'); if ($required_list[0] != '') { for ($i = 0; $i < count($required_list); $i++) { $required_list[$i] = trim($required_list[$i]); $the_value = getPostValue($required_list[$i]); if ($the_value == '') { $errorlist .= "Missing field: {$required_list[$i]}<BR>\n"; } } } // Check if there are file(s) to attach -- if so do it. $blockextns = $config->getDirective('non_valid_extensions'); // allowed extensions setup. $temp = strtolower(implode(",", $blockextns)); $nono = $badextns;
$_REQUEST['type'] = "view"; } if (!isset($_REQUEST['format'])) { $_REQUEST['format'] = "html"; } if (!isset($_REQUEST['src'])) { displayLocalImage("images/warning.png", "view"); exit; } $format = $_REQUEST['format']; $type = $_REQUEST['type']; $out = ""; $arr = array(); $style = ""; if ($_REQUEST['src'] == "form") { $arr = parseForm($_POST); $out = exportArray($arr, $format, "dataform", ".dataform {width:800px;height:auto !important;margin:auto;} .dataform tr td:nth-child(2) {width:200px;}"); } elseif ($_REQUEST['src'] == "memsql") { if (isset($_REQUEST['sqlid'])) { if (isset($_SESSION[$_REQUEST['sqlid']])) { $sql = $_SESSION[$_REQUEST['sqlid']]; $arr = parseSQL($sql); $out = exportArray($arr, $format, "datatable", ".datatable {margin:auto;width:100%;} .datatable tr td {min-width:75px;}"); } else { displayLocalImage("images/warning.png", "view"); exit; } } else { displayLocalImage("images/warning.png", "view"); exit; }
function data($id = '') { $this->form_validation->set_rules('nama', 'Guru', 'required|callback_cek_ketersediaan_guru'); if ($this->form_validation->run() === FALSE) { $this->data['ta'] = $this->ref->get_ta_aktif(); $this->data['sem'] = $this->ref->get_sem_aktif(); $this->data['tingkat'] = array('0' => '-- Silakan Pilih --', '1' => 'I', '2' => 'II', '3' => 'III'); $this->LoadView('pengampu/form', $this->data); } else { if (isset($_POST['j_action']) and $_POST['j_action'] !== '') { if ($_POST['j_action'] == 'add_param') { $d = parseForm($_POST); $this->db->insert('pengampu', $d); $this->data['msg'] = setMessage('insert', 'pengampu'); $this->LoadView('template/msg', $this->data); } } else { redirect('pengampu'); } } }
<?php /** * Client Manager * * Login Page * @package Client Manager 0.2 alpha * @author Jin Cong<*****@*****.**> */ define('LOAD_TEMPLATE', true); define('LOAD_FORM', true); define('LOAD_MYSQL', true); define('IN_LOGIN', true); require 'cm_includes/entry.php'; $frm = new SpoonForm('login'); $pf = parseForm($frm, 'login'); $pf[0] == 3 && $pf[1] && header('Location: ' . CM_URL); $frm->parse($tpl); $tpl->display(tpl_path('login.tpl.php'));
function data($id = '') { $this->form_validation->set_rules('db_NAMA', 'Nama', 'required'); $this->form_validation->set_rules('db_NIS', 'NIS', 'required'); $this->form_validation->set_rules('db_TMPLHR', 'Tempat Lahir', 'required'); $this->form_validation->set_rules('db_ALAMAT', 'Alamat', 'required'); $this->form_validation->set_rules('db_NOHP1', 'No. Telp', 'required'); if ($this->form_validation->run() === FALSE) { if (isset($id) && trim($id) !== '') { $this->data['row'] = $this->siswa->get_detail_siswa($id); } $this->data['agama'] = $this->referensi_model->get_data_ref('agama'); $this->data['jabatan'] = $this->referensi_model->get_data_ref('jabatan'); $this->data['jk'] = $this->referensi_model->get_data_ref('jk'); $this->LoadView('siswa/form', $this->data); } else { if (isset($_POST['j_action']) and $_POST['j_action'] !== '') { if ($_POST['j_action'] == 'update_param' and trim($id) !== '') { $d = parseForm($_POST); $d['TGLLHR'] = parseFormTgl('tgllhr'); $this->db->update('siswa', $d, array('NIS' => $_POST['id_param'])); $this->data['msg'] = setMessage('update', 'siswa'); $this->LoadView('template/msg', $this->data); } else { $d = parseForm($_POST); $d['TGLLHR'] = parseFormTgl('tgllhr'); $this->db->insert('siswa', $d); $this->data['msg'] = setMessage('insert', 'siswa'); $this->LoadView('template/msg', $this->data); } } } }
function data($id = '') { $this->form_validation->set_rules('db_nama_semester', 'Nama Semester', 'required'); if ($this->form_validation->run() === FALSE) { $this->LoadView('semester/form', $this->data); } else { if (isset($_POST['j_action']) and $_POST['j_action'] !== '') { if ($_POST['j_action'] == 'add_param') { $d = parseForm($_POST); $this->db->insert('semester', $d); $this->data['msg'] = setMessage('insert', 'semester'); $this->LoadView('template/msg', $this->data); } } else { redirect('semester'); } } }
function data($id = '') { $this->form_validation->set_rules('db_tahun', 'Tahun', 'required'); $this->form_validation->set_rules('db_mulai', 'Periode Awal', 'required'); $this->form_validation->set_rules('db_akhir', 'Periode Akhir', 'required'); if ($this->form_validation->run() === FALSE) { $this->data['sem'] = array('0' => '-- Silakan Pilih --', '1' => 'Ganjil', '2' => 'Genap'); $this->LoadView('tahunajaran/form', $this->data); } else { if (isset($_POST['j_action']) and $_POST['j_action'] !== '') { if ($_POST['j_action'] == 'add_param') { $d = parseForm($_POST); $this->db->insert('tahunajaran', $d); $this->data['msg'] = setMessage('insert', 'tahunajaran'); $this->LoadView('template/msg', $this->data); } } else { redirect('tahunajaran'); } } }
$titem->owner = $titem->escape($_POST["organiser"]); } else { $titem->owner = getCurrentUID(); } return $titem; } $logoAssigned = false; if (isset($_GET["action"])) { switch ($_GET["action"]) { case 'edit': if (isset($_POST["submitBtn"])) { $form = null; if (isset($_POST["id"])) { $form = parseForm($_POST["id"]); } else { $form = parseForm(); } $form->details = stripslashes($form->details); $master->Smarty->assign("event", $form); if (isset($_POST["delete"])) { $form->delete(); header('Location: intranet.php?p=timetable'); die; } else { if (streq($_POST["submitBtn"], "Update")) { //Update or switch type $game = new Lan_games(); if (isset($_POST["game"]) && 1 == $game->get($game->escape($_POST["game"]))) { $master->Smarty->assign("image", "images/games/" . $game->picture); $logoAssigned = true; } else {
function data($id = '') { $this->form_validation->set_rules('db_TANGGAL', 'Tanggal', 'required'); $this->form_validation->set_rules('db_JAM', 'Waktu', 'required|callback_cek_jadwal'); if ($this->form_validation->run() === FALSE) { $this->data['ta'] = $this->ref->get_ta_aktif(); $this->data['sem'] = $this->ref->get_sem_aktif(); $this->data['tingkat'] = array('0' => '-- Silakan Pilih --', '1' => 'I', '2' => 'II', '3' => 'III'); $this->data['hari'] = array('SENIN' => 'SENIN', 'SELASA' => 'SELASA', 'RABU' => 'RABU', 'KAMIS' => 'KAMIS', 'JUMAT' => 'JUMAT', 'SABTU' => 'SABTU', 'MINGGU' => 'MINGGU'); $this->LoadView('ujian/form', $this->data); } else { if (isset($_POST['j_action']) and $_POST['j_action'] !== '') { if ($_POST['j_action'] == 'add_param') { $d = parseForm($_POST); $d['ALIASHARI'] = substr($_POST['db_HARI'], 0, 3); $this->db->insert('ujian', $d); $this->data['msg'] = setMessage('insert', 'ujian'); $this->LoadView('template/msg', $this->data); } } else { redirect('ujian'); } } }
function data($id = '') { $this->form_validation->set_rules('db_tanggal', 'Tanggal', 'required'); $this->form_validation->set_rules('db_NIS', 'NIS', 'required'); $this->form_validation->set_rules('db_kasus', 'Kasus', 'required'); $this->form_validation->set_rules('db_keterangan', 'Keterangan', 'required'); if ($this->form_validation->run() === FALSE) { $this->data['sem'] = $this->ref->get_sem_aktif(); $this->data['tahun'] = $this->ref->get_id_tahunajaran(); $this->LoadView('kasus/form', $this->data); } else { if (isset($_POST['j_action']) and $_POST['j_action'] !== '') { if ($_POST['j_action'] == 'add_param') { $d = parseForm($_POST); $this->db->insert('kasus', $d); if ($_POST['db_kirimsms'] == '1') { /* cek apakah ada biaya potong pulsa */ $pot = $this->kasus->cek_potongan_aktif(); if ($pot->stat_potong_pulsa == '1') { $this->db->query("UPDATE pulsa SET SISAPULSA = SISAPULSA - " . $pot->biayapotong . " WHERE NIS='" . $_POST['db_NIS'] . "'"); } //$dep = $this->kasus->cek_deposit($_POST['db_NIS']); $f['DestinationNumber'] = $_POST['hportu']; $f['TextDecoded'] = $_POST['sms']; //$this->db->insert('outbox', $f); } $this->data['msg'] = setMessage('insert', 'kasus'); $this->LoadView('template/msg', $this->data); } } else { redirect('kasus'); } } }