Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL & ~E_NOTICE); // report all errors except notices
- echo '
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta name="description" content="convert csv2vcf" />
- <meta name="keywords" content="csv2vcf" />
- <title>convert csv2vcf</title>
- <!-- external styles -->
- <link href="css/style.css" type="text/css" rel="stylesheet"/>
- </head>
- <body>
- <div class="boxShadows" id="headline">
- <h1>csv2vcf: convert *.csv to *.vcf</h1>
- ';
- /* === examples for different vCard Versions according to Wikpedia ===
- vCard 2.1
- BEGIN:VCARD
- VERSION:2.1
- N:Gump;Forrest;;Mr.
- FN:Forrest Gump
- ORG:Bubba Gump Shrimp Co.
- TITLE:Shrimp Man
- PHOTO;GIF:http://www.example.com/dir_photos/my_photo.gif
- TEL;WORK;VOICE:(111) 555-1212
- TEL;HOME;VOICE:(404) 555-1212
- ADR;WORK;PREF:;;100 Waters Edge;Baytown;LA;30314;United States of America
- LABEL;WORK;PREF;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:100 Waters Edge=0D=
- =0ABaytown\, LA 30314=0D=0AUnited States of America
- ADR;HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America
- LABEL;HOME;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:42 Plantation St.=0D=0A=
- Baytown, LA 30314=0D=0AUnited States of America
- EMAIL:[email protected]
- REV:20080424T195243Z
- END:VCARD
- vCard 3.0
- BEGIN:VCARD
- VERSION:3.0
- N:Gump;Forrest;;Mr.
- FN:Forrest Gump
- ORG:Bubba Gump Shrimp Co.
- TITLE:Shrimp Man
- PHOTO;VALUE=URI;TYPE=GIF:http://www.example.com/dir_photos/my_photo.gif
- TEL;TYPE=WORK,VOICE:(111) 555-1212
- TEL;TYPE=HOME,VOICE:(404) 555-1212
- ADR;TYPE=WORK,PREF:;;100 Waters Edge;Baytown;LA;30314;United States of Amer
- ica
- LABEL;TYPE=WORK,PREF:100 Waters Edge\nBaytown\, LA 30314\nUnited States of
- America
- ADR;TYPE=HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America
- LABEL;TYPE=HOME:42 Plantation St.\nBaytown\, LA 30314\nUnited States of Ame
- rica
- EMAIL:[email protected]
- REV:2008-04-24T19:52:43Z
- END:VCARD
- vCard 4.0
- BEGIN:VCARD
- VERSION:4.0
- N:Forrest;Gump;;Mr.;
- FN:Forrest Gump
- ORG:Bubba Gump Shrimp Co.
- TITLE:Shrimp Man
- PHOTO;MEDIATYPE=image/gif:http://www.example.com/dir_photos/my_photo.gif
- TEL;TYPE=work,voice;VALUE=uri:tel:+1-111-555-1212
- TEL;TYPE=home,voice;VALUE=uri:tel:+1-404-555-1212
- ADR;TYPE=work;LABEL="100 Waters Edge\nBaytown, LA 30314\nUnited States of A
- merica";PREF=1:;;100 Waters Edge;Baytown;LA;30314;United States of America
- ADR;TYPE=home;LABEL="42 Plantation St.\nBaytown, LA 30314\nUnited States of
- America":;;42 Plantation St.;Baytown;LA;30314;United States of America
- EMAIL:[email protected]
- REV:20080424T195243Z
- END:VCARD
- <p>You can put as separator: ',' ';' or tab </p>
- */
- if(isset($_REQUEST["convert"])) // detect upload of file
- {
- $allowedExts = array('csv','txt'); // MMM
- $maximumFileSizeInKBytes = 4096;
- $allowedExts_string = "";
- for($i=0;$i<count($allowedExts);$i++) {
- $allowedExts_string .= "*.".$allowedExts[$i].", ";
- }
- $maximumFileSizeInBytes = $maximumFileSizeInKBytes * 1024;
- // $delimiter = $_POST['_delimiter'] == 'tab' ? "\t" : $_POST['_delimiter'];
- $delimiter = $_POST['_delimiter'];
- if($_FILES)
- {
- if(checkExtension($allowedExts)) // MMM
- {
- if(($_FILES["file"]["size"] < $maximumFileSizeInBytes))
- {
- if ($_FILES["file"]["error"] > 0)
- {
- echo "Return Code: " . $_FILES["file"]["error"] . "<br>";
- }
- else
- {
- echo '<div id="uploadDetails">';
- echo "Name: ".$_FILES["file"]["name"]."<br>";
- echo "Type: " . $_FILES["file"]["type"] . "<br>";
- echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>";
- echo "Temp file: ".$_FILES["file"]["tmp_name"] . "<br>";
- // echo "field selector: ".$_POST['_delimiter']." ZZZ<br>";
- echo "field selector: '".$delimiter."' ZZZ<br>";
- convert($_FILES["file"]["tmp_name"]);
- echo '</div>';
- }
- }
- else
- {
- echo "File exceeds filezie limit of ".$maximumFileSizeInBytes."kByte.";
- }
- }
- else
- {
- echo "File was not a allowed filetypes: ".$allowedExts_string;
- }
- }
- }
- else
- {
- echo '
- <form method="post" enctype="multipart/form-data">
- <label for="file">Please select your File.csv then hit convert:</label>
- <input type="file" name="file" id="file" style="width: 100%;">
- <br />
- field selector :
- <select name="_delimiter" >
- <option value=" "></option>
- <option value=",">Comma</option>
- <option value=";">Semicolon</option>
- <option value=" ">Tab</option>
- </select><br />
- <input type="submit" name="convert" value="convert" style="width: 100%;">
- </form>
- <p>the following fields in the *.csv will be converted:</p>
- <div style="overflow:auto;white-space:nowrap;width:100%;" class="codecolorer-container bash default">
- <pre>
- First Name
- Last Name
- Display Name
- Nicknam
- E-mail Address
- E-mail 2 Address
- E-mail 3 Address
- Home Phone
- Business Phone
- Home Fax
- Business Fax
- Pager
- Mobile Phone
- Home Street
- Home Address 2
- Home City
- Home State
- Home Postal Code
- Home Country
- Business Address
- Business Address 2
- Business City
- Business State
- Business Postal Code
- Business Country
- Country Code
- Related name
- Job Title
- Department
- Organization
- Notes
- Birthday
- Anniversary
- Gender
- Web Page
- Web Page 2
- Categories
- </pre>
- </div>
- </div>
- ';
- }
- // <script type="text/javascript">
- //function set_form_fields(elem)
- //{
- // var delimiter = elem.options[elem.selectedIndex].value;
- // elem.form._delimiter;
- //}
- //</script>
- // MMM verifie que le fichier envoye a l'une des extensions de $allowedExts
- function checkExtension(array $allowedExts)
- {
- $upload_filename = $_FILES["file"]["name"];
- $upload_filename_array = explode(".", $upload_filename);
- $extension = strtolower(end($upload_filename_array));
- $key = array_search($extension, $allowedExts);
- return $key !== false;
- }
- function convert($filename_csv)
- {
- // $filename_csv = "export2016.06.24.csv";
- $lines_csv = file($filename_csv);
- $filename_extension = explode('.',$filename_csv);
- $filename_vcf = "./upload/".$_FILES["file"]["name"].".vcf";
- $file_vcf = fopen($filename_vcf, 'w') or die("can't open file");
- echo '<pre>generating vCard-Version: VERSION:2.1</pre>';
- // display name;phone0;phone1;phone2;phone3;phone4;phone5;phone6;phone7;phone8;phone9;phone10;phone11;phone12;phone13;phone14;phone15;phone16;phone17;phone18;phone19;
- // email0;email_type0;email_label0;email1;email_type1;email_label1;email2;email_type2;email_label2;email3;email_type3;email_label3;email4;email_type4;email_label4;email5;email_type5;email_label5;email6;email_type6;email_label6;email7;email_type7;email_label7;email8;email_type8;email_label8;email9;email_type9;email_label9;email10;email_type10;email_label10;email11;email_type11;email_label11;email12;email_type12;email_label12;email13;email_type13;email_label13;
- // pobox0;street0;city0;region0;postcode0;country0;type0;pobox1;
- // street1;city1;region1;postcode1;country1;type1;pobox2;street2;city2;region2;postcode2;country2;type2;pobox3;street3;city3;region3;postcode3;country3;type3;pobox4;street4;city4;region4;postcode4;country4;type4;pobox5;street5;city5;region5;postcode5;country5;type5;pobox6;street6;city6;region6;postcode6;country6;type6;pobox7;street7;city7;region7;postcode7;country7;type7;pobox8;street8;city8;region8;postcode8;country8;type8;pobox9;street9;city9;region9;postcode9;country9;type9;pobox10;street10;city10;region10;postcode10;country10;type10;pobox11;street11;city11;region11;postcode11;country11;type11;pobox12;street12;city12;region12;postcode12;country12;type12;pobox13;street13;city13;region13;postcode13;country13;type13;organistion0;title0;organistion1;title1;organistion2;title2;organistion3;title3;
- // ==== fields to match ====
- // display name
- // street0 city0 region0 postcode0
- // phone0 phone1 phone2 phone3
- // email0
- // organistion0
- // First Name;Last Name;Display Name;Nickname;E-mail Address;E-mail 2 Address;E-mail 3 Address;Home Phone;Business Phone;Home Fax;Business Fax;Pager;Mobile Phone;Home Street;Home Address 2;Home City;Home State;Home Postal Code;Home Country;Business Address;Business Address 2;Business City;Business State;Business Postal Code;Business Country;Country Code;Related name;Job Title;Department;Organization;Notes;Birthday;Anniversary;Gender;Web Page;Web Page 2;Categories
- // get all possible fields in android-vcf
- $length = count($lines_csv);
- for($i = 0;$i < $length;$i++)
- {
- if($i == 0)
- {
- $keys_csv = $lines_csv[$i];
- // $keys_csv = explode($delimiter,$keys_csv);
- $keys_csv = explode($_POST['_delimiter'],$keys_csv);
- // $keys_csv = explode(";",$keys_csv);
- }
- else
- {
- fwrite($file_vcf, "BEGIN:VCARD\n"); // what Version does this file have
- fwrite($file_vcf, "VERSION:2.1\n"); // what Version does this file have
- $values_csv = $lines_csv[$i];
- // $values_csv = explode($delimiter,$values_csv);
- $values_csv = explode($_POST['_delimiter'],$values_csv);
- // $values_csv = explode(";",$values_csv);
- $position1 = findPos("First Name", $keys_csv);
- $position2 = findPos("Last Name", $keys_csv);
- $position = $values_csv[$position1] . ";" . $values_csv[$position2]. ";;" ;
- if ( ( $position ) !== ";;;")
- {
- fwrite($file_vcf, "N:".$position."\n"); // N:Gump;Forrest;;Mr.
- }
- $position3 = findPos("Display Name", $keys_csv);
- $position = $values_csv[$position3];
- if ( !empty( $position ) )
- {
- fwrite($file_vcf, "FN:".$position."\n"); // FN:Forrest Gump
- }
- $position3 = findPos("E-mail Address", $keys_csv);
- $position = $values_csv[$position3];
- if ( !empty( $position ) )
- {
- fwrite($file_vcf, "EMAIL;TYPE=home:".$position."\n");
- }
- $position3 = findPos("E-mail 2 Address", $keys_csv);
- $position = $values_csv[$position3];
- if ( !empty( $position ) )
- {
- fwrite($file_vcf, "EMAIL;TYPE=work:".$position."\n");
- }
- $position3 = findPos("E-mail 3 Address", $keys_csv);
- $position = $values_csv[$position3];
- if ( !empty( $position ) )
- {
- fwrite($file_vcf, "EMAIL;TYPE=OTHER:".$position."\n");
- }
- // ORG:Bubba Gump Shrimp Co.
- // TITLE:Shrimp Man
- // PHOTO;GIF:http://www.example.com/dir_photos/my_photo.gif
- // if phone1 differs from phone0
- $position = findPos("Home Phone", $keys_csv);
- $phone0 = $values_csv[$position];
- if ( !empty( $phone0 ) )
- {
- fwrite($file_vcf, "TEL;TYPE=home:".$phone0."\n"); // phone0
- }
- $position = findPos("Business Phone", $keys_csv);
- $phone1 = $values_csv[$position];
- if ( !empty( $phone1 ) )
- {
- fwrite($file_vcf, "TEL;TYPE=work:".$phone1."\n"); // phone1
- }
- $position = findPos("Home Fax", $keys_csv);
- $phone2 = $values_csv[$position];
- if ( !empty( $phone2 ) )
- {
- fwrite($file_vcf, 'TEL;TYPE="fax,home":'.$phone2."\n"); // phone2
- }
- $position = findPos("Business Fax", $keys_csv);
- $phone3 = $values_csv[$position];
- if ( !empty( $phone3 ) )
- {
- fwrite($file_vcf, 'TEL;TYPE="fax,work":'.$phone3."\n"); // phone2
- }
- $position = findPos("Mobile Phone", $keys_csv);
- $phone4 = $values_csv[$position];
- if ( !empty( $phone4 ) )
- {
- fwrite($file_vcf, "TEL;TYPE=cell:".$phone4."\n"); // phone3
- }
- // ADR;HOME;PREF:;;100 Waters Edge;Baytown;LA;30314;United States of America
- $street0 = $values_csv[findPos("Home Street", $keys_csv)];
- $street1 = $values_csv[findPos("Home Address 2", $keys_csv)];
- $city0 = $values_csv[findPos("Home City", $keys_csv)];
- $region0 = $values_csv[findPos("Home State", $keys_csv)];
- $postcode0 = $values_csv[findPos("Home Postal Code", $keys_csv)];
- $country0 = $values_csv[findPos("Home Country", $keys_csv)];
- if ( ( !empty( $street0 ) ) || ( !empty( $street1 ) ) || ( !empty( $city0 ) ) || ( !empty( $region0 ) ) || ( !empty( $postcode0 ) ) || ( !empty( $country0 ) ) )
- {
- fwrite($file_vcf, "ADR;TYPE=home:".$street0.";".$street1.";".$city0.";".$region0.";".$postcode0.";".$country0."\n");
- }
- // ADR;WORK;PREF:;;100 Waters Edge;Baytown;LA;30314;United States of America
- $street0 = $values_csv[findPos("Business Address", $keys_csv)];
- $street1 = $values_csv[findPos("Business Address 2", $keys_csv)];
- $city0 = $values_csv[findPos("Business City", $keys_csv)];
- $region0 = $values_csv[findPos("Business State", $keys_csv)];
- $postcode0 = $values_csv[findPos("Business Postal Code", $keys_csv)];
- $country0 = $values_csv[findPos("Business Country", $keys_csv)];
- if ( ( !empty( $street0 ) ) || ( !empty( $street1 ) ) || ( !empty( $city0 ) ) || ( !empty( $region0 ) ) || ( !empty( $postcode0 ) ) || ( !empty( $country0 ) ) )
- {
- fwrite($file_vcf, "ADR;TYPE=work:".$street0.";".$street1.";".$city0.";".$region0.";".$postcode0.";".$country0."\n");
- }
- // LABEL;WORK;PREF;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:100 Waters Edge=0D==0 ABaytown\, LA 30314=0D=0AUnited States of America
- // ADR;HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America
- // LABEL;HOME;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:42 Plantation St.=0D=0A=
- // Baytown, LA 30314=0D=0AUnited States of America
- // Web page
- $position = findPos("Web Page", $keys_csv);
- if ( !empty( $values_csv[$position] ) )
- {
- fwrite($file_vcf, "URL;VALUE=URI:".$values_csv[$position]."\n"); // email0 // EMAIL:
- }
- // Web page
- $position = findPos("Web Page 2", $keys_csv);
- if ( !empty( $values_csv[$position] ) )
- {
- fwrite($file_vcf, "URL;VALUE=URI:".$values_csv[$position]."\n"); // email1 // EMAIL:
- }
- // NOTE
- $position = findPos("Notes", $keys_csv);
- if ( !empty( $values_csv[$position] ) )
- {
- fwrite($file_vcf, "NOTE:".$values_csv[$position]."\n");
- }
- // Birthday
- $position = findPos("Birthday", $keys_csv);
- if ( !empty( $values_csv[$position] ) )
- {
- fwrite($file_vcf, "BDAY:".$values_csv[$position]."\n");
- }
- // Categories
- $position = findPos("Categories", $keys_csv);
- if ( !empty( $values_csv[$position] ) )
- {
- fwrite($file_vcf, "CATEGORIES :".$values_csv[$position]."\n"); // email0 // EMAIL:
- }
- fwrite($file_vcf, "END:VCARD"."\n"); // END:VCARD
- }
- }
- fclose($file_vcf);
- // move_uploaded_file($_FILES["file"]["tmp_name"],"upload/".$_FILES["file"]["name"]);
- echo "<pre> ".$length." entries transformed</pre>";
- echo '<span style="color: green; font-weight: bold;">Please DOWNLOAD RESULT: <a href="'.$filename_vcf.'">'.$filename_vcf.'</a></span>'; // $_FILES["file"]["name"]
- echo '<h1><a href="index.php">Do it again</a></h1>';
- // header("Content-type: text/plain");
- // header('Content-Disposition: attachment; filename="'.$filename_vcf.'"');
- /*
- echo '<h1>The result will selfdestruct in 60 seconds</h1>';
- sleep(60);
- if(!unlink($filename_vcf))
- {
- echo ("Error deleting ".$filename_vcf);
- }
- else
- {
- echo ("Deleted ".$filename_vcf);
- }
- */
- }
- /* determine position of a value in an number-indexed array */
- function findPos($value,$array)
- {
- $result = null;
- $length = count($array);
- for($i=0;$i<$length;$i++)
- {
- if($array[$i] == $value)
- {
- $result = $i;
- break;
- }
- }
- return $result;
- }
- echo '
- </div>
- <div class="boxShadows" id="headline">';
- if ($_POST['_delimiter'] == ';')
- {
- echo '
- <p>EXAMPLE INPUT with ";" : this goes in:</p>
- <div style="overflow:auto;white-space:nowrap;width:100%;" class="codecolorer-container bash default">
- <pre>
- First Name;Last Name;Display Name;Nickname;E-mail Address;E-mail 2 Address;E-mail 3 Address;Home Phone;Business Phone;Home Fax;Business Fax;Pager;Mobile Phone;Home Street;Home Address 2;Home City;Home State;Home Postal Code;Home Country;Business Address;Business Address 2;Business City;Business State;Business Postal Code;Business Country;Country Code;Related name;Job Title;Department;Organization;Notes;Birthday;Anniversary;Gender;Web Page;Web Page 2;Categories
- Aprenom1 Anom1;;Aprenom1 Anom1;;[email protected];[email protected];;+33 1 23 45 67 89;+33 2 87 65 43 21;+33 9 12 34 56 78;+33 9 87 65 43 21;;+33 6 12 34 56 78;rue1;rue2;meylan;rhone alpes;38240;france;rue1T;rue2T;Grenoble;isere;38000;france;;;;;;notes;1604-12-08 00:00:00;;;;;test
- Aprenom2;Anom2;Aprenom2 Anom2;;[email protected];[email protected];;+33 1 23 45 67 89;+33 9 12 34 76 78;;;;+33 6 56 78 12 34;rue D;rue D étendue;ville D;paca D;12345;france;rue T;rue T étendue;ville T;paca T;23456;france;;;;;;note lig 1 note lig 2 note lig 3;2020-01-05 00:00:00;;;www.xxx.com;;test
- Aprenom3;Anom3;Aprenom3 Anom3;;;;;;;;;;+33 6 12 34 56 78;;;;;;;;;;;;;;;;;;;;;;;;test
- Aprenom5;Anom5;Aprenom5 Anom5;;;;;;+33 9 87 65 43 21;;;;;;;;;;;;;;;;;;;;;;;;;;;;test
- Aprenom4;Anom4;Aprenom4 Anom4;;;;;+33 1 23 45 67 89;+33 9 12 34 56 78;;;;+33 6 87 65 43 21;;;;;;;;;;;;;;;;;;;;;;;;test
- Aprenom7;Anom7;Aprenom7 Anom7;;;;;+33 1 23 45 67 89;;;;;;;;;;;;;;;;;;;;;;;;;;;;;test
- ;Aprenom Anom;Aprenom Anom;;[email protected];[email protected];[email protected];+33 9 12 34 56 78;+33 9 87 65 43 21;+33 8 12 34 56 78;+33 8 87 65 43 21;;+33 6 12 56 34 78;rueD;;VILLED;;01234;;rueT;;VilleT;;34567;;;;;;;notes en tout genre AAAAAA aaaaaa;2019-12-18 00:00:00;;;;;test
- ;;Aprenom6 Anom6;;;;;+33 1 23 45 67 89;;;;;;;;;;;;;;;;;;;;;;;;;;;;;test
- </pre>
- </div>';
- }
- else
- if ($_POST['_delimiter'] == '\t')
- {
- echo '
- <p>EXAMPLE INPUT with " " : this goes in:</p>
- <div style="overflow:auto;white-space:nowrap;width:100%;" class="codecolorer-container bash default">
- First Name Last Name Display Name Nickname E-mail Address E-mail 2 Address E-mail 3 Address Home Phone Business Phone Home Fax Business Fax Pager Mobile Phone Home Street Home Address 2 Home City Home State Home Postal Code Home Country Business Address Business Address 2 Business City Business State Business Postal Code Business Country Country Code Related name Job Title Department Organization Notes Birthday Anniversary Gender Web Page Web Page 2 Categories
- Aprenom1 Anom1 Aprenom1 Anom1 [email protected] [email protected] +33 1 23 45 67 89 +33 2 87 65 43 21 +33 9 12 34 56 78 +33 9 87 65 43 21 +33 6 12 34 56 78 rue1 rue2 meylan rhone alpes 38240 france rue1T rue2T Grenoble isere 38000 france notes 1604-12-08 00:00:00 test
- Aprenom2 Anom2 Aprenom2 Anom2 [email protected] [email protected] +33 1 23 45 67 89 +33 9 12 34 76 78 +33 6 56 78 12 34 rue D rue D étendue ville D paca D 12345 france rue T rue T étendue ville T paca T 23456 france note lig 1 note lig 2 note lig 3 2020-01-05 00:00:00 www.xxx.com test
- Aprenom3 Anom3 Aprenom3 Anom3 +33 6 12 34 56 78 test
- Aprenom5 Anom5 Aprenom5 Anom5 +33 9 87 65 43 21 test
- Aprenom4 Anom4 Aprenom4 Anom4 +33 1 23 45 67 89 +33 9 12 34 56 78 +33 6 87 65 43 21 test
- Aprenom7 Anom7 Aprenom7 Anom7 +33 1 23 45 67 89 test
- Aprenom Anom Aprenom Anom [email protected] [email protected] [email protected] +33 9 12 34 56 78 +33 9 87 65 43 21 +33 8 12 34 56 78 +33 8 87 65 43 21 +33 6 12 56 34 78 rueD VILLED 01234 rueT VilleT 34567 notes en tout genre AAAAAA aaaaaa 2019-12-18 00:00:00 test
- Aprenom6 Anom6 +33 1 23 45 67 89 test
- </pre>
- </div>';
- }
- else
- {
- echo '
- <p>EXAMPLE INPUT with "," : this goes in:</p>
- <div style="overflow:auto;white-space:nowrap;width:100%;" class="codecolorer-container bash default">
- <pre>
- First Name,Last Name,Display Name,Nickname,E-mail Address,E-mail 2 Address,E-mail 3 Address,Home Phone,Business Phone,Home Fax,Business Fax,Pager,Mobile Phone,Home Street,Home Address 2,Home City,Home State,Home Postal Code,Home Country,Business Address,Business Address 2,Business City,Business State,Business Postal Code,Business Country,Country Code,Related name,Job Title,Department,Organization,Notes,Birthday,Anniversary,Gender,Web Page,Web Page 2,Categories
- Aprenom1 Anom1,,Aprenom1 Anom1,,[email protected],[email protected],,+33 1 23 45 67 89,+33 2 87 65 43 21,+33 9 12 34 56 78,+33 9 87 65 43 21,,+33 6 12 34 56 78,rue1,rue2,meylan,rhone alpes,38240,france,rue1T,rue2T,Grenoble,isere,38000,france,,,,,,notes,1604-12-08 00:00:00,,,,,test
- Aprenom2,Anom2,Aprenom2 Anom2,,[email protected],[email protected],,+33 1 23 45 67 89,+33 9 12 34 76 78,,,,+33 6 56 78 12 34,rue D,rue D étendue,ville D,paca D,12345,france,rue T,rue T étendue,ville T,paca T,23456,france,,,,,,note lig 1 note lig 2 note lig 3,2020-01-05 00:00:00,,,www.xxx.com,,test
- Aprenom3,Anom3,Aprenom3 Anom3,,,,,,,,,,+33 6 12 34 56 78,,,,,,,,,,,,,,,,,,,,,,,,test
- Aprenom5,Anom5,Aprenom5 Anom5,,,,,,+33 9 87 65 43 21,,,,,,,,,,,,,,,,,,,,,,,,,,,,test
- Aprenom4,Anom4,Aprenom4 Anom4,,,,,+33 1 23 45 67 89,+33 9 12 34 56 78,,,,+33 6 87 65 43 21,,,,,,,,,,,,,,,,,,,,,,,,test
- Aprenom7,Anom7,Aprenom7 Anom7,,,,,+33 1 23 45 67 89,,,,,,,,,,,,,,,,,,,,,,,,,,,,,test
- ,Aprenom Anom,Aprenom Anom,,[email protected],[email protected],[email protected],+33 9 12 34 56 78,+33 9 87 65 43 21,+33 8 12 34 56 78,+33 8 87 65 43 21,,+33 6 12 56 34 78,rueD,,VILLED,,01234,,rueT,,VilleT,,34567,,,,,,,notes en tout genre AAAAAA aaaaaa,2019-12-18 00:00:00,,,,,test
- ,,Aprenom6 Anom6,,,,,+33 1 23 45 67 89,,,,,,,,,,,,,,,,,,,,,,,,,,,,,test
- </pre>
- </div>';
- }
- echo '
- </div>
- <div class="boxShadows" id="headline">
- <p>this comes out: (this is what android contact book understands)</p>
- <div style="overflow:auto;white-space:nowrap;width:100%;" class="codecolorer-container bash default">
- <pre>
- BEGIN:VCARD
- VERSION:2.1
- N:Aprenom1 Anom1;;;
- FN:Aprenom1 Anom1
- EMAIL;TYPE=home:[email protected]
- EMAIL;TYPE=work:[email protected]
- TEL;TYPE=home:+33 1 23 45 67 89
- TEL;TYPE=work:+33 2 87 65 43 21
- TEL;TYPE="fax,home":+33 9 12 34 56 78
- TEL;TYPE="fax,work":+33 9 87 65 43 21
- TEL;TYPE=cell:+33 6 12 34 56 78
- ADR;TYPE=home:rue1;rue2;meylan;rhone alpes;38240;france
- ADR;TYPE=work:rue1T;rue2T;Grenoble;isere;38000;france
- NOTE:notes
- BDAY:1604-12-08 00:00:00
- END:VCARD
- BEGIN:VCARD
- VERSION:2.1
- N:Aprenom2;Anom2;;
- FN:Aprenom2 Anom2
- EMAIL;TYPE=home:[email protected]
- EMAIL;TYPE=work:[email protected]
- TEL;TYPE=home:+33 1 23 45 67 89
- TEL;TYPE=work:+33 9 12 34 76 78
- TEL;TYPE=cell:+33 6 56 78 12 34
- ADR;TYPE=home:rue D;rue D étendue;ville D;paca D;12345;france
- ADR;TYPE=work:rue T;rue T étendue;ville T;paca T;23456;france
- URL;VALUE=URI:www.xxx.com
- NOTE:note lig 1 note lig 2 note lig 3
- BDAY:2020-01-05 00:00:00
- END:VCARD
- BEGIN:VCARD
- VERSION:2.1
- N:Aprenom3;Anom3;;
- FN:Aprenom3 Anom3
- TEL;TYPE=cell:+33 6 12 34 56 78
- END:VCARD
- BEGIN:VCARD
- VERSION:2.1
- N:Aprenom5;Anom5;;
- FN:Aprenom5 Anom5
- TEL;TYPE=work:+33 9 87 65 43 21
- END:VCARD
- BEGIN:VCARD
- VERSION:2.1
- N:Aprenom4;Anom4;;
- FN:Aprenom4 Anom4
- TEL;TYPE=home:+33 1 23 45 67 89
- TEL;TYPE=work:+33 9 12 34 56 78
- TEL;TYPE=cell:+33 6 87 65 43 21
- END:VCARD
- BEGIN:VCARD
- VERSION:2.1
- N:Aprenom7;Anom7;;
- FN:Aprenom7 Anom7
- TEL;TYPE=home:+33 1 23 45 67 89
- END:VCARD
- BEGIN:VCARD
- VERSION:2.1
- N:;Aprenom Anom;;
- FN:Aprenom Anom
- EMAIL;TYPE=home:[email protected]
- EMAIL;TYPE=work:[email protected]
- EMAIL;TYPE=OTHER:[email protected]
- TEL;TYPE=home:+33 9 12 34 56 78
- TEL;TYPE=work:+33 9 87 65 43 21
- TEL;TYPE="fax,home":+33 8 12 34 56 78
- TEL;TYPE="fax,work":+33 8 87 65 43 21
- TEL;TYPE=cell:+33 6 12 56 34 78
- ADR;TYPE=home:rueD;;VILLED;;01234;
- ADR;TYPE=work:rueT;;VilleT;;34567;
- NOTE:notes en tout genre AAAAAA aaaaaa
- BDAY:2019-12-18 00:00:00
- END:VCARD
- BEGIN:VCARD
- VERSION:2.1
- FN:Aprenom6 Anom6
- TEL;TYPE=home:+33 1 23 45 67 89
- END:VCARD
- </pre>
- </div>
- </div>
- </body>
- </html>
- ';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement