<?PHP
#A file to construct the NDA in pdf form, to be called by nda4.php or something else.
$address=mysql_getRow("select * from address where address_id=".$enrollee["address_id"]);
if (is_null($address))
  $address=mysql_getRow("select * from address where owner_id=$enrollee_id and address_type_id='ehom'");
$enrollee_name=makeName($enrollee);
include_once('includes/fpdf.php');
$pdfname=NDASTORAGE."/$enrollee_id.pdf";
$pdf=new FPDF();
$pdf->setDisplayMode("real");
$pdf->AddPage();
$pdf->SetFont('Times','B',16);
$pdf->Cell(0,5,'PERSONAL NONDISCLOSURE AGREEMENT',0,0,'C');
$pdf->SetFont('Times','',10);
$pdf->Ln(10);
$pdf->multiCell(0,5,"This Agreement is entered into this ".date('jS \d\a\y \of F, Y')." by and between "
  ."$enrollee_name, an individual whose legal residence is");
#$pdf->Ln();
$pdf->multiCell(0,5,str_replace("<BR>","\n",make_address($address)));
#$pdf->Ln();
$pdf->multiCell(0,5,"(hereinafter referred to as \"Owner\"), and ".OURLEGALNAME." (hereinafter referred to as \"Supplicant\"). ");
$pdf->Ln(5);
$pdf->multiCell(0,5,"Owner has established that all information that may be used to identify "
  .(($enrollee["gender"] == "m")?("himself"):("herself"))
  ." (hereinafter referred to as Personally Identifiable Information or PII) is to be "
  ."considered Proprietary and Confidential, specifically proprietary to "
  ."Owner and Confidential and to be disclosed only under license. "
  ."Such Personally Identifiable Information includes");
$pdf->Ln(5);
$pdf->Cell(10,5,"1.",0,0,"R");
$pdf->multiCell(0,5,"Name given on birth certificate");
$pdf->Cell(10,5,"2.",0,0,"R");
$pdf->multiCell(0,5,"Current name");
$pdf->Cell(10,5,"3.",0,0,"R");
$pdf->multiCell(0,5,"Diminutives, Nicknames, and Aliases");
$pdf->Cell(10,5,"4.",0,0,"R");
$pdf->multiCell(0,5,"Associations, linkages or bindings of any of the names above with any usernames, Identity Commons assertable identities such as OpenID, i-Card, i-Name, Shibboleth Name, etc.");
$pdf->Cell(10,5,"5.",0,0,"R");
$pdf->multiCell(0,5,"Associations, linkages or bindings of any of the names above with any electronic mail addresses or any telephone number");
$pdf->Cell(10,5,"6.",0,0,"R");
$pdf->multiCell(0,5,"Associations, linkages or bindings of any of the names above with any employer, membership organization, school, healthcare provider, insurer, bank or other financial institution");
$pdf->Cell(10,5,"7.",0,0,"R");
$pdf->multiCell(0,5,"Associations, linkages or bindings of any of the names above with any Physical Addresses including address of legal address above and all former addresses");
$pdf->Cell(10,5,"8.",0,0,"R");
$pdf->multiCell(0,5,"Associations, linkages or bindings of any of the names above with any personal biographical information including history, names of family members, names of schools attended, names of current or former employers, associations with any organization, real or personal property, vehicles and their registration numbers, or any other information which could in any way be used to develop an association between the names above and any entity.");
$pdf->Ln(5);
$pdf->multiCell(0,5,"Owner is hereby willing to disclose Personally Identifiable Information to Supplicant in connection with both parties' entering into a business relationship or other relationship and only under the following conditions:");
$pdf->Cell(10,5,"1.",0,0,"R");
$pdf->multiCell(0,5,"All Personally Identifiable Information disclosed shall fall within the terms of this Agreement.");
$pdf->Cell(10,5,"2.",0,0,"R");
$pdf->multiCell(0,5,"Supplicant agrees to take all reasonable precautions to safeguard Personally Identifiable Information disclosed to them by Owner and to hold in confidence for a period of ten (10) years all such Personally Identifiable Information except Personally Identifiable Information which, at the time of disclosure, was in the public domain by publication in a public directory; or");

