Welcome Guest, Not a member yet? Register   Sign In
Severity: Notice Message: Undefined variable
#1

Severity: Notice

Message: Undefined variable: midtrans
Filename: views/formppdb.php
Line Number: 117


my model
PHP Code:
public function ppdb()
    
 
$data['midtrans'] = $this->db->get('transaksi_midtrans') ->result();
    return $this->load->view('formppdb'$data);
    
my view
PHP Code:
<hr>
                <table class="table table-bordered table-striped">
                  <thead>
                    <tr>
                      <th>Order Id</th>
                      <th>Nama</th>
                      <th>Gender</th>
                      <th>Tingkat</th>
                      <th>NISM</th>
                      <th>Gross Amount</th>
                      <th>Paymet Type</th>
                      <th>Bank</th>
                      <th>VA Number</th>
                      <th>Transaction Time</th>
                      <th>Status</th>
                    </tr>
                  </thead>
                  <tbody>
                    <?php if(is_array($midtrans)): ?>
                    <?php foreach($midtrans as $d):?>
                      <tr>
                        <td><?php echo $d->order_id?></td>
                        <td><?php echo $d->nama?></td>
                        <td><?php echo $d->gender?></td>
                        <td><?php echo $d->pendidikan?></td>
                        <td><?php echo $d->nism?></td>
                        <td align="right"><?php echo number_format($d->gross_amount,'0','',','); ?></td>
                        <td><?php echo $d->payment_type?></td>
                        <td><?php echo $d->bank?></td>
                        <td><?php echo $d->va_number?></td>
                        <td><?php echo $d->transaction_time?></td>
                        <td>
                          <?php
                            
if($d->status_code == "200") {
                          ?>
                            <span for="" class="badge bg-success">Succes</span>
                          <?php
                          
} else {
                          ?>
                            <span for="" class="badge bg-warning">Pending</span>
                          <?php
                          
}
                          ?>
                        </td>
                      </tr>
                    <?php endforeach;?>  
                    <?php endif; ?>
                </table> 
Reply
#2

Are you calling the view from your model?
How is the function ppdb() in your model called?
Reply
#3

What's on line 117 in views/formppdb.php ?
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB