228 lines
8.6 KiB
JavaScript
228 lines
8.6 KiB
JavaScript
//exec last execution: Fri Jun 12 2026 11:17:40 GMT+0200 (Midden-Europese zomertijd)
|
|
|
|
$par_Regels_per_pagina=18;
|
|
$par_Excel_Bestandsnaam_voorzien_van_datum=true;
|
|
$par_Excel_Bestandsnaam='ledenlijst';
|
|
|
|
$p_filename = $par_Excel_Bestandsnaam;
|
|
ifThen($par_Excel_Bestandsnaam_voorzien_van_datum,
|
|
$now = datetime\today();
|
|
$fmt = datetime\format($now, 'Europe/Amsterdam', 'DD-MM-YYYY');
|
|
$p_filename = string\concatenate($p_filename, ' ', $fmt);
|
|
);
|
|
$p_page_len = $par_Regels_per_pagina;
|
|
ifThen($p_page_len < 1, $p_page_len = 10;);
|
|
|
|
html = '';
|
|
logAdd(log);
|
|
|
|
$fields = string\concatenate(
|
|
'id, salutationName, initialsName, firstName, middleName, lastName, ',
|
|
'geboortedatum, geslacht, ',
|
|
'addressStreet, addressPostalCode, addressCity, addressCountry, ',
|
|
'emailAddress, phoneNumber, website, ',
|
|
'regiocode, lidnummer, ',
|
|
'balens, quasier, ',
|
|
'dispensatie, ',
|
|
'agbcode, rbcznummer, mCode, ',
|
|
'datumRegistratie, vakopleidingDatumDiploma, mBKDatum, datumVOG, ',
|
|
'geplandeAfstudeerdatum, einddatum ',
|
|
''
|
|
);
|
|
|
|
$rows = record\fetchManyHash('Contact', $fields, 'lastName', 'asc');
|
|
|
|
$n = array\length($rows);
|
|
logAdd(log, 'Contacts read: ', $n);
|
|
$h = '';
|
|
|
|
strAdd($h, '<div class="nvkhresult">');
|
|
|
|
$table = table\new('Aanhef', 'Initialen', 'Voornaam', 'Voorzetsel', 'Achternaam',
|
|
'Geboortedatum',
|
|
'Straat', 'Postcode', 'Plaats', 'Land',
|
|
'eMail', 'Telefoon',
|
|
'Regiocode', 'Lidnummer',
|
|
'Agbcode',
|
|
'Registratie',
|
|
'Praktijken Agbcode',
|
|
'Praktijken tel.',
|
|
'P1 Naam', 'P1 Straat', 'P1 Postcode', 'P1 Plaats', 'P1 Website',
|
|
'P2 Naam', 'P2 Straat', 'P2 Postcode', 'P2 Plaats', 'P2 Website',
|
|
'P3 Naam', 'P3 Straat', 'P3 Postcode', 'P3 Plaats', 'P3 Website'
|
|
);
|
|
table\rowsPerPage($table, $p_page_len);
|
|
table\filename($table, $p_filename);
|
|
|
|
$i = 0;
|
|
while($i < $n,
|
|
$e = array\at($rows, $i);
|
|
|
|
$regiocode = hash\get($e, 'regiocode');
|
|
$regiocode = $regiocode + 0;
|
|
$meenemen = $regiocode < 30;
|
|
$lastname = hash\get($e, 'lastName');
|
|
|
|
logAdd(log, 'info', 'regiocode=', $regiocode, ' lastName=', $lastname);
|
|
|
|
ifThen($meenemen,
|
|
$contact_id = hash\get($e, 'id');
|
|
$salutation = hash\get($e, 'salutationName');
|
|
$initials = hash\get($e, 'initialsName');
|
|
$firstname = hash\get($e, 'firstName');
|
|
$voorvoegsel = hash\get($e, 'middleName');
|
|
$street = hash\get($e, 'addressStreet');
|
|
$postalcode = hash\get($e, 'addressPostalCode');
|
|
$city = hash\get($e, 'addressCity');
|
|
$country = hash\get($e, 'addressCountry');
|
|
ifThen($country == null || $country == '', $country = 'Nederland');
|
|
$email = hash\get($e, 'emailAddress');
|
|
ifThen($email, $email = table\link(string\concatenate('mailto:', $email), $email));
|
|
$phone = hash\get($e, 'phoneNumber');
|
|
ifThen($website, $website = table\link(string\concatenate('http://', $website), $website, '_blank'));
|
|
$birth = hash\get($e, 'geboortedatum');
|
|
$gender = hash\get($e, 'geslacht');
|
|
$lidnr = hash\get($e, 'lidnummer');
|
|
$balens = hash\get($e, 'balens');
|
|
$quasir = hash\get($e, 'quasier');
|
|
$dispensatie = hash\get($e, 'dispensatie');
|
|
$agbcode = hash\get($e, 'agbcode');
|
|
$mcode = hash\get($e, 'mCode');
|
|
$rbcznr = hash\get($e, 'rbcznummer');
|
|
$registratie = hash\get($e, 'datumRegistratie');
|
|
$vakopleiding = hash\get($e, 'vakopleidingDatumDiploma');
|
|
$mbk = hash\get($e, 'mBKDatum');
|
|
$vog = hash\get($e, 'datumVOG');
|
|
$afstuderen = hash\get($e, 'geplandeAfstudeerdatum')
|
|
$einddatum = hash\get($e, 'einddatum');
|
|
|
|
$contact = entity\get('Contact', $contact_id);
|
|
$p1s = entity\getRelated($contact, 'accounts', 1, 'name', 'asc', 'type=', 'P1');
|
|
ifThenElse(array\length($p1s) == 1, $p1 = array\at($p1s, 0), $p1 = null);
|
|
$p2s = entity\getRelated($contact, 'accounts', 1, 'name', 'asc', 'type=', 'P2');
|
|
ifThenElse(array\length($p2s) == 1, $p2 = array\at($p2s, 0), $p2 = null);
|
|
$p3s = entity\getRelated($contact, 'accounts', 1, 'name', 'asc', 'type=', 'P3');
|
|
ifThenElse(array\length($p3s) == 1, $p3 = array\at($p3s, 0), $p3 = null);
|
|
|
|
$report = true;
|
|
ifThenElse($p1,
|
|
$p1_name = attr($p1, 'naam');
|
|
$p1_straat = attr($p1, 'shippingAddressStreet');
|
|
$p1_postcode = attr($p1, 'shippingAddressPostalCode');
|
|
$p1_plaats = attr($p1, 'shippingAddressCity');
|
|
$p1_land = attr($p1, 'shippngAddressCountry');
|
|
$p1_email = attr($p1, 'emailAddress');
|
|
$p1_phone = attr($p1, 'phoneNumber');
|
|
$p1_website = attr($p1, 'website');
|
|
$p1_op_internet = attr($p1, 'opInternet');
|
|
$p1_agbcode = attr($p1, 'agbcode');
|
|
,
|
|
$p1_name = '';
|
|
$p1_straat = '';
|
|
$p1_postcode = '';
|
|
$p1_plaats = '';
|
|
$p1_land = '';
|
|
$p1_email = '';
|
|
$p1_phone = '';
|
|
$p1_website = '';
|
|
$p1_op_internet = '';
|
|
$p1_agbcode = '';
|
|
);
|
|
|
|
ifThenElse($p2,
|
|
$p2_name = attr($p2, 'naam');
|
|
$p2_straat = attr($p2, 'shippingAddressStreet');
|
|
$p2_postcode = attr($p2, 'shippingAddressPostalCode');
|
|
$p2_plaats = attr($p2, 'shippingAddressCity');
|
|
$p2_land = attr($p2, 'shippngAddressCountry');
|
|
$p2_email = attr($p2, 'emailAddress');
|
|
$p2_phone = attr($p2, 'phoneNumber');
|
|
$p2_website = attr($p2, 'website');
|
|
$p2_op_internet = attr($p2, 'opInternet');
|
|
$p2_agbcode = attr($p2, 'agbcode');
|
|
,
|
|
$p2_name = '';
|
|
$p2_straat = '';
|
|
$p2_postcode = '';
|
|
$p2_plaats = '';
|
|
$p2_land = '';
|
|
$p2_email = '';
|
|
$p2_phone = '';
|
|
$p2_website = '';
|
|
$p2_op_internet = '';
|
|
$p2_agbcode = '';
|
|
);
|
|
|
|
ifThenElse($p3,
|
|
$p3_name = attr($p3, 'naam');
|
|
$p3_straat = attr($p3, 'shippingAddressStreet');
|
|
$p3_postcode = attr($p3, 'shippingAddressPostalCode');
|
|
$p3_plaats = attr($p3, 'shippingAddressCity');
|
|
$p3_land = attr($p3, 'shippngAddressCountry');
|
|
$p3_email = attr($p3, 'emailAddress');
|
|
$p3_phone = attr($p3, 'phoneNumber');
|
|
$p3_website = attr($p3, 'website');
|
|
$p3_op_internet = attr($p3, 'opInternet');
|
|
$p3_agbcode = attr($p3, 'agbcode');
|
|
,
|
|
$p3_name = '';
|
|
$p3_straat = '';
|
|
$p3_postcode = '';
|
|
$p3_plaats = '';
|
|
$p3_land = '';
|
|
$p3_email = '';
|
|
$p3_phone = '';
|
|
$p3_website = '';
|
|
$p3_op_internet = '';
|
|
$p3_agbcode = '';
|
|
);
|
|
|
|
$p_agbcode = '';
|
|
ifThenElse($p1_agbcode,
|
|
$p_agbcode = $p1_agbcode;
|
|
,
|
|
ifThenElse($p2_agbcode,
|
|
$p_agbcode = $p2_agbcode;
|
|
,
|
|
ifThen($p3_agbcode, $p_agbcode = $p3_agbcode;);
|
|
);
|
|
);
|
|
$p_phone = '';
|
|
ifThenElse($p1_phone,
|
|
$p_phone = $p1_phone;
|
|
,
|
|
ifThenElse($p2_phone,
|
|
$p_phone = $p2_phone;
|
|
,
|
|
ifThen($p3_phone, $p_phone = $p3_phone;);
|
|
);
|
|
);
|
|
|
|
|
|
ifThen($report,
|
|
table\add($table,
|
|
$salutation, $initials, $firstname, $voorvoegsel, $lastname,
|
|
$birth,
|
|
$street, $postalcode, $city, $country,
|
|
$email, $phone,
|
|
$regiocode, $lidnr,
|
|
$agbcode,
|
|
$registratie,
|
|
$p_agbcode,
|
|
$p_phone,
|
|
$p1_name, $p1_straat, $p1_postcode, $p1_plaats, $p1_website,
|
|
$p2_name, $p2_straat, $p2_postcode, $p2_plaats, $p2_website,
|
|
$p3_name, $p3_straat, $p3_postcode, $p3_plaats, $p3_website
|
|
);
|
|
);
|
|
|
|
);
|
|
|
|
$i = $i + 1;
|
|
);
|
|
|
|
strAdd($h, table\toHtml($table));
|
|
|
|
strAdd($h, '</div>');
|
|
|
|
html=$h; |