Listing Program Menu Index - PHP
Listing Program Menu Index - PHP
Listing Program Menu Index - PHP
php
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8" />
<title>IPCAM</title>
<link href="stylesheets/screen.css" rel="stylesheet" media="screen,projection" />
<style>
.forms li {
position: relative;
}
.show-password-link {
display: block;
position: absolute;
z-index: 11;
}
.password-showing {
position: absolute;
z-index: 10;
}
</style>
</head>
function redirect($link){
echo "<script>window.location='$link';</script>";
}
$username = $_POST['username'];
$password = $_POST['password'];
$id_role = $_POST['id_role'];
include("config.php");
if ($password == $data['password'])
{
else {
//warning untuk proses login jika salah
echo "<script type='text/javascript'>alert('Cek Username dan Password
!');document.location='index.php'</script>";
?>
$id_role = $_SESSION['id_role'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Video Pembelajaran Jarak Jauh</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="images/Refresh.css" type="text/css" />
<script type="text/javascript" src="flowplayer-3.2.4.min.js">
flowplayer("player", "flowplayer-3.2.4.swf");</script>
</form>
</div>
<div id="content-wrap">
<div id="sidebar">
<h1>Sidebar Menu</h1>
<div class="left-box">
<ul class="sidemenu">
<li><a href="home.php">Home</a></li>
<li><a href="live.php">Live Streaming</a></li>
<li><a href="video.php">Video Pembelajaran</a></li>
<li><a href="materi.php">Materi</a></li>
</div>
<div id="main"> <a name="TemplateInfo"></a>
include "header.php";
include "cek.php";
$nama = $_SESSION['nama'];
$username = $_SESSION['username'];
$sql = mysql_query("select * from pengguna where username='$username'");
$user_login = mysql_fetch_array($sql);
$user = $user_login['nama'];
?>
<h1>Home</h1>
<h2>Selamat Datang <?php echo $user; ?></h2>
include "header.php";
include "cek.php";
$id_role = $_SESSION['id_role'];
?>
<h1>Video</h1>
<?php if($id_role == 0 || $id_role == 1) { ?>
<form action="video_action.php" method="post" enctype="multipart/form-data">
<label>Nama Materi</label><select name="id_materi"><option>--Nama Materi--</option>
<?php
$querykf = "SELECT * from materi";
$resultkf=mysql_query($querykf);
<div id="footer">
<p> © 2013 <strong>Politeknik Negeri Malang</strong> | Design by: Triaz dan Firdyan
</p>
</div>
</div>
</body>
</html>
<?php
include "config.php";
function redirect($link){
echo "<script>window.location='$link';</script>";
}
$aksi = $_REQUEST['aksi'];
if($aksi == "simpan")
{
simpan();
}
else if($aksi == "update")
{
update();
}
else if ($aksi == "delete")
{
delete();
}
function simpan()
{
$id_materi= $_POST['id_materi'];
$file = $_FILES['file']['name'];
$fileSize = $_FILES['file']['size'];
$fileError = $_FILES['file']['error'];
$result = mysql_query($query);
if($result == true)
{
redirect("video.php");}
else
{
echo "Simpan gagal<br><a href='video.php'>Lihat Data</a>".$query;
}
}
mysql_close();
?>
7. Listing Program video_detail.php
<?php
session_start();
include "header.php";
include "cek.php";
?>
<h1>Video Materi</h1>
<?php
$id_video = $_GET['id_video'];
$cServerAddress = $_SERVER['PHP_SELF'] ;
$sql = mysql_query("select m.*, v.* from materi m, video v where id_video = '$id_video' and
m.id_materi = v.id_materi");
while ($data = mysql_fetch_array($sql))
{
?>
<script type="text/javascript">
var s1 = new SWFObject("./video/player.swf","ply","380","320","9","#ffffff");
s1.addParam("flashvars","file=<?php echo "http://" . $_SERVER['SERVER_NAME']
."/file/" . $data['file']; ?>&image=./video/preview.jpg");
s1.addParam("allowfullscreen","true");
s1.addParam("allowscriptaccess","always");
s1.write("container2");
</script>
</div>
</div>
<div id="footer">
<p> © 2013 <strong>Politeknik Negeri Malang</strong> | Design by: Triaz dan Firdyan
</p>
</div>
</div>
</body>
</html>
include "cek.php";
?>
<?php
$sql = mysql_query("select v.*, m.* from video v, materi m where v.id_materi = m.id_materi");
while ($data = mysql_fetch_array($sql))
{
?>
<ul>
<li><a
href="video_detail.php?id_video=<?php echo $data[0]; ?>"><?php echo $data['nama_materi'];
?></a></li>
</ul>
<?php } ?>
include "header.php";
include "cek.php"; ?>
<script language="javascript" type="text/javascript">
alert("Untuk Mengakses Menu Live Streaming Kami Menyarankan Untuk Menggunakan
Web Browser <em>INTERNET EXPLORER</em>");
</script>
<h1>Live Streaming</h1><br />
<tabel>
<tr>
<td><form action="ruang1-1.php">
<input type="submit" name="button" id="button" value="R1.1" /></form>
<form action="ruang1-2.php">
<input type="submit" name="button" id="button" value="R1.2" /></form>
</td>
</tr>
</tabel>
</div>
</div>
<div id="footer">
<p> © 2013 <strong>Politeknik Negeri Malang</strong> | Design by: Triaz dan Firdyan
</p>
</div>
</div>
</body>
</html>
include "header.php";
include "cek.php"; ?>
<h1>Ruang 1.1</h1><br />
<tabel>
<td>
<tr>
<iframe src="http://telkom-hotspot.no-ip.biz:5000/index.htm" style="width:600px;
height:500px;" frameborder="0"></iframe>
</td>
</tabel>
</div>
</div>
<div id="footer">
<p> © 2013 <strong>Politeknik Negeri Malang</strong> | Design by: Triaz dan Firdyan
</p>
</div>
</div>
</body>
</html>
11. Listing Program ruang1-2.php
<?php
if(!isset($_SESSION))
{
session_start();
}
include "header.php";
include "cek.php"; ?>
<h1>Ruang 1.1</h1><br />
<tabel>
<td>
<tr>
<iframe src="http://telkom-hotspot.no-ip.biz:4000/index.htm" style="width:600px;
height:500px;" frameborder="0"></iframe>
</td>
</tabel>
</div>
</div>
<div id="footer">
<p> © 2013 <strong>Politeknik Negeri Malang</strong> | Design by: Triaz dan Firdyan
</p>
</div>
</div>
</body>
</html>
include "header.php";
include "cek.php";
$id_role = $_SESSION['id_role'];
?>
<h1>Materi</h1>
<?php if($id_role == 0 || $id_role == 1) { ?>
<form action="materi_action.php" method="post" enctype="multipart/form-data">
<label>Nama Materi</label><input type="text" name="nama_materi" size="50" />
<label>Link PPT</label><input type="text" name="ppt" size="50" />
<br />
<input type="hidden" name="aksi" value="simpan"/>
<input type="submit" name="btn_simpan" value="Save"/>
<input type="reset" value="Reset"/>
</form>
<?php } ?>
<?php include "materi_view.php"; ?>
</div>
</div>
<div id="footer">
<p> © 2013 <strong>Politeknik Negeri Malang</strong> | Design by: Triaz dan Firdyan
</p>
</div>
</div>
</body>
</html>
13. Listing Program materi_action.php
<?php
session_start(); ?>
<?php
include "config.php";
function redirect($link){
echo "<script>window.location='$link';</script>";
}
$aksi = $_REQUEST['aksi'];
if($aksi == "simpan")
{
simpan();
}
else if($aksi == "update")
{
update();
}
else if ($aksi == "delete")
{
delete();
}
function simpan()
{
$nama_materi= $_POST['nama_materi'];
$ppt = $_POST['ppt'];
$result = mysql_query($query);
if($result == true)
{
redirect("materi.php");}
else
{
echo "Simpan gagal Lihat Data</a>".$query;
}
}
function update()
{
$kf_kode = $_POST['kf_kode'];
$kode = $_POST['kode'];
$nama = $_POST['nama'];
$bentuk = $_POST['bentuk'];
$harga = $_POST['harga'];
$name = $_FILES['gambar']['name'];
$fileSize = $_FILES['gambar']['size'];
$fileError = $_FILES['gambar']['error'];
$move = move_uploaded_file($_FILES['gambar']['tmp_name'],
'C:/xampp/htdocs/flanelku/gambar/'.$name);
if($name == ""){
$query = "UPDATE flanel SET nama='$nama', bentuk='$bentuk', harga=$harga,
kf_kode='$kf_kode' WHERE kode='$kode'";
}else{
$result = mysql_query($query);
if($result == true)
{
echo "Update sukses <br><a href='../flanelku_admin.php'>Lihat Data</a>";
}
else
{
echo "Update gagal<br><a href='../flanelku_admin.php'>Lihat Data</a>".$query;
}
}
function delete()
{
$kode = $_GET['kode'];
$query="DELETE FROM flanel WHERE kode='$kode'";
$result=mysql_query($query);
if($result == true)
{
echo "Delete sukses <br><a href='../flanelku_admin.php'>Lihat Data</a>";
}
else
{
echo "Delete gagal<br><a href='../flanelku_admin.php'>Lihat Data</a><br>$query";
}
}
mysql_close();
?>
<?php
include "config.php";
function redirect($link){
echo "<script>window.location='$link';</script>";
}
$aksi = $_REQUEST['aksi'];
if($aksi == "simpan")
{
simpan();
}
else if($aksi == "update")
{
update();
}
else if ($aksi == "delete")
{
delete();
}
function simpan()
{
$nama_materi= $_POST['nama_materi'];
$ppt = $_POST['ppt'];
$result = mysql_query($query);
if($result == true)
{
redirect("materi.php");}
else
{
echo "Simpan gagal Lihat Data</a>".$query;
}
}
mysql_close();
?>
$id_role = $_SESSION['id_role'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Video Pembelajaran Jarak Jauh</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="images/Refresh.css" type="text/css" />
<script type="text/javascript" src="flowplayer-3.2.4.min.js">
flowplayer("player", "flowplayer-3.2.4.swf");</script>
</form>
</div>
<div id="content-wrap">
<div id="sidebar">
<h1>Sidebar Menu</h1>
<div class="left-box">
<ul class="sidemenu">
<li><a href="home.php">Home</a></li>
<li><a href="live.php">Live Streaming</a></li>
<li><a href="video.php">Video Pembelajaran</a></li>
<li><a href="materi.php">Materi</a></li>
</div>
<div id="main"> <a name="TemplateInfo"></a>
<?php
include "config.php";
function redirect($link){
echo "<script>window.location='$link';</script>";
}
$aksi = $_REQUEST['aksi'];
if($aksi == "simpan")
{
simpan();
}
else if($aksi == "update")
{
update();
}
else if ($aksi == "delete")
{
delete();
}
function simpan()
{
$nama= $_POST['nama'];
$username = $_POST['username'];
$password= $_POST['password'];
$id_role = $_POST['id_role'];
$result = mysql_query($query);
if($result == true)
{
redirect("register.php");}
else
{
echo "Simpan gagal<br><a href='../flanelku_admin.php'>Lihat Data</a>".$query;
}
}
function update()
{
$kf_kode = $_POST['kf_kode'];
$kode = $_POST['kode'];
$nama = $_POST['nama'];
$bentuk = $_POST['bentuk'];
$harga = $_POST['harga'];
$name = $_FILES['gambar']['name'];
$fileSize = $_FILES['gambar']['size'];
$fileError = $_FILES['gambar']['error'];
$move = move_uploaded_file($_FILES['gambar']['tmp_name'],
'C:/xampp/htdocs/flanelku/gambar/'.$name);
if($name == ""){
$query = "UPDATE flanel SET nama='$nama', bentuk='$bentuk', harga=$harga,
kf_kode='$kf_kode' WHERE kode='$kode'";
}else{
$result = mysql_query($query);
if($result == true)
{
echo "Update sukses <br><a href='../flanelku_admin.php'>Lihat Data</a>";
}
else
{
echo "Update gagal<br><a href='../flanelku_admin.php'>Lihat Data</a>".$query;
}
}
function delete()
{
$kode = $_GET['kode'];
$query="DELETE FROM flanel WHERE kode='$kode'";
$result=mysql_query($query);
if($result == true)
{
echo "Delete sukses <br><a href='../flanelku_admin.php'>Lihat Data</a>";
}
else
{
echo "Delete gagal<br><a href='../flanelku_admin.php'>Lihat Data</a><br>$query";
}
}
mysql_close();
?>
if ($conn == false)
{
echo "Koneksi ke server gagal.";
die();
}
?>