Guest User

konten.php

a guest
Jun 21st, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.14 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. include ('server.php');
  4.     $id =$_GET['id']; //parameter
  5.     $code =$_GET['code']; //parameter
  6.     $register=$_GET['register'];
  7.     $ekstra=$_GET['ekstra'];
  8.     $download=$_GET['download'];
  9.    
  10.     if ($ekstra == 'ekstra')
  11. {
  12.     $aksi = mysql_query("SELECT * FROM ekstra WHERE id='$id'");
  13.     while($row=mysql_fetch_array($aksi))
  14.     {
  15.         echo "<div id=text><h3>$row[1]</h3>";
  16.         echo "$row[4]";
  17.         echo "<br/><br/>";
  18.         echo "<center><input id=back type=button onClick=\"javascript:history.go(-1)\" value=\"[ klik untuk kembali ]\"></center></div>";
  19.     }
  20. }
  21.         elseif (!empty($id)) //pengecekan kondisi kosong atau tidak
  22.             {
  23.                 $sql = mysql_query("SELECT * FROM artikel WHERE id=$id ");
  24.                 while($row=mysql_fetch_array($sql)) {
  25.                 //menampilkan
  26.                     echo "<b>$row[judul]<b/>" ;
  27.                     echo "<br/>";
  28.                     echo "$row[isi]";
  29.             }
  30.             }
  31.         elseif (!empty($code))
  32.             {
  33.             $sql = mysql_query("SELECT * FROM materi WHERE id=$code");
  34.                 while($s = mysql_fetch_array($sql)){
  35.                  $judul = $s['judul'];
  36.                      echo "<h2>".$s['judul']."</h2>";
  37.                      echo $s['isi']."<p>";
  38.                 $isi = nl2br($s[isi]);
  39.             $isi2 = substr($isi,0,380); // ambil sebanyak 410 karakter
  40.             $isi2 = substr($isi,0,strrpos($isi2," ")); // spasi antar kalimat
  41.  
  42.      echo "$isi2 ... <a href=?code=code&id=$s[isi]>Selengkapnya</a>
  43.         <br><br><hr color=white></td></tr>";
  44.    
  45.             }
  46.            
  47.             }
  48.         elseif (!empty($register))
  49.             {
  50.                 include ('formulir1.php');
  51.             }      
  52.         elseif (!empty($ekstra))
  53.             {
  54.            
  55.     $query = mysql_query("SELECT * FROM ekstra ORDER BY id DESC");
  56.     echo "<table>
  57.              <tr>
  58.                 <th width=250px>ekstra</th><th width=90px>kelas</th><th width=200px>pembimbing</th><th width=90px>kode</th>
  59.              </tr>
  60.          ";
  61.     while($row=mysql_fetch_array($query))
  62.     {
  63.         echo "
  64.             <tr>
  65.             <td id=title>
  66.             <a href=?ekstra=ekstra&id=$row[0]>$row[1]</a></td><td>$row[2]</td><td>$row[3]</td><td>$row[5]</td>
  67.             </tr>
  68.              ";
  69.     }
  70.     echo "</table>";
  71. }  
  72. elseif (!empty($download))
  73. {
  74.     echo "<b>Downloads :</b><br/><ul>";
  75.     $query=mysql_query("SELECT * FROM download");
  76.     while ($row=mysql_fetch_array($query))
  77.     {
  78.         echo "<li><a href=\"admin/file/$row[2]\">$row[1]</a></li>";
  79.     }
  80.     echo "</ul>";
  81. }
  82.     else {
  83.    
  84.          ?>
  85.      <p><center><font size="+1" color="#006600">.:: Wellcome ::.</font></center></p>
  86. <div id="gallery">
  87.  
  88.     <a href="#" class="show">
  89.         <img src="image/profile.jpg" alt="SMP N 2 PLERET" width="438" height="357" title="" alt="" rel="<h3>SMP NEGERI 2 PLERET</h3>Ini adalah halam depan SMP NEGERI 2 PLERET "/>
  90.     </a>
  91.    
  92.     <a href="#">
  93.         <img src="image/bola.jpg" alt="EKSTRA SEPAK BOLA" width="438" height="357" title="" alt="" rel="<h3>EKSTRA SEPAK BOLA</h3>Ini adalah profile ekstrakurikuler sepak bola SMP NEGERI 1 PLERET "/>
  94.     </a>
  95.    
  96.  
  97.     <a href="#">
  98.         <img src="image/kir.jpg" alt="EKSTRA KIR" width="438" height="357" title="" alt="" rel="<h3>EKSTRA KIR</h3>Profile ekstrakurikuler KIR."/>
  99.     </a>
  100.    
  101.     <a href="#">
  102.         <img src="image/pramuka.jpg" alt="EKSTRA PRAMUKA" width="438" height="357" title="" alt="" rel="<h3>EKSTRA PRAMUKA</h3>Profile ekstrakurikuler pramuka"/>
  103.     </a>
  104.    
  105.     <a href="#">
  106.         <img src="image/komputer.jpg" alt="komputer" width="438" height="357" title="" alt="" rel="<h3>EKSTRA KOMPUTER</h3>Profile ekstrakurikuler Komputer"/>
  107.     </a>
  108.        
  109.     <a href="#">
  110.         <img src="image/pier.jpg" alt="Pier" width="438" height="357"" title="" alt="" rel="<h3>Pier</h3>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."/>
  111.     </a>
  112.    
  113.     <a href="#">
  114.         <img src="image/sea-mist.jpg" alt="Sea Mist" width="438" height="357" title="" alt="" rel="<h3>Sea Mist</h3>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."/>
  115.     </a>
  116.    
  117.     <a href="#">
  118.         <img src="image/stones.jpg" alt="Stone" width="438" height="357" title="" alt="" rel="<h3>Stone</h3>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."/>
  119.     </a>
  120.  
  121.     <div class="caption"><div class="content">
  122.    
  123.     </div></div>
  124. </div>
  125. <div class="clear"></div>
  126.  
  127. <br/><br/>
  128. <div style="font-size:10px;color:#ccc">@2011</div>
  129.      
  130.            
  131.     <?php
  132.     }
  133.  
  134.  
  135. ?>
Advertisement
Add Comment
Please, Sign In to add comment