rendered paste body<?php
/***********************************\
| DanPHPSupport |
| A Support System written in PHP |
|-----------------------------------|
| Written by Daniel Lo Nigro of |
| DanSoft Australia |
| http://www.dansoftaustralia.net/ |
|-----------------------------------|
| Please feel free to distribute |
| this script, as long as this |
| header stays attached. |
\***********************************/
// VERSION: 1.0 (Build 7)
// $Date: 2006-10-13 21:30:59 +1000 (Fri, 13 Oct 2006) $
// $Id: page_ticket_submit.php 2 2006-10-13 11:30:59Z daniel15 $
// page_ticket_submit.php: Page to submit a new ticket
if (!defined('IN_SUPPORT') || eregi("page_ticket_submit.php",$_SERVER['PHP_SELF'])) die("You can't run this directly!");
session_start();
// If the user isn't logged in
if (!isset($_SESSION['support_in']) || $_SESSION['support_in'] !== true) {
header("Location: http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}?page=login&return=ticket_submit");
}
// If they've submitted one
if (isset($_POST['submit2'])) {
// If no subject entered
if (!isset($_POST['subject']) || $_POST['subject'] == "") {
writeError("ERROR: You must enter a subject. Please click the 'Back' button in your browser to fix this.");
die();
// No message? That's not helpful at all :P
} elseif (!isset($_POST['message']) || $_POST['message'] == "") {
writeError("ERROR: You must enter a message (if you don't want to write a message, why are you filling in an RFQ?). Please click the 'Back' button in your browser to fix this.");
die();
} else {
// Insert the ticket
$database->safe_query("INSERT INTO tickets
(userID, date, category, subject, severity, lastPost)
VALUES (%i, NOW(), %i, '%s', %i, %i)",
array($_SESSION['support_id'], $_POST['category'],
$_POST['subject'], $_POST['severity'], $_SESSION['support_id']),
__FILE__, __LINE__);
$ticket_id = $database->get_insert_id();
// Insert the message
// NOTE: The actual ticket and the message are stored seperately, so don't get confused here
$database->safe_query("INSERT INTO ticket_messages
(date, message, ticketID, userID)
VALUES (NOW(), '%s', %i, %i)",
array(nl2br(htmlentities($_POST['message'])), $ticket_id, $_SESSION['support_id']),
__FILE__, __LINE__);
// Get the body of the email
$message = newTicketMail($_SESSION['support_id'], stripslashes($_POST['subject']), $_POST['severity'],
stripslashes($_POST['message']));
// Send the actual email
mail($SETTINGS['adminEmail'], "New support ticket (ID #{$ticket_id})", $message, "From: {$SETTINGS['fromEmail']}");
pageHeader("Ticket Received");
echo "Your RFQ was received by our support team and we will reply as soon as possible.<br /><br /><a href='index.php?page=ticket_main'>back</a>";
}
// If the form hasn't been submitted yet
} else {
pageHeader("Request For Quote");
// Get the category list
$cat_list = showTicketCategories(false, "name ASC", 0);
// Get the severity list
$severities = showTicketSeverities(false);
// Show the input form
echo <<<EOT
If you would like to submit an RFQ to the estimators, please use the form below. We will try to reply as soon as possible.<br /><br />
<form action='index.php?page=ticket_submit' method="post" name="adminForm">
<input type='hidden' name='submit2' value='true' />
Subject: <input type='text' name='subject' size='40' /><br />
Category: <select name='category'>{$cat_list}</select><br />
Severity: {$severities}<br />
Message:
EOT;
outputBBCEditor("message", "Type your message here");
<font face="Arial" size="2">Account Manager ID:</font><font size="2" face="Arial" color="red"> *</font>
<font face="Arial" size="2"><input type="text" name="acct_manager" class="inputbox" size="10" validate="required"></font><b><font face="Arial" size="-2" color="red"></font></b><font face="Arial" size="-2"></font>
<font face="Arial" size="2">Account Manager Email:</font><font size="2" face="Arial" color="red"> *</font>
<font face="Arial" size="2">
<li class="validated" id="email_li">
<input name="acct_manager_email" id="email" type="email" maxlength="20" />
<div id="email_msg"></div>
</li>
</font><b><font face="Arial" size="-2" color="red"></font></b><font face="Arial" size="-2"></font>
<font face="Arial" size="2">Sales Rep's Manager</font><font size="2" face="Arial" color="red"> *</font>
<font face="Arial" size="-2"><br>Select your manager from the list</font><br>
<font face="Arial" size="2"><select type="select" name="location" class="inputbox" size="1">
<option></option>
<option value="Chrisp@aplus.net" >Chris Plueger</option>
<option value="philipl@aplus.net" >Phil Lancashire</option>
<option value="allyd@aplus.net" >Ally Dole</option>
<option value="kerrys@aplus.net" >Kerry Stevens</option>
<option value="nasc@aplus.net" >Nas Chad</option>
</select></font>
<font face="Arial" size="2">Customer Name:</font><font size="2" face="Arial" color="red"> *</font>
<font face="Arial" size="2"><input type="text" name="customer_name" class="inputbox" size="20"></font><b><font face="Arial" size="-2" color="red"></font></b><font face="Arial" size="-2"><br></font>
<font face="Arial" size="2">Customer Account #:</font><font size="2" face="Arial" color="red"></font>
<font face="Arial" size="-2"><br>Enter the AP number</font><br>
<font face="Arial" size="2"><input type="text" name="ap_number" class="inputbox" size="20"></font><b><font face="Arial" size="-2" color="red"></font></b>
<font face="Arial" size="2">Customer Company Name:</font><font size="2" face="Arial" color="red"></font>
<font face="Arial" size="2"><input type="text" name="customer_company" class="inputbox" size="20"></font><b><font face="Arial" size="-2" color="red"></font></b><font face="Arial" size="-2"><br></font>
<font face="Arial" size="2">Customer Phone #:</font><font size="2" face="Arial" color="red"></font>
<font face="Arial" size="2"><input type="text" name="customer_phone" class="inputbox" size="15"></font><b><font face="Arial" size="-2" color="red"></font></b><font face="Arial" size="-2"><br></font>
<td width="100%" align="center">
<font face="Arial" size="2">Customer Email:</font><font size="2" face="Arial" color="red"> *</font>
<font face="Arial" size="2">
<li class="validated" id="customer_email_li">
<input name="customer_email" id="customer_email" type="customer_email_li" size="30">
<div id="customer_email_msg"></div>
</li>
</font><b><font face="Arial" size="-2" color="red"></font></b><font face="Arial" size="-2"><br></font>
<font face="Arial" size="2">Web site type (Description):</font><font size="2" face="Arial" color="red"> *</font>
<font face="Arial" size="-2"><br>Describe the general type of website</font><br>
<font face="Arial" size="2"><textarea type="textarea" name="description" class="inputbox" rows="2" cols="40"></textarea></font><b><font face="Arial" size="-2" color="red"></font></b>
<font face="Arial" size="2">How will the customer get revenue from the site?</font><font size="2" face="Arial" color="red"> *</font>
<font face="Arial" size="-2"><br>How are they planning on making money?</font><br>
<font face="Arial" size="2"><textarea type="textarea" name="revenue" class="inputbox" rows="2" cols="40"></textarea></font><b><font face="Arial" size="-2" color="red"></font></b>
<font face="Arial" size="2">Features the customer wants:</font><font size="2" face="Arial" color="red"> *</font>
<font face="Arial" size="2"><textarea type="textarea" name="features" class="inputbox" rows="3" cols="40"></textarea></font><b><font face="Arial" size="-2" color="red"></font></b><font face="Arial" size="-2"></font>
<font face="Arial" size="2">Special requirements (Unique features):</font><font size="2" face="Arial" color="red"></font>
<font face="Arial" size="2"><textarea type="textarea" name="unique_features" class="inputbox" rows="3" cols="40"></textarea></font><b><font face="Arial" size="-2" color="red"></font></b><font face="Arial" size="-2"></font>
<font face="Arial" size="2">Does the customer want a Member Area?</font><font size="2" face="Arial" color="red"> *</font>
<font face="Arial" size="2">
<select type="select" name="member_area" class="inputbox" size="1">
<option></option>
<option value="Yes" >Yes</option>
<option value="No" >No</option>
</select>
<font face="Arial" size="2">How many products is he/she going to sell?</font><font size="2" face="Arial" color="red"> *</font>
<font face="Arial" size="2"><input type="text" name="product_number" class="inputbox" size="10"></font><b><font face="Arial" size="-2" color="red"></font></b>
<font face="Arial" size="2">Who is going to input the data?</font><font size="2" face="Arial" color="red"> *</font>
<font face="Arial" size="2"><select type="select" name="data_input" class="inputbox" size="1">
<option></option>
<option value="Aplus" >Aplus</option>
<option value="Customer" >Customer</option>
</select></font><b><font face="Arial" size="-2" color="red"></font></b><font face="Arial" size="-2"></font>
<font face="Arial" size="2">Will the customer add more categories / products</font><font size="2" face="Arial" color="red"> *</font>
<font face="Arial" size="2">
<select type="select" name="more_products" class="inputbox" size="1">
<option></option>
<option value="yes" >Yes</option>
<option value="no" >No</option>
</select>
</font>
<font face="Arial" size="2">Similar web sites:</font><font size="2" face="Arial" color="red"> *</font>
<font face="Arial" size="-2"><br>Enter any sites that the customer feels are similar to the one they want</font><br>
<font face="Arial" size="2"><textarea type="textarea" name="similar_sites" class="inputbox" rows="5" cols="40"></textarea></font><b><font face="Arial" size="-2" color="red"></font></b>
<font face="Arial" size="2">Which features does he/she like/dislike?</font><font size="2" face="Arial" color="red"></font>
<font face="Arial" size="-2"><br>Of the features on the similar sites, which ones does he like or dislike?</font><br>
<font face="Arial" size="2"><textarea type="textarea" name="features_like" class="inputbox" rows="3" cols="40"></textarea></font><b><font face="Arial" size="-2" color="red"></font></b>
<font face="Arial" size="2">Number of Static HTML Pages:</font><font size="2" face="Arial" color="red"> *</font>
<font face="Arial" size="2"><input type="text" name="static_pages" class="inputbox" size="7"></font><b><font face="Arial" size="-2" color="red"></font></b><font face="Arial" size="-2"></font>
<font face="Arial" size="2">Design Plan:</font><font size="2" face="Arial" color="red"> *</font>
<font face="Arial" size="-2"><br>Select the design plan you feel is appropriate</font><br>
<font face="Arial" size="2"><select type="select" name="design_plan" class="inputbox" size="1">
<option></option>
<option value="Palette" >Palette</option>
<option value="Sunshine" >Sunshine</option>
<option value="Rainbow " >Rainbow </option>
<option value="Reflections" >Reflections</option>
<option value="Reflections" >No Design Plan</option>
</select></font><b><font face="Arial" size="-2" color="red"></font></b>
<font face="Arial" size="2">Flash Template</font><font size="2" face="Arial" color="red"></font>
<font face="Arial" size="2"><input type="text" name="flash_template" class="inputbox" size="20"></font><b><font face="Arial" size="-2" color="red"></font></b><font face="Arial" size="-2"></font>
<font face="Arial" size="2">Add-Ons:</font><font size="2" face="Arial" color="red"></font>
<font face="Arial" size="2"><textarea type="textarea" name="addons" class="inputbox" rows="3" cols="40"></textarea></font><b><font face="Arial" size="-2" color="red"></font></b><font face="Arial" size="-2"></font>
<font face="Arial" size="2">Comments/Concerns/Clarifications:</font><font size="2" face="Arial" color="red"></font>
<font face="Arial" size="-2"><br>Any additional information that may need to be added</font><br>
<font face="Arial" size="2"><textarea type="textarea" name="comments" class="inputbox" rows="3" cols="40"></textarea></font><b><font face="Arial" size="-2" color="red"></font></b>
echo "<input type='submit' value='Submit Ticket' />
</form>";
}
?>