I code element with visual composer. I want to use fontawesome in element.
Code here show list font-awesome in param visual composer
<code>
array(
'type' => 'iconpicker',
'heading' => esc_html__('Fontawesome', 'interior'),
'param_name' => 'fontawesome_icon',
'settings' => array(
'type' => 'fontawesome'
),
'description' => esc_html__( 'Fontawesome list. Pickup your choice.', 'interior'
),
'dependency' => array(
'element' => 'icon_type',
'value' => array( 'fontawesome-icon' )
)
</code>
I showed list icon in element but i chosen it don't saved and i don't know get value font-awsome display html.
Help me!!!
I have made a code only for Font Awesome Icon... You can try this
below code. it's tested and definitely works. here I have used
"Facebook" in title...Let me know via comment if you found any issue
in code or having any trouble for this.
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
if( !class_exists( 'RN_FA_Icon_list' ) ) {
class RN_FA_Icon_list {
private $shortcode;
function __construct() {
/* shortcode base */
$this->shortcode = 'rn_fa_icon_list';
add_action( 'init', array( $this, 'rn_map_shortcode' ) );
add_shortcode( $this->shortcode, array( $this, 'rn_create_shortcode' ) );
}
function rn_map_shortcode( $atts, $content = NULL ) {
if( function_exists( 'vc_map' ) ) {
vc_map(
array(
'name' => esc_html__( 'Font Awesome Icon', 'rn_shortcodes' ),
//'icon' => RN_SHORTCODES_URL . '/admin/img/vc_icons/fancy-list.png',
'base' => $this->shortcode,
'category' => 'Structual',
'class' => 'rn-vc-icon-module rn-structual-module',
'content_element' => true,
'params' => array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Description', 'rn_shortcodes' ),
'description' => esc_html__( 'Only for internal use. This adds a label to Visual Composer for an easier element identification.', 'rn_shortcodes' ),
'param_name' => 'list_description',
'admin_label' => true,
'group' => 'General'
),
array(
'type' => 'iconpicker',
'heading' => __( 'Icon', 'js_composer' ),
'param_name' => 'icon_fontawesome',
'value' => 'fa fa-adjust',
'group' => 'General',
'settings' => array(
'emptyIcon' => false,
'type' => 'fontawesome',
'iconsPerPage' => 4000,
),
'dependency' => array(
'element' => 'type',
'value' => 'fontawesome',
),
'description' => __( 'Select icon from library.', 'js_composer' ),
),
array(
'type' => 'css_editor',
'param_name' => 'css',
'group' => esc_html__( 'Design Options', 'rn_shortcodes' ),
),
)
)
); /* end mapping */
}
}
function rn_create_shortcode( $atts, $content = NULL ) {
extract( shortcode_atts( array (
'icon_fontawesome' => '',
'css' => ''
), $atts ) );
/* extract list items */
if( function_exists('vc_param_group_parse_atts') && !empty( $values ) ) {
$values = vc_param_group_parse_atts( $values );
}
/* unique listz ID */
$id = uniqid("rn_fa_");
$output = '';
$output .= '<div id="' . esc_attr( $id ) . '">';
$output .= '<i class="' . $icon_fontawesome . '"></i> Facebook';
$output .= '</div>';
return '<div class="wpb_content_element ' . apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css, ' ' ), $this->shortcode, $atts ) . '">' . $output . '</div>';
}
}
}
new RN_FA_Icon_list;
?>
I have a database and form with some trigger in phpmyadmin. When I input the value manually on phpmyadmin, the trigger is executed normally. The problem is, when I input the value by form I made with codeigniter, the trigger is not executed, and there is no error. Can anybody help me?
This is the controller
<?php if (!defined('BASEPATH')) exit ('No direct script access allowed');
class Pengujian extends MY_Controller
{
public $data = array(
'modul' => 'pengujian',
'breadcrumb' => 'Pengujian',
'pesan' => '',
'pagination' => '',
'tabel_data' => '',
'main_view' => 'view_pengujian/pengujian_view',
'form_action' => '',
'form_value' => '',
'option_uji' => '',
);
public function __construct()
{
parent::__construct();
$this->load->model('Pengujian_model', 'pengujian', TRUE);
$this->load->model('Peralatan_model', 'peralatan', TRUE);
$this->load->model('Penerangan_model', 'penerangan', TRUE);
$this->load->model('Kemudi_model', 'kemudi', TRUE);
$this->load->model('Suspensi_model', 'suspensi', TRUE);
$this->load->model('Banpelek_model', 'banpelek', TRUE);
$this->load->model('Rangka_model', 'rangka', TRUE);
$this->load->model('Rem_model', 'rem', TRUE);
$this->load->model('Gasbuang_model', 'gasbuang', TRUE);
$this->load->model('Mesin_model', 'mesin', TRUE);
$this->load->model('Lainlain_model', 'lainlain', TRUE);
$this->load->model('Lainlain2_model', 'lainlain2', TRUE);
$this->load->model('Akhir_model', 'akhir', TRUE);
$this->load->helper('form');
//$this->load->model('Penguji_model', 'penguji', TRUE);
}
public function index($offset = 0)
{
$this->session->unset_userdata('no_pengujian_sekarang', '');
$pengujian = $this->pengujian->cari_semua($offset);
if ($pengujian)
{
$tabel = $this->pengujian->buat_tabel($pengujian);
$this->data['tabel_data'] = $tabel;
$this->data['pagination'] = $this->pengujian->paging(site_url('pengujian/halaman'));
}
else
{
$this->data['pesan'] = 'Tidak ada data pengujian';
}
$this->load->view('template', $this->data);
}
public function tambah1()
{
$this->data['breadcrumb'] = 'Pengujian > Tambah > Awal';
$this->data['main_view'] = 'view_pengujian/pengujian_form';
$this->data['form_action'] = 'pengujian/tambah1';
if($this->input->post('submit'))
{
if($this->pengujian->validasi_tambah())
{
if($this->pengujian->tambah1())
{
$this->session->set_flashdata('pesan', ' Proses tambah data berhasil');
redirect('pengujian/tambah2');
}
else
{
$this->data['pesan'] = 'Proses tambah data gagal';
$this->load->view('template', $this->data);
}
}
else
{
$this->load->view('template', $this->data);
}
}
else
{
$this->load->view('template', $this->data);
}
}
public function tambah2()
{
$this->data['breadcrumb'] = 'Pengujian > Tambah > Peralatan';
$this->data['main_view'] = 'view_pengujian/peralatan_form';
$this->data['form_action'] = 'pengujian/tambah2';
if($this->input->post('submit'))
{
if($this->peralatan->validasi_tambah())
{
if($this->peralatan->tambah2())
{
$this->session->set_flashdata('pesan', ' Proses tambah data berhasil');
redirect('pengujian/tambah3');
}
else
{
$this->data['pesan'] = 'Proses tambah data gagal';
$this->load->view('template', $this->data);
}
}
else
{
$this->load->view('template', $this->data);
}
}
else
{
$this->load->view('template', $this->data);
}
}
I have until tambah12 methods, for each method, it must load from 12 models too, and 12 forms.
This is model
private function load_form_rules_tambah()
{
$form = array(
array(
'field' => 'NO_PENGUJIAN',
'label' => 'no pengujian',
'rules' => 'required'
),
);
return $form;
}
public function validasi_tambah()
{
$form = $this->load_form_rules_tambah();
$this->form_validation->set_rules($form);
if($this->form_validation->run())
{
return TRUE;
}
else
{
return FALSE;
}
}
public function tambah1()
{
$pengujian = array(
'NO_PENGUJIAN' => $this->input->post('NO_PENGUJIAN'),
'NO_PEMERIKSAAN' => $this->input->post('NO_PEMERIKSAAN'),
'LOKASI_PENGUJIAN' => $this->input->post('LOKASI_PENGUJIAN'),
'NO_KODE' => $this->input->post('NO_KODE'),
'NO_KENDARAAN' => $this->input->post('NO_KENDARAAN'),
'PEMILIK_KENDARAAN' => $this->input->post('PEMILIK_KENDARAAN'),
'TYPE_MERK_PABRIK' => $this->input->post('TYPE_MERK_PABRIK'),
'JENIS_KENDARAAN' => $this->input->post('JENIS_KENDARAAN'),
'MULAI_DIPERGUNAKAN' => $this->input->post('MULAI_DIPERGUNAKAN'),
'NO_LAPORAN' => $this->input->post('NO_LAPORAN'),
'JENIS_PEMERIKSAAN' => $this->input->post('JENIS_PEMERIKSAAN'),
'JARAK_PEMAKAIAN' => $this->input->post('JARAK_PEMAKAIAN'),
'BERAT_KENDARAAN' => $this->input->post('BERAT_KENDARAAN'),
'PERALATAN' => $this->input->post('PERALATAN'),
'SISTEM_PENERANGAN' => $this->input->post('SISTEM_PENERANGAN'),
'SISTEM_KEMUDI' => $this->input->post('SISTEM_KEMUDI'),
'AS_DAN_SUSPENSI' => $this->input->post('AS_DAN_SUSPENSI'),
'BAN_DAN_PELEK' => $this->input->post('BAN_DAN_PELEK'),
'RANGKA_DAN_BODI' => $this->input->post('RANGKA_DAN_BODI'),
'SISTEM_REM' => $this->input->post('SISTEM_REM'),
'SISTEM_REM_GAS_BUANG' => $this->input->post('SISTEM_REM_GAS_BUANG'),
'MESIN_TRANSMISI' => $this->input->post('MESIN_TRANSMISI'),
'LAIN_LAIN' => $this->input->post('LAIN_LAIN'),
'LAIN_LAIN2' => $this->input->post('LAIN_LAIN2')
);
//$this->load->library('form_validation');
$this->db->insert($this->db_tabel, $pengujian);
if($this->db->affected_rows() > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}
and this
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Peralatan_model extends CI_Model
{
public $db_tabel ='peralatan';
//public $offset = 0;
//public function cari_semua($offset = 0);
public function tambah2()
{
$peralatan = array(
'NO_CHASIS' => $this->input->post('NO_CHASIS'),
'PLAT_PABRIK_PEMBUAT' => $this->input->post('PLAT_PABRIK_PEMBUAT'),
'PLAT_NOMOR' => $this->input->post('PLAT_NOMOR'),
'TULISAN' => $this->input->post('TULISAN'),
'PENGHAPUS_KACA_DEPAN' => $this->input->post('PENGHAPUS_KACA_DEPAN'),
'KLAKSON' => $this->input->post('KLAKSON'),
'KACA_SPION' => $this->input->post('KACA_SPION'),
'PANDANGAN_KE_DEPAN' => $this->input->post('PANDANGAN_KE_DEPAN'),
'KACA_PENAHAN_SINAR' => $this->input->post('KACA_PENAHAN_SINAR'),
'ALAT_PENGENDALIAN' => $this->input->post('ALAT_PENGENDALIAN'),
'LAMPU_INDIKASI' => $this->input->post('LAMPU_INDIKASI'),
'SPEEDOMETER' => $this->input->post('SPEEDOMETER'),
'PERLENGKAPAN' => $this->input->post('PERLENGKAPAN')
);
//$this->load->library('form_validation');
$this->db->insert($this->db_tabel, $peralatan);
if($this->db->affected_rows() > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}
private function load_form_rules_tambah()
{
$form = array(
array(
'field' => 'NO_PENGUJIAN',
'label' => 'no chasis',
'rules' => 'required'
),
);
return $form;
}
public function validasi_tambah()
{
$form = $this->load_form_rules_tambah();
$this->form_validation->set_rules($form);
if($this->form_validation->run())
{
return TRUE;
}
else
{
return FALSE;
}
}
}
this is the form
<?php
$form = array(
'no pengujian' => array(
'name' => 'NO_PENGUJIAN',
'size' => '30',
'class' => 'form_field',
'value' => set_value('NO_PENGUJIAN', isset($form_value['NO_PENGUJIAN']) ? $form_value['NO_PENGUJIAN'] : '')),
'no pemeriksaan' => array(
'name' => 'NO_PEMERIKSAAN',
'size' => '30',
'class' => 'form_field',
'value' => set_value('NO_PEMERIKSAAN', isset($form_value['NO_PEMERIKSAAN']) ? $form_value['NO_PEMERIKSAAN'] : '')),
'lokasi pengujian' => array(
'name' => 'LOKASI_PENGUJIAN',
'size' => '30',
'class' => 'form_field',
'value' => set_value('LOKASI_PENGUJIAN', isset($form_value['LOKASI_PENGUJIAN']) ? $form_value['LOKASI_PENGUJIAN'] : '')),
'no kode' => array(
'name' => 'NO_KODE',
'size' => '30',
'class' => 'form_field',
'value' => set_value('NO_KODE', isset($form_value['NO_KODE']) ? $form_value['NO_KODE'] : '')),
'no kendaraan' => array(
'name' => 'NO_KENDARAAN',
'size' => '30',
'class' => 'form_field',
'value' => set_value('NO_KENDARAAN', isset($form_value['NO_KENDARAAN']) ? $form_value['NO_KENDARAAN'] : '')),
'pemilik kendaraan' => array(
'name' => 'PEMILIK_KENDARAAN',
'size' => '30',
'class' => 'form_field',
'value' => set_value('PEMILIK_KENDARAAN', isset($form_value['[PEMILIK_KENDARAAN]']) ? $form_value['PEMILIK_KENDARAAN'] : '')),
'type merk pabrik' => array(
'name' => 'TYPE_MERK_PABRIK',
'size' => '30',
'class' => 'form_field',
'value' => set_value('TYPE_MERK_PABRIK', isset($form_value['TYPE_MERK_PABRIK']) ? $form_value['TYPE_MERK_PABRIK'] : '')),
'jenis kendaraan' => array(
'name' => 'JENIS_KENDARAAN',
'size' => '30',
'class' => 'form_field',
'value' => set_value('JENIS_KENDARAAN', isset($form_value['JENIS_KENDARAAN']) ? $form_value['JENIS_KENDARAAN'] : '')),
'mulai dipergunakan' => array(
'name' => 'MULAI_DIPERGUNAKAN',
'size' => '30',
'class' => 'form_field',
'value' => set_value('MULAI_DIPERGUNAKAN', isset($form_value['MULAI_DIPERGUNAKAN']) ? $form_value['MULAI_DIPERGUNAKAN'] : '')),
'no laporan' => array(
'name' => 'NO_LAPORAN',
'size' => '30',
'class' => 'form_field',
'value' => set_value('NO_LAPORAN', isset($form_value['NO_LAPORAN']) ? $form_value['NO_LAPORAN'] : '')),
'jenis pemeriksaan' => array(
'name' => 'JENIS_PEMERIKSAAN',
'size' => '30',
'class' => 'radio',
'value' => set_value('JENIS_PEMERIKSAAN', isset($_POST['JENIS_PEMERIKSAAN']))),
'jarak pemakaian' => array(
'name' => 'JARAK_PEMAKAIAN',
'size' => '30',
'class' => 'form_field',
'value' => set_value('JARAK_PEMAKAIAN', isset($form_value['JARAK_PEMAKAIAN']) ? $form_value['JARAK_PEMAKAIAN'] : '')),
'berat kendaraan' => array(
'name' => 'BERAT_KENDARAAN',
'size' => '30',
'class' => 'form_field',
'value' => set_value('BERAT_KENDARAAN', isset($form_value['BERAT_KENDARAAN']) ? $form_value['BERAT_KENDARAAN'] : '')),
'peralatan' => array(
'name' => 'PERALATAN',
'size' => '30',
'value' => set_value('PERALATAN', isset($form_value['PERALATAN']) ? $form_value['PERALATAN'] : '')),
'sistem penerangan' => array(
'name' => 'SISTEM_PENERANGAN',
'size' => '30',
'value' => set_value('SISTEM_PENERANGAN', isset($form_value['SISTEM_PENERANGAN']) ? $form_value['SISTEM_PENERANGAN'] : '')),
'sistem kemudi' => array(
'name' => 'SISTEM_KEMUDI',
'size' => '30',
'value' => set_value('SISTEM_KEMUDI', isset($form_value['SISTEM_KEMUDI']) ? $form_value['SISTEM_KEMUDI'] : '')),
'as dan suspensi' => array(
'name' => 'AS_DAN_SUSPENSI',
'size' => '30',
'value' => set_value('AS_DAN_SUSPENSI', isset($form_value['AS_DAN_SUSPENSI']) ? $form_value['AS_DAN_SUSPENSI'] : '')),
'ban dan pelek' => array(
'name' => 'BAN_DAN_PELEK',
'size' => '30',
'value' => set_value('BAN_DAN_PELEK', isset($form_value['BAN_DAN_PELEK']) ? $form_value['BAN_DAN_PELEK'] : '')),
'rangka dan bodi' => array(
'name' => 'RANGKA_DAN_BODI',
'size' => '30',
'value' => set_value('RANGKA_DAN_BODI', isset($form_value['RANGKA_DAN_BODI']) ? $form_value['RANGKA_DAN_BODI'] : '')),
'sistem rem' => array(
'name' => 'SISTEM_REM',
'size' => '30',
'value' => set_value('SISTEM_REM', isset($form_value['SISTEM_REM']) ? $form_value['SISTEM_REM'] : '')),
'sistem rem gas buang' => array(
'name' => 'SISTEM_REM_GAS_BUANG',
'size' => '30',
'value' => set_value('SISTEM_REM_GAS_BUANG', isset($form_value['SISTEM_REM_GAS_BUANG']) ? $form_value['SISTEM_REM_GAS_BUANG'] : '')),
'mesin transmisi' => array(
'name' => 'MESIN_TRANSMISI',
'size' => '30',
'value' => set_value('MESIN_TRANSMISI', isset($form_value['MESIN_TRANSMISI']) ? $form_value['MESIN_TRANSMISI'] : '')),
'lain lain' => array(
'name' => 'LAIN_LAIN',
'size' => '30',
'value' => set_value('LAIN_LAIN', isset($form_value['LAIN_LAIN']) ? $form_value['LAIN_LAIN'] : '')),
'lain lain2' => array(
'name' => 'LAIN_LAIN2',
'size' => '30',
'value' => set_value('LAIN_LAIN2', isset($form_value['LAIN_LAIN2']) ? $form_value['LAIN_LAIN2'] : '')),
'submit' => array(
'name' => 'submit',
'id' => 'submit',
'value' => 'Simpan'
)
);
?>
<h2><?php echo $breadcrumb ?></h2>
<!-- pesan start -->
<?php if (! empty($pesan)) : ?>
<div class="pesan">
<?php echo $pesan; ?>
</div>
<?php endif ?>
<!-- pesan end -->
<!-- form start -->
<?php echo form_open($form_action); ?>
<p>
<?php echo form_label('No Pengujian', 'NO_PENGUJIAN'); ?>
<?php echo form_input($form['no pengujian']); ?>
</p>
<?php echo form_error('NO_PENGUJIAN', '<p class = "field_error">', '</p>');?>
<p>
<?php echo form_label('No Pemeriksaan', 'NO_PEMERIKSAAN'); ?>
<?php echo form_input($form['no pemeriksaan']); ?>
</p>
<?php echo form_error('NO_PEMERIKSAAN', '<p class = "field_error">', '</p>');?>
<p>
<?php echo form_label('Lokasi Pengujian', 'LOKASI_PENGUJIAN'); ?>
<?php echo form_input($form['lokasi pengujian']); ?>
</p>
<?php echo form_error('LOKASI_PENGUJIAN', '<p class = "field_error">', '</p>');?>
<p>
<?php echo form_label('No Kode', 'NO_KODE'); ?>
<?php echo form_input($form['no kode']); ?>
</p>
<?php echo form_error('NO_KODE', '<p class = "field_error">', '</p>');?>
<p>
<?php echo form_label('No Kendaraan', 'NO_KENDARAAN'); ?>
<?php echo form_input($form['no kendaraan']); ?>
</p>
<?php echo form_error('NO_KENDARAAN', '<p class = "field_error">', '</p>');?>
<p>
<?php echo form_label('Pemilik Kendaraan', 'PEMILIK_KENDARAAN'); ?>
<?php echo form_input($form['pemilik kendaraan']); ?>
</p>
<?php echo form_error('PEMILIK_KENDARAAN', '<p class = "field_error">', '</p>');?>
<p>
<?php echo form_label('Type Merk Pabrik', 'TYPE_MERK_PABRIK'); ?>
<?php echo form_input($form['type merk pabrik']); ?>
</p>
<?php echo form_error('TYPE_MERK_PABRIK', '<p class = "field_error">', '</p>');?>
<p>
<?php echo form_label('Jenis Kendaraan', 'JENIS_KENDARAAN'); ?>
<?php echo form_input($form['jenis kendaraan']); ?>
</p>
<?php echo form_error('JENIS_KENDARAAN', '<p class = "field_error">', '</p>');?>
<p>
<?php echo form_label('Mulai Dipergunakan', 'MULAI_DIPERGUNAKAN'); ?>
<?php echo form_input($form['mulai dipergunakan']); ?>
</p>
<?php echo form_error('MULAI_DIPERGUNAKAN', '<p class = "field_error">', '</p>');?>
<p>
<?php echo form_label('No Laporan', 'NO_LAPORAN'); ?>
<?php echo form_input($form['no laporan']); ?>
</p>
<?php echo form_error('NO_LAPORAN', '<p class = "field_error">', '</p>');?>
<p>
<?php echo form_label('Jenis Pemeriksaan', 'JENIS_PEMERIKSAAN'); ?>
<?php echo form_radio('JENIS_PEMERIKSAAN', 'Utama'); ?> Utama
<?php echo form_radio('JENIS_PEMERIKSAAN', 'Ulang'); ?> Ulang
</p>
<p>
<?php echo form_label('Jarak Pemakaian', 'JARAK_PEMAKAIAN'); ?>
<?php echo form_input($form['jarak pemakaian']); ?>
</p>
<?php echo form_error('JARAK_PEMAKAIAN', '<p class = "field_error">', '</p>');?>
<p>
<?php echo form_label('Berat Kendaraan', 'BERAT_KENDARAAN'); ?>
<?php echo form_input($form['berat kendaraan']); ?>
</p>
<?php echo form_error('BERAT_KENDARAAN', '<p class = "field_error">', '</p>');?>
<p>
<?php echo form_submit($form['submit']); ?>
<?php echo anchor('pengujian', 'Batal', array('class' => 'cancel')) ?>
</p>
<?php echo form_close(); ?>
<?php echo var_dump($form["no pengujian"]); ?>
and this
<?php
$form = array(
'no pengujian' => array(
'name' => 'NO_PENGUJIAN',
'size' => '30',
'class' => 'form_field',
'value' => set_value('NO_PENGUJIAN', isset($form_value['NO_PENGUJIAN']) ? $form_value['NO_PENGUJIAN'] : '')),
'no chasis' => array(
'name' => 'NO_CHASIS',
'size' => '30',
'class' => 'radio',
'value' => set_value('NO_CHASIS', isset($_POST['NO_CHASIS']))),
'plat pabrik pembuat' => array(
'name' => 'PLAT_PABRIK_PEMBUAT',
'size' => '30',
'class' => 'radio',
'value' => set_value('PLAT_PABRIK_PEMBUAT', isset($_POST['PLAT_PABRIK_PEMBUAT']))),
'plat nomor' => array(
'name' => 'PLAT_NOMOR',
'size' => '30',
'class' => 'radio',
'value' => set_value('PLAT_NOMOR', isset($_POST['PLAT_NOMOR']))),
'tulisan' => array(
'name' => 'TULISAN',
'size' => '30',
'class' => 'radio',
'value' => set_value('TULISAN', isset($_POST['TULISAN']))),
'penghapus kaca depan' => array(
'name' => 'PENGHAPUS_KACA_DEPAN',
'size' => '30',
'class' => 'radio',
'value' => set_value('PENGHAPUS_KACA_DEPAN', isset($_POST['PENGHAPUS_KACA_DEPAN']))),
'klakson' => array(
'name' => 'KLAKSON',
'size' => '30',
'class' => 'radio',
'value' => set_value('KLAKSON', isset($_POST['KLAKSON']))),
'kaca spion' => array(
'name' => 'KACA_SPION',
'size' => '30',
'class' => 'radio',
'value' => set_value('KACA_SPION', isset($_POST['KACA_SPION']))),
'pandangan ke depan' => array(
'name' => 'PANDANGAN_KE_DEPAN',
'size' => '30',
'class' => 'radio',
'value' => set_value('PANDANGAN_KE_DEPAN', isset($_POST['PANDANGAN_KE_DEPAN']))),
'kaca penahan sinar' => array(
'name' => 'KACA_PENAHAN_SINAR',
'size' => '30',
'class' => 'radio',
'value' => set_value('KACA_PENAHAN_SINAR', isset($_POST['KACA_PENAHAN_SINAR']))),
'alat pengendalian' => array(
'name' => 'ALAT_PENGENDALIAN',
'size' => '30',
'class' => 'radio',
'value' => set_value('ALAT_PENGENDALIAN', isset($_POST['ALAT_PENGENDALIAN']))),
'lampu indikasi' => array(
'name' => 'LAMPU_INDIKASI',
'size' => '30',
'class' => 'radio',
'value' => set_value('LAMPU_INDIKASI', isset($_POST['LAMPU_INDIKASI']))),
'speedometer' => array(
'name' => 'SPEEDOMETER',
'size' => '30',
'class' => 'radio',
'value' => set_value('SPEEDOMETER', isset($_POST['SPEEDOMETER']))),
'perlengkapan' => array(
'name' => 'PERLENGKAPAN',
'size' => '30',
'class' => 'radio',
'value' => set_value('PERLENGKAPAN', isset($_POST['PERLENGKAPAN']))),
'submit' => array(
'name' => 'submit',
'id' => 'submit',
'value' => 'Simpan'
)
);
?>
<h2><?php echo $breadcrumb ?></h2>
<!-- pesan start -->
<?php if (! empty($pesan)) : ?>
<div class="pesan">
<?php echo $pesan; ?>
</div>
<?php endif ?>
<!-- pesan end -->
<!-- form start -->
<?php echo form_open($form_action); ?>
<p>
<?php echo form_label('No Pengujian', 'NO_PENGUJIAN'); ?>
<?php echo form_input($form['no pengujian']); ?>
</p>
<?php echo form_error('NO_PENGUJIAN', '<p class = "field_error">', '</p>');?>
<p>
<?php echo form_label('No Chasis', 'NO_CHASIS'); ?>
<?php echo form_radio('NO_CHASIS', 'Lulus'); ?> Lulus
<?php echo form_radio('NO_CHASIS', 'Gagal'); ?> Gagal
</p>
<p>
<?php echo form_label('Plat Pabrik Pembuat', 'PLAT_PABRIK_PEMBUAT'); ?>
<?php echo form_radio('PLAT_PABRIK_PEMBUAT', 'Lulus'); ?> Lulus
<?php echo form_radio('PLAT_PABRIK_PEMBUAT', 'Gagal'); ?> Gagal
</p>
<p>
<?php echo form_label('Plat Nomor', 'PLAT_NOMOR'); ?>
<?php echo form_radio('PLAT_NOMOR', 'Lulus'); ?> Lulus
<?php echo form_radio('PLAT_NOMOR', 'Gagal'); ?> Gagal
</p>
<p>
<?php echo form_label('Tulisan', 'TULISAN'); ?>
<?php echo form_radio('TULISAN', 'Lulus'); ?> Lulus
<?php echo form_radio('TULISAN', 'Gagal'); ?> Gagal
</p>
<p>
<?php echo form_label('Penghapus Kaca Depan', 'PENGHAPUS_KACA_DEPAN'); ?>
<?php echo form_radio('PENGHAPUS_KACA_DEPAN', 'Lulus'); ?> Lulus
<?php echo form_radio('PENGHAPUS_KACA_DEPAN', 'Gagal'); ?> Gagal
</p>
<p>
<?php echo form_label('Klakson', 'KLAKSON'); ?>
<?php echo form_radio('KLAKSON', 'Lulus'); ?> Lulus
<?php echo form_radio('KLAKSON', 'Gagal'); ?> Gagal
</p>
<p>
<?php echo form_label('Kaca Spion', 'KACA_SPION'); ?>
<?php echo form_radio('KACA_SPION', 'Lulus'); ?> Lulus
<?php echo form_radio('KACA_SPION', 'Gagal'); ?> Gagal
</p>
<p>
<?php echo form_label('Pandangan Ke Depan', 'PANDANGAN_KE_DEPAN'); ?>
<?php echo form_radio('PANDANGAN_KE_DEPAN', 'Lulus'); ?> Lulus
<?php echo form_radio('PANDANGAN_KE_DEPAN', 'Gagal'); ?> Gagal
</p>
<p>
<?php echo form_label('Kaca Penahan Sinar', 'KACA_PENAHAN_SINAR'); ?>
<?php echo form_radio('KACA_PENAHAN_SINAR', 'Lulus'); ?> Lulus
<?php echo form_radio('KACA_PENAHAN_SINAR', 'Gagal'); ?> Gagal
</p>
<p>
<?php echo form_label('Alat Pengendalian', 'ALAT_PENGENDALIAN'); ?>
<?php echo form_radio('ALAT_PENGENDALIAN', 'Lulus'); ?> Lulus
<?php echo form_radio('ALAT_PENGENDALIAN', 'Gagal'); ?> Gagal
</p>
<p>
<?php echo form_label('Lampu Indikasi', 'LAMPU_INDIKASI'); ?>
<?php echo form_radio('LAMPU_INDIKASI', 'Lulus'); ?> Lulus
<?php echo form_radio('LAMPU_INDIKASI', 'Gagal'); ?> Gagal
</p>
<p>
<?php echo form_label('Speedometer', 'SPEEDOMETER'); ?>
<?php echo form_radio('SPEEDOMETER', 'Lulus'); ?> Lulus
<?php echo form_radio('SPEEDOMETER', 'Gagal'); ?> Gagal
</p>
<p>
<?php echo form_label('Perlengkapan', 'PERLENGKAPAN'); ?>
<?php echo form_radio('PERLENGKAPAN', 'Lulus'); ?> Lulus
<?php echo form_radio('PERLENGKAPAN', 'Gagal'); ?> Gagal
</p>
<p>
<?php echo form_submit($form['submit']); ?>
<?php echo anchor('pengujian', 'Batal', array('class' => 'cancel')) ?>
</p>
<?php echo form_close(); ?>
and this is the trigger form php myadmin
CREATE TRIGGER `trigger_peralatan` BEFORE INSERT ON `peralatan`
FOR EACH ROW begin
if (new.NO_CHASIS = "Lulus"
AND new.PLAT_PABRIK_PEMBUAT = "Lulus"
AND new.PLAT_NOMOR = "Lulus"
AND new.TULISAN = "Lulus"
AND new.PENGHAPUS_KACA_DEPAN = "Lulus"
AND new.KLAKSON = "Lulus"
AND new.KACA_SPION = "Lulus"
AND new.PANDANGAN_KE_DEPAN = "Lulus"
AND new.KACA_PENAHAN_SINAR = "Lulus"
AND new.ALAT_PENGENDALIAN = "Lulus"
AND new.LAMPU_INDIKASI = "Lulus"
AND new.SPEEDOMETER = "Lulus"
AND new.PERLENGKAPAN = "Lulus")
then
UPDATE pengujian
SET PERALATAN = "Lulus"
WHERE NO_PENGUJIAN = new.NO_PENGUJIAN;
else
UPDATE pengujian
SET PERALATAN = "Gagal"
WHERE NO_PENGUJIAN = new.NO_PENGUJIAN; end if;
end
and this for the last trigger
CREATE TRIGGER `trigger_nilai` BEFORE INSERT ON `pengujian`
FOR EACH ROW begin
if
(new.AS_DAN_SUSPENSI = "Lulus" AND
new.BAN_DAN_PELEK = "Lulus" AND
new.LAIN_LAIN = "Lulus" AND
new.LAIN_LAIN2 = "Lulus" AND
new.MESIN_TRANSMISI = "Lulus" AND
new.PERALATAN = "Lulus" AND
new.RANGKA_DAN_BODI = "Lulus" AND
new.SISTEM_KEMUDI = "Lulus" AND
new.SISTEM_PENERANGAN = "Lulus" AND
new.SISTEM_REM = "Lulus" AND
new.SISTEM_REM_GAS_BUANG = "Lulus")
then
SET new.PENILAIAN = "Lulus" ;
else
SET new.PENILAIAN = "Gagal" ; end if;
end
this is the insert query
INSERT INTO `pengujian`(`NO_PENGUJIAN`, `NO_PEMERIKSAAN`, `LOKASI_PENGUJIAN`, `NO_KODE`, `NO_KENDARAAN`, `PEMILIK_KENDARAAN`, `TYPE_MERK_PABRIK`, `JENIS_KENDARAAN`, `MULAI_DIPERGUNAKAN`, `TANGGAL_PEMERIKSAAN`, `NO_LAPORAN`, `JENIS_PEMERIKSAAN`, `JARAK_PEMAKAIAN`, `BERAT_KENDARAAN`, `PERALATAN`, `SISTEM_PENERANGAN`, `SISTEM_KEMUDI`, `AS_DAN_SUSPENSI`, `BAN_DAN_PELEK`, `RANGKA_DAN_BODI`, `SISTEM_REM`, `SISTEM_REM_GAS_BUANG`, `MESIN_TRANSMISI`, `LAIN_LAIN`, `LAIN_LAIN2`, `PENILAIAN`, `TANGGAL_PEMERIKSAAN_BERIKUTNYA`, `CATATAN`, `PENGUJI`, `BIAYA_TOTAL`) VALUES ([value-1],[value-2],[value-3],[value-4],[value-5],[value-6],[value-7],[value-8],[value-9],[value-10],[value-11],[value-12],[value-13],[value-14],[value-15],[value-16],[value-17],[value-18],[value-19],[value-20],[value-21],[value-22],[value-23],[value-24],[value-25],[value-26],[value-27],[value-28],[value-29],[value-30])
It's a little confusing...