php - Returning NULL not working with tabs plugin -


this code works when have data rows returned messages object when there isn't have returning null in case having hard time getting code still show correctly works tabs plugin have up. i'm using datatables tables.

anybody have ideas?

<!-- start of main content --> <div id="main_content">  <h2 class="grid_12">personal messages</h2> <div class="clean"></div>  <div class="grid_8">      <div id="tab-panel-1" class="box">          <div class="header">             <img src="<?php echo base_url() ?>assets/img/icons/packs/fugue/16x16/shadeless/mail.png" width="16" height="16" />             <h3>messages</h3><span></span>             <ul>                 <li><a href="#tab-1">inbox messages</a></li>                 <li><a href="#tab-2">sent messages</a></li>                 <li><a href="#tab-3">compose message</a></li>             </ul>         </div>         <div class="content">             <div id="tab-1" class="tab-content">                 <table id="inbox" class="table datatable">                     <thead>                         <tr>                             <th></th>                             <th>date</th>                             <th>subject</th>                             <th>from</th>                             <th></th>                         </tr>                     </thead>                     <tbody>                         <?php                          if ($messages[0] !== null)                         {                             foreach ($messages[0] $message)                             {                                 echo '<tr>';                                     echo '<td style="text-align: center">';                                     if ($message->message_read == 1)                                     {                                         echo '<img src='.base_url().'assets/img/icons/packs/fugue/16x16/mail-open.png />';                                     }                                     else                                     {                                         echo '<img src='.base_url().'assets/img/icons/packs/fugue/16x16/mail.png />';                                     }                                     echo '</td>';                                     echo '<td>'.date('f d, y', strtotime($message->date_sent)).'</td>';                                     echo '<td>'.$message->subject.'</td>';                                     echo '<td>'.$message->first_name.' '.$message->last_name.'</td>';                                     echo '<td></td>';                                 echo '</tr>';                             }                         }                         else                         {                             echo '<tr>';                             echo 'no records';                             echo '</tr>';                         }                         ?>                      </tbody>                 </table>             </div>              <div id="tab-2" class="tab-content">                 <table id="sent" class="table datatable">                     <thead>                         <tr>                             <th></th>                             <th>date</th>                             <th>subject</th>                             <th>to</th>                             <th></th>                         </tr>                     </thead>                     <tbody>                         <?php                          if ($messages[1] !== null)                         {                             foreach ($messages[1] $message)                             {                                 echo '<tr>';                                     echo '<td style="text-align: center">';                                     if ($message->message_read == 1)                                     {                                         echo '<img src='.base_url().'assets/img/icons/packs/fugue/16x16/mail-open.png />';                                     }                                     else                                     {                                         echo '<img src='.base_url().'assets/img/icons/packs/fugue/16x16/mail.png />';                                     }                                     echo '</td>';                                     echo '<td>'.date('f d, y', strtotime($message->date_sent)).'</td>';                                     echo '<td>'.$message->subject.'</td>';                                     echo '<td>'.$message->first_name.' '.$message->last_name.'</td>';                                     echo '<td></td>';                                 echo '</tr>';                             }                         }                         else                         {                             echo '<tr>';                             echo 'no records';                             echo '</tr>';                         }                         ?>                      </tbody>                 </table>             </div>              <div id="tab-3" class="tab-content">                 <?php echo form_open('') ?>                         <div class="_100">                             <p>                                 <?php echo form_label('recipient', 'recipient'); ?>                                 <select name="to" class="required">                                     <option></option>                                     <?php                                     foreach ($users $user)                                     {                                         echo '<option>'.$user->first_name.' '.$user->last_name.'</option>';                                     }                                     ?>                                 </select>                             </p>                         </div>                         <div class="_100">                             <?php echo form_label('subject', 'subject'); ?>                             <?php echo form_input('subject', '', 'class=required'); ?>                         </div>                          <div class="_100">                             <?php echo form_label('message', 'message'); ?>                             <?php echo form_textarea('message', '', 'class=required'); ?>                         </div>                         <?php echo form_hidden('sender', $this->session->userdata('user_id')); ?>                        <div class="actions">                         <div class="actions-left">                             <?php echo form_reset('reset', 'reset'); ?>                                    </div>                         <div class="actions-right">                             <?php echo form_submit(array('id' => 'submit', 'name' => 'submit'), 'submit message'); ?>                                    </div>                     </div>                 <?php echo form_close(); ?>             </div>          </div> <!-- end of .content -->          <div class="clear"></div>      </div>  </div>  <div class="clear"></div> 

heres doing: http://jsfiddle.net/mgram/

echo '<tr>'; echo 'no records'; echo '</tr>'; 

needs td

echo '<tr><td colspan="5">'; echo 'no records'; echo '</td></tr>'; 

there seems issue javascript , instantiation of tabs plugin. don't see js tabs anywhere. did see there ci error on page in select:

<select name="to" class="required">                                         <option></option>                                          <div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">  <h4>a php error encountered</h4>  <p>severity: warning</p> <p>message:  invalid argument supplied foreach()</p> <p>filename: views/pmsystem.php</p> <p>line number: 121</p>  </div>                                    </select> 

which can mess javascript stuff.

are getting in error console?

can see js?


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -