<commit_before><?php
session_start();
include 'db.php';
include_once './classes/format_dates_and_times.class.php';
include './classes/get_names.php';
include './classes/format_case_number.php';

	$id = $_GET['id'];
	$get_student_info = mysql_query("SELECT * FROM `cm_users` WHERE `id` = '$id' LIMIT 1");
	while ($line = mysql_fetch_array($get_student_info, MYSQL_ASSOC)) {
		$i=0;
		foreach ($line as $col_value) {
			$field=mysql_field_name($get_student_info,$i);
			$d[$field] = $col_value;
			$i++;

		}
		}
		
echo <<<DETAIL

<span id="close" style="right:35px;"><a href="#" onclick="Effect.Shrink('window1');location.href='cm_students.php';return false;" alt="Close this Case Window" title="Close this Case Window"><img src="images/cancel_small.png" border="0"></a></span>

<div id="photo">
<h3>$d[first_name] $d[last_name]</h3>
<table border="0" width="100%">
<tr><td width="50%">
<img src="$d[picture_url]" border="0"></td><td width="50%" align="center" valign="center">

<a href="#" title="Send $d[first_name] $d[last_name] a message" alt="Send $d[first_name] $d[last_name] a message" onClick="
new Ajax.Updater('messaging_window','message_new.php',{method:'get',parameters:{direct:'$d[username]' + ',',direct_full:'$d[first_name] $d[last_name]'},onComplete:function(){Effect.Grow('messaging_window');(function(){new Draggable('messaging_window',{handle:'bar'})}).defer();}});return false"><img src="images/new_msg_blue.png" border="0"></a></td></tr></table>
<table>
<tr><td><label>Last Login</label></td><td>
DETAIL;

	$last_login = mysql_query("SELECT * FROM `cm_logs` WHERE `username` = '$d[username]' ORDER BY `timestamp` DESC LIMIT 1");<commit_msg>Fix error where when admin looks at students details and then closes pages, is redirected to cm_students.php instead of cm_admin_students.php<commit_after><?php
session_start();
include 'db.php';
include_once './classes/format_dates_and_times.class.php';
include './classes/get_names.php';
include './classes/format_case_number.php';

	$id = $_GET['id'];
	$get_student_info = mysql_query("SELECT * FROM `cm_users` WHERE `id` = '$id' LIMIT 1");
	while ($line = mysql_fetch_array($get_student_info, MYSQL_ASSOC)) {
		$i=0;
		foreach ($line as $col_value) {
			$field=mysql_field_name($get_student_info,$i);
			$d[$field] = $col_value;
			$i++;

		}
		}
		
		if ($_SESSION['class'] == 'admin')
		{$tg_url = 'cm_admin_students.php';}
		else
		{$tg_url = 'cm_students.php';}
		
echo <<<DETAIL

<span id="close" style="right:35px;"><a href="#" onclick="Effect.Shrink('window1');location.href='$tg_url';return false;" alt="Close this Case Window" title="Close this Case Window"><img src="images/cancel_small.png" border="0"></a></span>

<div id="photo">
<h3>$d[first_name] $d[last_name]</h3>
<table border="0" width="100%">
<tr><td width="50%">
<img src="$d[picture_url]" border="0"></td><td width="50%" align="center" valign="center">

<a href="#" title="Send $d[first_name] $d[last_name] a message" alt="Send $d[first_name] $d[last_name] a message" onClick="
new Ajax.Updater('messaging_window','message_new.php',{method:'get',parameters:{direct:'$d[username]' + ',',direct_full:'$d[first_name] $d[last_name]'},onComplete:function(){Effect.Grow('messaging_window');(function(){new Draggable('messaging_window',{handle:'bar'})}).defer();}});return false"><img src="images/new_msg_blue.png" border="0"></a></td></tr></table>
<table>
<tr><td><label>Last Login</label></td><td>
DETAIL;

	$last_login = mysql_query("SELECT * FROM `cm_logs` WHERE `username` = '$d[username]' ORDER BY `timestamp` DESC LIMIT 1");
{'fraction_non_alphanumeric': 0.21623139567537208, 'fraction_numerical': 0.010671159786576805, 'mean_word_length': 7.666666666666667, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 57, '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': '1831052', 'n_tokens_mistral': 1348, 'n_tokens_neox': 1277, 'n_words': 236}