Advertisement
ariestamirra

Untitled

Sep 4th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.09 KB | None | 0 0
  1. <table class="table table-bordered table-hover table-striped tablesorter" id="tableData">
  2.    <?php //Parsing table header ?>
  3.    <thead>
  4.     <tr>
  5.         <?php
  6.         for($i=0;$i<count($this->colNames);$i++){
  7.             ?>
  8.             <th width="<?=$this->colWidths[$i]?>%"><?=$this->colNames[$i]?></th>
  9.             <?php
  10.         }
  11.         ?>
  12.         <?php
  13.         if($this->del || $this->edit || $this->detail){
  14.         ?>
  15.         <th>Action</th>
  16.         <?php
  17.         }
  18.         ?>
  19.     </tr>
  20.    </thead>
  21.    <tbody>
  22.     <?php                
  23.     $queryResult = mysql_query($this->query);
  24.     if($queryResult){                    
  25.         while($row=mysql_fetch_array($queryResult)){
  26.         ?>
  27.         <tr>
  28.             <?php
  29.             for($i=0;$i<count($this->colNames);$i++){
  30.                 echo "<td>$row[$i]</td>";
  31.             }
  32.             if($this->edit || $this->del || $this->detail){
  33.             ?>
  34.             <td>
  35.                 <?php
  36.                 if($this->detail)
  37.                     echo "<a href=\"#\" name=\"actionDetail\" >Detail</a>";
  38.                 if($this->edit)
  39.                     echo "<a href=\"#\" name=\"actionEdit\" >Edit</a>";
  40.                 if($this->del)
  41.                     echo "<a href=\"#\" name=\"actionDelete\" >Hapus</a>";
  42.             }    ?>
  43.             </td>
  44.         </tr>
  45.         <?php
  46.         }
  47.     }
  48.     ?>              
  49.    </tbody>
  50. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement