Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("connect.php");
- $topic=isset($_GET['topic'])?$_GET['topic']:'';
- $sub_topic=isset($_GET['sub_topic'])?$_GET['sub_topic']:'';
- $speciality=isset($_GET['speciality'])?$_GET['speciality']:'';
- ?>
- <link href="style.css" rel="stylesheet" type="text/css" />
- <div class='find'>
- <div class="topic">
- <div class="top">Kategori<hr>
- </div>
- <?php
- $aa = "SELECT * FROM topic";
- $bb = mysql_query($aa); ?>
- <div class="browserPane">
- <table class="browser"><?php
- $c = 0;
- while ($cc = mysql_fetch_array($bb)) { ?>
- <tr class="<?php echo ($c++%2==1) ? 'odd' : 'even' ?>">
- <td><a href="?topic.php&topic=<?php echo $cc[id_topic]?>"><?php echo $cc[topic];?></a></td>
- </tr> <?php
- $baris++; } ?>
- </table>
- </div>
- </div>
- <div class="sub-topic">
- <div class="top">Sub-Kategori<hr>
- </div><?php
- if(!empty($topic)){
- $dd = "SELECT * FROM topic_sub_topic WHERE id_topic='$topic'";
- $ee = mysql_query($dd); ?>
- <div class="browserPane">
- <table class="browser"><?php
- $c = 0;
- while ($ff = mysql_fetch_array($ee)) { ?>
- <tr class="<?php echo ($c++%2==1) ? 'odd' : 'even' ?>">
- <td><a href="?topic.php&topic=<?php echo $topic?>&sub_topic=<?php echo $ff[id_sub_topic]?>"><?php echo $ff[sub_topic];?></a></td>
- </tr> <?php
- $baris++; } ?>
- </table>
- </div>
- <?php } ?>
- </div>
- <div class="specality">
- <div class="top">Specality<hr>
- </div><?php
- if(!empty($sub_topic)){
- $gg = "SELECT * FROM sub_topic_specality WHERE id_sub_topic='$sub_topic'";
- $hh = mysql_query($gg); ?>
- <div class="browserPane">
- <table class="browser"><?php
- $c = 0;
- while ($ii = mysql_fetch_array($hh)) { ?>
- <tr class="<?php echo ($c++%2==1) ? 'odd' : 'even' ?>">
- <td><a href="?topic.php&topic=<?php echo $topic?>&sub_topic=<?php echo $sub_topic?>&specality=<?php echo $ii[id_specality];?>"><?php echo $ii[specality]; ?></a></td>
- </tr> <?php
- $baris++; } ?>
- </table>
- </div>
- <?php } ?>
- </div>
- </div>
- <div class="home">
- <p class="title">results</p>
- </div>
- <div id="result">
- <table class="Daftar">
- <?php
- $sql="SELECT * FROM matkul WHERE 1 "
- .(!empty($topic)?"AND id_topic='$topic' ":"")
- .(!empty($sub_topic)?"AND id_sub_topic='$sub_topic' ":"")
- .(!empty($speciality)?"AND id_speciality='$speciality' ":"");
- $result = mysql_query($sql);
- if (empty($result)) {
- echo '<tr class="current">
- <td style="width: 100%;">Pilih Kategori</td>
- </tr>';
- } else { ?>
- <tr class="current">
- <td>NO</td>
- <td style="width: 90px;">Number</td>
- <td style="width: 500px;">judul</td>
- <td style="width: 90px;">specality</td>
- </tr>
- <?php
- $nomor=0;
- while ($data = mysql_fetch_array($result)) { ?>
- <tr class="hasil">
- <td align="center"><?php echo ++$nomor; ?></td>
- <td><a href="home.php?ref_id=<?php echo $data[kode]; ?>"><?php echo $data[kode]; ?></a></td>
- <td><a href="home.php?ref_id=<?php echo $data[kode]; ?>"><?php echo $data[nama]; ?></a></td>
- <td><a href="home.php?ref_id=<?php echo $data[kode]; ?>"><?php echo $data[id_specality]; ?></td>
- </tr>
- <?php
- }
- }?>
- </table>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement