<script type="text/javascript">
$(document).ready(function(){
function search(){
var judul=$("#search").val();
if(judul!=""){
$("#result").html("<img src='img/ajax-loader.gif'/>");
$.ajax({
type:"post",
url:"get.php",
data:"judul="+judul,
success:function(data){
$("#result").html(data);
$("#search").val("");
}
});
}
}
$("#button").click(function(){
search();
});
$('#search').keyup(function(e) {
if(e.keyCode == 13) {
search();
}
});
});
</script>
</head>
<body>
<div id="container">
<input type="text" id="search" placeholder="Cari Artikel Berdasarkan Judul"/>
<input type="button" id="button" value="Cari" />
<ul id="result"></ul>
</div>
<script type="text/javascript">
$(document).ready(function(){
function search(){
var judul=$("#search").val();
if(judul!=""){
$("#result").html("<img src='img/ajax-loader.gif'/>");
$.ajax({
type:"post",
url:"get.php",
data:"judul="+judul,
success:function(data){
$("#result").html(data);
$("#search").val("");
}
});
}
}
$("#button").click(function(){
search();
});
$('#search').keyup(function(e) {
if(e.keyCode == 13) {
search();
}
});
});
</script>
</head>
<body>
<div id="container">
<input type="text" id="search" placeholder="Cari Artikel Berdasarkan Judul"/>
<input type="button" id="button" value="Cari" />
<ul id="result"></ul>
</div>
<html>
<head>
<style type="text/css">
#container{
width:800px;
margin:0 auto;
}
#searchi{
width:700px;
padding:10px;
}
#button{
display: block;
width: 100px;
height:30px;
border:solid #366FEB 1px;
background: #91B2FA;
}
ul{
margin-left:-40px;
}
ul li{
list-style-type: none;
border-bottom: dotted 1px black;
height: 50px;
}
li:hover{
background: #A592E8;
}
a{
text-decoration: none;
font-size: 18px;
}
</style>
<script src="js/jquery-1.7.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
function search(){
var judul=$("#search").val();
if(judul!="")
{
$("#result").html("<img src='img/ajax-loader.gif'/>");
$.ajax({
type:"POST",
url:"check.php",
data:"judul="+judul,
success:function(data){
$("#result").html(data);
$("#search").val("");
}
});
}
}
$("#button").click(function(){
search();
});
$('#search').keyup(function(e) {
if(e.keyCode == 13) {
search();
}
});
});
</script>
</head>
<body>
<div id="container">
<select id="search" placeholder="Cari">
<option value="#">-----</option>
<option value="pegawai">pegawai</option>
</select>
<input type="button" id="button" value="Cari" />
<ul id="result"></ul>
</div>
</body>
</html>
check.php<?php
include "con.php";
$judul=$_POST["judul"];
$result=mysql_query("SELECT * FROM btn where pegawai like '%$judul%'");
$found=mysql_num_rows($result);
if($found>0){
while($row=mysql_fetch_array($result)){
echo "<li>$row[gaji]</br>
<a href=\"$row[link]\">$row[link]</a></li>";
}
}else{
echo "<li>Tidak ada artikel yang ditemukan <li>";
}
?>
itu cuma 1 combobox gimana kalau ditambah satu combobox ? <?php
$sql1 = mysql_query("Select Kode_Kriteria,Bobot from kriteria");
while($data1 = mysql_fetch_array($sql1)){
$sql3 = mysql_query("Select Distinct(Nik_Pegawai) from pegawai");
while ($data3 = mysql_fetch_array($sql3)) {
$sql4 = mysql_query("Select max(Nilai) as Maks from nilai_kriteria where Kode_Kriteria = '".$data1['Kode_Kriteria']."'");
$data4 = mysql_fetch_array($sql4);
$sql5 = mysql_query("Select (Nilai) as nilai from nilai_kriteria where Kode_Kriteria = '".$data1['Kode_Kriteria']."' And Nik_Pegawai = '".$data3['Nik_Pegawai']."'");
$data5 = mysql_fetch_array($sql5);
echo "".round($data5['nilai'] / $data4['Maks'],2)."";
}
}
?>