Code: Select all
<?php
ob_start();
include("database.php");
#JavaScript
echo <<<END
<head>
<script language="javascript">
function hideAll(divid){
document.getElementById(nte1).style.display = 'none';
document.getElementById(nte2).style.display = 'none';
document.getElementById(nte3).style.display = 'none';
document.getElementById(nte4).style.display = 'none';
document.getElementById(nte5).style.display = 'none';
document.getElementById(nte6).style.display = 'none';
document.getElementById(divid).style.display = 'block';
}
</script>
</head>
END;
#Setting variables, to make life easy
if (isset($_COOKIE['loggeduser']) and isset($_COOKIE['loggedpass'])) {
$usr = $_COOKIE['loggeduser'];
$pwd = $_COOKIE['loggedpass'];
} else {
echo <<<END
<head>
<meta HTTP-EQUIV="REFRESH" content="0; url='../login.php'">
</head>
END;
}
$sidepanel = "images/side.gif";
$buttons = "images/side.gif";
$background = "images/back.jpg";
$notes = "images/notes.jpg";
$p = 0;
$note1 = mysql_fetch_object(mysql_query("select note1 from barker_users where users = '$usr' and password = '$pwd'"))->note1;
$note2 = mysql_fetch_object(mysql_query("select note2 from barker_users where users = '$usr' and password = '$pwd'"))->note1;
$note3 = mysql_fetch_object(mysql_query("select note3 from barker_users where users = '$usr' and password = '$pwd'"))->note1;
$note4 = mysql_fetch_object(mysql_query("select note4 from barker_users where users = '$usr' and password = '$pwd'"))->note1;
$note5 = mysql_fetch_object(mysql_query("select note5 from barker_users where users = '$usr' and password = '$pwd'"))->note1;
$note6 = mysql_fetch_object(mysql_query("select note6 from barker_users where users = '$usr' and password = '$pwd'"))->note1;
$note1name = mysql_fetch_object(mysql_query("select note1name from barker_users where users = '$usr' and password = '$pwd'"))->note1;
$note2name = mysql_fetch_object(mysql_query("select note2name from barker_users where users = '$usr' and password = '$pwd'"))->note1;
$note3name = mysql_fetch_object(mysql_query("select note3name from barker_users where users = '$usr' and password = '$pwd'"))->note1;
$note4name = mysql_fetch_object(mysql_query("select note4name from barker_users where users = '$usr' and password = '$pwd'"))->note1;
$note5name = mysql_fetch_object(mysql_query("select note5name from barker_users where users = '$usr' and password = '$pwd'"))->note1;
$note6name = mysql_fetch_object(mysql_query("select note6name from barker_users where users = '$usr' and password = '$pwd'"))->note1;
#Code for the side panel
echo <<<END
<div style="height:98%;width:20%;top:1%;left:0%;position:absolute;background:url($sidepanel) no-repeat;background-size:100%;">
<div style="height:80%;width:90%;top:10%;left:0%;background-color:#FFFFFF;">
<FORM NAME ="form1" METHOD ="POST" ACTION = "test.php">
<a onclick="hideAll(nte1)" style="background:url('$buttons');height:11%;width:100%;top:0%;">$note1name</a>
<a onclick="hideAll(nte2)" style="background:url('$buttons');height:11%;width:100%;top:11%;">$note2name</a>
<a onclick="hideAll(nte3)" style="background:url('$buttons');height:11%;width:100%;top:22%;">$note3name</a>
<a onclick="hideAll(nte4)" style="background:url('$buttons');height:11%;width:100%;top:33%;">$note4name</a>
<a onclick="hideAll(nte5)" style="background:url('$buttons');height:11%;width:100%;top:44%;">$note5name</a>
<a onclick="hideAll(nte6)" style="background:url('$buttons');height:11%;width:100%;top:55%;">$note6name</a>
<div style="height:11%;width:100%;top:66%;background:url("$buttons");">
<input type="Text" name="search" value="Search">
<input type="Submit" name="searchbutton" value="Search">
</div>
<input onclick="hideAll(settings)" type="Submit" name="settings" value="Settings" style="background:url('$buttons');height:11%;width:100%;top:77%;">
<input type="Submit" name="logout" value="Log Out" style="background:url('$buttons');height:11%;width:100%;top:88%;">
</div>
</div>
END;
echo <<<END
<div style="position:absolute;height:90%;width:70%;top:5%;left:25%;background:url('$notes') no-repeat;background-size:100%;">
END;
$p = 0;
for ($i = 1; $i <= 8; $i++) {
$p=$p+1;
$button = "update".$p;
$subject = "subject".$p;
$note = "text".$p;
$text = ${"note".$p};
$subjecttext = ${"note".$p."name"};
$id = "nte".$p;
echo <<<END
<div style="height:100%;width:100%;top:0%;left:0%;background:url('$notes') no-repeat;background-size:100%;display:none; background-color:yellow;" id = "$id">
<FORM NAME ="form1" METHOD ="POST" ACTION = "test.php">
<input type="Submit" name="$button" value="Update" style = "height:10%;width:30px;left:50%;top:5%;">
<input type="Text" name="$subject" value="$subjecttext" style = "height:10%;width:35%;left:5%;top:5%;">
<input type="Text" name="$note" value="$text" style = "height:75%;width:90%;left:5%;top:10%;">
</div>
END;
}
echo <<<END
<div style="height:100%;width:100%;top:0%;left:0%;background:url('$notes') no-repeat;background-size:100%;display:none;" id = "settings">
<FORM NAME ="form1" METHOD ="POST" ACTION = "notepad.php">
</div>
END;
?>