<?
include ('Mail.php');


print "<title> REMC #1 Support Net Help System</title>";
print '<link rel="stylesheet" href="http://support.remc1.net/templates/247portal-b-grey/css/template_css.css" type="text/css"/>';

if ($HTTP_POST_VARS[sending]) 
        {
        $headers['From']=$HTTP_POST_VARS[emailaddy];
        $headers['Subject'] = $HTTP_POST_VARS[subject] . " ($HTTP_POST_VARS[supporttag])";

        print "<p>";
        $mail_object =& Mail::factory('sendmail', '');

        $body = "$HTTP_POST_VARS[name], in district: $HTTP_POST_VARS[district], building $HTTP_POST_VARS[building], room $HTTP_POST_VARS[room] and with phone number $HTTP_POST_VARS[phone], made a request from ip:  $HTTP_POST_VARS[userip] said this about machine $HTTP_POST_VARS[supporttag]:\n\n $HTTP_POST_VARS[problem]\n\n Requesting IP: $HTTP_POST_VARS[ip]";

        $mail_object->send('support@remc1.net', $headers, $body);

        print "Your message (listed below) was delivered to the Support.net help desk system.  You should receive a confirmation message shortly by email.  If you would like to follow up by phone on your ticket please call:<br>
(906) 487-7624 or <br>
(866) 214-0978 (toll free)<br>
        Thank you -<br>
        The Support.net team<br>
        <p>
        <b>Email Address:</b> $HTTP_POST_VARS[emailaddy]<br>
        <b>Subject:</b> $headers[Subject]<br>
        <b>Message:</b> <br>
        $body
        ";
        }

else    {
        print "
        <form method=post action=$_SERVER[PHP_SELF]>
        <table>
        <tr>
        <td>
        
        Please fill out the information below and click <b>Send in Request</b>.  A trouble ticket will be entered into the Help Desk.  <p>The more detail you can provide the better service we can offer.  If you experience problems with this form, or if you prefer you may send the same information directly by email to support@remc1.net
        </td></tr><tr><td height=45></td></tr><tr>
        <td>Your Email Address: </td><td><input type=text name=emailaddy> </td></tr>
        <td>Your Name:</td><td><input type=text name=name></td></tr>
        <td>Your District:</td><td><input type=text name=district></td></tr>
        <td>Your Building:</td><td><input type=text name=building></td></tr>
        <td>Your Room Number:</td><td><input type=text name=room></td></tr>
        <td>Your Phone Number:</td><td><input type=text name=phone></td></tr>
        <td>Your IP Address (if known):</td><td><input type=text name=userip></td></tr>
        <tr>
        <td>Subject of the Problem: </td><td><input type=text name=subject></td></tr>
        <tr>
        <td>Support Tag Number:</td><td><input type=text name=supporttag></td></tr>
        <tr>
        <td>
        Please describe the problem:</td><td><textarea name=problem cols=80 rows=20></textarea></td></tr></table>
        <input type=hidden name=sending value=1>
        <input type=hidden name=ip value=$_SERVER[REMOTE_ADDR]>
        <input type=submit value='Send in Request'>
        <br>
        All requests are tracked.
        </html>
        ";
        }

?>