<?php
	session_start();
	include "php_class/class_mysql.php";
	include "php_class/class_operator.php";
	
	$dataOperator = new dataOperator;
	
	$NamaOperator = $_POST['NamaOperator'];
	$Pwd = $_POST['password'];
	$jumlah = $dataOperator->get_operator_for_login('jumlah',$NamaOperator,$Pwd);
	$KodeOperator = $dataOperator->get_operator_for_login_kode('kodeOperator',$NamaOperator,$Pwd);
	
	
	if ($jumlah!=1){ ?>
		<script>window.location = "login-sistem.php"</script>
    <?php 
	} else{
		$_SESSION["idOperator"] = $dataOperator->get_operator_for_login_kode('kodeOperator',$NamaOperator,$Pwd);
		$_SESSION["NamaOperator"] = $dataOperator->get_operator_for_login_kode('namaOperator',$NamaOperator,$Pwd); 		
		$_SESSION["Akses"] =  $dataOperator->get_operator_for_login_kode('Akses',$NamaOperator,$Pwd);
		$_SESSION["foto"] =  $dataOperator->get_operator_for_login_kode('foto',$NamaOperator,$Pwd);
		$_SESSION['program'] = '121';
		$_SESSION['jurusansempek'] = 'MANAJEMEN';
		$_SESSION['semestersempek'] = '1';
			
		$idOperator = $_SESSION['idOperator'];
		$keterangan = "Login sistem dengan nama : ".$NamaOperator."";
		?>
		<script>window.location = "index"</script>
    <?php 
	}
	
	//baris log sistem yang harus ada
	
	
?>
