LAMPIRAN
1.
Listing Program Login.php
<?php
session_start();
if(isset($_SESSION['userid'])) { header('location:index.php'); } $host = 'localhost';
$user = 'root'; $pass = '1234'; $dbname = 'akademik';
$konek = mysql_connect($host, $user, $pass) or die('Mysql Tidak Terhubung');
mysql_select_db($dbname, $konek); ?>
<html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Login</title>
<meta name="keywords" content="" /> <meta name="description" content="" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<style type="text/css"> body,td,th {
color: #FFF;
font-weight: bold; font-size: 12px; }
.style11 {color: #0000FF} .style12 {
color: #FFF }
</style> </head> <body>
<div id="wrapper"> <div id="logo">
<h1><em>Mobile Information System </em></h1> <p align="left">for SMK Swasta Teladan Medan</p> </div>
</div> <center>
<p> </p>
<table border="5" align="center" cellpadding="7" cellspacing="2" style="margin-top:50px; color: #FFF;">
<form action="proseslogin.php" method="post">
<tr align="center" valign="middle" bgcolor="#000000"> <td colspan="2"><h2>Admin Login</h2></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center" valign="middle" bgcolor="#000000">User ID </td>
<td valign="middle" bgcolor="#000000"><input name="userid" type="text" size="20"/></td>
</tr>
<td align="center" valign="middle" bgcolor="#000000">Password</td>
<td valign="middle" bgcolor="#000000"><input name="password" type="password" size="20"/></td>
</tr>
<tr align="center" valign="middle" bgcolor="#000000">
<td colspan="2"><input type="submit" name="Submit" value="Login" /></td> </tr>
<tr align="center" valign="middle" bgcolor="#000000">
<td colspan="2"><span class="style12">Belum Jadi Admin?</span> <a href="register.php" class="style1">Daftar</a></td></tr>
</form> </table> <p> </p> </center>
<div id="footer-bgcontent"> <div id="footer">
<p>Copyright @ 2012 departemen ilmu komputer. program studi ekstensi s1 ilmu komputer. </p>
<p>universitas sumatera utara.Design by APRILIA Ramadhani </p> </div></div>
</body> </html>
2.
Listing Program Home.php
<html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Home</title>
<meta name="keywords" content="" /> <meta name="description" content="" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<style type="text/css"> .style3 {font-size: 14px} body,td,th {
color: #044dbc; }
.style9 {color: #044dbc} .style11 {color: #0000FF} .style13 {font-size: large} .style14 {
color: #000000; font-size: 22px; font-weight: bold; }
.style15 {font-size: large; color: #0000FF;} </style>
</head> <body>
<div id="wrapper"> <div id="logo">
<h1><em>Mobile Information System </em></h1> <p align="left">for SMK Swasta Teladan Medan</p> </div>
<hr/>
<li class="current_page_item"><a href="home.php" target="_parent" class="first style3"><strong>Home</strong></a></li>
</div> </div>
<div id="page">
<div id="page-bgtop"> <div id="sidebar"> <ul>
<h2>Menu</h2> <li><ul> <li></li>
<li><a href="admin.php" target="_parent">Admin Account</a><a href="creator.php" target="_parent"></a></li>
<li><a href="admin.php" target="_parent"></a> <a href="send.php" target="_parent">Create SMS </a></li>
<li><a href="create_sms.php" target="_parent"></a><a href="siswa.php" target="_parent">Data Siswa </a></li>
<li><a href="inbox.php" target="_parent">Inbox</a></li> <li><a href="outbox.php" target="_parent">Outbox </a></li> <li><a href="logout.php" target="_parent">Logout</a></li> </ul></li></ul>
</div>
<div id="content">
<h2 align="center" class="title style9"> </h2> <div class="entry">
<form class="style13"> <div align="justify"> <div align="justify">
<p><span class="style14">Mobile Academic Information System </span><span class="style11">adalah suatu aplikasi yang berfungsi memberikan informasi kepada siswa dan orangtua/wali siswa mengenai akademik sekolah berbasis SMS. </span></p>
<p><span class="style11">Aplikasi ini hanya dapat digunakan oleh Admin sebagai operator dalam pengolahan data, mengirim dan menerima pesan. </span></p>
</div> </form></p> </div> </div> </div>
<div id="sidebar"> <ul>
<h2>Menu</h2> <li><ul>
<li><a href="jadwal.php" target="_parent"></a></li> <li><a href="jadwal_ujian.php" target="_parent"></a>
<a href="jduas.php" target="_parent"></a>
<a href="jadwal_ujian.php" target="_parent"></a> <a href="info.php" target="_parent"></a>
<strong><a href="absen.php" target="_parent">Absensi </a></strong>
<a href="jadwal.php" target="_parent"></a></li>
<li><a href="jadwal.php" target="_parent">Jadwal Pelajaran</a> </li>
<li><a href="jduan.php" target="_parent"></a>
<a href="ujian.php" target="_parent">Nilai Ujian</a></li> <li><a href="nilai_ujian.php" target="_parent"></a>
<a href="uas.php" target="_parent">Nilai UAS</a></li> <li><a href="nilaiuas.php" target="_parent"></a>
<a href="spp.php" target="_parent">SPP</a></strong></li> </ul></li></ul>
</div>
<div style="clear: both;"> <p> </p>
</div></div>
<div id="footer-bgcontent"> <div id="footer">
<p>Copyright @ 2012 departemen ilmu komputer. program studi ekstensi s1 ilmu komputer. </p> <p>universitas sumatera utara. Design by APRILIA Ramadhani </p>
</div></div></div> </body>
</html>
3.
Listing Program Data Siswa
<?php require_once('Connections/dbkoneksi.php'); ?> <?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ?
mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break;
case "long": case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL"; break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break;
}
return $theValue;}}
mysql_select_db($database_dbkoneksi, $dbkoneksi);
$query_dtsiswa = "SELECT * FROM siswa ORDER BY nis ASC"; $dtsiswa = mysql_query($query_dtsiswa, $dbkoneksi) or die(mysql_error());
$row_dtsiswa = mysql_fetch_assoc($dtsiswa); $totalRows_dtsiswa = mysql_num_rows($dtsiswa); ?>
<html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Data Siswa</title>
<meta name="Description" content="">
<link href="style.css" rel="stylesheet" type="text/css" media="screen"> <style type="text/css">
.style1 {
font-size: 14px; font-style: italic; font-weight: bold; }
body,td,th { color: #FFFFFF; font-size: 12px; }
.style2 {
color: #000000; font-size: x-large; font-weight: bold; }
.style3 {
color: #0000FF; font-weight: bold; font-size: 16px; }
.style5 {
color: #FFFFFF; font-weight: bold; }
.style6 {color: #FFFFFF} body {
background-color: #FFF; background-repeat: repeat-x; }
#wrapper #page #page-bgtop #content .post1 .entry form { color: #000;
}
#wrapper #page #page-bgtop #content .post1 .entry form { font-size: 14px;
}
#wrapper #page #page-bgtop #content .post1 .entry form { font-weight: bold;
}
</style> </head>
<body text="#FFFFFF"> <div id="wrapper"> <div id="logo">
<h1><em>Mobile Information System </em></h1>
<p class="style1">for SMK swasta teladan medan </p> </div>
<hr>
<div id="page"> <div id="header"> <div id="menu">
<li class="current_page_item"><a href="home.php" target="_parent" class="first"><strong>Home</strong></a></li>
</div></div>
<div id="page-bgtop"> <div id="content"> <div class="post1">
<h2 align="center" class="title ">Data Siswa</h2> <div class="entry">
<label>
<div align="justify">
<input type="submit" name="Submit" value="Tambah Data" /> </div>
</label> </form>
<table width="880" align="center" border="1" bordercolor="#FFFFFF" bgcolor="#000000" cellpadding="6">
<tr align="center" valign="middle" bgcolor="#0166FF"> <td colspan="10"><strong>Teknik Elektro</strong></td> </tr>
<tr align="center" valign="middle" bgcolor="#0166FF"> <td>NIS</td>
<td>Nama</td> <td>Kelas</td> <td>Gender</td> <td>Tempat</td> <td>Tgl Lahir</td> <td>Alamat</td>
<td colspan="2">Aksi</td> </tr>
<?php do { ?>
<tr align="center" valign="middle">
<td><?php echo $row_dtsiswa['nis']; ?></td> <td><?php echo $row_dtsiswa['nama']; ?></td> <td><?php echo $row_dtsiswa['kelas']; ?></td> <td><?php echo $row_dtsiswa['gender']; ?></td> <td><?php echo $row_dtsiswa['tempat']; ?></td> <td><?php echo $row_dtsiswa['tgllahir']; ?></td> <td><?php echo $row_dtsiswa['alamat']; ?></td>
<td><a href="edit_siswa.php?nis=<?php echo $row_dtsiswa['nis']; ?>"><strong>Edit</strong></a></td>
<td><a href="hapus_siswa.php?nis=<?php echo $row_dtsiswa['nis']; ?>"><strong>Delete</strong></a></td>
</tr>
<?php } while ($row_dtsiswa = mysql_fetch_assoc($dtsiswa)); ?> </table>
</div></div></div>
<div style="clear: both;"> </div> </div></div>
<div id="footer-bgcontent"> <div id="footer">
<p>Copyright @ 2012 departemen ilmu komputer. program studi ekstensi s1 ilmu komputer. </p>
<p>universitas sumatera utara.Design by APRILIA Ramadhani </p> </div></div></div>
</body> </html> <?php
mysql_free_result($dtsiswa); ?>
4.
Listing Program Tambah Siswa
<?php require_once('Connections/dbkoneksi.php'); ?> <?php
if (!function_exists("GetSQLValueString")) {
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ?
mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break;
case "long": case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL"; break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break;
}
return $theValue;}}
$editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); }
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO siswa (nis, nama, kelas, gender, tempat, tgllahir, alamat) VALUES (%s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['nis'], "text"),
GetSQLValueString($_POST['nama'], "text"), GetSQLValueString($_POST['kelas'], "text"), GetSQLValueString($_POST['gender'], "text"), GetSQLValueString($_POST['tempat'], "text"), GetSQLValueString($_POST['tgllahir'], "text"), GetSQLValueString($_POST['alamat'], "text"));
mysql_select_db($database_dbkoneksi, $dbkoneksi);
$Result1 = mysql_query($insertSQL, $dbkoneksi) or die(mysql_error()); }
mysql_select_db($database_dbkoneksi, $dbkoneksi); $query_dtsiswa = "SELECT * FROM siswa";
$dtsiswa = mysql_query($query_dtsiswa, $dbkoneksi) or die(mysql_error());
$row_dtsiswa = mysql_fetch_assoc($dtsiswa); $totalRows_dtsiswa = mysql_num_rows($dtsiswa); ?>
<html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Input Data Siswa</title>
<meta name="keywords" content="" /> <meta name="description" content="" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
font-size: 14px; font-style: italic; font-weight: bold; }
body,td,th { color: #FFFFFF;
font-family: Arial, Helvetica, sans-serif; font-size: 12px;
}
.style2 {
color: #000000; font-size: x-large; font-weight: bold; }
.style3 {
color: #0000FF; font-weight: bold; font-size: 16px; }
.style5 {
color: #FFFFFF; font-weight: bold; }
.style6 {color: #FFFFFF} #wrapper div div h2 strong { color: #000;
}
</style> </head>
<body text="#000000"> <div id="wrapper"> <div id="logo">
<h1><em>Mobile Information System </em></h1>
<p class="style1">for SMK swasta teladan medan </p> </div>
<hr/>
<div id="header"> <div id="menu">
<li class="current_page_item"><a href="home.php" target="_parent" class="first"><strong>Home</strong></a></li>
</div></div>
<div style="clear: both; color: #FFF; font-size: 12px; font-weight: bold;"><span style="font-size: x-large"><strong>
</strong></span> <div align="center">
<h2><strong>Tambah Data</strong></h2> <p> </p>
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
<table border="5" align="center" cellpadding="4" cellspacing="2"> <tr valign="baseline">
<td align="center" valign="middle"
bgcolor="#000000"><strong>NIS</strong></td>
<td align="left" valign="middle" bgcolor="#000000"><input type="text" name="nis" value="" size="15"></td>
</tr>
<tr valign="baseline">
<td align="center" valign="middle"
bgcolor="#000000"><strong>Nama</strong></td>
</tr>
<tr valign="baseline">
<td align="center" valign="middle"
bgcolor="#000000"><strong>Kelas</strong></td>
<td align="left" valign="middle" bgcolor="#000000"><input type="text" name="kelas" value="" size="5"></td>
</tr>
<tr valign="baseline">
<td align="center" valign="middle"
bgcolor="#000000"><strong>Gender</strong></td>
<td align="left" valign="middle" bgcolor="#000000"><select name="gender">
<option value="Laki-laki" <?php if (!(strcmp("Laki-laki", ""))) {echo "SELECTED";} ?>>Laki-laki</option>
<option value="Perempuan" <?php if (!(strcmp("Perempuan", ""))) {echo "SELECTED";} ?>>Perempuan</option>
</select></td> </tr>
<tr valign="baseline">
<td align="center" valign="middle" bgcolor="#000000"><strong>Tempat Lahir</strong></td>
<td align="left" valign="middle" bgcolor="#000000"><input type="text" name="tempat" value="" size="20"></td>
</tr>
<tr valign="baseline">
<td align="center" valign="middle" bgcolor="#000000"><strong>Tgl Lahir</strong></td>
<td align="left" valign="middle" bgcolor="#000000"><input type="text" name="tgllahir" value="" size="10">
dd-mm-yyyy</td> </tr>
<tr valign="baseline">
<td align="center" valign="middle"
bgcolor="#000000"><strong>Alamat</strong></td>
<td align="left" valign="middle" bgcolor="#000000"><textarea name="alamat" cols="20" rows="2"></textarea></td>
</tr>
<tr valign="baseline">
<td colspan="2" align="center" valign="middle" bgcolor="#000000"><input type="submit" value="Insert record"></td>
</tr> </table>
<input type="hidden" name="MM_insert" value="form1"> </form>
<p>
<p><a href="siswa.php"><span class="style3">Lihat Data</span></a> </div></div></div>
<div id="footer-bgcontent"> <div id="footer">
<p>Copyright @ 2012 departemen ilmu komputer. program studi ekstensi s1 ilmu komputer. </p>
<p>universitas sumatera utara.Design by APRILIA Ramadhani </p> </div></div></div>
</body> </html> <?php
5.
Listing Program Edit Siswa
<?php require_once('Connections/koneksi.php'); ?> <?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ?
mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break;
case "long": case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL"; break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break;
}
return $theValue; }
}
$editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); }
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $updateSQL = sprintf("UPDATE siswa SET nama=%s, kelas=%s, gender=%s, tempat=%s, tgllahir=%s, alamat=%s WHERE nis=%s",
GetSQLValueString($_POST['nama'], "text"), GetSQLValueString($_POST['kelas'], "text"), GetSQLValueString($_POST['gender'], "text"), GetSQLValueString($_POST['tempat'], "text"), GetSQLValueString($_POST['tgllahir'], "text"), GetSQLValueString($_POST['alamat'], "text"), GetSQLValueString($_POST['nis'], "text")); mysql_select_db($database_koneksi, $koneksi);
$Result1 = mysql_query($updateSQL, $koneksi) or die(mysql_error()); $updateGoTo = "siswa.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?"; $updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo)); }
$colname_dtsiswa = $_GET['nis']; }
mysql_select_db($database_koneksi, $koneksi);
$query_dtsiswa = sprintf("SELECT * FROM siswa WHERE nis = %s", GetSQLValueString($colname_dtsiswa, "text"));
$dtsiswa = mysql_query($query_dtsiswa, $koneksi) or die(mysql_error()); $row_dtsiswa = mysql_fetch_assoc($dtsiswa);
$totalRows_dtsiswa = mysql_num_rows($dtsiswa); ?>
<html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Edit Data Siswa</title>
<meta name="Keywords" content=""> <meta name="Description" content="">
<link href="style.css" rel="stylesheet" type="text/css" media="screen"> <style type="text/css">
.style1 {
font-size: 14px; font-style: italic; font-weight: bold; }
body,td,th { color: #FFFFFF; font-size: 12px; }
.style2 {
color: #000000; font-size: x-large; font-weight: bold; }
.style3 {
color: #0000FF; font-weight: bold; font-size: 16px; }
.style5 {
color: #FFFFFF; font-weight: bold; }
.style6 {color: #FFFFFF} body {
background-color: #FFF; }
</style> </head>
<body text="#FFFFFF"> <div id="wrapper"> <div id="logo">
<h1><em>Mobile Information System </em></h1>
<p class="style1">for SMK swasta teladan medan </p> </div>
<hr>
<div id="header"> <div id="menu">
<li class="current_page_item"><a href="home.php" target="_parent" class="first"><strong>Home</strong></a></li>
</div></div>
<div style="clear: both;"><span style="font-size: x-large"><strong>
<div align="center">
<h2><span class="style2">Edit Siswa</span></h2>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<table border="5" align="center" cellpadding="4" cellspacing="2"> <tr valign="baseline">
<td align="center" valign="middle"
bgcolor="#000000"><strong>NIS</strong></td>
<td align="left" valign="middle" bgcolor="#000000"><?php echo $row_dtsiswa['nis']; ?></td>
</tr>
<tr valign="baseline">
<td align="center" valign="middle"
bgcolor="#000000"><strong>Nama</strong></td>
<td align="left" valign="middle" bgcolor="#000000"><input type="text" name="nama" value="<?php echo htmlentities($row_dtsiswa['nama'], ENT_COMPAT, 'utf-8'); ?>" size="20" /></td>
</tr>
<tr valign="baseline">
<td align="center" valign="middle"
bgcolor="#000000"><strong>Kelas</strong></td>
<td align="left" valign="middle" bgcolor="#000000"><input type="text" name="kelas" value="<?php echo htmlentities($row_dtsiswa['kelas'], ENT_COMPAT, 'utf-8'); ?>" size="5" /></td>
</tr>
<tr valign="baseline">
<td align="center" valign="middle"
bgcolor="#000000"><strong>Gender</strong></td>
<td align="left" valign="middle" bgcolor="#000000"><select name="gender">
<option value="Laki-laki" <?php if (!(strcmp("Laki-laki",
htmlentities($row_dtsiswa['gender'], ENT_COMPAT, 'utf-8')))) {echo "SELECTED";} ?>>Laki-laki</option>
<option value="Perempuan" <?php if (!(strcmp("Perempuan",
htmlentities($row_dtsiswa['gender'], ENT_COMPAT, 'utf-8')))) {echo "SELECTED";} ?>>Perempuan</option>
</select></td> </tr>
<tr valign="baseline">
<td align="center" valign="middle" bgcolor="#000000"><strong>Tempat Lahir</strong></td>
<td align="left" valign="middle" bgcolor="#000000"><input type="text" name="tempat" value="<?php echo htmlentities($row_dtsiswa['tempat'], ENT_COMPAT, 'utf-8'); ?>" size="15" /></td>
</tr>
<tr valign="baseline">
<td align="center" valign="middle" bgcolor="#000000"><strong>Tanggal Lahir</strong></td>
<td align="left" valign="middle" bgcolor="#000000"><input type="text" name="tgllahir" value="<?php echo htmlentities($row_dtsiswa['tgllahir'], ENT_COMPAT, 'utf-8'); ?>" size="10" />
dd-mm-yyyy</td> </tr>
<tr valign="baseline">
<td align="center" valign="middle"
bgcolor="#000000"><strong>Alamat</strong></td>
<td align="left" valign="middle" bgcolor="#000000"><textarea name="alamat" cols="20" rows="2"><?php echo
htmlentities($row_dtsiswa['alamat'], ENT_COMPAT, 'utf-8'); ?></textarea></td>
<tr valign="baseline">
<td colspan="2" align="center" valign="middle" bgcolor="#000000"><input type="submit" value="Update record" /></td>
</tr> </table>
<input type="hidden" name="MM_update" value="form1" />
<input type="hidden" name="nis" value="<?php echo $row_dtsiswa['nis']; ?>" />
</form>
<p> </p> </div>
</div> </div>
<div id="footer-bgcontent"> <div id="footer">
<p>Copyright @ 2012 departemen ilmu komputer. program studi ekstensi s1 ilmu komputer. </p>
<p>universitas sumatera utara. Design by APRILIA Ramadhani </p> </div></div></div>
</body> </html> <?php
mysql_free_result($dtsiswa); ?>
6.
Listing Program Hapus Siswa
<title>Hapus Data Siswa</title>
<?php require_once('Connections/koneksi.php'); ?> <?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ?
mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) { case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break;
case "long": case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL"; break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break;
return $theValue;} }
if ((isset($_GET['nis'])) && ($_GET['nis'] != "")) { $deleteSQL = sprintf("DELETE FROM siswa WHERE nis=%s", GetSQLValueString($_GET['nis'], "text"));
mysql_select_db($database_koneksi, $koneksi);
$Result1 = mysql_query($deleteSQL, $koneksi) or die(mysql_error()); $deleteGoTo = "siswa.php";
if (isset($_SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?"; $deleteGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo)); }
?>
7.
Listing Program Logout
<?php
session_start();
unset($_SESSION['userid']); ?>
<html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Logout</title>
<meta name="keywords" content="" /> <meta name="description" content="" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<style type="text/css"> .style3 {font-size: 14px} body,td,th {
color: #044dbc; }
.style9 {color: #044dbc} .style10 {color: #000000} body {
background-color: #044dbc; }
</style> </head> <body>
<div id="wrapper"> <div id="logo">
<h1><em>Mobile Information System </em></h1> <p align="left">for SMK Swasta Teladan Medan</p> </div><hr/>
<div id="header"> <div id="menu"></div> </div>
<div id="page">
<div id="page-bgtop">
<center>
<h2>Anda telah berhasil logout..</h2>
Silahkan klik <a href="login.php"><b>disini</b></a> untuk login kembali <p> </p>
<?php
if ($_POST['submit']) {
// menjalankan command menghentikan service Gammu passthru("gammu-smsd -k");
} else {
// form berisi tombol untuk menghentikan service Gammu
echo "<form method='post' action=".$_SERVER['PHP_SELF'].">";
echo "<input type='submit' name='submit' value='Hentikan SMS Service'>"; echo "</form>";
} ?> </p>
<p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </center> </div></div>
<div id="footer-bgcontent"> <div id="footer">
<p>Copyright @ 2012 departemen ilmu komputer. program studi ekstensi s1 ilmu komputer. </p>
<p>universitas sumatera utara.Design by APRILIA Ramadhani </p> </div></div></div>