<?php
//If the form is submitted
if(isset($_POST['submit'])) {
$name = trim($_POST['name']);
$dept = trim($_POST['dept']);
$papercolour = trim($_POST['papercolour']);
$Date = trim($_POST['Date']);
$quantity = trim($_POST['quantity']);
$datereq = trim($_POST['datereq']);
$size = trim($_POST['size']);
$hole = trim($_POST['hole']);
$stapled = trim($_POST['stapled']);
$folded = trim($_POST['folded']);
$special = trim($_POST['special']);
$emailTo = '***************';
$subject="Reprographics Requests";
$headers = "From: " . $emailTo . "\r\nReply-To: " . $emailTo;
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$message = '
<html>
<head>
<title>Reprograhics Request</title>
</head>
<body>
<h1 align="center"><strong>Reprographics Request</strong></h1>
<table width="793" height="224" border="0">
<tr>
<th width="123" height="60" scope="col"><div align="left">Name:</div></th>
<td width="259" scope="col">' . $name . '</td>
<th width="114" scope="col"><div align="left">Department:</div></th>
<td width="269" scope="col">' . $dept . '</td>
</tr>
<tr>
<th height="60" scope="row"><div align="left">Paper Colour:</div></th>
<td>' . $papercolour . '</td>
<th><div align="left">Date:</div></th>
<td>' . $Date . '</td>
</tr>
<tr>
<th height="60" scope="row"><div align="left">Quantity:</div></th>
<td>' . $quantity . '</td>
<th><div align="left">Date Required:</div></th>
<td>' . $datereq . '</td>
</tr>
<tr>
<th width="212" height="60" scope="col"><div align="left">Size:</div></th>
<td>' . $size . '</td>
<th><div align="left">Hole Punched:</div></th>
<td>' . $hole . '</td>
</tr>
<tr>
<th height="60" scope="row"><div align="left">Stapled:</div></th>
<td>' . $stapled . '</td>
<th><div align="left">Folded:</div></th>
<td>' . $folded . '</td>
</tr>
</table>
<table width="700" height="341" border="1">
<tr>
<th width="79" height="75" scope="col">Special Instructions:</th>
<td width="670" scope="col">' . $special . '</td>
</tr>
</table>
<center><a href="http:\\webapps02:802\uploads\\' . $_FILES['uploadedfile']['name'] . '">Link to file</a>
</body>
</html>
';
mail($emailTo, $subject, $message, $headers);
$emailSent = true;
$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
$file = $_FILES['uploadedfile'];
$allowedExtensions = array("txt", "rtf", "doc", "docx", "txt", "pdf", "xls", "xlsx", "ppt", "pptx", "pub", "pubx");
function isAllowedExtension($fileName) {
global $allowedExtensions;
return in_array(end(explode(".", $fileName)), $allowedExtensions);
}
$ok=1;
//Condition to return error or upload
if($file['error'] == UPLOAD_ERR_OK) {
if(isAllowedExtension($file['name'])) {
//This is our size condition
if ($uploadedfile_size > 350000) { echo "Your file is too large.<br>"; $ok=0; }
//Here we check that $ok was not set to 0 by an error
if ($ok==0) { Echo "Sorry your file was not uploaded"; }
//If everything is ok we try to upload it else
{ if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; }
else { echo "Sorry, there was a problem uploading your file."; } }
} else {
echo "Invalid file type";
}
} else die("Cannot upload");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Reprographics Request Form</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script src="jquery.validate.pack.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#contactform").validate();
});
</script>
<style type="text/css">
/* ----------------------------------------------
HTML ELEMENTS
------------------------------------------------- */
/* Top Elements */
* { margin: 0; padding: 0; outline: 0 }
body {
background: #d5ea8e url(/media/1062/bg.gif) repeat-x;
font: 12px/170% 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
color: #666666;
text-align: center;
}
/* links */
a, a:visited {
color: #306495;
background: inherit;
text-decoration: none;
}
a:hover {
color: #73471B;
background: inherit;
text-decoration: underline;
}
/* headers */
h1, h2, h3 {
font-family: 'Trebuchet MS', 'Helvetica Neue', Arial, Sans-serif;
font-weight: Bold;
padding: 10px;
color: #444;
}
h1 {
font-size: 2.2em;
}
h2 {
font-size: 2em;
color: #88ac0b;
}
h3 {
font-size: 1.4em;
font-weight: normal;
padding: 16px 10px 4px 10px;
}
/* Paragraph */
p { padding: 12px 10px; }
/* Lists */
ul, ol {
margin: 10px 20px;
padding: 0 20px;
}
ul { list-style: none; }
dl { padding: 10px; margin: 0; }
dt {
font-weight: bold;
color: #79A62E;
}
dd {
padding-left: 25px;
}
/* images */
img {
background: #EDF8C7;
border: 1px solid #EDF8C7;
padding: 7px;
}
img.float-right {
margin: 5px 0px 10px 10px;
}
img.float-left {
margin: 5px 10px 10px 0px;
}
code {
margin: 5px 0;
padding: 0px;
text-align: left;
display: block;
overflow: auto;
font: 500 1em/1.5em 'Lucida Console', 'Courier New', monospace ;
/* white-space: pre; */
border: 1px solid #deedae;
background: #EDF8C7;
}
acronym {
cursor: help;
border-bottom: 1px dotted #895F30;
}
blockquote {
margin: 15px 10px;
padding: 5px 7px 5px 40px;
font-weight: normal;
font-size: 17px;
line-height: 1.6em;
font-style: italic;
font-family: Georgia, 'Times New Roman', Times, serif;
color: #80614D;
border: 1px solid #DFF4B5;
background: #F0FFD2 url(/media/1072/quote.gif) no-repeat 7px 10px;
}
/* start - table */
table {
border-collapse: collapse;
margin: 15px 10px;
}
th {
height: 38px;
padding-left: 12px;
padding-right: 12px;
color: #fff;
text-align: left;
background: #ADD163;
border-width: 1px;
border-style: solid;
border-color: #C4DE8F #93C138 #93C138 #C4DE8F;
}
tr {
height: 34px;
background: #fff;
}
td {
padding-left: 11px;
padding-right: 11px;
border: 1px solid #E7F0CC;
}
/* end - table */
/* form elements */
/*as shipped in template form {
margin: 15px 10px;
padding: 5px 10px 20px 10px;
border: 1px solid #D8E99E;
background: #deedae;
}*/
/* as hacked by ed*/
form {
background:#EDF8C7 url(/media/1064/content.gif) repeat-y scroll 0 0;
border:0 solid #D8E99E;
margin:0;
padding:5px 10px 20px;
}
label {
display: block;
font-weight: bold;
margin: 8px 0 5px 0;
color: #895F30;
}
input, textarea, select {
padding: 4px;
color: #666666;
background: #fff;
border-width: 1px;
border-style: solid;
border-color: #d4d4d4 #ebebeb #ebebeb #d4d4d4;
font: normal 11px Verdana, sans-serif;
}
textarea {
width: 400px;
height: 100px;
display: block;
}
input.button {
font: bold 12px Arial, Sans-serif;
height: 30px;
margin: 0;
padding: 2px 3px;
color: #fff;
background: #A6CD56;
border-width: 1px;
border-style: solid;
border-color: #C4DE8F #8DB836 #8DB836 #C4DE8F;
}
/********************************************
LAYOUT
********************************************/
#wrap {
position: relative;
width: 920px;
background: #edf8c7 url(/media/1075/wrap.gif) repeat-y center top;
margin: 35px auto;
text-align: left;
}
#content-wrap {
position: relative;
clear: both;
float: left;
width: 920px;
padding: 25px 0;
background: #edf8c7 url(/media/1064/content.gif) repeat-y;
}
#header {
position: relative;
width: 920px;
height: 205px;
background: #317cb1 url(/media/1068/header.gif) no-repeat;
color: #fff;
padding: 0;
margin: 0;
}
#header h1#logo-text a {
position: absolute;
margin: 0; padding: 0;
font: bold 56px 'Trebuchet MS', 'Helvetica Neue', Arial, Sans-serif;
letter-spacing: -3px;
text-decoration: none;
color: #fff;
/* change the values of top and left to adjust the position of the logo*/
top: 58px; left: 55px;
}
#header p#slogan {
position: absolute;
margin: 0; padding: 0;
font: bold 15px 'Trebuchet MS', 'Helvetica Neue', Arial, Sans-serif;
color: #D6EBAB;
letter-spacing: -0.5px;
/* change the values of top and left to adjust the position of the slogan*/
top: 122px; left: 135px;
}
/* header quick search */
#header form#quick-search {
position: absolute;
top: 75px; right: 55px;
padding: 0; margin: 0;
border: none;
width: 223px; height: 33px;
background: #82c7f4 url(/media/1069/header-search.gif) no-repeat;
z-index: 999999;
}
#header form#quick-search p {
margin: 0; padding: 0;
}
#header form#quick-search input {
border: none;
background: transparent;
color: #0e5792;
float: left;
}
#header form#quick-search .tbox {
margin: 5px 0 0 5px;
width: 170px;
display: inline;
}
#search form#quick-search .btn{
width: 25px; height: 25px;
}
#header form#quick-search label {
display: none;
}
/* Navigation */
#nav {
clear: both;
padding: 0; margin: 0;
width: 920px;
height: 50px;
background: #EDF8C7 url(/media/1070/nav.gif) no-repeat;
}
#nav ul {
float: left;
list-style: none;
margin: 0;
padding: 0 0 0 40px;
height: 50px;
}
#nav ul li {
display: inline;
margin: 0; padding: 0;
}
#nav ul li a {
display: block;
float: left;
width: 112px;
margin: 0;
padding: 0 84px;
color: #fff;
font: bold 15px/50px 'Trebuchet MS', 'Helvetica Neue', Arial, sans-serif;
text-decoration: none;
letter-spacing: -0.5px;
}
#nav ul li a:hover,
#nav ul li a:active {
color: #edf8c7;
}
#nav ul li.Selected a {
background: #0c4e80 url(/media/1071/pointer.gif) no-repeat center bottom;
color: #93DAFF;
}
/* Main Column */
#main {
float: left;
width: 795px;
padding: 0; margin: 0 0 0 45px;
display: inline;
}
#main h2 {
font: bold 2.25em 'Trebuchet MS', 'Helvetica Neue', Arial, Sans-serif;
color: #115280;
padding: 10px 0 5px 5px;
margin-left: 5px;
letter-spacing: -1px;
border-bottom: 1px solid #D2E9A4;
}
#main h2 a {
color: #115280;
text-decoration: none;
}
#main ul li {
list-style-image: url(/media/1063/bullet.gif);
}
#sidebar {
float: right;
width: 1px;
padding: 0;
margin: 0 45px 0 0;
display: inline;
}
#sidebar h3 {
color: #115280;
font: normal 1.6em 'Trebuchet MS', 'Helvetica Neue', Arial, Sans-serif;
text-transform: none;
padding: 10px 0 2px 0;
margin: 10px 0 0 10px;
}
/* sidebar menu */
#sidebar .sidemenu {
margin: 5px 10px 8px 7px; padding: 0;
text-decoration: none;
border-top: 2px solid #D0E89F;
}
#sidebar .sidemenu li {
list-style: none;
margin: 0;
padding: 7px 10px;
border-bottom: 1px solid #DAEBA3;
}
* html body #sidebar .sidemenu li {
height: 1%;
}
#sidebar .sidemenu li a {
text-decoration: none;
color: #684F3E;
}
#sidebar .sidemenu li a span {
color: #A98D76;
font-size: .9em;
font-family: Georgia, 'Times New Roman', Times, serif;
font-style: italic;
font-weight: normal;
}
#sidebar .sidemenu li a:hover {
color: #000;
background: none;
}
#sidebar .sidemenu ul { margin: 0 0 0 5px; padding: 0; }
#sidebar .sidemenu ul li { border: none; }
#sidebar #NewsList {
margin: 5px 10px 8px 7px; padding: 0;
text-decoration: none;
border-top: 2px solid #D0E89F;
}
#sidebar #NewsList li {
list-style: none;
margin: 0;
padding: 7px 10px;
border-bottom: 1px solid #DAEBA3;
}
* html body #sidebar #NewsList li {
height: 1%;
}
#sidebar #NewsList li a {
text-decoration: none;
color: #684F3E;
}
#sidebar #NewsList li a span {
color: #A98D76;
font-size: .9em;
font-family: Georgia, 'Times New Roman', Times, serif;
font-style: italic;
font-weight: normal;
}
#sidebar #NewsList li a:hover {
color: #000;
background: none;
}
#sidebar #NewsList ul { margin: 0 0 0 5px; padding: 0; }
#sidebar #NewsList ul li { border: none; }
/* search form */
#sidebar .searchform {
background-color: transparent;
border: none;
margin: 0 0 0 5px;
padding: 10px 0 10px 10px;
width: 260px;
}
#sidebar .searchform p { margin: 0; padding: 0; }
#sidebar .searchform input.textbox {
width: 180px;
height: 18px;
padding: 2px;
vertical-align: top;
}
#sidebar .searchform input.button {
width: 60px;
height: 24px;
padding: 2px 4px;
vertical-align: top;
}
/* footer */
#footer-wrap {
clear: both;
width: 950px;
text-align: left;
padding: 0; margin: 0;
background: url(/media/1066/footer-bottom.gif) no-repeat left bottom;
}
#footer-content {
width: 950px;
background: url(/media/1067/footer-top-sep.gif) no-repeat;
padding: 30px 0 35px 0;
}
#footer-wrap p {
padding:10px 0;
}
#footer-wrap h3 {
color: #145F94;
margin: 0;
padding: 5px 0 5px 10px;
text-transform: uppercase;
}
#footer-wrap a:hover {
color: #000;
text-decoration: none;
}
#footer-columns {
color: #888;
margin: 0 auto;
padding: 0;
width: 800px;
}
#footer-columns ul {
list-style: none;
margin: 0;
padding: 0;
border-top: 1px solid #BFD286;
}
#footer-columns li {
border-bottom: 1px solid #CCDA9E;
}
#footer-columns li a {
display: block;
font-weight: normal;
padding: 8px 0 8px 10px;
width: 96%;
color: #666666;
}
#footer-columns .col3, .col3-center {
float: left;
width: 32%;
}
#footer-columns .col3-center {
margin: 0 15px;
}
/* bottom */
#footer-bottom {
clear: both;
color: #555;
margin: 0 auto;
width: 920px;
padding: 15px 0 10px 0;
text-align: center;
font-size: 0.95em;
}
#footer-bottom a { color: #306495; }
/* postmeta */
.post-footer {
padding: 8px 5px;
margin: 5px 10px 10px 10px;
color: #A2745D;
border: 1px solid #deedae;
background: #F0FFD2;
}
.post-footer .date{ margin: 0 10px 0 5px; }
.post-footer a.comments { margin: 0 10px 0 5px; }
.post-footer a.readmore { margin: 0 10px 0 5px; }
.post-info { font-size: .95em; padding: 0 10px; margin-left: 2px; color: #A98D76; }
.post-info a, .post-info a:visited { color: #9C652E; }
/* alignment classes */
.float-left { float: left; }
.float-right { float: right; }
.align-left { text-align: left; }
.align-right { text-align: right; }
/* clearing */
.clearer { clear: both; }
.clear { display:inline-block; }
.clear:after {
display:block;
visibility:hidden;
clear:both;
height:0;
content: ".";
}
</style>
</head>
<body>
<h1 align="center"><strong>Reprographics Request Form</strong></h1>
<div id="contact-wrapper">
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" id="contactform" enctype="multipart/form-data" >
<table width="900" height="300" border="0" align="center">
<tr>
<td width="900" height="40" colspan="4" scope="col">
<div align="center">
<p>
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
<strong>Choose a file to upload:</strong>
<input name="uploadedfile" type="file" />
</p>
</div>
</td>
</tr>
<tr>
<td colspan="2" scope="col">
<div style="width:400px">
<div align="left"><strong>Name:</strong></div>
<div align="left">
<input type="text" size="50" name="name" id="name" value="" />
</div>
</div>
</td>
<td colspan="2" scope="col"> <div style="width:400px">
<div align="left"><strong>Department:</strong></div>
<div align="left">
<input type="text" size="50" name="dept" id="dept" value="" />
</div>
</div>
</td>
</tr>
<tr>
<td colspan="2" scope="row">
<div style="width:400px">
<div align="left"><strong>Paper Colour:</strong></div>
<div align="left">
<input type="text" size="50" name="papercolour" id="papercolour" value="" />
</div>
</div>
</td>
<td colspan="2">
<div style="width:400px">
<div align="left"><strong>Date:<br /></strong>
<input type="text" size="50" name="Date" id="Date" value="" />
</div>
</div>
</td>
</tr>
<tr>
<td colspan="2" scope="row">
<div style="width:400px">
<div align="left"><strong>Quantity:</strong></div>
<div align="left">
<input type="text" size="50" name="quantity" id="quantity" value="" />
</div>
</div>
</td>
<td colspan="2">
<div style="width:400px">
<div align="left"><strong>Date Required:</strong></div>
<div align="left">
<input type="text" size="50" name="datereq" id="datereq" value="" />
</div>
</div>
</td>
</tr>
<tr>
<td width="222" scope="row">
<div style="width:200px">
<div align="left"><strong>Size:</strong></div>
</div>
</td>
<td width="219" scope="row">
<select name="size" id="size">
<option value="A4">A4</option>
<option value="A3">A3</option>
<option value="A5">A5</option>
</select>
</td>
<td width="222">
<div style="width:200px">
<div align="left"><strong>Hole Punched:</strong></div>
</div>
</td>
<td width="219"><input name="hole" type="checkbox" id="hole" value="Yes" />
</td>
</tr>
<tr>
<td scope="row">
<div style="width:200px">
<div align="left"><strong>Stapled:</strong></div>
</div>
</td>
<td scope="row"><input name="stapled" type="checkbox" id="stapled" value="Yes" />
</td>
<td>
<div style="width:200px">
<div align="left"><strong>Folded:</strong></div>
</div>
</td>
<td>
<input name="folded" type="checkbox" id="folded" value="Yes" />
</td>
</tr>
</table>
<table width="900" height="114" border="1" align="center">
<tr>
<th width="79" height="169" scope="col">Special Instructions:
</th>
<th width="670" scope="col"><textarea name="special" cols="112" rows="10" id="C"></textarea>
</th>
</tr>
</table>
<p align="center">
<input type="submit" name="submit" value="Submit" />
</p>
</form>
</div>
</body>
</html>