<!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>
<?php

function inputfield($field,$id,$label,$missing,$warning)
{
	$a= "<label for=\"$field\">$label";
	if (isset($missing) && in_array($id,$missing))
	{
		$a.="<BR><span class=\"warning\">$warning</span>";
	}
	$a.="</label>";
	$a.= "<input name=\"$field\" id=\"$id\" class=\"formbox\" type=\"text\"";
	if (isset($missing))
	{
		$a.=" value=\"".$_POST[$id]."\"";
	}
	$a.=">";
	return $a;
}
?>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="CSS/main.css" />
<title>Schedule Enrollments</title>
<?php
 /*if (function_exists('nukeMagicQuotes')) {nukeMagicQuotes();}*/

if (array_key_exists('send', $_POST))
switch ($_POST["send"])
{
case "Generate and send affidavit":
	$expected = array ('name','city','state','county','address','addresscity','addressstate','email','birthname','birthdate','birthplace','mom','dad','birthaddress','nickname','social','license','licensestate','passport','military','school');

	$required = array ('name','state','county','address','birthname','birthdate','birthplace','email','mom','dad','license','licensestate');
	$missing = array();
	// process the $_POST variables
	foreach ($required as $key)
	{
		if (empty($_POST[$key])) array_push($missing,$key);
	}
	$nummissing=count($missing);
	foreach ($_POST as $key => $value)
	{
		// assign to temporary variable and strip whitespace if not an array
		$temp = is_array($value) ? $value : trim($value);
		if (in_array($key, $expected))
		{
			${$key} = $temp;
		}
	}
	if ($nummissing == 0)
	{
		include('includes/fpdf.php');
		$pdf=new FPDF();
		$pdf->AddPage();
		$pdf->SetFont('Times','B',16);
		$pdf->Cell(0,10,'AFFIDAVIT OF IDENTITY',0,0,'C');
		$pdf->Ln(10);
		$pdf->SetFont('Times','',10);
		$pdf->Cell(0,10,'State of '.$state);
		$pdf->Ln(5);
		$pdf->Cell(0,10,' County of '.$county);
		$pdf->Ln(10);
		$pdf->Cell(0,10,'I, '.$name.', being duly sworn, and under penalties of perjury, state that:');
		$pdf->Ln(5);
		$pdf->Cell(0,10,'I reside at '.$address.', '.$addresscity.', '.$addressstate.'.');
		$pdf->Ln(5);
		$pdf->Cell(0,10,'I was born on the date '.$birthdate.' at '.$birthplace.'.');
		$pdf->Ln(5);
		$pdf->Cell(0,10,'The name given to me at my birth was '.$birthname.'.');
		$pdf->Ln(5);
		$pdf->Cell(0,10,'The names of my parents at the time of my birth were '.$mom.' and '.$dad.'.');
		if($birthaddress)
		{
			$pdf->Ln(5);
			$pdf->Cell(0,10,'My address at the time of my birth was '.$birthaddress.'.');
		}
		if($nickname)
		{
			$pdf->Ln(5);
			$pdf->Cell(0,10,'I am also known by others as '.$nickname.'.');
		}
		if($social)
		{
			$pdf->Ln(5);
			$pdf->Cell(0,10,'My social security number is '.$social.'.');
		}
		if($license)
		{
			$pdf->Ln(5);
			$pdf->Cell(0,10,'My driver\'s license number is '.$license.' issued by the state of '.$licensestate.'.');
		}
		if ($military)
		{
			$pdf->Ln(5);
			$pdf->Cell(0,10,'My military ID number is '.$military.'.');
		}
		if ($school)
		{
			$pdf->Ln(5);
			$pdf->Cell(0,10,'My school ID number is '.$school.'.');
		}
		if ($passport)
		{
			$pdf->Ln(5);
			$pdf->Cell(0,10,'My passport number is '.$passport.'.');
		}
	/*
		$pdf->Ln(5);
		$pdf->Cell(0,10,'The biometric information which is obtained today by __________________ and which further identifies me is');
		$pdf->Ln(5);
		$pdf->Cell(0,10,'to be made part of this record.');
	*/
		$pdf->Ln(5);
		$pdf->Cell(0,10,'I am responsible for determining under what circumstances the information in this record is to be disclosed, and to');
		$pdf->Ln(5);
		$pdf->Cell(0,10,'whom it will be disclosed, as specified in my Personal Non-Disclosure Agreement.');
		$pdf->Ln(5);
		$pdf->Cell(0,10,'I swear that the identity information given above is true, under penalties of perjury.');
		$pdf->Ln(15);
		$pdf->Cell(100,10,'_______________________________________');
		$pdf->Cell(0,10,'______________');
		$pdf->Ln(5);
		$pdf->Cell(100,10,'Signature');
		$pdf->Cell(0,10,'Date');
		$pdf->Ln(10);

		//JURAT
	
		$pdf->SetFont('Times','B',16);
		$pdf->Cell(0,10,'Jurat',0,0,'C');
	//	$pdf->Cell(0,10,'Notarial Certificate',0,0,'C');
		$pdf->Ln(15);
		$pdf->SetFont('Times','',10);
		$pdf->Cell(0,10,'State of '.$state);
		$pdf->Ln(5);
		$pdf->Cell(0,10,'County of '.$county);
		$pdf->Ln(10);
		$pdf->Cell(0,10,'Sworn to (or affirmed) before me, a notary public in the state of '.$state.',');
		$pdf->Ln(5);
		$pdf->Cell(0,10,'this ________ day of _____________, 20___ by '.$name.',');
		$pdf->Ln(5);
		$pdf->Cell(0,10,'who deposes and says that this affidavit is made for the purpose of establishing his/her');
		$pdf->Ln(5);
		$pdf->Cell(0,10,'identity for the purpose to be determined by himself/herself.');
		$pdf->Ln(10);
		$pdf->Cell(0,10,'Signer ____is known to me (or) ____produced identification: _________________________');
		$pdf->Ln(15);
		$pdf->Cell(100,10,'_________________________');
		$pdf->Cell(0,10,'(Notary Seal)');
		$pdf->Ln(5);
		$pdf->Cell(0,10,'Signature of Notary');
		$pdf->Ln(15);
		$pdf->Cell(0,10,'_________________________');
		$pdf->Ln(5);
		$pdf->Cell(0,10,'Printed Name of Notary');
		$pdf->Ln(10);
		$pdf->Cell(0,10,'NOTARY PUBLIC, State of '.$state);
		$pdf->Ln(15);
		$pdf->Cell(0,10,'Copyright 2001-2008 Village Group, Inc. All rights reserved.',0,0,'C');
		$pdf->Output('/home/brandon/created/test.pdf');

		unset($missing);
		$pdfmade = true;
		$display="done";
	}
	else	//nummissing>0
	{
		$display="apply";
	}
	break;
case "Schedule enrollment session":
	break;
default:
	
	
}


?>
</head>
<body>

<?PHP
if (!isset($display)) $display="default";
switch ($display)
{
	case "schedule":
?>
		<h1>Schedule One Face-To-Face Enrollment</h1>
		<h2><br />
		If your digital and physical assets and spaces call for the
		most reliable identities of the people who will access them,
		then you've come to the right place.
		<br /><br />
		<span style="font-weight: normal;">
		Your face-to-face
enrollment is a Notarial process, meaning
		that you'll have the benefit of the skills of an individual who is
		legally required to know how to perform identity verification, and who
		as a public official applies the authority of the state to the
		enrollment document. Among other things this places you, the enrollee, under
		penalty of perjury for claims made in the oath and accompanying affidavit.
		<b>It is in your interest to ensure that you do not knowingly enter any false information in this form.</b>
		</span>
		<br /><br />
		First, let us know when and where you would like the
		enrollment to take place:
		<br /><br />
<form id="timeandplace" method="post" action=""><p>

		<?php
		echo inputfield("where","state","City and State where enrollment session is desired:",$missing,"Please enter the name of the location where an enrollment session is desired");
		echo "</p><p>";
		echo inputfield("when","when","What time of day, or time range, is best:",$missing,"Please enter the date on which you would like to have your enrollment session");
		echo "</p><p>";
		echo inputfield("phone","phone","Telephone number at which we can contact you:",$missing,"Please give us a phone number so we can make this appointment");
		echo "</p><p>";
		echo inputfield("email","email","Email address:",$missing,"Please give us your email address for further contact");

		echo "</p><p>";
		//<input name="send" id="send" value="Schedule enrollment session" type="submit" />
		?>
		The button to schedule an enrollment session is temporarily removed.
		I never understood why the two were on the same page in the first place.
		</p>
		</form>
<?PHP
		break;
	case "done":
		echo "<H1>Congratulations</H1>";
			echo "<p><strong>Your affidavit has been created.</strong></p>";
			include('includes/mail.inc.php');
?>
<PRE>
Once you receive the finished Affidavit form back in your email, you will take it to a notary along with two of your identification cards with picture &ndash; driver&prime;s license and passport, military ID or other photo ID preferred.  Please take the ID cards and the Affidavit with you to a notary in your state, and have the notary complete the notarization as required.  NOTE:  Do NOT sign this form ahead of time – it must be signed in the presence of the notary.

Scan your ID cards, saving as a jpg or tif, file, then go to <A href=https://www.startssl.com/?app=12 target=blank>StartCom</A>  for your Class Two certification. 

Please use Firefox, not Internet Explorer.  This is recommended for the following secure transaction.

Here are the steps to get this going:<OL>

<LI>Navigate to <A target=blank href=https://www.startssl.com/?app=12>the startssl registration page</A>  (with Firefox)
<LI>Click on "Register"
<LI>Provide all of the details in the form and click "Continue"
<LI>Check your email account for the verification code. This should take less than a minute.
<LI>Enter the code into the field at the screen (copy / paste)
<LI>At the next step the browser creates a private key - Continue.
<LI>Thereafter, a client authentication certificate will be installed into the certificate store of the browser.
<LI>Finally you enter the StartSSL Control Panel - your account.
<LI>At the right hand side one can view current status and all other kinds of information.
<LI>Click on the "Validations Wizard" tab
<LI>Select "Personal Identity Validation"
<LI>Select "Personal Class 2"
<LI>Upload the documents. Each time another document is selected it's uploaded instantly. After all documents are uploaded click on "Continue"
<LI>Click on "Finish" and wait for the response from the StartSSL group.
If you have questions on this process, <A href=mailto:certmaster@startcom.org>email StartCom</A> for support.

<LI>Finally, scan and email the notarized Affidavit to me at <A href=mailto:joanna@reliableid.com>joanna@reliableid.com</A> or fax it to 850-597-9201.  Call me with any questions.
</OL>
 

Thank you for your confidence!

Joanna Lilly
<A href=http://www.reliableid.com>www.ReliableID.com</A>

850-878-9548

850-443-8215
</PRE>
<?PHP
		break;
	case "apply":
	default:
?>
		<h1>Affidavit Form</h1>
		<h2><br />
		If your digital and physical assets and spaces call for the
		most reliable identities of the people who will access them,
		then you've come to the right place.
		<br /><br />
		<span style="font-weight: normal;">
		Your face-to-face
enrollment is a Notarial process, meaning
		that you'll have the benefit of the skills of an individual who is
		legally required to know how to perform identity verification, and who
		as a public official applies the authority of the state to the
		enrollment document. Among other things this places you, the enrollee, under
		penalty of perjury for claims made in the oath and accompanying affidavit.
		<b>It is in your interest to ensure that you do not knowingly enter any false information in this form.</b>
		</span>
		<h2>Complete this form to generate the affidavit that will be used at your enrollment session.</h2>
		<div id="wrapper">
		<?php
		if ($nummissing > 0)
		{
			echo "<P class=\"warning\">We cannot proceed unless you fill in the $nummissing item".(($nummissing >1)?("s"):(""))." in red below.</P>";
		}
	/*
		if ($_POST && isset($missing))
		{ 
			echo "<p class=\"warning\">Please complete the missing item(s) indicated.</p>";
		}
		elseif ($_POST && $pdfmade)
		{
			echo "<p><strong>Your affidavit has been created.</strong></p>";
			include('includes/mail.inc.php');
		}
	*/
		?>
		<form id="feedback" method="post" action="">
<p>

		<?php
		echo inputfield("name","name","Full Name:",$missing,"Please enter your name");
		echo "</p><p>";
		echo inputfield("state","state","State to be enrolled in:",$missing,"Please enter the state you will be enrolling in");
		echo "</p><p>";
		echo inputfield("city","city","City to be enrolled in:",$missing,"Please enter the city you will be enrolling in");
		echo "</p><p>";
		echo inputfield("county","county","County to be enrolled in:",$missing,"Please enter the county you will be enrolling in");
		echo "</p><p>";
		echo inputfield("address","address","Home address:",$missing,"Please enter your address");
		echo "</p><p>";
		echo inputfield("addresscity","addresscity","Home city:",$missing,"");
		echo "</p><p>";
		echo inputfield("addressstate","addressstate","Home state:",$missing,"");
		echo "</p><p>";
		echo inputfield("email","email","Email address:",$missing,"Please give us your email address for further contact");
		echo "</p><p>";
		echo inputfield("birthname","birthname","Name given at birth",$missing,"You should give us your name as it appears on your birth certificate");
		echo "</p><p>";
		echo inputfield("birthdate","birthdate","Date of birth:","Please enter your birthdate");
		echo "</p><p>";
		echo inputfield("birthplace","birthplace","Place of birth (city and state):",$missing,"Please enter your birthplace");
		echo "</p><p>";
		echo inputfield("mom","mom","Mother's full name:",$missing,"Please enter your mother's full name");
		echo "</p><p>";
		echo inputfield("dad","dad","Father's full name:",$missing,"Please enter your father's full name");
		echo "</p><p>";
		echo inputfield("license","license","Driver's license number",$missing,"We need some credential which asserts your identity");
		//echo "</p><p>";
		echo inputfield("licensestate","licensestate","State issuing driver's license",$missing,"You need a driver's license");
		echo "</p><p>";
		echo inputfield("issued","issued","Date Issued:",$missing,"");
		echo "</p><p>";
		echo inputfield("expires","expires","Date of Expiration:",$missing,"");
		echo "</p><p>";
		echo "In addition, we shall be asking you for one other photo id:";
		echo "</p><p>";
		echo inputfield("passport","passport","Passport",$missing,"");
		echo "</p><p>";
		echo inputfield("military","military","Military ID",$missing,"");
		echo "</p><p>";
		echo inputfield("school","school","School ID",$missing,"");
		echo "</p><p>";
		echo inputfield("eyes","eyes","Eye Color:",$missing,"");
		echo "</p><p>";
		echo inputfield("height","heigher","Height:",$missing,"");
		echo "</p><p>";
		/*
		echo inputfield("race","race","(Is asking race allowed here, Wes?)",$missing,"");
		echo "</p><p>";
		*/
		echo "Optional Items";
		echo "</p><p>";
		echo inputfield("birthaddress","birthaddress","(optional) Address at time of birth:",$missing,"Please enter your address at the time you were born");
		echo "</p><P>";
		echo inputfield("nickname","nickname","(optional) Aliases, Nicknames:",$missing,"Please enter all of your aliases");
		echo "</p><p>";
		echo inputfield("social","social","(optional) Social Security number:",$missing,"Please enter your social security number");

		?>
		</p>
<p>
		<input name="send" id="send" value="Generate and send affidavit" type="submit" />
		</p></form></div>
</body></html>
<?PHP
}

echo "</BODY></HTML>";
?>