Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 13.59.205.182
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/akimiavi/www/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/akimiavi/www/forwardAnalysis.php
<!-- forwardAnalysis.php FWD ANALYSIS (php) -->
<STYLE>
img {
     	border: 5px solid #ffffff;
        max-width: 100%;
        box-shadow: 10px 10px 5px;
}
</STYLE>
<?php
session_start();
$goals = $_POST["goals"];
$assists = $_POST["assists"];
$name = $_POST["name"];
$matches = $_POST["matches"];


$host = 'localhost';
$user = 'akimiavi';
$passwd = 'cs389';
$database = 'akimiavi';

$connect = mysqli_connect($host, $user, $passwd, $database);

// Connection check
if (!$connect) {
    die("Connection failed: " . mysqli_connect_error());
}
//ANALYSIS VARIABLES (CALC. AFTER INPUT)
$goalconts = $goals + $assists;
$efficiency = $matches > 0 ? $goalconts / $matches : 0; //condition ? value_if_true : value_if_false

$query = "INSERT INTO SSFWD VALUES ('$name', $matches, $goals, $assists)";
$stmt = mysqli_prepare($connect, $query);

if ($stmt) {
    mysqli_stmt_bind_param($stmt, 'siii', $name, $goals, $assists, $matches);
    if (mysqli_stmt_execute($stmt)) {
        include("fwdDisplay.php");
	echo '<div style="text-align: center;">';

	//Info After Table (Analysis)
	print "<P><strong><em>$name ~ Fwd. Player Analysis</em></strong><P>";
	print "<P>Hello, <em>$name</em>! Thank you for sharing your statistical data with the <strong>socStat Player Database</strong>.<BR><BR> You achieved <em>$goalconts</em> goal contributions in <em>$matches</em> matches, measuring out to <em>$efficiency</em> goal contributions per match.</P>";
	//Efficiency Logic
	if ($efficiency > 1.0) {
		print "<P>Outstanding! With a goal contribution every <em>$efficiency</em> matches, you are statistically expected to make in impact on the game!</P>";
	} elseif ($efficiency >=0.5) {
		print "<P>Good work! With a goal contribution every <em>$efficiency</em> matches, your efficiency is above average, but there is always room for improvement.<BR><BR>A forward is generally expected to contribute to a goal every other match on average, so keep pushing to increase the margin.</P>";
	} else {
		print "<P>Keep going! Your efficiency as a forward could use some work. While goals and assists are not everything, teams look to their forwards to produce for them when times are tough. At the end of the day, goal contributions are what win games!<P>";
	}
    } else {
        print "<P>Insert Fail: " . mysqli_error($connect) . "</P>";
    }
    mysqli_stmt_close($stmt);
} else {
    print "<P>Insert Fail: " . mysqli_error($connect) . "</P>";
}

mysqli_close($connect);

echo '<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTSATKR-97CpcV_DNm12g5ExMZSFDh16yp1kw&s">';
?>
<BR><BR><BR>
<HR>

Stv3n404 - 2023