#!/usr/bin/perl --


#This will display customer testimonials. Created 03/08/09
#Modified 02/06/10 - changed name of sport folio and bio file names.pl
#Modified 05/08/10 - remove categories option in menu and add rates
#Modified 22/09/10 - to add Patrick Welsh's testimonial
#Modified 02/10/10 - added google analytics
#Modified 21/10/10 - add link to patrick welsh web site.
#Modified 07/01/11 - to make text area same width
#Modified 12/01/11 - Add Louise Housley testimonial
#Modified 09/08/11 - added Simon Crellin testimonial
#modified 27/04/12 - remove google analytics for cookie law complience
#Modified 11/05/12 - added page hit count
#Modified 14/08/12 - added back google analytics
#Modified 10/08/13 - Copyright year now a variable
#Modified 06/12/13 - to pick up new database following migarion/upgrade of hosting.
#Modified 21/04/15 - viewport & mobile-friendly mods
#Modified 31/07/15 - allow for cookie mods
#Modified 14/04/16 - align all pages to the same bio page.
#Modified 21/04/16 - added header image.


use DBI;

use CGI qw (:standard);
use CGI::Carp qw(fatalsToBrowser);

use Time::gmtime;
$ct = gmtime();
$realyear = $ct->year + 1900;

my ($cgi) = new CGI;

#To pick out the data sent from the thumbnail review page.

#@pairs=split(/&/,$ENV{'QUERY_STRING'});


print $cgi->header;

#foreach $pair(@pairs)
#{
#($name,$image_id) = split (/=/,$pair);



#$name=~ s/\+/ /g;
#$name=~ s/%(..)/pack("C", hex($1))/ge;

#$value=~ s/\+/ /g;
#$value=~ s/%(..)/pack("C", hex($1))/ge;
#$value=~s/<!--(.|\n)*-->//g;
#}


my ($page_title);


#To select a title based upon the catgory of the image
$page_title="/title_testimonials.gif";



print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
print"<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
print"<head>\n";
print"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\" />\n";
print"<title>peter hatter photography - Customer Testimonials - commercial sports action stock. It's only light</title>\n";
print"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n";
print"<link rel=\"stylesheet\" media=\"(max-width: 640px)\" href=\"/global-max-640px.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
print"<link rel=\"stylesheet\" media=\"(max-width: 640px)\" href=\"/global-max-640px.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
print"<link rel=\"stylesheet\" media=\"(min-width: 640px)\" href=\"/global.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
print"<link rel=\"icon\" type=\"image/gif\" href=\"http://www.peterhatter.com/sports_photography.gif\"/>\n";

print"<script type=\"text/javascript\">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-18865309-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>\n";

