'Tech support', 'email' => 'max@iws.com.ua'), array('name' => 'Bollards or railings', 'email' => 'parishcouncilwebsite@mh-p.net'), array('name' => 'Bridge roblem', 'email' => 'parishcouncilwebsite@mh-p.net'), array('name' => 'Bus Shelters / Stops', 'email' => 'parishcouncilwebsite@mh-p.net'), array('name' => 'Grass cutting / Weed spraying', 'email' => 'parishcouncilwebsite@mh-p.net'), array('name' => 'Flooding / Drainage', 'email' => 'parishcouncilwebsite@mh-p.net'), array('name' => 'Footpath / Pavement problem', 'email' => 'parishcouncilwebsite@mh-p.net'), array('name' => 'Road surface / Pothole', 'email' => 'parishcouncilwebsite@mh-p.net'), array('name' => 'Rights of Way', 'email' => 'parishcouncilwebsite@mh-p.net'), array('name' => 'Road lines and markings', 'email' => 'parishcouncilwebsite@mh-p.net'), array('name' => 'Damage or incorrect road sign', 'email' => 'parishcouncilwebsite@mh-p.net'), array('name' => 'Rubbish or Fly tipping', 'email' => 'parishcouncilwebsite@mh-p.net'), array('name' => 'Street light not working', 'email' => 'parishcouncilwebsite@mh-p.net'), array('name' => 'Street light damage', 'email' => 'parishcouncilwebsite@mh-p.net'), array('name' => 'Street light on during day', 'email' => 'parishcouncilwebsite@mh-p.net'), array('name' => 'Traffic light or crossing', 'email' => 'parishcouncilwebsite@mh-p.net'), array('name' => 'Verge problem', 'email' => 'parishcouncilwebsite@mh-p.net'), array('name' => 'Winter salting', 'email' => 'parishcouncilwebsite@mh-p.net'), array('name' => 'Salt bin empty', 'email' => 'parishcouncilwebsite@mh-p.net'), array('name' => 'Snow and ice problem', 'email' => 'parishcouncilwebsite@mh-p.net'), ); /* Cleanup */ $maxFileAge = 24 * 60 * 60; $contactFiles = glob('contacts/contact_*.json'); if ($contactFiles && is_array($contactFiles)) foreach ($contactFiles as $file) if (filemtime($file) < (time() - $maxFileAge)) { $messageData = json_decode(file_get_contents($file), true); if ($messageData && is_array($messageData) && count($messageData['files']) > 0) foreach ($messageData['files'] as $attachments) @unlink('contacts/'.$attachments['target']); @unlink($file); } /* Message template */ function buildMessage($messageData, $messageID, $isVerification) { $html = ''. ''. 'Contact form'. ''."\r\n".''. '
'."\r\n"; $text = ''; if ($isVerification) { $confirmLink = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'?confirmid='.$messageID; $html .= '

Please confirm the contents are correct by clicking on the link below:

'."\r\n"; $html .= '

'.$confirmLink.'

'."\r\n"; $text .= 'Please confirm the contents are correct by clicking on the link below:'."\r\n\r\n"; $text .= $confirmLink."\r\n\r\n"; } else { $html .= '

Website visitor sent new message by contact form:

'."\r\n"; $text .= 'Website visitor sent new message by contact form:'."\r\n\r\n"; } $html .= '

From: '.$messageData['from'].'

'."\r\n"; $html .= '

E-mail: '.$messageData['email'].'

'."\r\n"; $html .= '

Message:
'.nl2br($messageData['message']).'

'."\r\n"; $text .= 'From: '.$messageData['from']."\r\n"; $text .= 'E-mail: '.$messageData['email']."\r\n"; $text .= 'Message:'."\r\n".$messageData['message']."\r\n"; if ($messageData['link']) { $html .= '

Link: '.$messageData['link'].'

'; $text .= 'Link: '.$messageData['link']."\r\n"; } $html .= '
'. ''; return array('html' => $html, 'text' => $text); } if (!isset($_SESSION)) session_start(); ?> Report-A-Fault

Information

Please use this form to report a fault or a problem.

Please remember that the technician attending may not be from the area so ensure your location details are explicit.

To ensure the message is being sent from a real email account after clicking on the submit button you will be sent an email with a link for verification.

You only need to verify your email address once as it is stored in an encryted format should you wish to contact the Council again.

Report-A-Fault

0) { $attachments = array(); foreach ($messageData['files'] as $file) $attachments[] = array('type' => 'file', 'path' => 'contacts/'.$file['target'], 'filename' => $file['name']); } else $attachments = null; include('lib/phpmailer/mailer.class.php'); $mailer = new mailer($messageData['email'], $messageData['from']); $mailer->sendHTML($messageData['toemail'], $messageData['toname'], $emailSubject, $message['html'], $message['text'], $attachments); foreach ($messageData['files'] as $file) @unlink('contacts/'.$file['target']); @unlink('contacts/contact_'.$confirmID.'.json'); if (file_exists('contacts/@verified.json')) $verifiedList = json_decode(file_get_contents('contacts/@verified.json'), true); else $verifiedList = array(); if (!in_array($messageData['email'], $verifiedList)) { $verifiedList[] = $messageData['email']; file_put_contents('contacts/@verified.json', json_encode($verifiedList)); } } } } else { $confirmError = false; $messageConfirmed = false; $formSubmitted = $_SERVER['REQUEST_METHOD'] == 'POST'; $showForm = !$formSubmitted; $fieldFrom = ''; $fieldEmail = ''; $fieldTo = ''; $fieldMessage = ''; $fieldLink = ''; $fieldCaptcha = ''; $newFiles = array(); if ($formSubmitted && count($recipientsList) != 0) { if (isset($_POST['from'])) $fieldFrom = strip_tags(stripslashes($_POST['from'])); if (isset($_POST['email'])) $fieldEmail = strip_tags(stripslashes($_POST['email'])); if (isset($_POST['message'])) $fieldMessage = strip_tags(stripslashes($_POST['message'])); if ($showRecipients && isset($_POST['to'])) $fieldTo = $_POST['to']; else $fieldTo = 0; if ($showLink && isset($_POST['link'])) $fieldLink = strip_tags(stripslashes($_POST['link'])); if ($showAttachments && isset($_POST['newfiles']) && $_POST['newfiles']) $newFiles = json_decode(stripslashes($_POST['newfiles']), true); if (isset($_POST['captcha'])) $fieldCaptcha = $_POST['captcha']; if (!isset($_SESSION['captcha_keystring']) || $_SESSION['captcha_keystring'] != $fieldCaptcha) $fieldCaptcha = ''; if ($fieldLink == 'http://') $fieldLink = ''; elseif (substr($fieldLink, 0, 7) != 'http://' && substr($fieldLink, 0, 8) != 'https://') $fieldLink = 'http://'.$fieldLink; if ($fieldFrom && $fieldEmail && $fieldMessage && $fieldCaptcha) { if (!array_key_exists($fieldTo, $recipientsList)) $fieldTo = 0; $fieldToName = $recipientsList[$fieldTo]['name']; $fieldToEmail = $recipientsList[$fieldTo]['email']; $contactData = array('from' => $fieldFrom, 'email' => $fieldEmail, 'message' => $fieldMessage, 'link' => $fieldLink, 'toname' => $fieldToName, 'toemail' => $fieldToEmail, 'files' => $newFiles); $isVerified = false; if (file_exists('contacts/@verified.json')) { $verifiedList = json_decode(file_get_contents('contacts/@verified.json'), true); if (in_array($contactData['email'], $verifiedList)) $isVerified = true; } include('lib/phpmailer/mailer.class.php'); if ($isVerified) { $message = buildMessage($contactData, '', false); if (count($contactData['files']) > 0) { $attachments = array(); foreach ($contactData['files'] as $file) $attachments[] = array('type' => 'file', 'path' => 'contacts/'.$file['target'], 'filename' => $file['name']); } else $attachments = null; $mailer = new mailer($contactData['email'], $contactData['from']); $mailer->sendHTML($contactData['toemail'], $contactData['toname'], $emailSubject, $message['html'], $message['text'], $attachments); foreach ($contactData['files'] as $file) @unlink('contacts/'.$file['target']); ?>
Your message is successfully sent.
sendHTML($fieldEmail, $fieldFrom, $emailSubject, $message['html'], $message['text']); ?>
Thank you for your email which has been addressed to . Please confirm the contents are correct by click on the link in verification e-mail that was sent to your e-mail address to send this message.
Sorry, this form is temporarily unavailable.
Your message is successfully confirmed.
Message confirmation ID is expired or invalid.
Enter your name
Enter your e-mail address
characters left
Enter your message
files allowed
Control code
Invalid control code