<commit_before><?php include "inc/conn.php"; ?>
<!DOCTYPE html>
<html lang="en">
<head>
  <?php require('inc/head.php'); ?>

  <title>SNOMED CT GP/FP RefSet Field Test - Home</title>
</head>
<body>

<?php
// check for login post
if($_POST["loginEmail"] && $_POST["loginPassword"]){
  $sql = sprintf("SELECT * FROM Users WHERE email='%s'",
                 mysql_real_escape_string($_POST[loginEmail]));
  $rows = mysql_query($sql) or die(mysql_error());

  if(mysql_num_rows($rows)==1){
    $user = mysql_fetch_array($rows);
    if($user["password"]==md5($_POST["loginPassword"])){
      if($user["verified"]){
        $tRows = mysql_query("SELECT * FROM Title WHERE title_id='$user[title_id]'") or die(mysql_error());
        $uTitle = mysql_fetch_array($tRows);
        $_SESSION["title"] = $uTitle["title"];
        $_SESSION["first_name"] = $user["first_name"];
        $_SESSION["last_name"] = $user["last_name"];
        $_SESSION["email"] = $user["email"];
        $_SESSION["user_id"] = $user["user_id"];
        $_SESSION["option"] = $user["option"];
        $_SESSION["logged"] = true;
      } else {
        $message = '<div class="alert">You have not yet verified your email address.<br>Please retrieve the verification code from the email you should by now have received, and enter it <a href="verify.php">here</a>.</div>';
      }
    } else {
      $message = '<div class="alert alert-error">Password incorrect</div>';
    }
  } else {
    $message = '<div class="alert alert-error">Email address not recognised</div>';
  }
  // echo $message;
}
?>

  <div class="container">
    <?php require('inc/header.php'); ?>
    <div class="main clearfix">
<?php
if($message){
  echo $message;
}
if(!$_SESSION["logged"]){
?>
      <div class="row"><commit_msg>Correct session variable used for optionality<commit_after><?php include "inc/conn.php"; ?>
<!DOCTYPE html>
<html lang="en">
<head>
  <?php require('inc/head.php'); ?>

  <title>SNOMED CT GP/FP RefSet Field Test - Home</title>
</head>
<body>

<?php
// check for login post
if($_POST["loginEmail"] && $_POST["loginPassword"]){
  $sql = sprintf("SELECT * FROM Users WHERE email='%s'",
                 mysql_real_escape_string($_POST[loginEmail]));
  $rows = mysql_query($sql) or die(mysql_error());

  if(mysql_num_rows($rows)==1){
    $user = mysql_fetch_array($rows);
    if($user["password"]==md5($_POST["loginPassword"])){
      if($user["verified"]){
        $tRows = mysql_query("SELECT * FROM Title WHERE title_id='$user[title_id]'") or die(mysql_error());
        $uTitle = mysql_fetch_array($tRows);
        $_SESSION["title"] = $uTitle["title"];
        $_SESSION["first_name"] = $user["first_name"];
        $_SESSION["last_name"] = $user["last_name"];
        $_SESSION["email"] = $user["email"];
        $_SESSION["user_id"] = $user["user_id"];
        $_SESSION["option"] = $user["option_id"];
        $_SESSION["logged"] = true;
      } else {
        $message = '<div class="alert">You have not yet verified your email address.<br>Please retrieve the verification code from the email you should by now have received, and enter it <a href="verify.php">here</a>.</div>';
      }
    } else {
      $message = '<div class="alert alert-error">Password incorrect</div>';
    }
  } else {
    $message = '<div class="alert alert-error">Email address not recognised</div>';
  }
  // echo $message;
}
?>

  <div class="container">
    <?php require('inc/header.php'); ?>
    <div class="main clearfix">
<?php
if($message){
  echo $message;
}
if(!$_SESSION["logged"]){
?>
      <div class="row">
{'fraction_non_alphanumeric': 0.1968040370058873, 'fraction_numerical': 0.00112139052425007, 'mean_word_length': 3.8743169398907105, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1236315', 'n_tokens_mistral': 1135, 'n_tokens_neox': 1125, 'n_words': 254}