Advertisement
cahyadyazin

IF ELSE

Oct 24th, 2014
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.24 KB | None | 0 0
  1. <div class="table-responsive">
  2.             <table width="100%" class="table table-striped">
  3.                 <tr>
  4.                     <td>#Name</td>
  5.                     <td>#Action</td>
  6.                 </tr>
  7.  
  8.                 <?php foreach($lihat as $eusi){?>
  9.                
  10.                     <tr>            
  11.                         <td><?php if (substr($eusi->img, -3) == "pdf"){ ?>
  12.                         <p>
  13.                            <a href="<?php echo site_url('welcome/vpdf1/'.$eusi->id);?>">
  14.                             <img src="<?php echo base_url('assets/icon/pdf.png');?>">
  15.                                 <?php echo $eusi->name_path;?>.pdf
  16.                            </a>
  17.                         </p>
  18.                         <?php } else if (substr($eusi->img,  -3) == "ocx") {?>
  19.                         <p>
  20.                            <a href="<?php echo base_url('assets/uploads/files/'.$eusi->img);?>">
  21.                             <img src="<?php echo base_url('assets/icon/word.png');?>">
  22.                             <?php echo $eusi->name_path;?>.docx
  23.                            </a>
  24.                         </p>
  25.                         <?php } ?>
  26.                         <?php if ($eusi->type_path == "folder") {?>            
  27.                         <p>
  28.                            <a href="<?php echo site_url('welcome/sub2/'.$eusi->id);?>">
  29.                             <img src="<?php echo base_url('assets/icon/open.png');?>">
  30.                             <?php echo $eusi->name_path;?>
  31.                            </a>
  32.                         </p>
  33.                         <?php } else if ($eusi->type_path == "artikel") {?>
  34.                         <p>
  35.                            <a href="<?php echo site_url('welcome/art1/'.$eusi->id);?>">
  36.                             <img src="<?php echo base_url('assets/icon/art.png');?>">
  37.                             <?php echo $eusi->name_path;?> 
  38.                            </a>            
  39.                         </p>
  40.                         <?php } ?></td>
  41.  
  42.                         <td>
  43.                     <?php if ($eusi->type_path == "folder") { ?>
  44.                      <a href="<?php echo site_url('welcome/sub2/'.$eusi->id);?>">
  45.                         [ OPEN ]
  46.                      </a>
  47.                     <?php } else if ($eusi->type_path == "file") {
  48.                         if (substr($eusi->img, -3) == "pdf"){?>
  49.                             <a href="<?php echo site_url('welcome/vpdf1/'.$eusi->id);?>">
  50.                                 [ VIEW ]
  51.                             </a>
  52.                            
  53.                             <a href="<?php echo base_url('assets/uploads/files/'.$eusi->img);?>">
  54.                                 [ Download ]
  55.                             </a>
  56.                         <?php } else if (substr($eusi->img,  -3) == "ocx") { ?>
  57.                             <a href="<?php echo base_url('assets/uploads/files/'.$eusi->img);?>">
  58.                                 [ Download ]
  59.                             </a>
  60.                         <?php } ?>
  61.                     <?php } else if ($eusi->type_path == "artikel") { ?>
  62.                      <a href="<?php echo site_url('welcome/art1/'.$eusi->id);?>">
  63.                                     [ Read ]
  64.                      </a>
  65.                     </td></tr>
  66.                 <?php } } ?>
  67.             </table>
  68.             </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement