<?php

/**
 * @file
 * Customize the e-mails sent by Webform after successful submission.
 *
 * This file may be renamed "webform-mail-[nid].tpl.php" to target a
 * specific webform e-mail on your site. Or you can leave it
 * "webform-mail.tpl.php" to affect all webform e-mails on your site.
 *
 * Available variables:
 * - $node: The node object for this webform.
 * - $submission: The webform submission.
 * - $email: The entire e-mail configuration settings.
 * - $user: The current user submitting the form.
 * - $ip_address: The IP address of the user submitting the form.
 *
 * The $email['email'] variable can be used to send different e-mails to different users
 * when using the "default" e-mail template.
 */

 
// print_r($subData=$submission->data);
 //print_r($comp=$node->webform['components']);
 
 $subData=$submission->data;
 $comp=$node->webform['components'];
 
 $name=$subData[3]['value'][0];
 $approxtime=$subData[5]['value'][0];
 $codate=$subData[4]['value'][0];
 $anychange=$subData[6]['value'][0];
 $updatetxt=$subData[7]['value'][0];
 $authorized=$subData[8]['value'][0];
 $roomchoice1=array();
 $roomchoice1=$subData[31]['value'];
 $roomchoice2=array();
 $roomchoice2=$subData[32]['value'];
 $platinum=$subData[24]['value'][0];
 $choice1=$subData[25]['value'][0];
 $gold=$subData[26]['value'][0];
 $choice2=$subData[27]['value'][0];
 $silver=$subData[36]['value'][0];
 $choice3=$subData[37]['value'][0];
 $bronze=$subData[39]['value'][0];
 $choice4=$subData[40]['value'][0];
 $feeding1=$subData[43]['value'][0];
 $feeding2=$subData[46]['value'][0];
 $dfood=$subData[49]['value'][0];
 $cfood=$subData[50]['value'][0];
 $morning=$subData[55]['value'][0];
 $mixed1=$subData[56]['value'][0];
 $noon=$subData[57]['value'][0];
 $mixed2=$subData[64]['value'][0];
 $evening=$subData[66]['value'][0];
 $mixed3=$subData[68]['value'][0];
 $peteat=$subData[72]['value'];
 $yourpet=$subData[74]['value'];
 $petfood=$subData[76]['value'];
 $otherins=$subData[70]['value'][0];
 $serviceupgrade=array();
 $serviceupgrade=$subData[79]['value'];
 $treats=array();
 $treats=$subData[81]['value'];
 $gmeals=array();
 $gmeals=$subData[82]['value'];
 $packages=array();
 $packages=$subData[88]['value'];
 $indser=array();
 $indser=$subData[90]['value'];
 $Preventatives=array();
 $Preventatives=$subData[92]['value'];
 $medication1= $subData[98]['value'][0];
 $medication2=  $subData[99]['value'][0];
 $frequency1= $subData[102]['value'][0];
 $frequency2= $subData[103]['value'][0];
 $dosage1=  $subData[105]['value'][0];
 $dosage2=   $subData[107]['value'][0];
 $signP= $subData[112]['value'][0];
 $date=  $subData[114]['value'][0];

 
if($anychange!=""){
$sn="yes";

}
else{$sn="no";}
 

