0

Boss wants to get email notifications when the submit button is pressed. Can i get help with this thanks. it is a request system to keep track of work. i really want to be able to get email notifications when i hit submit and to a group of people as well. Also is there anyway on how to export this into a excel sheet.

?php require_once('Connections/Systems.php');
require_once('calendar/classes/tc_calendar.php');?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", 
$theNotDefinedValue = "") 
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? 
mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
  case "text":
  $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  break;    
  case "long":
  case "int":
  $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  break;
  case "double":
   $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  break;
  case "date":
   $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  break;
  case "defined":
  $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  break;
}
return $theValue;
  }
  }

  $editFormAction = $_SERVER['PHP_SELF'];
  if (isset($_SERVER['QUERY_STRING'])) {
 $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
 }

  if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO inctickets (RecordID, INCNum, Requester, 
 Category, Details, Status, DateSubmitted, CompletedBy, Comments, 
  DateChanged) 
    VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                   GetSQLValueString($_POST['RecordID'], "int"),
                   GetSQLValueString($_POST['INCNum'], "text"),
                   GetSQLValueString($_POST['Requester'], "text"),
                   GetSQLValueString($_POST['Category'], "text"),
                   GetSQLValueString($_POST['Details'], "text"),
                   GetSQLValueString($_POST['Status'], "text"),
                   GetSQLValueString($_POST['DateSubmitted'], "date"),
                   GetSQLValueString($_POST['CompletedBy'], "date"),
                   GetSQLValueString($_POST['Comments'], "text"),
                   GetSQLValueString($_POST['DateChanged'], "date"));

 mysql_select_db($database_Systems, $Systems);
 $Result1 = mysql_query($insertSQL, $Systems) or die(mysql_error());
}
?>
<!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>INC Ticket</title>
 <script language="javascript" src="calendar.js"></script>
 </head>

  <body>
  <p><a href="./SystemsDashboard.php"><img border="0" alt="menu" 
 src="penskelogo.jpg"></a>
 </p>
  <h2 align="center">Insert Request</h2>
  <form action="<?php echo $editFormAction; ?>" method="post" name="form1" 
  id="form1">
  <table align="center">
  <tr valign="baseline">
  <td nowrap="nowrap" align="right"><strong>Help Desk Inc#:</strong></td>
   <td><input type="text" name="INCNum" value="" size="32" /></td>
  </tr>
  <tr valign="baseline">
  <td nowrap="nowrap" align="right"><strong>Requester:</strong></td>
  <td><input type="text" name="Requester" value="" size="32" /></td>
   </tr>
   <tr valign="baseline">
  <td nowrap="nowrap" align="right"><strong>Category:</strong></td>
  <td><select name="Category">
  <option value="Computer Issue" <?php if (!(strcmp("Computer Issue", ""))) 
   {echo "SELECTED";} ?>>Computer Issue</option>
    <option value="Email Issue" <?php if (!(strcmp("Email Issue", ""))) 
   {echo "SELECTED";} ?>>Email Issue</option>
    <option value="Internet Issue" <?php if (!(strcmp("Internet Issue", 
   ""))) {echo "SELECTED";} ?>>Internet Issue</option>
      <option value="Label Printer Issue" <?php if (!(strcmp("Label Printer 
   Issue", ""))) {echo "SELECTED";} ?>>Label Printer Issue</option>        
    <option value="Network Connection Issue" <?php if (!(strcmp("Network 
  Connection Issue", ""))) {echo "SELECTED";} ?>>Network Connection 
  Issue</option>
    <option value="Other" <?php if (!(strcmp("Other", ""))) {echo 
   "SELECTED";} ?>>Other</option>
    <option value="Printer Issue" <?php if (!(strcmp("Printer Issue", ""))) 
   {echo "SELECTED";} ?>>Printer Issue</option>
    <option value="SAP Connection Issue" <?php if (!(strcmp("Internet 
   Issue", ""))) {echo "SELECTED";} ?>>SAP Connection Issue</option>
      <option value="SAP Program Issue" <?php if (!(strcmp("Internet Issue", 
  ""))) {echo "SELECTED";} ?>>SAP Program Issue</option>
  </select></td>
  </tr>
  <tr valign="baseline">
  <td nowrap="nowrap" align="right" valign="top"><strong>Details:</strong>
  </td>
  <td><textarea name="Details" cols="50" rows="5"></textarea></td>
</tr>
<tr valign="baseline">
  <td nowrap="nowrap" align="right"><strong>Status:</strong></td>
  <td><select name="Status">
    <option value="Pending" <?php if (!(strcmp("Pending", ""))) {echo 
"SELECTED";} ?>>Pending</option>

  </select></td>
</tr>
<tr valign="baseline">
  <td nowrap="nowrap" align="right"><strong>Date Submitted:</strong></td>
  <td><span class="Arial">
    <?php
 $myCalendar = new tc_calendar("DateSubmitted", true, false);
$myCalendar->setIcon("images/iconCalendar.gif");
$myCalendar->setDate(date('d'), date('m'), date('Y'));
$myCalendar->setPath("calendar/");
$myCalendar->setYearInterval(2000, 2025);
$myCalendar->dateAllow('2008-05-13', '2025-03-01');
$myCalendar->setDateFormat('j F Y');
$myCalendar->setAlignment('left', 'bottom');
//output the calendar
  $myCalendar->writeScript();
 ?>
  </span></td>
  </tr>
  <tr valign="baseline">
  <td nowrap="nowrap" align="right">&nbsp;</td>
  <td><input type="submit" value="Insert record" /></td>
  </tr>
  </table>

  <p align="center">&nbsp;</p>
  <p>
  <input type="hidden" name="RecordID" value="" />
  <input type="hidden" name="CompletedBy" value="" />
  <input type="hidden" name="Comments" value="" />
  <input type="hidden" name="MM_insert" value="form1" />
  </p>
  </form>
  <p>&nbsp;</p>
  </body>
  </html>enter code here
Saad
  • 1,047
  • 2
  • 19
  • 32
  • ***Please [stop using `mysql_*` functions](http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php).*** [These extensions](http://php.net/manual/en/migration70.removed-exts-sapis.php) have been removed in PHP 7. Learn about [prepared](http://en.wikipedia.org/wiki/Prepared_statement) statements for [PDO](http://php.net/manual/en/pdo.prepared-statements.php) and [MySQLi](http://php.net/manual/en/mysqli.quickstart.prepared-statements.php) and consider using PDO, [it's really pretty easy](http://jayblanchard.net/demystifying_php_pdo.html). – Jay Blanchard Sep 26 '17 at 20:46
  • We are always glad to help and support new coders but ***you need to help yourself first. :-)*** After [**doing more research**](https://meta.stackoverflow.com/q/261592/1011527) if you have a problem **post what you've tried** with a **clear explanation of what isn't working** and provide [a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). Read [How to Ask](http://stackoverflow.com/help/how-to-ask) a good question. Be sure to [take the tour](http://stackoverflow.com/tour) and read [this](https://meta.stackoverflow.com/q/347937/1011527). – Jay Blanchard Sep 26 '17 at 20:46

0 Answers0