Advertisement
GWibisono

perbaikan 02

Jun 21st, 2012
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. {
  3.     $sql = mysql_query("SELECT * FROM materi WHERE id=$code");
  4.     while($s = mysql_fetch_array($sql)){
  5.     $judul = $s['judul'];
  6.     echo "<h2>".$s['judul']."</h2>";
  7.     /*
  8.     echo $s['isi']."<p>";
  9.  
  10.     LHO??? kok km malah nulis apa isinya??
  11.     */
  12. <?php
  13. error_reporting(0);
  14. include ('server.php');
  15.     $id =$_GET['id']; //parameter
  16.     $code =$_GET['code']; //parameter
  17.     $register=$_GET['register'];
  18.     $ekstra=$_GET['ekstra'];
  19.     $download=$_GET['download'];
  20.    
  21. if ($ekstra == 'ekstra')
  22. {
  23.     $aksi = mysql_query("SELECT * FROM ekstra WHERE id='$id'");
  24.     while($row=mysql_fetch_array($aksi))
  25.     {
  26.         echo "<div id=text><h3>$row[1]</h3>";
  27.         echo "$row[4]";
  28.         echo "<br/><br/>";
  29.         echo "<center><input id=back type=button onClick=\"javascript:history.go(-1)\" value=\"[ klik untuk kembali ]\"></center></div>";
  30.     }
  31. }
  32. elseif (!empty($id)) //pengecekan kondisi kosong atau tidak
  33. {
  34.     $sql = mysql_query("SELECT * FROM artikel WHERE id=$id ");
  35.             while($row=mysql_fetch_array($sql)) {
  36.                 //menampilkan
  37.                     echo "<b>$row[judul]<b/>" ;
  38.                     echo "<br/>";
  39.                     echo "$row[isi]";
  40.             }
  41. }
  42. elseif (!empty($code))
  43. {
  44.     $sql = mysql_query("SELECT * FROM materi WHERE id=$code");
  45.     while($s = mysql_fetch_array($sql)){
  46.                  $judul = $s['judul'];
  47.                      echo "<h2>".$s['judul']."</h2>";
  48.  //                  echo $s['isi']."<p>";
  49.                 $isi = nl2br($s[isi]);
  50.     $isi2 = substr($isi,0,380); // ambil sebanyak 410 karakter
  51.     $isi2 = substr($isi,0,strrpos($isi2," ")); // spasi antar kalimat
  52.  
  53.      echo "$isi2 ... <a href=?code=code&id=$s[id]>Selengkapnya</a>
  54.         <br><br><hr color=white></td></tr>";
  55.          $isi2="";
  56.    
  57.     }
  58.            
  59. }
  60. elseif (!empty($register))
  61. {
  62.     include ('formulir1.php');
  63. }      
  64. elseif (!empty($ekstra))
  65. {
  66.  
  67.     $query = mysql_query("SELECT * FROM ekstra ORDER BY id DESC");
  68.     echo "<table>
  69.              <tr>
  70.                 <th width=250px>ekstra</th><th width=90px>kelas</th><th width=200px>pembimbing</th><th width=90px>kode</th>
  71.              </tr>
  72.          ";
  73.     while($row=mysql_fetch_array($query))
  74.     {
  75.         echo "
  76.             <tr>
  77.             <td id=title>
  78.             <a href=?ekstra=ekstra&id=$row[0]>$row[1]</a></td><td>$row[2]</td><td>$row[3]</td><td>$row[5]</td>
  79.             </tr>
  80.              ";
  81.     }
  82.     echo "</table>";
  83. }  
  84. elseif (!empty($download))
  85. {
  86.     echo "<b>Downloads :</b><br/><ul>";
  87.     $query=mysql_query("SELECT * FROM download");
  88.     while ($row=mysql_fetch_array($query))
  89.     {
  90.         echo "<li><a href=\"admin/file/$row[2]\">$row[1]</a></li>";
  91.     }
  92.     echo "</ul>";
  93. }
  94.     else {
  95.    
  96.          ?>
  97.      <p><center><font size="+1" color="#006600">.:: Wellcome ::.</font></center></p>
  98. <div id="gallery">
  99.  
  100.     <a href="#" class="show">
  101.         <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 "/>
  102.     </a>
  103.    
  104.     <a href="#">
  105.         <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 "/>
  106.     </a>
  107.    
  108.  
  109.     <a href="#">
  110.         <img src="image/kir.jpg" alt="EKSTRA KIR" width="438" height="357" title="" alt="" rel="<h3>EKSTRA KIR</h3>Profile ekstrakurikuler KIR."/>
  111.     </a>
  112.    
  113.     <a href="#">
  114.         <img src="image/pramuka.jpg" alt="EKSTRA PRAMUKA" width="438" height="357" title="" alt="" rel="<h3>EKSTRA PRAMUKA</h3>Profile ekstrakurikuler pramuka"/>
  115.     </a>
  116.    
  117.     <a href="#">
  118.         <img src="image/komputer.jpg" alt="komputer" width="438" height="357" title="" alt="" rel="<h3>EKSTRA KOMPUTER</h3>Profile ekstrakurikuler Komputer"/>
  119.     </a>
  120.        
  121.     <a href="#">
  122.         <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."/>
  123.     </a>
  124.    
  125.     <a href="#">
  126.         <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."/>
  127.     </a>
  128.    
  129.     <a href="#">
  130.         <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."/>
  131.     </a>
  132.  
  133.     <div class="caption"><div class="content">
  134.    
  135.     </div></div>
  136. </div>
  137. <div class="clear"></div>
  138.  
  139. <br/><br/>
  140. <div style="font-size:10px;color:#ccc">@2011</div>
  141.      
  142.            
  143.     <?php
  144.     }
  145.  
  146.  
  147.  
  148.  
  149.  
  150. /*
  151. mas ini skript nya munculnya tuh ga hilang teksnya tapi mlh doble yg 400 karakter .
  152. kemudian pas d klik selanjutnya kosong ga ada teks
  153.  
  154. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement