My friend and I are building a website for the WYSE team (http://www.gallatinwyseteam.uphero.com/index.php).
I've built the majority of the webpages but he dealt with most of the php since I didn't know how to at the time. Well he also took the liberty of setting up the messaging system between users. Well just to enhance the aesthetics of the site I want the message to be align right and in the middle of the webpage. I've tried all the commands I could find to align it vertically but it just isn't working. I've also tried aligning the table so it will be directly to the left of the main part of the website but that isn't working either. Any help?
And you can use this login:
Username: kb2016
Password: wyse2013
Messaging
Code:
Homepage
Code:
Any and all help will be appreciated
I've built the majority of the webpages but he dealt with most of the php since I didn't know how to at the time. Well he also took the liberty of setting up the messaging system between users. Well just to enhance the aesthetics of the site I want the message to be align right and in the middle of the webpage. I've tried all the commands I could find to align it vertically but it just isn't working. I've also tried aligning the table so it will be directly to the left of the main part of the website but that isn't working either. Any help?
And you can use this login:
Username: kb2016
Password: wyse2013
Messaging
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<?php
$acti = $_GET['act'];
$arra = array('view','delete','compose');
$sql = "SELECT * FROM `messages` WHERE `uid`='".$_SESSION['uid']."' ORDER BY id DESC";
$res = mysqli_query($con,$sql)or die(mysql_error());
echo "<table border=\"1\" cellspacing=\"3\" cellpadding=\"3\" width=\"100%\">\n";
if(!$acti || !in_array($acti,$arra)){
echo "<form method=\"post\" action=\"./index.php?action=message&act=compose\">\n";
echo "<tr align=\"center\"><td colspan=\"5\"><input type=\"submit\" name=\"compose\" value=\"COMPOSE\"></form></td></tr>\n";
echo "<form method=\"post\" action=\"./index.php?action=message&act=delete\">\n";
echo "<tr align=\"center\"><td>DELETE?</td><td>DATE</td><td>FROM</td><td>READ(?)</td><td>SUBJECT</td></tr>\n";
if(mysqli_num_rows($res) == 0){
echo "<tr align=\"center\"><td colspan=\"4\">You have no messages.</td></tr>\n";
}else {
while($row = mysqli_fetch_assoc($res)){
$sql2 = "SELECT * FROM `users` WHERE `id`='".$row['sid']."'";
$res2 = mysqli_query($con,$sql2)or die(mysql_error());
$row2 = mysqli_fetch_assoc($res2);
if($row['rid'] == 1){
$read = "YES";
}elseif($row['rid'] == 0){
$read = "NO";
}
echo "<tr align=\"center\"><td><input type=\"checkbox\" name=\"checkbox[]\" value=\"".$row['id']."\"></td><td>".$row['date']."</td><td>".$row2['firstname']." ".$row2['lastname']."</td><td>".$read."</td><td><a href=\"./index.php?action=message&act=view&msgid=".$row['id']."\">".$row['subject']."</a></td></tr>\n";
}
}
echo "<tr align=\"center\"><td><input type=\"submit\" name=\"button\" value=\"DELETE\"></form><td colspan=\"4\"></td><tr>\n";
}elseif($acti == 'view'){
$mid = $_GET['msgid'];
$sql1 = "SELECT * FROM `messages` WHERE `id`='".$mid."' AND `uid`='".$_SESSION['uid']."'";
$res1 = mysqli_query($con,$sql1)or die(mysql_error());
$row1 = mysqli_fetch_assoc($res1);
if($row1['rid'] == 0){
$update = "UPDATE `messages` SET `rid`='1' WHERE `id`='".$mid."'";
$resupdate = mysqli_query($con,$update)or die(mysql_error());
}
echo "<tr><td><a style=\"text-align:center;\">SUBJECT: ".$row1['subject']."</a> <a href=\"./index.php?action=message\" style=\"text-align:right;\">BACK</a></td></tr>\n";
echo "<tr align=\"left\"><td>".$row1['message']."</td></tr>\n";
}elseif($acti == 'delete'){
echo "You're where you're supposed to be\n";
$count = mysqli_num_rows($res);
$checkbox = $_POST['checkbox'];
for($i=0;$i<$count;$i++){
$del_id = $checkbox[$i];
echo $checkbox[$i];
$del = "DELETE FROM `messages` WHERE `id`='".$del_id."'";
$result = mysqli_query($con,$del);
header( 'Location: ./index.php?action=message' ) ;
}
}elseif($acti == 'compose'){
include "./message_c.php";
}
echo "</table>\n";
?>
</body>
</html>
Homepage
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head>
<title>Gallatin County WYSE Team</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="http://www.gallatinwyseteam.uphero.com/style.css" type="text/css" /><style type="text/css">._css3m{display:none}</style>
<style type="text/css">
._css3m {
display:none
}
.WYSETITLE {
font-family: "Times New Roman", Times, serif;
color: #000;
text-decoration: none;
font-size: 50px;
text-align: center;
}
.WYSE {
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
color: #000;
text-decoration: none;
text-align: center;
}
.PINFO {
position: fixed;
color: #C0C0C0
font-size: 12px;
text-decoration: none;
text-color: #181818;
}
body,td,th {
font-size: 12px;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="margin: 0px; padding: 0px" bgcolor="#e0e0e0">
<a style="text-decoration: none; color: #000;">
<?php
session_start();
include "./functions.php";
$sql = "SELECT * FROM `users` WHERE `id`='".$_SESSION['uid']."'";
$res = mysqli_query($con,$sql)or die(mysql_error());
$row = mysqli_fetch_assoc($res);
$test1 = $row['test1'];
$test2 = $row['test2'];
$test = $_GET['test'];
$section = $_GET['section'];
$act = $_GET['action'];
$actions = array('login','logout','test','message');
$nummsg = "SELECT count(*) AS number FROM `messages` WHERE `uid`='".$_SESSION['uid']."' AND `rid`='0'";
$nummsg1 = mysqli_query($con,$nummsg)or die(mysql_error());
$rw = mysqli_fetch_assoc($nummsg1);
?>
<?php
if($_SESSION['uid']){
?>
<table width="15%" border=".1" class="PINFO" bgcolor="#C0C0C0" align="right">
<?php
echo "<tr><td>Name:</td><td>".$row['firstname']." ".$row['lastname']."</td></tr>\n";
echo "<tr><td>Test 1:</td><td>".$row['test1name']."</td></tr>\n";
echo "<tr><td>Test 2:</td><td>".$row['test2name']."</td></tr>\n";
echo "<tr align=\"center\"><td colspan=\"2\"><a href=\"./index.php?action=message\" style=\"text-color: #181818;text-decoration: none;\">Messages (".$rw['number'].")</td></tr>\n";
?>
</table>
<?php
}
?>
<table width="850ex" style="height: 100%;" cellpadding="10" cellspacing="0" border="0px" align="center" bgcolor="#FFFFFF">
<tr>
<!-- ============ HEADER SECTION ============== -->
<td colspan="15" style="height: 80px" class="WYSETITLE">Gallatin County WYSE Team</td></tr>
<!-- ============ NAVIGATION BAR SECTION ============== -->
<tr class="WYSE"><td align="center" width="8%" height="30" colspan="1" valign="middle">
<ul id="css3menu1" class="topmenu">
<li class="topfirst"><a href="./index.php" style="height:15px;line-height:15px;">Home</a></li>
<?php
if(!$_SESSION['uid']){
?>
<li class="topmenu"><a href="#" style="height:15px;line-height:15px;">You must be logged in to access the site.</a></li>
<?php
}
if($test1 == 1 || $test1 == 8){
?>
<li class="topmenu"><a href="#" style="height:15px;line-height:15px;"><span>Biology</span></a>
<ul>
<li class="subfirst"><a href="./index.php?action=test&test=1§ion=1">Regional</a></li>
<li><a href="./index.php?action=test&test=1§ion=2">Sectional</a></li>
<li><a href="./index.php?action=test&test=1§ion=3">State</a></li>
</ul></li>
<?php
}
if($test1 == 2 || $test2 == 2 || $test1 == 8){
echo "<li class=\"topmenu\"><a href=\"#\" style=\"height:15px;line-height:15px;\"><span>Chemistry</span></a>\n";
echo "<ul>\n";
echo "<li class=\"subfirst\"><a href=\"./index.php?action=test&test=2§ion=1\">Regional</a></li>\n";
echo "<li><a href=\"./index.php?action=test&test=2§ion=2\">Sectional</a></li>\n";
echo "<li><a href=\"./index.php?action=test&test=2§ion=3\">State</a></li>\n";
echo "</ul></li>\n";
}
if($test1 == 3 || $test2 == 3 || $test1 == 8){
?>
<li class="topmenu"><a href="#" style="height:15px;line-height:15px;"><span>Computer Science</span></a>
<ul>
<li class="subfirst"><a href="./index.php?action=test&test=3§ion=1">Regional</a></li>
<li><a href="./index.php?action=test&test=3§ion=2">Sectional</a></li>
<li><a href="./index.php?action=test&test=3§ion=3">State</a></li>
</ul></li>
<?php
}
if($test1 == 4 || $test2 == 4 || $test1 == 8){
?>
<li class="topmenu"><a href="#" style="height:15px;line-height:15px;"><span>Engineering Graphics</span></a>
<ul>
<li class="subfirst"><a href="./index.php?action=test&test=4§ion=1">Regional</a></li>
<li><a href="./index.php?action=test&test=4§ion=2">Sectional</a></li>
<li><a href="./index.php?action=test&test=4§ion=3">State</a></li>
</ul></li>
<?php
}
if($test1 == 5 || $test2 == 5 || $test1 == 8){
?>
<li class="topmenu"><a href="#" style="height:15px;line-height:15px;"><span>English</span></a>
<ul>
<li class="subfirst"><a href="./index.php?action=test&test=5§ion=1">Regional</a></li>
<li><a href="./index.php?action=test&test=5§ion=2">Sectional</a></li>
<li><a href="./index.php?action=test&test=5§ion=3">State</a></li>
</ul></li>
<?php
}
if($test1 == 6 || $test2 == 6 || $test1 == 8){
?>
<li class="topmenu"><a href="#" style="height:15px;line-height:15px;"><span>Mathematics</span></a>
<ul>
<li class="subfirst"><a href="./index.php?action=test&test=6§ion=1">Regional</a></li>
<li><a href="./index.php?action=test&test=6§ion=2">Sectional</a></li>
<li><a href="./index.php?action=test&test=6§ion=3">State</a></li>
</ul></li>
<?php
}
if($test2 == 7 || $test1 == 8){
?>
<li class="topmenu"><a href="#" style="height:15px;line-height:15px;"><span>Physics</span></a>
<ul>
<li class="subfirst"><a href="./index.php?action=test&test=7§ion=1">Regional</a></li>
<li><a href="./index.php?action=test&test=7§ion=2">Sectional</a></li>
<li><a href="./index.php?action=test&test=7§ion=3">State</a></li>
</ul></li>
<?php
}
if($_SESSION['uid']){
?>
<li class="toplast"><a href="./index.php?action=logout" style="height:15px;line-height:15px;">Logout</a></li>
</ul><p class="_css3m"><a href="http://css3menu.com/">Flash Menu In HTML Css3Menu.com</a></p>
<?php
}
?>
</tr>
<!-- ============ RIGHT COLUMN (CONTENT) ============== -->
<tr>
<center>
<td align="center">
<table align="center"><td align="center" width="768">
<?php
if(!$_SESSION['uid']){
include "./login.php";
?>
<h1 style="text-align:center; margin-left:auto; margin-right:auto">
<img align="center" src="http://i1301.photobucket.com/albums/ag102/Burklow2016/901385_10151449428403087_1688470681_o_zps73064d9e.jpg" height="576" width="768"></h1></td></table>
<tr><td height="20" colspan="15" align="center"><font color="#000" face="Comic Sans MS, cursive"><h5>Created By: Kaleb Burklow and Dustin Oldham</h5></font></td></tr>
<?php
}else{
if(!$act || !in_array($act,$actions)){
?>
<img align="center" src="http://i1301.photobucket.com/albums/ag102/Burklow2016/901385_10151449428403087_1688470681_o_zps73064d9e.jpg" height="576" width="768">
</td>
<?php
}
if($act == 'test'){
include "./".$test."/".$section.".php";
}
if($act == 'message'){
include "./message.php";
}
if($act == 'logout'){
include "./logout.php";
}
?>
</tr>
<!-- ============ FOOTER SECTION ============== -->
<tr><td height="20" colspan="15" align="center"><font color="#000" face="Comic Sans MS, cursive"><h5>Created By: Kaleb Burklow and Dustin Oldham</h5></font></td></tr>
</table>
<?php
}
?>
</a>
</body>
</html>
Any and all help will be appreciated