$pdf->Cell(10,5,"3.",0,0,"R");
$pdf->multiCell(0,5,"It is necessary and desirable that certain Personally Identifiable Information be disclosed to Supplicant and that employees of Supplicant have contact with Owner. Supplicant acknowledges that the disclosure of Personally Identifiable Information, as defined in this Agreement, and the obligations herein are good consideration for Supplicant fulfilling its obligations under this Agreement, and that any Personally Identifiable Information which Owner discloses to Supplicant will be received and maintained by the Supplicant in trust and confidence.

Supplicant will take all necessary action to ensure that there is no unauthorized disclosure of Personally Identifiable Information by it or any of its employees or persons with whom it deals; and if it becomes necessary and proper for Supplicant to disclose proprietary information to any of its employees or persons with whom it deals, to hold such Personally Identifiable Information in trust and confidence subject to the restrictions in this Agreement.

Except as directly necessary for the performance of dealings between the parties, Supplicant will not reproduce, use or disclose to others any Personally Identifiable Information without the prior written consent of Owner.");

$pdf->Cell(10,5,"4.",0,0,"R");
$pdf->multiCell(0,5,"All Personally Identifiable Information of Owner will remain its own property, regardless of its disclosure to Supplicant. This information is a valuable personal asset and the protection of such information is therefore essential.

Within thirty (30) days following a request or the completion of business dealings between the parties, Supplicant will any and all copies of such Personally Identifiable Information; in which case Supplicant will destroy them and within such thirty (30) day period certify in writing their destruction.");

$pdf->Cell(10,5,"5.",0,0,"R");
$pdf->multiCell(0,5,"It is understood by both parties hereto that this Agreement does not constitute a license to use the Personally Identifiable Information other than as specified herein and further specified in Exhibit A.");
$pdf->Ln(5);
$pdf->multiCell(0,5,"Owner and Supplicant agree that this Agreement and all disputes arising hereunder are governed by the laws and courts of the Province and Canton of Geneva and that breach of this Agreement will cause irreparable harm to Owner. Both parties agree that in the event of breach of this Agreement, the injured party shall be entitled to equitable relief in addition to any other remedies it may have in order to restrain such breach. Equitable relief will include, but not be limited to, penalties for unauthorized disclosure of Personally Identifiable Information as specified by the Graham-Leach-Bliley Act of the United States of America. If Supplicant breaches or threatens to breach any of the Non-Disclosure covenants herein, Owner, in addition to any other remedies it may have at law or in equity, will be entitled to a restraining order, injunction, or similar remedy so as to specifically enforce such provisions. The parties acknowledge that money damages alone would be an inadequate remedy for injury which would be suffered by a breach of any of the provisions of this Agreement.");
$pdf->Ln(5);
$pdf->multiCell(0,5,"This Agreement constitutes the entire agreement between the parties hereto and its terms may not be modified, altered or cancelled except by further written agreement signed by Owner or an authorized officer of Supplicant or, if Supplicant is an individual, by Supplicant.");
$pdf->Ln(5);
$pdf->multiCell(0,5,"The parties hereto have indicated below their acceptance of this Agreement as of the date written above.");
$pdf->Ln(5);
$pdf->Cell(80,5,"OWNER");$pdf->Cell(0,5,"SUPPLICANT");
$pdf->Ln(5);
$pdf->Cell(80,5,"Signature: [to be digitally signed]");
$pdf->Cell(80,5,"Printed Name: $enrollee_name");$pdf->Cell(0,5,"Printed Name: ".OURCEONAME);
$pdf->Ln(15);
$pdf->Cell(80,5,"");$pdf->Cell(0,5,"Title: CEO, ".OURLEGALNAME);
$pdf->Ln(5);
$pdf->Cell(80,5,"Date:".date('jS \d\a\y \of F, Y'));$pdf->Cell(0,5,"Date: to be date stamped");

$pdf->addPage();
$pdf->SetFont('Times','B',16);
$pdf->Cell(0,5,'EXHIBIT A to PERSONAL NONDISCLOSURE AGREEMENT',0,0,'C');
$pdf->Ln(10);
$pdf->Cell(0,5,'LICENSE',0,0,'C');
$pdf->SetFont('Times','',10);
$pdf->Ln(10);
$pdf->multiCell(0,5,"Permitted use of Personally Identifiable Information as identified in the Personal Nondisclosure Agreement of which this Exhibit A is part is as follows:");
$pdf->multiCell(0,5,"Supplicant shall use Personally Identifiable Information of Owner in "
  ."order to assist Owner in establishing one or more cryptographic key "
  ."pairs, the signing of the public key(s) of those key pairs in order to "
  ."create an identity credential and the attestation of a certification "
  ."authority as to the reliability of that credential; and a personal "
  ."autobiographical work which will be deemed to be subject to the "
  ."provisions of the Personal Nondisclosure Agreement");
$pdf->multiCell(0,5,"[need a lawyer's
help with this - it is too self-referential]");

$pdf->Output($pdfname);
loggywoggy("NDA for $enrollee_id created at $pdfname .");
?>