forked from informatikauntan/spota
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·217 lines (204 loc) · 6.65 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<?php
include "sambung.inc.php";
session_start();
if(!isset($_POST['ok']))
{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>..::[SPOTA Prodi TEKNIK INFORMATIKA]::..</title>
<meta name="keywords" content="SPOTA, Sistem Pendukung Outline Tugas Akhir" />
<meta name="copyright" content="nikolaidiez - Teknik Informatika - UNTAN" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body> <!--
<div id="header">
<br /><br /><br /><br /><center><img src="images/maintenance.png" /></center>
</div>
-->
<div id="menu" style="background-image:url(images/menu.gif);">
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="praoutline.php">Praoutline</a></li>
<li><a href="index.php?bag=kontak">Kontak</a></li>
</ul>
</div>
<div id="header" style="background-image:url(images/header.gif);"></div>
<div id="page">
<form method="post" action="<?php echo "index.php?bag=kotaksaran"; ?>">
<div id="content">
<ul>
<li>
<h2><u>Penjelasan tentang SPOTA</u></h2>
<ul>
<?php
$link=$_GET['bag'];
if ($link=="kontak")
{
?>
<table width="100%" border="0">
<tr>
<td colspan="2"><u><strong>Berikan Saran Anda</strong></u></td>
</tr>
<tr>
<td width="30%">Nama Anda </td>
<td width="70%"><input type="text" name="nama" maxlength="20" size="20"></td>
</tr>
<tr>
<td>Email Anda </td>
<td><input type="text" name="email" maxlength="30" size="30"></td>
</tr>
<tr>
<td>Saran/Pesan </td>
<td><textarea name="problem" rows=6 cols=40></textarea></td>
</tr>
<tr>
<td> </td>
<td> <input type="submit" name="kirimpesan" value="Kirim" class="biasa"> <input type="reset" name="reset" value="Cancel" class="biasa"></td>
</tr>
</table>
<?php
}
else
{
?>
<p>Sistem Pendukung Outline Tugas Akhir merupakan sistem yang dibangun untuk <b>membantu</b> kerja dosen dalam me-review atau menanggapi setiap judul yang dipilih atau diangkat oleh mahasiswa sebagai judul Tugas Akhir.</p>
<p>Mahasiswa diharapkan dapat<strong> meng-upload-kan</strong> draft praoutline yang berisi keterangan lengkap tentang judul yang diangkat dimulai dari inti permasalahan yang bersifat <strong><i>urgen</i></strong> dan tujuan <em><strong>jelas</strong></em> penelitian.</p>
<p>Hasil dari review atau tanggapan dosen dapat dilihat pada menu praoutline ataupun pada account masing-masing mahasiswa. Pada halaman itu pula dapat dilihat saran dari mahasiswa.</p>
<?php
}
?>
</ul>
</li>
</ul>
</div>
</form>
<?php
if (isset($_POST['kirimpesan']))
{
function valemail($str)
{
return (ereg('^[^@]+@([a-z\-]+\.)+[a-z]{2,4}$',$str));
}
$problem_cek = strip_tags($_POST['problem']);
$problem_cek = trim($problem_cek);
$nama=trim($_POST['nama']);
$waktu=date("H:i:s");
if ((($problem_cek!=NULL) or ($problem_cek!='%')) and (($nama!=NULL) or ($nama!='%')) and (valemail($_POST['email'])))
{
$query=mysql_query("INSERT INTO kotak_pesan(nama,email,saran,tanggal,waktu) values ('$nama','$_POST[email]','$problem_cek', NOW(), '$waktu')");
?>
<script language="javascript">alert("Terima Kasih")</script>
<meta http-equiv="refresh" content="0;URL=index.php?bag=kontak">
<?php
}
else
{
?>
<script language="javascript">alert("Input Kosong ataupun Format Email keliru")</script>
<meta http-equiv="refresh" content="0;URL=index.php?bag=kontak">
<?php
}
}
?>
<div id="sidebar">
<ul>
<li>
<h2>Website Untan Lainnya</h2>
<ul>
<li><a href="#">E-learning</a></li>
<li><a href="#">Untan</a></li>
<li><a href="#">Video Streaming</a></li>
<li><a href="#">Next</a></li>
</ul>
</li>
<li>
<form method="post" action="index.php">
<h2>Login Mahasiswa</h2>
<ul>
<table width="200" align="center">
<tr>
<td width="110">Username</td>
<td><input type="text" name="nim" size="20" class="biasa"></td>
</tr>
<tr>
<td width="110">Password</td>
<td><input type="password" name="pass" size="20" class="biasa"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="ok" value="Login" class="spesial"></td>
</tr>
</table>
</ul>
</form>
</li>
</ul>
</div>
</div>
<div id="footer">
<p>Copyright 2008 - Teknik Informatika - Universitas Tanjungpura</p>
</div>
</body>
<?php
}
else
{
include "sambung.inc.php";
$nim=strtoupper($_POST['nim']);
$pass=md5($_POST['pass']);
$query = sprintf("SELECT * FROM log_mhs WHERE NIM='%s' and PWMHS='%s'",mysql_real_escape_string($nim),mysql_real_escape_string($pass));
$login = mysql_query($query,$connect);
$rowcount = mysql_num_rows($login);
if ($rowcount == 1)
{
$_SESSION['nim'] = $nim;
$now=date("Y-m-d H:i:s");
$ip=$_SERVER['REMOTE_ADDR'];
$cekonline = mysql_query("SELECT * FROM online_user WHERE id='" . $nim . "'",$connect);
if(mysql_num_rows($cekonline)>=1){
$updatenya = mysql_query("UPDATE online_user SET tm=now(),sta='1' WHERE id='$nim'");
}else{
$loginn = mysql_query("INSERT INTO `neospota`.`online_user` (`id` ,`ip` ,`tm` ,`sta` )VALUES (
'$nim', '$ip', now(), '1');
");
}
$cek=mysql_fetch_array($cekonline);
$dul=strtotime($cek['tm']);
$skr=strtotime($now);
$dif=$skr-$dul;
if ($cek['sta']=="0")
{
header("Location: mhs/index.php");
}
else
{
if ($dif >= 600)
{
header("Location: mhs/index.php");
}
else
{
if ($cek['ip']=="$ip")
{
header("Location: mhs/index.php");
}
else
{
header("Location: index.php");
}
}
}
}
else
{
?>
<script type="text/javascript">alert("Gagal LOGIN, Cek Username dan Password Anda")</script>
<meta http-equiv="refresh" content="0;URL=index.php">
<?php
}
}
?>
</html>