<?xml version="1.0" encoding="UTF-8"?>
<PGVReport access="PRIV_PUBLIC" icon="place">
	<!--
	@package PhpGedView
	@subpackage Reports
	@version $Id: bdmlist.xml 6595 2009-12-21 21:47:10Z canajun2eh $
	-->
	<PGVRTitle><PGVRvar var="pgv_lang[bdm]" /></PGVRTitle>
	<PGVRDescription>Prints a list of BIRT/DEAT/MARR events for individuals matching NAME or PLAC criteria.</PGVRDescription>
	<PGVRInput name="name" lookup="NAME" type="text"><PGVRvar var="pgv_lang[name]" /></PGVRInput>
	<PGVRInput name="bdmplace" lookup="PLAC" type="text"><PGVRvar var="factarray[PLAC]" /></PGVRInput>
	<PGVRInput name="birthdate1" lookup="DATE" type="text"><PGVRvar var="pgv_lang[birthdate1]" /></PGVRInput>
	<PGVRInput name="birthdate2" lookup="DATE" type="text"><PGVRvar var="pgv_lang[birthdate2]" /></PGVRInput>
	<PGVRInput name="deathdate1" lookup="DATE" type="text"><PGVRvar var="pgv_lang[deathdate1]" /></PGVRInput>
	<PGVRInput name="deathdate2" lookup="DATE" type="text"><PGVRvar var="pgv_lang[deathdate2]" /></PGVRInput>
	<PGVRInput name="sortby" type="select" default="BIRT:DATE" options="ID,NAME,BIRT:DATE,DEAT:DATE"><PGVRvar var="pgv_lang[sort_by]" /></PGVRInput>
	<PGVRInput name="pageSize" type="select" default="A4" options="letter,A3,A4,legal"><PGVRvar var="pgv_lang[page_size]" /></PGVRInput>
	<PGVRInput name="fonts" type="select" default="dejavusans" options="arialunicid0,dejavusans,helvetica"><PGVRvar var="pgv_lang[font]"/></PGVRInput>

	<!-- Header -->
	<PGVRStyle name="header" font="$fonts" size="15" style="b" />
	<!-- Page numbers text -->
	<PGVRStyle name="pagenum" font="$fonts" size="8"/>
	<!-- Standard text -->
	<PGVRStyle name="text" font="$fonts" size="9"/>
	<!-- Generated by style - required style name by the generator -->
	<PGVRStyle name="genby" font="$fonts" size="8" />
	<!-- Date text -->
	<PGVRStyle name="date" font="$fonts" size="8"/>
	<PGVRStyle name="small" font="$fonts" size="7"/>
	<PGVRStyle name="label" font="$fonts" size="10" style="b" />

	<PGVRDoc pageSize="$pageSize" orientation="landscape">
		<PGVRHeader>
			<PGVRCell align="center" newline="1" style="label"><PGVRvar var="pgv_lang[bdm]" /></PGVRCell>
			<PGVRCell align="center" newline="1" style="header">
				<PGVRif condition="$name!=''">
				    <PGVRvar var="name" /> 
				</PGVRif>
				<PGVRif condition="$bdmplace!=''">
					<PGVRvar var="bdmplace" />
				</PGVRif>
			</PGVRCell>
			<PGVRCell align="rightrtl" height="10" newline="1" style="pagenum"><PGVRvar var="pgv_lang[page]" /> <PGVRPageNum /> <PGVRvar var="pgv_lang[of]" /> <PGVRTotalPages /></PGVRCell>
			<!-- ID -->
			<PGVRSetVar name="fill" value="" />
			<PGVRif condition="$sortby=='ID'">
				<PGVRSetVar name="fill" value="#AAAAAA" />
			</PGVRif>
			<PGVRTextBox bgcolor="$fill" border="1" height="12" width="40">
				<PGVRText style="label"></PGVRText>
			</PGVRTextBox>
			<!-- Name -->
			<PGVRSetVar name="fill" value="" />
			<PGVRif condition="$sortby=='NAME'">
				<PGVRSetVar name="fill" value="#AAAAAA" />
			</PGVRif>
			<PGVRTextBox bgcolor="$fill" border="1" height="12" width="205">
				<PGVRText style="label"><PGVRvar var="pgv_lang[name]" /></PGVRText>
			</PGVRTextBox>
			<!-- Birth -->
			<PGVRSetVar name="fill" value="" />
			<PGVRif condition="$sortby=='BIRT:DATE'">
				<PGVRSetVar name="fill" value="#AAAAAA" />
			</PGVRif>
			<PGVRTextBox bgcolor="$fill" border="1" height="12" width="165">
			<!-- todo: do not print [-] if no dates are selected -->
				<PGVRText style="label">
					<PGVRvar var="factarray[BIRT]" />   [
					<PGVRif condition="$birthdate1!=''">
						<PGVRvar var="birthdate1" />
					</PGVRif>
					-
					<PGVRif condition="$birthdate2!=''">
						<PGVRvar var="birthdate2" />
					</PGVRif>
					]
				</PGVRText>
			</PGVRTextBox>
			<!-- Marrige -->
			<PGVRSetVar name="fill" value="" />
			<PGVRif condition="$sortby=='MARR:DATE'">
				<PGVRSetVar name="fill" value="#AAAAAA" />
			</PGVRif>
			<PGVRTextBox bgcolor="$fill" border="1" height="12" width="165">
				<PGVRText style="label"><PGVRvar var="factarray[MARR]" /></PGVRText>
			</PGVRTextBox>
			<!-- Death -->
			<PGVRSetVar name="fill" value="" />
			<PGVRif condition="$sortby=='DEAT:DATE'">
				<PGVRSetVar name="fill" value="#AAAAAA" />
			</PGVRif>
			<PGVRTextBox bgcolor="$fill" border="1" height="12" newline="1">
			<!-- todo: do not print [-] if no dates are selected -->
				<PGVRText style="label">
					<PGVRvar var="factarray[DEAT]" />   [
					<PGVRif condition="$deathdate1!=''">
						<PGVRvar var="deathdate1" />
					</PGVRif>
					-
					<PGVRif condition="$deathdate2!=''">
						<PGVRvar var="deathdate2" />
					</PGVRif>
					]
				</PGVRText>
			</PGVRTextBox>
		</PGVRHeader>

		<PGVRBody>
			<PGVRSetVar name="filter1" value="" />
			<PGVRif condition="$bdmplace!=''">
				<PGVRSetVar name="filter1" value=":PLAC CONTAINS $bdmplace" />
				<!-- todo: print only if BDM place is the searched place - use OR - search also on marriage place and date -->
			</PGVRif>

			<PGVRList list="individual" filter1="$filter1" filter2="BIRT:DATE GTE $birthdate1" filter3="BIRT:DATE LTE $birthdate2" filter4="DEAT:DATE GTE $deathdate1" filter5="DEAT:DATE LTE $deathdate2" filter6="NAME CONTAINS $name" sortby="$sortby">
				<PGVRSetVar name="spid" value="@ID" />

				<PGVRTextBox width="40" height="46">
					<PGVRText style="text">
						<PGVRGedcomValue tag="@id" />
					</PGVRText>
				</PGVRTextBox>

				<PGVRTextBox width="205" height="46">
					<PGVRText style="text">
						<PGVRGetPersonName id="" />
					</PGVRText>
					<PGVRText style="small">
						<br />   <PGVRvar var="pgv_lang[father]" />
						: <PGVRGedcom id="@FAMC"><PGVRGetPersonName id="@HUSB" /></PGVRGedcom>
						<br />   <PGVRvar var="pgv_lang[mother]" />
						: <PGVRGedcom id="@FAMC"><PGVRGetPersonName id="@WIFE" /></PGVRGedcom>
					</PGVRText>
				</PGVRTextBox>

				<PGVRTextBox width="165" height="46" border="1">
					<PGVRSetVar name="moreB" value="0" />
					<PGVRText style="small">
						<PGVRRepeatTag tag="BIRT">
							<PGVRif condition="$moreB==1">
								<br />
							</PGVRif>
							<PGVRvar var="factarray[DATE]" />
							: <PGVRGedcomValue tag="BIRT:DATE" />
							<br />  <PGVRvar var="factarray[PLAC]" />
							: <PGVRGedcomValue tag="BIRT:PLAC" />
							<br />  <PGVRvar var="factarray[SOUR]" />
							: <PGVRRepeatTag tag="BIRT:SOUR">
								<PGVRGedcomValue tag="SOUR" /> 
							</PGVRRepeatTag>
							<PGVRSetVar name="moreB" value="1" />
						</PGVRRepeatTag>
					</PGVRText>
				</PGVRTextBox>

				<PGVRTextBox width="165" height="46" border="1">
					<PGVRSetVar name="more" value="0" />
					<PGVRRepeatTag tag="FAMS">
						<PGVRText style="small">
							<PGVRGedcom id="@FAMS">
								<PGVRif condition="$more==1">
									<br />
									~~~~~~~~~~~~~~~~~~~~~~~~~~~
									<br />
								</PGVRif>
								<!-- todo: print the dates, places and sources of all the FAM MARR records -->
								<PGVRvar var="factarray[DATE]" />
								: <PGVRGedcomValue tag="MARR:DATE" />
								<br />  <PGVRvar var="factarray[PLAC]" />
								: <PGVRGedcomValue tag="MARR:PLAC" />
								<br />  <PGVRvar var="factarray[SOUR]" />
								: <PGVRRepeatTag tag="MARR:SOUR">
									<PGVRGedcomValue tag="SOUR" /> 
								</PGVRRepeatTag>
								<br />
								<PGVRvar var="pgv_lang[spouse]" />
								: 
								<PGVRif condition="$spid==@WIFE">
									<PGVRGetPersonName id="@HUSB" />
								</PGVRif>
								<PGVRif condition="$spid==@HUSB">
									<PGVRGetPersonName id="@WIFE" />
								</PGVRif>
								<PGVRSetVar name="more" value="1" />
							</PGVRGedcom>
						</PGVRText>
					</PGVRRepeatTag>
				</PGVRTextBox>

				<PGVRTextBox border="1" height="46" newline="1">
					<PGVRSetVar name="moreD" value="0" />
					<PGVRText style="small">
						<PGVRRepeatTag tag="DEAT">
							<PGVRif condition="$moreD==1">
								<br />
							</PGVRif>
							<PGVRvar var="factarray[DATE]" />
							: <PGVRGedcomValue tag="DEAT:DATE" />
							<br />  <PGVRvar var="factarray[PLAC]" />
							: <PGVRGedcomValue tag="DEAT:PLAC" />
							<br />  <PGVRvar var="factarray[SOUR]" />
							: <PGVRRepeatTag tag="DEAT:SOUR">
								<PGVRGedcomValue tag="SOUR" /> 
							</PGVRRepeatTag>
							<PGVRSetVar name="moreD" value="1" />
						</PGVRRepeatTag>
						<PGVRRepeatTag tag="BURI:CEME">
							<br /><PGVRvar var="factarray[CEME]" />
							: <PGVRGedcomValue tag="CEME" />
						</PGVRRepeatTag>
					</PGVRText>
				</PGVRTextBox>
				
			</PGVRList>

			<PGVRCell align="rightrtl" height="24" newline="1" style="label"><br />
				<PGVRvar var="pgv_lang[total_indis]" />
				: <PGVRListTotal />
			</PGVRCell>
		</PGVRBody>
		<PGVRFooter>
			<PGVRCell align="rightrtl" newline="1" style="date"><PGVRNow /></PGVRCell>
		</PGVRFooter>
	</PGVRDoc>
</PGVReport>
