Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- {
- $sql = mysql_query("SELECT * FROM materi WHERE id=$code");
- while($s = mysql_fetch_array($sql)){
- $judul = $s['judul'];
- echo "<h2>".$s['judul']."</h2>";
- /*
- echo $s['isi']."<p>";
- LHO??? kok km malah nulis apa isinya??
- */
- <?php
- error_reporting(0);
- include ('server.php');
- $id =$_GET['id']; //parameter
- $code =$_GET['code']; //parameter
- $register=$_GET['register'];
- $ekstra=$_GET['ekstra'];
- $download=$_GET['download'];
- if ($ekstra == 'ekstra')
- {
- $aksi = mysql_query("SELECT * FROM ekstra WHERE id='$id'");
- while($row=mysql_fetch_array($aksi))
- {
- echo "<div id=text><h3>$row[1]</h3>";
- echo "$row[4]";
- echo "<br/><br/>";
- echo "<center><input id=back type=button onClick=\"javascript:history.go(-1)\" value=\"[ klik untuk kembali ]\"></center></div>";
- }
- }
- elseif (!empty($id)) //pengecekan kondisi kosong atau tidak
- {
- $sql = mysql_query("SELECT * FROM artikel WHERE id=$id ");
- while($row=mysql_fetch_array($sql)) {
- //menampilkan
- echo "<b>$row[judul]<b/>" ;
- echo "<br/>";
- echo "$row[isi]";
- }
- }
- elseif (!empty($code))
- {
- $sql = mysql_query("SELECT * FROM materi WHERE id=$code");
- while($s = mysql_fetch_array($sql)){
- $judul = $s['judul'];
- echo "<h2>".$s['judul']."</h2>";
- // echo $s['isi']."<p>";
- $isi = nl2br($s[isi]);
- $isi2 = substr($isi,0,380); // ambil sebanyak 410 karakter
- $isi2 = substr($isi,0,strrpos($isi2," ")); // spasi antar kalimat
- echo "$isi2 ... <a href=?code=code&id=$s[id]>Selengkapnya</a>
- <br><br><hr color=white></td></tr>";
- $isi2="";
- }
- }
- elseif (!empty($register))
- {
- include ('formulir1.php');
- }
- elseif (!empty($ekstra))
- {
- $query = mysql_query("SELECT * FROM ekstra ORDER BY id DESC");
- echo "<table>
- <tr>
- <th width=250px>ekstra</th><th width=90px>kelas</th><th width=200px>pembimbing</th><th width=90px>kode</th>
- </tr>
- ";
- while($row=mysql_fetch_array($query))
- {
- echo "
- <tr>
- <td id=title>
- <a href=?ekstra=ekstra&id=$row[0]>$row[1]</a></td><td>$row[2]</td><td>$row[3]</td><td>$row[5]</td>
- </tr>
- ";
- }
- echo "</table>";
- }
- elseif (!empty($download))
- {
- echo "<b>Downloads :</b><br/><ul>";
- $query=mysql_query("SELECT * FROM download");
- while ($row=mysql_fetch_array($query))
- {
- echo "<li><a href=\"admin/file/$row[2]\">$row[1]</a></li>";
- }
- echo "</ul>";
- }
- else {
- ?>
- <p><center><font size="+1" color="#006600">.:: Wellcome ::.</font></center></p>
- <div id="gallery">
- <a href="#" class="show">
- <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 "/>
- </a>
- <a href="#">
- <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 "/>
- </a>
- <a href="#">
- <img src="image/kir.jpg" alt="EKSTRA KIR" width="438" height="357" title="" alt="" rel="<h3>EKSTRA KIR</h3>Profile ekstrakurikuler KIR."/>
- </a>
- <a href="#">
- <img src="image/pramuka.jpg" alt="EKSTRA PRAMUKA" width="438" height="357" title="" alt="" rel="<h3>EKSTRA PRAMUKA</h3>Profile ekstrakurikuler pramuka"/>
- </a>
- <a href="#">
- <img src="image/komputer.jpg" alt="komputer" width="438" height="357" title="" alt="" rel="<h3>EKSTRA KOMPUTER</h3>Profile ekstrakurikuler Komputer"/>
- </a>
- <a href="#">
- <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."/>
- </a>
- <a href="#">
- <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."/>
- </a>
- <a href="#">
- <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."/>
- </a>
- <div class="caption"><div class="content">
- </div></div>
- </div>
- <div class="clear"></div>
- <br/><br/>
- <div style="font-size:10px;color:#ccc">@2011</div>
- <?php
- }
- /*
- mas ini skript nya munculnya tuh ga hilang teksnya tapi mlh doble yg 400 karakter .
- kemudian pas d klik selanjutnya kosong ga ada teks
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement