1, langkah pertama kita siapkan database serta tabel ya :
2. berikut kita lampirkan coding nya untuk tampilan halaman depan dari program tersebut yakni file index,php beserta gambar :
<?php include 'kepala.php'; ?>
<div class="container">
<div class="well well-small">
<p>
<?php
include("koneksi.php");
echo "<CENTER><H1>Diagnosa Kerusakan Rangkaian CPU</H1></CENTER>";
echo "<CENTER><H1>Dengan Sistem Pakar</H1></CENTER>";
echo "<CENTER><img src='CPU2.jpg' WIDTH='300' HEIGHT='300' BORDER=20 ALT=''></CENTER>";
?>
<a href='''' class='btn btn-block btn-large ' /> <blink><H1>Navigasi</H1> </blink>
</p>
<p align="center"><a href="diagnosa_motherboard.php"><img src="Image Menu Utama/Motherboard.jpg" width="200" height="100" longdesc="Image Menu Utama/Motherboard.jpg" /></a> <a href="diagnosa_Hardisk.php"><img src="Image Menu Utama/Hard_disk.jpg" longdesc="Image Menu Utama/Hard_disk.jpg" /></a> <a href="diagnosa_vga.php"><img src="Image Menu Utama/vga.jpg" longdesc="Image Menu Utama/vga.jpg" /></a></p>
<p align="center"><a href="diagnosa_powersupply.php"><img src="Image Menu Utama/powersupply.jpg" longdesc="Image Menu Utama/powersupply.jpg" /></a><a href="diagnosa_dvd.php"><img src="Image Menu Utama/DVD.jpg" longdesc="Image Menu Utama/DVD.jpg" /></a> <a href="diagnosa_RAM.php"><img src="Image Menu Utama/ram.jpg" longdesc="Image Menu Utama/ram.jpg" /></a></p>
</br><div class=" well">
<marquee>
<center><p>Tugas Kelompok Pemograman Mobile Lanjutan</p></center> </div></marquee>
<marquee>
<center><p>Mc Donald, Roni Amardi, M.Hilman Fauzi</p></center> </div></marquee>
</div>
</div>
3. salah satu sampel kita ambil atau pilih diagnosa kerusakan bserta gambar :
<?php
include 'kepala.php';
include("koneksi.php");
?>
<div class="container">
<div class="well well-small">
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.3.js'></script>
<style type='text/css'>
</style>
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){
$("div.btn-input").live('click', function(){
var btn = $(this),
container = btn.parent(),
name = btn.data('toggle-name'),
hidden = container.find('input[name="' + name + '"]'),
value = btn.attr('value');
hidden.val(value);
container.find(".btn-input").removeClass('active btn-primary');
btn.addClass('active btn-primary');
});
});//]]>
</script>
</head>
<?php
if(!isset($_GET['idpertanyaan'])){
//tampilkan pertanyaan pertama
$sqlp = "select * from diagnosa_motherboard where mulai='Y'";
$rs=mysql_query($sqlp);
$data=mysql_fetch_array($rs);
//bentuk pertanyaan echo "<form>";
echo "<form>";
echo " <small> Diagnosa Di mulai... </small>";
echo "<center>";
echo "<h1>".$data['solusi_dan_pertanyaan']."</h1></center><br>";
echo '
<div class="span5"> <div class="alert alert-info">
<div class="control-group ">
<label class="control-label" style="width:120px;">Apakah Benar </label>
<div class="controls" style="margin-left:150px;">
';
echo "<input type='radio' name='idpertanyaan' value='".$data['bila_benar']."'>
Benar<br>";
echo '
</div>
</div>
</div>
</div>
<div class="span5"> <div class="alert alert-warning">
<div class="control-group ">
<label class="control-label" style="width:120px;">Apakah Salah</label>
<div class="controls" style="margin-left:150px;">
';
echo "<input type='radio' name='idpertanyaan' value='".$data['bila_salah']."'>Tidak<br>";
echo '
</div>
</div>
</div>
</div>';
echo "<input type='submit' class='btn btn-primary btn-block btn-large' value='Lanjutken ' >";
}else{
// }else{
//tampilkan pertanyaan pertama
$idsolusi=$_GET['idpertanyaan'];
$sqlp = "select * from diagnosa_motherboard where id=$idsolusi";
$rs=mysql_query($sqlp);
$data=mysql_fetch_array($rs);
echo "<form>";
echo " <small> Mari mulai Mendiagnosa </small>";
echo "<center>";
echo "<h1>".$data['solusi_dan_pertanyaan']."</h1></center><br>";
// echo "<a href='' class='btn btn-success btn-large btn-block' /> Kembali Melakukan Diagnosa </a>";
if($data['selesai']!="Y"){
echo '
<div class="span5"> <div class="alert alert-info">
<div class="control-group ">
<label class="control-label" style="width:120px;">Apakah Benar </label>
<div class="controls" style="margin-left:150px;">
';
echo "<input type='radio' name='idpertanyaan' value='".$data['bila_benar']."'>
Benar<br>";
echo '
</div>
</div>
</div>
</div>
<div class="span5"> <div class="alert alert-warning">
<div class="control-group ">
<label class="control-label" style="width:120px;">Apakah Salah</label>
<div class="controls" style="margin-left:150px;">
';
echo "<input type='radio' name='idpertanyaan' value='".$data['bila_salah']."'>Tidak<br>";
echo '
</div>
</div>
</div>
</div>';
echo "<input type='submit' class='btn btn-primary btn-block btn-large' value='Lanjutken ' >";
echo "<a class='btn btn-block btn-large ' href='Solusi_motherboard.php?idpertanyaan=1'>Solusi </a>";
}else{
//jika ingin menambah pertanyaan
}
echo "</form>";
echo '</br><div class=" well">
<center><p>Mc Donald & Roni Amardi</p></center> </div>';
}
?>
<center><img src="Motherboard.jpg" width="400" height="150" />
<a href='''' class='btn btn-block btn-large ' /> <H1>Back To Diagnosa</H1> </a>
</div>
</div>
3. berikutnya untuk menampilkan beberapa pertanyaan dan jawaban
Demikianlah semoga bermanfaat buat para sobat jika sobat ingin mencoba bisa di akses di link websitenya :
DOSEN MATAKULIAH
Nama : M.Ropianto, M.Kom
NIDN : 1028067804
Status : Dosen Tetap YAPISTA/STT Ibnu Sina
Matakuliah : Pemograman Mobile Lanjutan
No comments:
Post a Comment