Home | E-Learning
"; if(isset($_POST['login'])){ include "anti.php"; $care =cegah($_POST['sem']); $_SESSION['semester']=$care; date_default_timezone_set('Asia/Jakarta'); $hal=date('Y-m-d H:i:s'); include "ubahdata.php"; $length = 32; $_SESSION['token'] = substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $length); $_SESSION['tokenexpire'] = time() + 9200; if($_POST['pilih']=='1'){ $nama=$_POST['injekuser']; $namamasuk = preg_replace('/[^a-zA-Z0-9]/', '', $nama); $namapass=$_POST['injekpass']; $namapassword= preg_replace('/[^a-zA-Z0-9]/', '', $namapass); function antiinjection($data){ global $kon; $filter = mysqli_real_escape_string($kon, stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES)))); return $filter; } $username = antiinjection($namamasuk); $pass2 = antiinjection($namapassword); $pass=sekolah($pass2, 'e'); $login=mysqli_query($kon, "select * from anggota where username='$username' and password='$pass'"); $find=mysqli_num_rows($login); $a=mysqli_fetch_array($login); if ($find>0){ if($a['akses']=='7' || $a['akses']=='8' || $a['akses']=='9' ){ echo "
Username atau Password SALAH!
"; }else{ $jumlahlogin=$a['login']; $totallogin=$jumlahlogin + 1; mysqli_query($kon, "UPDATE anggota SET login='$totallogin',
tanggal='$hal'
where username='$username' and password='$pass'") or die (mysqli_error($kon)); $_SESSION['idnya']=$a['id_anggota']; $_SESSION['user']=$a['username']; $_SESSION['password']=$a['password']; $_SESSION['akses']=$a['akses']; $_SESSION['unik']=$a['unik']; $_SESSION['tokenexpire'] = time() + 1200;
if($a['akses']=='2'){ echo "
"; }else{ echo "
"; } } }else{ echo "
Username atau Password SALAH!
"; } }else{ $nama=$_POST['injekuser']; $namamasuk = preg_replace('/[^a-zA-Z0-9]/', '', $nama); $namapass=$_POST['injekpass']; $namapassword= preg_replace('/[^a-zA-Z0-9]/', '', $namapass); function antiinjection($data){ global $kon; $filter = mysqli_real_escape_string($kon, stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES)))); return $filter; } $username = antiinjection($namamasuk); $pass2 = antiinjection($namapassword); $pass=sekolah($pass2, 'e'); $login=mysqli_query($kon, "select * from siswa where username='$username' and password='$pass'"); $find=mysqli_num_rows($login); $a=mysqli_fetch_array($login); if ($find>0){ $jumlahlogin=$a['login']; $totallogin=$jumlahlogin + 1; mysqli_query($kon, "UPDATE siswa SET login='$totallogin',
tanggal='$hal'
where username='$username' and password='$pass'") or die (mysqli_error($kon)); $_SESSION['idnya']=$a['id_siswa']; $_SESSION['user']=$a['username']; $_SESSION['password']=$a['password']; $_SESSION['siswaunik']=$a['unik']; $_SESSION['tokenexpire'] = time() + 37200; $jlk=mysqli_query($kon,"select * from pjj where idpjj='3'"); $u=mysqli_fetch_array($jlk); $kelasx=$u['kelasx']; $kelasxi=$u['kelasxi']; $kelasxii=$u['kelasxii']; $tingkat=$a['tingkat']; if($tingkat==10){ $pembelajaran=$kelasx; } if($tingkat==11){ $pembelajaran=$kelasxi; } if($tingkat==12){ $pembelajaran=$kelasxii; } $_SESSION['pembelajaran']=$pembelajaran; echo "
"; }else{ echo "
Username atau Password SALAH!
"; } } } $semester=mysqli_query($kon, "select * from aktif_semester where id_aktif='1' "); $ew=mysqli_fetch_array($semester)or die (mysqli_error($kon)); $aktifsemester=$ew['id_semester'];
$semester11=mysqli_query($kon, "select * from semester where id_semester='$aktifsemester' "); $ew1=mysqli_fetch_array($semester11)or die (mysqli_error($kon)); echo "