<?php require_once('Connections/data.php'); ?>
<?php
// *** Start the session
if (!session_id()) session_start();
// *** Validate request to log in to this site.
$FF_LoginAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING']) && $HTTP_SERVER_VARS['QUERY_STRING']!="") $FF_LoginAction .= "?".htmlentities($HTTP_SERVER_VARS['QUERY_STRING']);
if (isset($HTTP_POST_VARS['username'])) {
  $FF_valUsername=$HTTP_POST_VARS['username'];
  $FF_valPassword=$HTTP_POST_VARS['password'];
  $FF_fldUserAuthorization="branch";
  $FF_m="student.php";
  $FF_n="student.php";
  $FF_redirectLoginFailed="login.php";
  $FF_rsUser_Source="SELECT user_no,user_pass,type ";
  if ($FF_fldUserAuthorization != "") $FF_rsUser_Source .= "," . $FF_fldUserAuthorization;
  $FF_rsUser_Source .= " FROM user_login WHERE user_no='" . $FF_valUsername . "' AND user_pass='" . $FF_valPassword . "'";
  mysql_select_db($database_data, $data);
  $FF_rsUser=mysql_query($FF_rsUser_Source, $data) or die(mysql_error());
  $row_FF_rsUser = mysql_fetch_assoc($FF_rsUser);
   
if(mysql_num_rows($FF_rsUser) > 0) {
    // username and password match - this is a valid user
    $MM_Username=$FF_valUsername;
    session_register("MM_Username");
    if ($FF_fldUserAuthorization != "") {
     $MM_UserAuthorization=$row_FF_rsUser[$FF_fldUserAuthorization];
    } else {
      $MM_UserAuthorization="";
    }
    
 while($mychk=mysql_free_result($FF_rsUser)){
    $tt=$mychk['type'];
     if($tt=4){
     echo $tt;
   //header ("Location: $FF_m");
 }
   else {
   echo "rr" ;
   header ("Location: $FF_n");
}
exit;
}
 mysql_free_result($FF_rsUser);
  session_register("FF_login_failed");
  $FF_login_failed = true;
  header ("Location: $FF_redirectLoginFailed");
  exit;
}}

?>




<html dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<title>&#1588;&#1575;&#1588;&#1577; &#1575;&#1604;&#1583;&#1582;&#1608;&#1604;</title>
</head>
<body topmargin=0>
z<div align=right>
<table border="0" width="27%" id="table1" height="224">
	<!-- MSTableType="nolayout" -->
	<tr>
		<td height="220" valign="top"><br>
	<div align=right>
		<table width="76%" border="1" cellpadding="0" cellspacing="0" bordercolor="#336699">
        <tr> 
          <td valign="middle" height="25" width="191" align="center" class="titles"> 
            <div align="center"><font color="#000080"><b><span lang="ar-ye">&#1588;&#1575;&#1588;&#1577; 
				&#1575;&#1604;&#1583;&#1582;&#1608;&#1604;</span></b></font></div>
          </td>
        </tr>
       
       
      
      </table>
		<table border="0" width="196" bgcolor="#4483DC" id="table2">
			<tr>
				<td width="89"> 
            			<form action="<?php echo $KT_LoginAction?>" name="form2" method="POST">

           
              <span class="subtitles2"><font color="#FFFFFF"><b>&nbsp;&#1575;&#1587;&#1605; &#1575;&#1604;&#1605;&#1587;&#1578;&#1582;&#1583;&#1605;: </b></font></span>             
            	</td>
				<td width="97"> 
            	 <input type="text" name="username" class="textbox" size="10" maxlength="20" autocomplete=off>
                   </td>
			</tr>
			<tr>
				<td width="89">
				<p align="center"><font color="#FFFFFF"><b><span class="subtitles2">
				&nbsp;&#1603;&#1604;&#1605;&#1577; &#1575;&#1604;&#1605;&#1585;&#1608;&#1585; :&nbsp; </span> 
              	</b></font>
              	</td>
				<td width="97">              
				<input type="password" name="password" class="textbox" size="10" maxlength="20" autocomplete=off>
                </td>
			</tr>
			<tr>
				<td width="190" colspan="2">
				<p align="center">
              <input type="submit" name="Submit" value="&#1583;&#1582;&#1608;&#1604;" class="button"></form>
              </td>
			</tr>   
			</table>
</td>
	</tr>
</table></div>
</body>
</html>