echo "<table><tr><th style='width: 65%;'></th><th></th></tr>
<tr><td >Pet(s) Name: </td><td>$name</td></tr>
<tr><td >Approximate Time: </td><td>$approxtime</td></tr>
<tr><td >Check-out Date:</td><td>$codate</td></tr>
<tr><td >Have there been any changes/updates to your personal information (i.e. phone number, emergency contact(s), and veterinarian)? </td><td>$sn</td></tr>
<tr><td >If yes, please update: </td><td>$updatetxt</td></tr>
<tr><td >Other person(s) authorized to pick-up my pet:</td><td>$authorized</td></tr>
<tr><td >Room Choices(All rooms quoted at single occupancy rate):</td><td></td></tr>";
foreach($roomchoice1 as $val)
{
	
	if($val==1)
	{
		echo "<tr><td>VIP (Very Important Pooch): 10’x10’, Off The Floor Bed + Upgrade, Dedicated 24hr Web Cam -- $35.00 per night </td><td>Yes</td></tr>";
		
	}
	else if($val==2)
	{
		echo "<tr><td>Free Roam: Appropriate Secure Indoor Play Area, Off The Floor Bed, Dedicated 24hr Web Cam-- $32.00 per night</td><td>Yes</td></tr>";
	}
	else if($val==3)
	{
		echo "<tr><td>Executive Suite: 5’x8’, Off The Floor bed, Glass Doors, Optional Web Cam Access-- $30.00 per night </td><td>Yes</td></tr>";
	}
	else if($val==4)
	{
		echo "<tr><td>Luxury Suite: 5’x 7’, Off The Floor Bed, Glass Doors, Optional Web Cam Access-- $28.00 per night </td><td>Yes</td></tr>";
	}
}
echo "<tr><td ></td><td></td></tr>";
foreach($roomchoice2 as $val1)
{
	
	if($val1==1)
	{
		echo "<tr><td>Deluxe Suite: 4’x 5’, Off The Floor Bed, Glass Doors, Optional Web Cam access-- $25.00 per night
</td><td>Yes</td><tr>";
		
	}
	else if($val1==2)
	{
		echo "<tr><td>Deluxe Privacy Suite: 5’ x 5’ Off The Floor Bed, Optional Webcam Access-- $25.00 per night </td><td>Yes</td></tr>";
	}
	else if($val1==3)
	{
		echo "<tr><td>Junior Suite: 4’x 4’ Off The Floor Bed, Glass Doors, Optional Webcam Access-- $25.00 per night  </td><td>Yes</td></tr>";
	}
	else if($val1==4)
	{
		echo "<tr><td>Junior Privacy Suite: 4’x 4’ Off The Floor Bed, Optional Webcam Access-- $25.00 per night  </td><td>Yes</td></tr>";
	}
}
echo "<tr><td></td></tr><tr><td >SUITE UPGRADE PACKAGES: </td><td></td></tr>
<tr><td >Platinum Collar Package ($20.00) – Plush Bedding Upgrade, Obedience Training W/ Fun time, Vacation Photo Emailed </td><td>";
if($platinum==1)
{
	echo "Yes ";
}
else
{
	echo "No";
}
echo "</td></tr>
<tr><td >Choice one:</td> <td>";
if($choice1==1)
{
	echo "Organic Yogurt Treat or";
}
else if($choice1==2)
{
	echo "Doggy Ice Cream Treat or ";
}
else if($choice1==3)
{
	echo "Gourmet Cookie or ";
}
else if($choice1==4)
{
	echo "Gourmet Meal";
}
echo "</td></tr>
<tr><td >Gold Collar Package ($18.00) Plush Bedding Upgrade, 1 on 1 Play Time Session x1, Vacation Photo Emailed, </td><td>";
if($gold==1)
{
	echo "Yes";
}
else
{
		echo "No";
}
echo "</td></tr>
<tr><td >Choice one:</td> <td>";
if($choice2==1)
{
	echo "Organic Yogurt Treat or";
}
else if($choice2==2)
{
	echo "Doggy Ice Cream Treat or ";
}
else if($choice2==3)
{
	echo "Gourmet Cookie or ";
}
else if($choice2==4)
{
	echo "Gourmet Meal";
}
echo "</td></tr>
<tr><td >Silver Collar Package ($15.00) Plush Bedding Upgrade, 1 on 1 Play Time Session x1,</td>td><td>";
if($silver==1)
{
	echo "Yes";
}
else
{
		echo "No";
}
echo "</td></tr>
<tr><td >Choice one: </td><td>";
if($choice3==1)
{
	echo "Organic Yogurt Treat or";
}
else if($choice3==2)
{
	echo "Doggy Ice Cream Treat or ";
}
else if($choice3==3)
{
	echo "Gourmet Cookie or ";
}
else if($choice3==4)
{
	echo "Gourmet Meal";
}
echo "</td></tr>
<tr><td >Bronze Collar Package ($10.00) Plush Bedding Upgrade, Lounge Time x 1,</td><td>";
if($bronze==1)
{
echo "Yes ";
}
else
{
		echo "No";
}
echo "</td></tr>
<tr><td >Choice one:</td><td>";
if($choice4==1)
{
	echo "Organic Yogurt Treat or";
}
else if($choice4==2)
{
	echo "Doggy Ice Cream Treat or ";
}
else if($choice4==3)
{
	echo "Gourmet Cookie or ";
}
else if($choice4==4)
{
	echo "Summer Sausage";
}
echo "</td></tr>
<tr><td></td></tr>
<tr><td >Feeding Preferences </td><td></td></tr>
<tr><td >I would like to supply my pet’s food. (No Additional Charge) </td><td>";
if($feeding1==1)
{
	echo "Yes";
}
else
{
	echo "No";
}
echo "</td></tr>
<tr><td >I would like my pet to eat the house recipe. We serve ‘Natural Balance kibble and canned’. (No Additional Charge): </td><td>";
if($feeding2)
{
	echo "Yes";
}
else
{
	echo "No";
}
echo "</td></tr>
<tr><td></td><td></td></tr>
<tr><td >Preparation Instructions: </td><td></td></tr>
<tr><td >Dry Food (brand):  </td><td>$dfood</td></tr>
<tr><td >Canned Food (brand): </td><td>$cfood</td></tr>
<tr><td >Morning </td><td>$morning</td></tr>
<tr><td >Mixed with  </td><td>$mixed1</td></tr>
<tr><td >Noon  </td><td>$noon</td></tr>
<tr><td >Mixed with  </td><td>$mixed2</td></tr>
<tr><td >Evening   </td><td>$evening</td></tr>
<tr><td >Mixed with  </td><td>$mixed3</td></tr>
<tr><td >Other Instructions (Specify):  </td><td>$otherins</td></tr>
<tr><td >My pet eats:  </td><td>";
if($peteat==1)
{
	echo "Free Feeder";
}
else
{
	echo "With Siblings";
}
echo "</td></tr>
<tr><td >If your pet chooses to be a difficult eater, is it ok to add a small amount of canned food to encourage eating? </td><td>";
if($yourpet==1)
{
	echo "Yes";
}
else
{
	echo "No";
}
echo "</td></tr>
<tr><td >Are your pets food and water dishes provided:  </td><td>";
if($petfood==1)
{
	echo "In a raised feeder stand";
}
else
{
	echo "At ground level";
}
echo "</td></tr>
<tr><td></td><td></td></tr>
<tr style='font-size: 14px;'><td >Additional Options</td><td></td></tr>
<tr></tr>
<tr><td >Service Upgrades</td><td></td></tr>";
foreach($serviceupgrade as $sup)
{
	if($sup==1)
	{
		echo "<tr><td> x Daily Web Cam Access (Complimentary)</td><td>Yes</td></tr>";
	}
	else if($sup==2)
	{
		echo "<tr><td>x Daily Group Play (Complimentary) </td><td>Yes</td></tr>";
	}
	else if($sup==3)
	{
		echo "<tr><td>x ___ Lounge Time ($2.00/day) </td><td>Yes</td></tr>";
	}
	else if($sup==4)
	{
		echo "<tr><td>x ___ 1 on 1 Play Time $5.00/15 Minutes </td><td>Yes</td></tr>";
	}
	else if($sup==5)
	{
		echo "<tr><td>x ___ Obedience Training W/ Fun time ($10/20 minutes) </td><td>Yes</td></tr>";
	}
	else if($sup==6)
	{
		echo "<tr><td> x ___ Vacation Photo Emailed ($4.00) </td><td>Yes</td></tr>";
	}
	else if($sup==7)
	{
		echo "<tr><td>x ___ Daily Bedding Wash ($1.00/day) </td><td>Yes</td></tr>";
	}
	else if($sup==8)
	{
		echo "<tr><td>x ___ Plush Bedding Upgrade ($1.50/day) </td><td>Yes</td></tr>";
	}
	else if($sup==9)
	{
		echo "<tr><td>x ___ Brush & Massage ($5/15 minutes) </td><td>Yes</td></tr>";
	}
	else if($sup==10)
	{
		echo "<tr><td>x ___ Daily Report Card and Activities Log ($2.00/day) </td><td>Yes</td></tr>";
	}
	else if($sup==11)
	{
		echo "<tr><td>x ___ Agility Course Time ($10.00/30 minutes) </td><td>Yes</td></tr>";
	}
	else if($sup==12)
	{
		echo "<tr><td>x ___ Shopping Allowance@10% Store Discount ($5.00/up) </td><td>Yes</td></tr>";
	}
	else if($sup==13)
	{
		echo "<tr><td>x ___ Private Web Cam Viewing ($3.00/day) </td><td>Yes</td></tr>";
	}
	else if($sup==14)
	{
		echo "<tr><td> x ___ Daily Brushing ($2.00/day) </td><td>Yes</td></tr>";
	}
	
	
}
echo "
<tr><td >Treats</td><td></td></tr>";
foreach($treats as $ttt)
{
	if($ttt==1)
	{
		echo "<tr><td> x ___ Organic Yogurt ($2.99)</td><td>Yes</td></tr>";
	}
	else if($ttt==2)
	{
		echo "<tr><td>x ___ Doggy Ice Cream ($2.99) </td><td>Yes</td></tr>";
	}
	else if($ttt==3)
	{
		echo "<tr><td>x ___ Bottled Spring Water ($1.99) </td><td>Yes</td></tr>";
	}
	else if($ttt==4)
	{
		echo "<tr><td>x ___ Summer Sausage ($1.50) </td><td>Yes</td></tr>";
	}
	else if($ttt==5)
	{
		echo "<tr><td>x ___ In Suite Stuffed Kong Use and Treat ($.99/day) </td><td>Yes</td></tr>";
	}
	else if($ttt==6)
	{
		echo "<tr><td> x ___ Gourmet Carob Fudge Brownie Peanut Butter Cookie ($1.99) </td><td>Yes</td></tr>";
	}
}
echo "
<tr><td >Gourmet Meals</td><td></td></tr>";
foreach($gmeals as $gm)
{
	if($gm==1)
	{
		echo "<tr><td>  x ___ Chicken Pot Pie Dinner ($4.00)</td><td>Yes</td></tr>";
	}
	else if($gm==2)
	{
		echo "<tr><td>x ___ Venison Stew ($4.00) </td><td>Yes</td></tr>";
	}
	else if($gm==3)
	{
		echo "<tr><td> x ___ Chicken and Turkey Meatball Dinner ($4.00) </td><td>Yes</td></tr>";
	}
	else if($gm==4)
	{
		echo "<tr><td> x ___ Wild Buffalo Stew ($4.00) </td><td>Yes</td></tr>";
	}
}
echo "
<tr><td></td><td></td></tr>
<tr style='font-size: 14px;'><td >Grooming</td><td></td></tr>
<tr><td >Packages</td><td></td></tr>";
foreach($packages as $pac)
{
	if($pac==1)
	{
		echo "<tr><td>Full Grooming ---($ Breed Dependent) (Bath, Ears, Nails, Hair Cut, Blow Dry, Bandana and Perfume)</td><td>Yes</td></tr>";
	}
	else if($pac==2)
	{
		echo "<tr><td>Tidy Up---($25.99+) Includes bath, brush, dry, nails and trimming of hair on face, feet and sanitary areas.</td><td>Yes</td></tr>";
	}
	else if($pac==3)
	{
		echo "<tr><td>Oatmeal or Medicated Dog Bath Package---($15.99) Includes our complimentary bath with the addition of soothing oatmeal shampoo and conditioner for dogs with dry or flakey skin, (or medicated shampoo and conditioner for dogs with sensitive or itchy skin) also includes basic nail trim, brushing of the teeth and a bandana.</td><td>Yes</td></tr>";
	}
	else if($pac==4)
	{
		echo "<tr><td>Nails Plus Package---($14.99) Includes nail trim and trimming of paw hair.</td><td>Yes</td></tr>";
	}
	else if($pac==5)
	{
		echo "<tr><td>Nails + Ears Package ---($18.99) Includes cleaning of ears and trimming or plucking of ear hair, nail trim, and paw hair trim .</td><td>Yes</td></tr>";
	}
}
echo "<tr><td >Individual Services</td><td></td></tr>";
foreach($indser as $iser)
{
	if($iser==1)
	{
		echo "<tr><td>Check Out Bath (Complimentary)</td><td>Yes</td></tr>";
	}
	else if($iser==2)
	{
		echo "<tr><td>Nail Trimming ($10.00)</td><td>Yes</td></tr>";
	}
	else if($iser==3)
	{
		echo "<tr><td>Nail Filing ($14.00)</td><td>Yes</td></tr>";
	}
	else if($iser==4)
	{
		echo "<tr><td>Basic Ear Clean ($5.00)</td><td>Yes</td></tr>";
	}
	else if($iser==5)
	{
		echo "<tr><td>Gland Expression ($5.00)</td><td>Yes</td></tr>";
	}
	else if($iser==6)
	{
		echo "<tr><td>Tooth Brushing ($5.00)</td><td>Yes</td></tr>";
	}
}
echo "<tr><td >Preventatives</td><td></td></tr>";
foreach($Preventatives as $prevent)
{
	if($prevent==1)
	{
		echo "<tr><td> Flea and Tick Shampoo and Dip ($18.99)</td><td>Yes</td></tr>";
	}
	else if($prevent==2)
	{
		echo "<tr><td> Virbac Tick Collar ($17.99)</td><td>Yes</td></tr>";
	}
	else if($prevent==3)
	{
		echo "<tr><td>Adams Plus Flea & Tick Collar ($8.99)</td><td>Yes</td></tr>";
	}
}
echo "<tr><td >Medical Information</td><td></td></tr>";



if($medication1!="" ||  $medication2!="" )
{
echo "<tr><td>Medication:</td><td>".$medication1."</td></tr>";
echo "<tr><td>Medication:</td><td>".$medication2."</td></tr>";
}

if($frequency1!="" ||  $frequency2!="" )
{
echo"<tr><td>Frequency:</td><td>".$frequency1."</td></tr>";
echo "<tr><td>Frequency:</td><td>".$frequency2."</td></tr>";
}


if( $dosage1!="" || $dosage2!="" )
{
echo"<tr><td>Dosage:</td><td>".$dosage1."</td></tr>";
echo "<tr><td>Dosage:</td><td>".$dosage2."</td></tr>";
}


echo "<tr><td >Acknowledgement</td><td></td></tr>";

if(  $signP!="")
{
echo"<tr><td>Dosage:</td><td>".$signP."</td></tr>";
}

if($date!="")
{
echo"<tr><td>Dosage:</td><td>".$date."</td></tr>";
}


echo "</table>";

 
?>