print"<script type=\"text/javascript\">
function myF() {
	if (screen.width < 500) {
		document.getElementById(\"title\").width=\"80\";
		document.getElementById(\"twitter_logo\").width=\"30\";
		document.getElementById(\"fb_logo\").width=\"30\";
	}
}

function myF1() {
	if (screen.width < 500) {
		document.getElementById(\"top_image\").width=\"300\";
				}
		}

</script>\n";

print"<!--Cookie compliance code from https://silktide.com/tools/cookie-consent/download/-->

<!-- Begin Cookie Consent plugin by Silktide - http://silktide.com/cookieconsent -->
<script type=\"text/javascript\">
    window.cookieconsent_options = {\"message\":\"This website uses cookies to ensure you get the best experience on our website\",\"dismiss\":\"Got it!\",\"learnMore\":\"More info\",\"link\":\"http://www.peterhatter.com/cgi-bin/privacy_policy.pl\",\"theme\":\"dark-top\"};
</script>

<script type=\"text/javascript\" src=\"//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/1.0.9/cookieconsent.min.js\"></script>
<!-- End Cookie Consent plugin -->\n";

print"</head>\n";
print"<body>\n";
print"<div class=\"body\">\n";
print"<div class=\"banner\">\n";
print"<div class = \"page_title\">\n";
print"<img src = \"$page_title\" width=\"230\" alt = \"Testimonials\" id =\"title\" onload=\"myF()\">\n";

print"</div>\n";
print"</div>\n";


print"<div class=\"new_mainNav\">\n";
print"  	<ul>\n";
print"  	 	<li><a href=javascript:history.back();>back</a></li>\n";
print"    		<li><a href=\"/index.html\">home</a></li>\n";
print"		<li><a href=\"/cgi-bin/sports_photography_portfolio.pl\">sport folio</a></li>\n";
#print"		<li><a href=\"/cgi-bin/non_sport_portfolio.pl\">non-sport folio</a></li>\n";
print"		<li><a href=\"/cgi-bin/rates.pl\">rates</a></li>\n";
#print"		<li><a href=\"/cgi-bin/category_search.pl?category=general\">general</a></li>\n";
print"    		<li><a href=\"/cgi-bin/contact.pl\">contact</a></li>\n";
print"		<li><a href=\"/nottingham_commercial_freelance_photographer_bio.html\">bio</a></li>\n";
print"	</ul>\n";
print"</div>\n";




print"<div class=\"testimonials\">\n";
print"<img src=\"/nottingham_freelance_photography_climber.jpg\" style=\"clear: both;  margin-left: auto; margin-right: auto; padding-right: 0px; padding-top: 0px; margin-top: 0px;\" id=\"top_image\" onload=\"myF1()\">\n";

print"<h2>Customer Testimonials.</h2>\n";
print"<p>Below are testimonials from clients for whom I have completed a commission.\n";
print"<br/><br/>\n";

print"From <b>Neil Ellis<br/>Marketing Campaigns Executive at <br/>Kings Foundation</b><br/><br/>\n";
print"\"Great to work with Peter for 2 consecutive years now. He understood our brief fully and captured some great shots of children enjoying sport and interacting with one another (which can be very difficult to do). 
He was very hard working throughout each shoot and I am sure we’ll be using him for our photography in the future.\"<br/><br/>\n";
print"The Kings Foundation website can be found here: <a href=\"https://www.kingsfoundation.org/\">www.kingsfoundation.org/</a><br/><br/>\n";

print"From <b>Dave Gunn<br/>National Development Officer at <br/>The Croquet Association</b><br/><br/>\n";
print"\"Right from the off, Peter made sure that he fully understood our brief which the resulting film has more than met, exceeding all of our expectations. 
He struck a nice balance between allowing us to shape the filming and making subtle suggestions for ways of improving the end product. Without exception, all our participants 
were made to feel very comfortable and were thus able to enjoy the experience. We will be using the film to promote our sport for many years to come!\"<br/><br/>\n";
#print"<br/>\n";
print"The Croquet Association website can be found here: <a href =\"http://www.croquet.org.uk\"> www.croquet.org.uk<a><br/><br/>\n";
#print"<br/>\n";

print"From <b>Jason O\'Callaghan<br/>Participation Manager at England Hockey</b><br/><br/>\n";
print"\"Peter provided us with great shots from our recent high performance hockey tournament, capturing the live action on the pitch and experiences off it. 
He took the time to understand our brief and his professional manner allowed us to have a hands off approach on the day, which is invaluable on event. 
We have and will continue to us the images for a range of purposes and wouldn't hesitate to ask Peter to capture a future England Hockey event.\"<br/><br/>\n";
#print"<br/>\n";
print"The England Hockey website can be found here: <a href =\"http://www.englandhockey.co.uk\"> www.englandhockey.co.uk</a><br/><br/>\n";
#print"<br/>\n";
print"From <b>Fiona Simpson<br/>Sportscotland Institute Of Sport</b><br/><br/>\n";
print"\"Peter Hatter delivered a top quality, professional, and friendly service which provided us with shots
 which absolutely fitted the brief which we gave him. He made the staff and athletes feel relaxed as he went
 about the shoot, they enjoyed themselves and the end product is a great testament to how good a photographer he is.\"<br/><br/>\n";
#print"<br/>\n";
print"The sportscotland institute of sport website can be found here: <a href =\"http://www.sisport.com\"> www.sisport.com<a><br/><br/>\n";
#print"<br/>\n";
print"From <b>Simon Crellin<br/>MD at Redpoint PR</b><br/><br/>\n";
print"\"Peter is a great photographer who was able to provide us with a wide range of new and varied images to promote our adventure sports events. He delivered a high quality set of pictures to the required brief.\"<br/><br/>\n";
print"The Redpoint PR website can be found here: <a href=\"http://www.redpointpr.co.uk\">www.redpointpr.co.uk</a><br/><br/>\n";
print"<br/><br/>\n";
print"From <b>Louise Housley<br/>PR Manager at Liz Hobbs Group Ltd</b><br/><br/>\n";
print"\"I found Peter really friendly, professional and easy to work with at the launch of the Nottinghamshire and Lincolnshire Air Ambulance. It was a hectic day so it was a huge a relief to find that Peter understood my initial brief and documented the event really well.\"<br/><br/>\n";
print"The Liz Hobbs website can be found here: <a href=\"http://www.lizhobbsgroup.com\">www.lizhobbsgroup.com</a><br/><br/>\n";
print"<br/><br/>\n";
print"From <b>Patrick Welsh<br/>Managing Director at Patrick Welsh Marketing</b><br/><br/>\n";
print"\"For me having a professional photo taken is akin to a trip to the dentist. Despite my fears, with Peter the whole things was a really enjoyable experience. I was clearly in the hands of a professional; someone who knew his craft and was able to get the best out of me. Great results.\"<br/><br/>\n";
print"Patrick's website can be found here: <a href=\"http://www.pwelsh.co.uk\">www.pwelsh.co.uk</a><br/><br/>\n";
print"From <b>Rob Pittam<br/>MD Robin Hood Media</b><br/><br/>\n";
print"\"I found Peter a delight to work with. Highly professional and a very skilled photographer. 
His pictures were spot on, exactly what I was looking for. 
But more importantly , his personal manner in dealing with the people being photographed was excellent. 
I have been a journalist with the BBC and with local newspapers. I have had high standards bred into my work
 and Peter was able to effortlessly meet them.\"<br/><br/>\n";
print"The Robin Hood Media website can be found here: <a href=\"http://www.robinhoodmedia.net\">www.robinhoodmedia.net</a><br/><br/>\n";
#print"<br/><br/>\n";
print"From <b>Tara de Cozar<br/>Internal Communications Manager, University of Nottingham</b><br/><br/>\n";
print"\"I was really pleased with the pictures Peter took at the Tri-Campus Games event. 
The images really captured the spirit of the Games and were used extensively in the publicity following the event, 
from magazines and marketing materials to the internet. I'd recommend Peter for any sporting event.\" \n";
print"<br/><br/>\n";
print"From <b>Steve Cooper<br/>ASC Finance For Business.</b><br/><br/>\n";
print"\"Peter has arranged some portraits for work. Not the biggest project he’s undertaken but great results considering what he had to work with! 
Prompt professional service. Would highly recommend.
Top Qualities: Great Results, Good Value, On Time\"<br/><br/>\n";
print"Steve can be contacted on: 01332 202300. <br/>The ASC website can be found here: <a href =\"http://www.asc.co.uk\"> www.asc.co.uk<a><br/><br/></p>\n";

print"</div>\n";

	
print"<div class=\"bottom_of_page\">
<br/>
<a href=\"/index.html\">Home </a>
<a href=\"legal.pl\">Legal   </a>
<a href=\"privacy_policy.pl\">   Privacy</a>
<p>© ".$realyear." Peter Hatter Photography Ltd. All rights reserved.</p>
<a href=\"http://www.twitter.com/peterhatter\"><img src=\"/Twitter_logo_blue.jpg\" id=\"twitter_logo\" onload=\"myF()\" width=\"60\"></a>
</div>\n";

print"</div>\n";

print"<div class=\"preload\">&nbsp;</div>\n";
print"</div>\n";
print"</body>\n";
print"</html>\n";

my ($host_name)="database.lcn.com";
my ($user_name,$password) = ("LCN104139_birch","xmasinjanuary713");
my ($db_name) = "peterhatter_com_db";
my ($dsn) = "DBI:mysql:$db_name:$host_name";
my ($dbh) = DBI->connect ($dsn, $user_name, $password);

$page_name="testimonials";

$query="SELECT count from page_hit_mstr WHERE page_hit_mstr.page_id = \"$page_name\"";
$rct =$dbh->prepare (qq{SELECT * from page_hit_mstr where page_hit_mstr.page_id = "$page_name";});
$rct->execute ();
@page_hit = $rct -> fetchrow_array ();
$page_hit_id = @page_hit[0];
$page_hit_count = @page_hit[1];

if (!defined ($page_hit_id))
{
$page_hit_count=1;
$query="INSERT page_hit_mstr(page_id,page_count) VALUES (\"$page_name\",\"$page_hit_count\")";
$rct = $dbh-> prepare (qq{$query});
$rct->execute();
}
else
{
$page_hit_count = $page_hit_count + 1;
$query="UPDATE page_hit_mstr SET page_count = \"$page_hit_count\" WHERE page_id = \"$page_name\"";
$rct = $dbh-> prepare (qq{$query;});
$rct->execute();
}
#End of the display count updates


# To finish off here now.

$DBI::err == 0;




