<?php
function get_menu($data, $parent = 0) {
static $i = 1;
$tab = str_repeat("\t\t", $i);
if (isset($data[$parent])) {
$html = "\n$tab<ul>";
$i++;
foreach ($data[$parent] as $v) {
$child = get_menu($data, $v->id);
$html .= "\n\t$tab<li>";
$html .= '<a href="'.$v->url.'">'.$v->title.'</a>';
if ($child) {
$i--;
$html .= $child;
$html .= "\n\t$tab";
}
$html .= '</li>';
}
$html .= "\n$tab</ul>";
return $html;
} else {
return false;
}
}
mysql_connect('localhost', 'root', '');
mysql_select_db('tes');
$result = mysql_query("SELECT * FROM menu ORDER BY menu_order");
while ($row = mysql_fetch_object($result)) {
$data[$row->parent_id][] = $row;
}
$menu = get_menu($data);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Sistem Informasi OBC </title>
<link rel="stylesheet" type="text/css" href="jquerycssmenu.css" />
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="jquerycssmenu.js"></script>
<style type="text/css">
body { font: 11px Tahoma, sans-serif; margin: 0; padding: 0; }
a { color: #3150a9; text-decoration: none; }
#content { padding: 10px; margin: 15px; border: 1px solid #ccc; width: 1350px; background: #fafafa; }
</style>
</head>
<body>
<align="center"><img src="telkom.jpg" height="150" width="1350"></align>
<div id="myjquerymenu" class="jquerycssmenu">
<?php echo $menu; ?>
<br style="clear: left" />
</div>
<div id="content">
<!-- form quick search -->
<form name="form1" method="get" action="">
Search : <input type="text" name="q" id="q"/> <input type="submit" value="Search"/>
</form>
<!-- menampilkan hasil pencarian -->
<?php
if(isset($_GET['q']) && $_GET['q']){
$conn = mysql_connect("localhost", "root", "");
mysql_select_db("galeri");
$q = $_GET['q'];
$sql = "select * from foto where nama_file like '%$q%' or
nama like '%$q%' or alamat like '%$q%' or gender like '%$q%' or pendidikan like '%$q%' or deskripsi like '%$q%' or tanggal like '%$q%'";
$result = mysql_query($sql);
if(mysql_num_rows($result) > 0){
?><table background="id.jpg">
<tr>
<td></td></tr>
<?php
while($siswa = mysql_fetch_array($result)){?>
<Table Background="tb2.jpg">
<td width="300" height="500"><pre> <img src="images/<?php echo $siswa['nama_file'];?>" alt="" width="190" border="0"/><br><br> <?php echo $siswa['nama'];?
></td></tr>
<?php }?>
</table>
<?php
}else{
echo 'Data not found!';
}
}
?>
</div>
</body>
</html>
<select name="tahun_ajaran" id="tahun_ajaran">
<?
$tahun_ajaran=mysql_query("select * from tblspp");
while($data=mysql_fetch_array($tahun_ajaran)){
echo"<option value=\"$data[tahun_ajaran]\">$data[tahun_ajaran]</option>";
}
?>
</select>
yang membuat saya kesulitan di textbox_nya mas. saya bikin textbox di bawah combobox itu dengan nama Nominal dengan tujuan untuk menampilkan nominal pembayaran spp pada tahun ajaran yang kita pilih pada combobox tersebut.