Jual Beli Produk Digital - Cepat, Aman, Dan Terpercaya Sejak 2012 (Ada 70698 Members, 832 Products, 4745 Topic, 13114 Comments)

Membuat Form Seperti Tracking Order di Toko Online

Dibuat
Login Terakhir 6 Tahun lalu,
Telah Dilihat 2005 Kali
Ujang Rukman Mengatakan : Sultan Account
Assalamualaikum Warahmatullahi Wabarakatuh... mas saya membuat modul pendaftaran siswa baru di SIKOLAG ci, nah saya ingin membuat form cek kelulusan seperti traking order pada toko onlien jadi, hanya memasukan no_pendaftaran siswa tersebut kemudian muncul status kelulusan, nah sebelum nya saya sudah mencoba membatnya dengan menggunakan codingan dari traking order di doko online tapi error kira2 apa yang kurang

1. berikut coding di controller Kelulusan.php

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Kelulusan extends CI_Controller {
	function index(){
		$data['title'] = 'Lihat Kelulusan';
		$data['description'] = description();
		$data['keywords'] = keywords();
		$this->template->load(template().'/template',template().'/view_kelulusan',$data);
	}
	function lihat(){
		if (isset($_POST['submit1']) OR $this->uri->segment(3)!=''){
			if ($this->uri->segment(3)!=''){
				$no_pendaftaran = filter($this->uri->segment(3));
			}else{
				$no_pendaftaran = filter($this->input->post('a'));
			}

			$cek = $this->model_app->view_where('siswabaru',array('no_pendaftaran'=>$no_pendaftaran));
			if ($cek->num_rows()>=1){
				$data['title'] = 'Lihat Kelulusan '.$no_pendaftaran;
				$data['rows'] = $this->db->query("SELECT * FROM siswa where no_pendaftaran");
				$data['record'] = $this->db->query("SELECT no_pendaftaran, nama, status where no_pendaftaran");
				$this->template->load('phpmu-sekolah/template','phpmu-sekolah/view_kelulusan_view',$data);
			}else{
				redirect('konfirmasi/tracking');
			}
		}else{
			$data['title'] = 'Lihat Kelulusan';
			$this->template->load('phpmu-sekolah/template','phpmu-sekolah/view_kelulusan',$data);
		}
	}
}


2. kemudian pada phpmu-sekolah -->view_kelulusan

<p class='sidebar-title'><?php echo $title; ?></p>
<?php 
    $attributes = array('class'=>'form-horizontal','role'=>'form');
    echo form_open_multipart('kelulusan/lihat',$attributes); 
    echo "<div class='alert alert-info'>Masukkan No Invoice atau No Transaksi Terlebih dahulu!</div>
      <table class='table table-condensed'>
        <tbody>
          <tr><th scope='row' width='120px'>No Invoice</th>       <td><input type='text' name='a' class='form-control' style='width:100%' placeholder='TRX-0000000000' required>
        </tbody>
      </table>

      <div class='box-footer'>
        <button type='submit' name='submit1' class='btn btn-info'>Cek Invoice</button>
      </div>";
    echo form_close();

3. phpmu-sekolah --> view_kelulusan_view

 
<?php 

if ($total['status']=='0'){ $status = '<i class="text-danger">Pending</i>'; }elseif($total['status']=='1'){ $status = '<i class="text-warning">status</i>'; }else{ $status = '<i class="text-success">Packing </i>'; }
  
  echo "<div class='col-md-8'>
        <dl class='dl-horizontal'>
            <dt>Nama</dt>       <dd>$rows[nama]</dd>
            <dt>Asal Sekolah</dt>       <dd>$rows[asal_sekolah]</dd>
            <dt>Jalur Seleksi</dt>       <dd>$rows[seleksi]</dd>
            <dt>Status</dt>               <dd>$$status</dd>
        </dl>
    </div>
    </div>";


mohon bantuannya mas

Ada 5 Jawaban

PHPMU.COM Support
commented on 20 Mei 2018 23:40:36
Assalam,.. untuk pesan error yang muncul apa mas, 
sekalian share printscreen pesan errornya?
agar bisa kita bantu cek,..
PHPMU.COM Support
commented on 21 Mei 2018 00:26:13
Assalam,.. coba ubah ini :
if ($this->uri->segment(3)!=''){
	$no_pendaftaran = filter($this->uri->segment(3));
}else{
	$no_pendaftaran = filter($this->input->post('a'));
}

ubah menjadi begini : 
if ($this->uri->segment(3)!=''){
	$no_pendaftaran = strip_tags($this->uri->segment(3));
}else{
	$no_pendaftaran = strip_tags($this->input->post('a'));
}
Ujang Rukman
commented on 21 Mei 2018 00:40:47
Assalam,.. oh alhamdulilah mas sudah bisa, terimakasih
Ujang Rukman
commented on 21 Mei 2018 01:06:35
Assalam,.. oh iya mas minta bantuannya lagi mengenai pertayaan saya yang ini https://members.phpmu.com/forum/read/tidak-ada-notif-salah-input-captcha-di-sikolag-ci

notif sudah muncul atas bantun mas bukhari cuma bisa ga ketika notif itu di close jangan jadi reload halaman tapi fokus ke inputan captcha nya aja

dan mengenai input username yg sama jadi errorr tidak ada notifikasi username sudah digunakan
Ujang Rukman
commented on 21 Mei 2018 14:15:29
Assalam,..  ini coding di controller nya mas , alert na ngereload halaman  ketika di close, supaya ketika di close ga ngereload dan focus ke inputan captcha bagaimana?
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Kontributor extends CI_Controller {
	public function index(){
		$data['title'] = "Pendaftaran Kontributor";
		$data['description'] = description();
		$data['keywords'] = keywords();

		$this->load->helper('captcha');
		$vals = array(
            'img_path'	 => './captcha/',
            'img_url'	 => base_url().'captcha/',
            'font_path' => './asset/Tahoma.ttf',
            'font_size'     => 15,
            'img_width'	 => '150',
            'img_height' => 40,
            'border' => 0, 
            'word_length'   => 5,
            'expiration' => 7200
        );

        $cap = create_captcha($vals);
        $data['image'] = $cap['image'];
        $this->session->set_userdata('mycaptcha', $cap['word']);
		$this->template->load(template().'/template',template().'/kontributor',$data);
	}

	function pendaftaran(){
		if (isset($_POST['submit'])){
			$config['upload_path'] = 'asset/foto_user/';
            $config['allowed_types'] = 'gif|jpg|png|JPG|JPEG';
            $config['max_size'] = '1000'; // kb
            $this->load->library('upload', $config);
            $this->upload->do_upload('f');
            $hasil=$this->upload->data();
            if ($this->input->post() && (strtolower($this->input->post('secutity_code')) == strtolower($this->session->userdata('mycaptcha')))) {
	            if ($hasil['file_name']==''){
	                    $data = array('username'=>cetak($this->input->post('a')),
	                                    'password'=>hash("sha512", md5(cetak($this->input->post('b')))),
	                                    'nama_lengkap'=>cetak($this->input->post('c')),
	                                    'email'=>cetak($this->input->post('d')),
	                                    'no_telp'=>cetak($this->input->post('e')),
	                                    'level'=>'kontributor',
	                                    'blokir'=>'N',
	                                    'id_session'=>md5(cetak($this->input->post('a'))).'-'.date('YmdHis'));
	            }else{
	                    $data = array('username'=>cetak($this->input->post('a')),
	                                    'password'=>hash("sha512", md5(cetak($this->input->post('b')))),
	                                    'nama_lengkap'=>cetak($this->input->post('c')),
	                                    'email'=>cetak($this->input->post('d')),
	                                    'no_telp'=>cetak($this->input->post('e')),
	                                    'foto'=>$hasil['file_name'],
	                                    'level'=>'kontributor',
	                                    'blokir'=>'N',
	                                    'id_session'=>md5(cetak($this->input->post('a'))).'-'.date('YmdHis'));
	            }

	            $this->model_app->insert('users',$data);
	            $datam = array('id_session'=>md5(cetak($this->input->post('a'))).'-'.date('YmdHis'),
	                           'id_modul'=>18);
	            $this->model_app->insert('users_modul',$datam);
	            $this->session->set_userdata('upload_image_file_manager',true);
				$this->session->set_userdata(array('username'=>cetak($this->input->post('a')),
								   'level'=>'kontributor',
                                   'id_session'=>md5(cetak($this->input->post('a'))).'-'.date('YmdHis')));
			redirect('administrator/home');
		}else{
			echo"<script>window.alert('Maaf captcha tidak sesuai');
			window.location=('".base_url()."kontributor')</script>";
		}
		}
	}
}

Maaf, Untuk Memberikan Komentar Anda Harus Login !!!

Online