Assalamualaikum Warahmatullahi Wabarakatuh...
Saya memiliki kendala pada saat isi form pendaftaran order di halaman detail paket dan form hubungi tetapi tidak bisa ke simpan ke db, mohon bantuannya ya.. thanks
//controlldetail order
public function detail(){
$id = $this->uri->segment(2);
$query = $this->model_app->getjoinpaket2($id);
//$query = $this->model_utama->view_join_two('cmstour','users','cms_itinerary','username','idtour',array('judul_seo' => $this->uri->segment(3)),'idtour','DESC',0,1);
if ($query->num_rows()<=0){
redirect('Main');
}else{
$row = $query->row_array();
//$spell = cetak_meta($row['description']);
$data['title'] = cetak($row['title']);
$data['description'] = cetak_meta($row['description'],0,500);
$data['keywords'] = cetak($row['description']);
$data['rows'] = $row;
$dataa = array('dibaca'=>$row['dibaca']+1);
$where = array('idtour' => $row['idtour']);
$this->model_utama->update('cmstour', $dataa, $where);
$data['paket'] = $this->model_app->getjoinpaket();
$data['regiscode'] = $this->model_app->getcode();
//$this->db->get('paket_umroh')->result_array();
// $data['us'] = $this->model_app->view_where('users',array('username'=>$this->session->username))->row_array();
$this->template->load(template().'/template',template().'/detailpaket',$data);
}
}
//formorder
function kirim(){
if (isset($_POST['submit'])){
$cek = $this->model_utama->view_where('cmstour',array('idtour' => $this->input->post('id_paket')));
$row = $cek->row_array();
if ($cek->num_rows()<=0){
redirect('main');
}else{
if ($this->input->post()) {
$data = array('idtour'=>cetak($this->db->escape_str($this->input->post('id_tour',TRUE))),
'idkattour'=>cetak($this->db->escape_str($this->input->post('id_kate',TRUE))),
'fullname'=>cetak($this->db->escape_str($this->input->post('full_name',TRUE))),
'no_identitas'=>cetak($this->db->escape_str($this->input->post('no_identitas_',TRUE))),
'nama_ayah_kandung'=>cetak($this->db->escape_str($this->input->post('nama_ayah_kandung_',TRUE))),
'email'=>cetak($this->db->escape_str(strip_tags($this->input->post('email_',TRUE)))),
'tempat_lahir_'=>cetak($this->db->escape_str(strip_tags($this->input->post('tempat_lahir_',TRUE)))),
'no_hp'=>cetak($this->db->escape_str(strip_tags($this->input->post('no_hp_',TRUE)))),
'regiscode'=>cetak($this->db->escape_str(strip_tags($this->input->post('regiscode_',TRUE)))),
'tgl_daftar'=>date('Y-m-d'),
'jam_daftar'=>date('H:i:s'));
$this->model_utama->insert('cms_regis_umroh',$data);
//var_dump($data);
// exit;
echo $this->session->set_flashdata('message', '<div class="alert alert-success" style="margin-top:10px"><center>Terima kasih telah melakukan pemesanan, Staff kami akan menghubungi Anda dalam waktu dekat.</center></div>');
}else{
echo $this->session->set_flashdata('message', '<div class="alert alert-danger" style="margin-top:10px"><center>Oops..Please Checked Your identitation</center></div>');
}
}
redirect('paket/'.$row['seo_title']);
}
}
//tampilan form order
<div class="col-lg-6 contact-left-form">
<?php echo form_open('paket/kirim')?>
<div class="col-sm-12 form-group contact-forms">
<input type="text" class="form-control" placeholder="Nama Lengkap" name='full_name' autocomplete="off" id="c_name" required />
<input type="hidden" class="form-control" placeholder="Kode Registrasi" name='regiscode_' value="<?= $regiscode;?>"autocomplete="off" id="c_name" readonly />
<input type="hidden" class="form-control" placeholder="Id Paket" name='id_tour' value="<?= $rows['idtour'];?>" autocomplete="off" id="c_name" required/>
</div>
<div class="col-sm-12 form-group contact-forms">
<input type="number" class="form-control" placeholder="No Identitas (KTP, SIM, NIS)" name='no_identitas_' autocomplete="off" id="c_email" required/>
</div>
<div class="col-sm-12 form-group contact-forms">
<input type="text" class="form-control" placeholder="Nama Ayah Kandung" name='nama_ayah_kandung_' autocomplete="off" id="c_email" required/>
</div>
<div class="col-sm-12 form-group contact-forms">
<input type="email" class="form-control" placeholder="E-mail" name='email_' autocomplete="off" id="c_email" required/>
</div>
<div class="col-sm-12 form-group contact-forms">
<input type="text" class="form-control" placeholder="Tempat lahir" name='tempat_lahir_' autocomplete="off" id="c_email" required/>
</div>
<div class="col-sm-12 form-group contact-forms">
<input type="number" class="form-control" name='no_hp_' minlength="5" placeholder="Nomer HP" autocomplete="off" id="c_message" required />
</div>
<div class="col-md-12 booking-button">
<input type="submit" name="submit" class="btn btn-primary btn-lg" value="Pesan" style="cursor:pointer;" onclick="return confirm('Pesan anda ini akan kami balas secepatnya')"/>
</div>
<?php
echo $this->session->flashdata('message');
echo form_close();
?>
</div>
//controller form_hubungi
function kirim(){
if (isset($_POST['submit'])){
if ($this->input->post() && (strtolower($this->input->post('security_code')) == strtolower($this->session->userdata('mycaptcha')))) {
$data = array('nama'=>cetak($this->input->post('name_',TRUE)),
'email'=>cetak($this->input->post('email_',TRUE)),
'subjek'=>$_SERVER['REMOTE_ADDR'],
'pesan'=>cetak($this->input->post('pesan_',TRUE)),
'tanggal'=>date('Y-m-d'),
'jam'=>date('H:i:s'));
$this->model_utama->insert('hubungi',$data);
echo $this->session->set_flashdata('message', '<div class="alert alert-success"><center>Pesan terkirim!, akan kami respon via email!</center></div>');
}else{
echo $this->session->set_flashdata('message', '<div class="alert alert-danger"><center>Periksa kembali data anda</center></div>');
}
redirect('hubungi');
}
}
//tampilan form
<div class="col-lg-12" >
<?php echo form_open
('hubungi/kirim', array('role'=>'form', 'class'=>'php-email-form'))?>
<div class="form-row">
<div class="col-lg-6 form-group">
<input type="text" name="name_" class="form-control" id="name" placeholder="Your Name" data-rule="minlen:4" data-msg="Masukan minimal 4 karakter" />
<div class="validate"></div>
</div>
<div class="col-lg-6 form-group">
<input type="email" class="form-control" name="email_" id="email" placeholder="Your Email" data-rule="email" data-msg="Masukan email dengan benar" />
<div class="validate"></div>
</div>
</div>
<div class="form-group">
<textarea class="form-control" name="pesan_" rows="5" data-rule="required" data-msg="Pesan tidak boleh kosong" placeholder="Message"></textarea>
<div class="validate"></div>
</div>
<div class="form-group">
<?php echo $image; ?><br></label>
<input name='security_code' maxlength="6" type="text" class="form-control" placeholder="Masukkkan kode di atas..">
</div>
<div class="text-center"><input type="submit" name="submit" value="Send Message"></div>
</form>
</div>