Subversion Repositories eFlore/Applications.cel

Rev

Rev 1655 | Rev 1664 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1652 raphael 1
<?php
2
 
3
// Include the main TCPDF library (search for installation path).
4
date_default_timezone_set("Europe/Paris");
5
require_once('tcpdf_config.php');
6
require_once('tcpdf/tcpdf.php');
7
 
1661 aurelien 8
//set_time_limit(6);
1652 raphael 9
Class GenerateurPDF {
10
 
11
	public $pdf;
12
 
13
	function GenerateurPDF($utilisateur = NULL) {
14
		// create new PDF document
15
		$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
16
 
17
		// set document information
18
		$pdf->SetCreator(PDF_CREATOR);
19
		$pdf->SetAuthor($utilisateur ? $utilisateur['prenom'] . ' ' . $utilisateur['nom'] : 'CEL - Tela Botanica');
20
		$pdf->SetTitle('Observations en étiquettes');
21
		$pdf->SetSubject('Étiquettes des observations');
22
		$pdf->SetKeywords('botaniques, observations, étiquettes, cel, tela-botanica');
23
 
24
		// set default header data
25
		// $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 005', PDF_HEADER_STRING);
26
 
27
		// set header and footer fonts
28
		// $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
29
		// $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
30
 
31
		// set default monospaced font
32
		$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
33
 
34
		// set margins
35
		$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
36
		$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
37
		$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
38
 
39
		// set auto page breaks
40
		// $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
41
		$pdf->SetAutoPageBreak(FALSE, PDF_MARGIN_BOTTOM);
42
 
1655 raphael 43
		$pdf->SetFont('times', '', 11);
1652 raphael 44
		$pdf->setCellPaddings(1, 1, 1, 1);
45
		$pdf->setCellMargins(1, 1, 1, 1);
46
 
1655 raphael 47
		$pdf->AddPage();
48
		$pdf->setEqualColumns(2);
49
 
1652 raphael 50
		$this->pdf = $pdf;
51
	}
52
 
53
 
54
 
55
	function export($obs) {
56
		$pdf = &$this->pdf;
57
 
58
		$i = 0;
59
		while($i < count($obs)) {
60
			$pdf->selectColumn(0);
61
			// Multicell test
1655 raphael 62
			$this->doHTMLcell($obs[$i++]); if(!isset($obs[$i])) break;
1652 raphael 63
			$pdf->Ln();
1655 raphael 64
			$this->doHTMLcell($obs[$i++]);  if(!isset($obs[$i])) break;
1652 raphael 65
			$pdf->Ln();
1655 raphael 66
			$this->doHTMLcell($obs[$i++]); if(!isset($obs[$i])) break;
1652 raphael 67
			/*$pdf->MultiCell(0, 25, self::doTemplate($obs), 1, 'L', 1, 1, '', '', true);
68
			  $pdf->MultiCell(0, 25, self::doTemplate($obs), 1, 'L', 1, 1, '', '', true);*/
69
 
70
			$pdf->selectColumn(1);
1655 raphael 71
			$this->doHTMLcell($obs[$i++]); if(!isset($obs[$i])) break;
1652 raphael 72
			$pdf->Ln();
1655 raphael 73
			$this->doHTMLcell($obs[$i++]); if(!isset($obs[$i])) break;
1652 raphael 74
			$pdf->Ln();
1655 raphael 75
			$this->doHTMLcell($obs[$i++]); if(!isset($obs[$i])) break;
1652 raphael 76
			/*$pdf->MultiCell(0, 25, self::doTemplate($obs), 1, 'L', 0, 1, '', '', true);
77
			$pdf->MultiCell(0, 25, self::doTemplate($obs), 1, 'L', 0, 1, '', '', true);
78
			$pdf->MultiCell(0, 25, self::doTemplate($obs), 1, 'L', 0, 1, '', '', true);*/
79
 
80
			if(isset($obs[$i])) $pdf->AddPage();
81
		}
82
	}
83
 
1655 raphael 84
	function getlinenb4($txt) {
85
		// store current object
86
		$this->pdf->startTransaction();
87
		// store starting values
88
		$start_y = $this->pdf->GetY();
89
		$start_page = $this->pdf->getPage();
90
 
91
		$this->pdf->MultiCell($this->column_width, $h=0, $txt, $border=0, $align='L', $fill=false, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0);
92
		$end_y = $this->pdf->GetY();
93
		$end_page = $this->pdf->getPage();
94
		// calculate height
95
		$height = 0;
96
		if ($end_page == $start_page) {
97
			$height = $end_y - $start_y;
98
		} else {
99
			for ($page=$start_page; $page <= $end_page; ++$page) {
100
				$this->setPage($page);
101
				if ($page == $start_page) {
102
					// first page
103
					$height = $this->pdf->h - $start_y - $this->pdf->bMargin;
104
				} elseif ($page == $end_page) {
105
					// last page
106
					$height = $end_y - $this->pdf->tMargin;
107
				} else {
108
					$height = $this->pdf->h - $this->pdf->tMargin - $this->bMargin;
109
				}
110
			}
111
		}
112
		// restore previous object
113
		$this->pdf = $this->pdf->rollbackTransaction();
114
		return $height;
115
	}
116
 
117
	function getlinenb3($txt) {
118
		return $this->pdf->getStringHeight($this->column_width, $txt);
119
	}
120
 
121
	function getlinenb2($txt) {
122
		//var_dump($line, $this->pdf->GetStringWidth($line));
123
		return ceil($this->pdf->GetStringWidth($txt)  / $this->column_width);
124
	}
125
 
126
	function getlinenb($txt) {
127
		return $this->pdf->getStringHeight('', $txt) / ($this->pdf->getFontSize() * $this->pdf->getCellHeightRatio());
128
	}
129
 
130
	// singe la propriété CSS3 "text-overflow" : "ellipsis"
131
	function elude($txt, $limite_lignes = 3) {
132
		// echo strlen($txt) . ' '.  $this->getlinenb($txt) . ' ' . $limite_lignes . "\n";
133
 
1661 aurelien 134
		$cell_paddings = $this->pdf->getCellPaddings();
135
		$marge = $cell_paddings['T'] + $cell_paddings['B'];
1655 raphael 136
		$line_height = $this->pdf->getStringHeight($this->column_width, "a") - $marge;
137
		if($limite_lignes > 1) {
138
			$lim = $line_height * $limite_lignes + $marge; // $line_height + ($line_height - $marge) * ($limite_lignes - 1);
139
		} else {
140
			$lim = $line_height + $marge;
141
		}
142
 
143
		while(strlen($txt) > 4 && ($nb = $this->getlinenb3(strip_tags($txt))) > $lim) {
144
			//echo "$nb / $line_height: $txt\n";
145
			// TODO: mb_internal_encoding()
146
			$txt = mb_substr($txt, 0, -4, 'UTF-8') . '…';
147
		}
148
		//echo "$txt: $nb / $limite_lignes \n";
149
		return $txt;
150
	}
151
 
152
 
153
	// TODO: affichage pays dans "localité"
1652 raphael 154
	// ORDER BY id_observation
155
	// italique pour nom d'espèce, mais pas auteur
1661 aurelien 156
	function doHTMLcell(&$obs) {
1655 raphael 157
		$this->pdf->setCellMargins(0,0,0,0);
158
		$width = $this->column_width = 98;
159
 
160
		//echo "cell_padding['T']: " . $this->pdf->getCellPaddings()['T'] . ", cell_padding['B']: " . $this->pdf->getCellPaddings()['B'] . "\n";
161
 
162
		$lh = $this->pdf->getFontSize() * $this->pdf->getCellHeightRatio();
163
		//$lh = $this->pdf->GetLineWidth();
164
 
165
		/*
166
		var_dump($this->pdf->GetLineWidth(),
167
				 $this->pdf->GetCharWidth("a"),
168
				 $this->pdf->getStringHeight(60, "Ê"),
169
				 $this->pdf->getHTMLFontUnits("plop"),
170
				 $this->pdf->GetStringWidth("aa"),
171
				 $lh,
172
 
173
				 5,
174
				 $this->getlinenb4("Observation : Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum..."),
175
				 $this->elude("Observation : Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum...", 5),
176
 
177
				 4,
178
				 $this->getlinenb4("Observation : Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor"),
179
				 $this->elude("Observation : Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum...", 4),
180
 
181
				 3,
182
				 $this->getlinenb4("Observation : Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet"),
183
				 $this->elude("Observation : Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum...", 3),
184
 
185
				 2,
186
				 $this->getlinenb4("Observation : Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore"),
187
				 $this->elude("Observation : Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum...", 2),
188
 
189
				 1,
190
				 $this->getlinenb4("Observation : Lorem ipsum dolor sit amet, consectetur"),
191
				 $this->elude("Observation : Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum...", 1)
192
		);
193
		die;
194
		*/
195
 
196
 
197
		/*		$str = '<strong>Observation</strong> : ' . $obs['commentaire'];
198
		echo $this->getlinenb(strip_tags($str)) . "\n";
199
		echo $this->getlinenb2(strip_tags($str)) . "\n";
200
		echo $this->pdf->getStringHeight($width, strip_tags($str)) . "\n";
201
		echo $this->pdf->getStringHeight($width, "a") . "\n";
202
		echo ( $this->pdf->getStringHeight($width, strip_tags($str)) / $this->pdf->getStringHeight($width, "a")) . "\n";
203
 
204
		die;*/
205
 
206
		// 3ème paramètre = '' equivalent à $this->pdf->getX()
207
		// 4ème paramètre = '' equivalent à $this->pdf->getY()
208
		// famille
209
		$this->pdf->writeHTMLCell($w = $width - 20, '', '', '',
210
								  $html = '<strong>Famille</strong> : ' . $obs['famille'],
211
								  $border = 'LT', $ln = 0, $fill = false, $reset = true, $align = 'L', $autopadding = true);
212
 
213
 
214
		// N°: TODO: writeHTMLCell() semble bugger
215
		$this->pdf->Cell($w = 20, '',
216
						 $txt = 'N° : ' . $obs['id_observation'], //. sprintf("%04d", $obs['ordre'])
217
						 $border = 'TR', $ln = 1, $align = 'L', $fill = false, $link = false, $stretch = 1, $ignore_min_height = false, $calign = 'T', $valign = 'M');
218
		/*$this->pdf->writeHTMLCell($w = 20, '', '', '',
219
								  $html = '<strong>N°</strong> : ' . $obs['id_observation'], //. sprintf("%04d", $obs['ordre']),
220
								  $border = 'TR', $ln = 1, $fill = true, $reset = true, $align = 'R', $autopadding = true);*/
221
 
222
		// espece
223
		$this->pdf->writeHTMLCell($w = $width, $lh * 2.5, '',  '',
224
								  //$html = '<strong>Espèce</strong> : ' . self::elude('Espèce : ', $obs['nom_ret'], 2),
225
								  $html = $this->elude('<strong>Espèce</strong> : ' . $obs['nom_ret'], 2),
226
								  $border = 'RL', $ln = 1, $fill = false, $reset = true, $align = 'L', $autopadding = true);
227
 
228
		// collecteur
229
		$this->pdf->writeHTMLCell($w = $width, '', '', '',
230
								  $html = '<strong>Collecteur</strong> : ' . $obs['prenom_utilisateur'] . ' ' . $obs['nom_utilisateur'],
231
								  $border = 'RL', $ln = 1, $fill = false, $reset = true, $align = 'L', $autopadding = true);
232
 
233
		// localité
234
		$this->pdf->writeHTMLCell($w = $width, $lh * 3.5, '', '',
235
								  //$html = "<strong>Localité</strong> : " .
236
								  //self::elude('Localité : ', sprintf("%s (%s)\n%s, %s [%s]", $obs['zone_geo'], $obs['ce_zone_geo'], $obs['lieudit'], $obs['station'], $obs['milieu'] ), 3),
237
								  // $html = self::elude(sprintf("<strong>Localité</strong> : %s (%s)\n%s, %s [%s]", $obs['zone_geo'], $obs['ce_zone_geo'], $obs['lieudit'], $obs['station'], $obs['milieu']), 3),
238
								  $html = $this->elude(sprintf("<strong>Localité</strong> : %s (%s)", $obs['zone_geo'], $obs['ce_zone_geo']), 2) . "\n" .
239
								  $this->elude(sprintf("%s, %s [%s]", $obs['lieudit'], $obs['station'], $obs['milieu']), 2),
240
								  $border = 'RL', $ln = 1, $fill = false, $reset = true, $align = 'L', $autopadding = true);
241
 
242
		// lon/lat
243
		$this->pdf->writeHTMLCell($w = $width, '', '', '',
244
								  $html = sprintf("<strong>Latitude / Longitude</strong> : %s  /  %s", $obs['latitude'], $obs['longitude']),
245
								  $border = 'RL', $ln = 1, $fill = false, $reset = true, $align = 'L', $autopadding = true);
246
 
247
		// commentaire
248
		$this->pdf->writeHTMLCell($w = $width, $lh * 4.5, '', '',
249
								  //$html = '<strong>Observation</strong> : ' . self::elude('Observation : ', $obs['commentaire']),
250
								  $html = self::elude('<strong>Observation</strong> : ' . $obs['commentaire'], 4),
251
								  $border = 'RL', $ln = 1, $fill = false, $reset = true, $align = 'L', $autopadding = true);
252
 
253
		// date
254
		$this->pdf->writeHTMLCell($w = $width, '', '', '',
255
								  $html = '<strong>Date</strong> : ' . strftime("%d/%m/%Y", strtotime($obs['date_observation'])),
256
								  $border = 'LBR', $ln = 1, $fill = false, $reset = true, $align = 'R', $autopadding = true);
257
 
258
	}
259
 
1652 raphael 260
	function docell($obs) {
261
		$this->pdf->setCellMargins(0,0,0,0);
262
 
263
		$this->pdf->Cell($w = 60, '',
264
						 $txt = 'Famille : ' . $obs['famille'],
1655 raphael 265
						 $border = 'LT', $ln = 0, $align = 'L', $fill = false, $link = false, $stretch = 1, $ignore_min_height = false, $calign = 'T', $valign = 'M');
1652 raphael 266
 
267
		$this->pdf->Cell($w = 20, '',
268
						 $txt = 'N° : ' . $obs['id_observation'] /*. sprintf("%04d", $obs['ordre']) */,
1655 raphael 269
						 $border = 'TR', $ln = 1, $align = 'L', $fill = false, $link = false, $stretch = 1, $ignore_min_height = false, $calign = 'T', $valign = 'M');
1652 raphael 270
 
271
		$this->pdf->Cell($w = 80, '',
272
						 $txt = 'Espèce : ' . $obs['nom_ret'],
1655 raphael 273
						 $border = 'RL', $ln = 1, $align = 'L', $fill = false, $link = false, $stretch = 1, $ignore_min_height = false, $calign = 'T', $valign = 'M');
1652 raphael 274
 
275
		$this->pdf->Cell($w = 80, '',
276
						 $txt = 'Collecteur : ' . $obs['prenom_utilisateur'] . ' ' . $obs['nom_utilisateur'],
1655 raphael 277
						 $border = 'RL', $ln = 1, $align = 'L', $fill = false, $link = false, $stretch = 1, $ignore_min_height = false, $calign = 'T', $valign = 'M');
1652 raphael 278
 
279
		$this->pdf->MultiCell(80, 20,
1655 raphael 280
							  $txt = sprintf("Localité : %s (%s)\n%s, %s", $obs['zone_geo'], $obs['ce_zone_geo'], $obs['lieudit'], $obs['station']),
281
							  $border = 'RL', 'L', 0, 1, '', '', true);
1652 raphael 282
 
283
		$this->pdf->Cell($w = 80, '',
284
						 $txt = sprintf("Latitude, Longitude : %s  /  %s", $obs['latitude'], $obs['longitude']),
1655 raphael 285
						 $border = 'RL', $ln = 1, $align = 'L', $fill = false, $link = false, $stretch = 1, $ignore_min_height = false, $calign = 'T', $valign = 'M');
1652 raphael 286
 
287
		$this->pdf->MultiCell(80, 20,
1655 raphael 288
							  $txt = 'Observation : ' . self::elude('Observation : ', $obs['commentaire']),
289
							  $border = 'RL', 'L', 0, 1, '', '', true);
1652 raphael 290
 
291
		$this->pdf->Cell($w = 80, '',
292
						 $txt = 'Date : ' . strftime("%d/%m/%Y", strtotime($obs['date_observation'])),
1655 raphael 293
						 $border = 'LBR', $ln = 1, $align = 'R', $fill = false, $link = false, $stretch = 1, $ignore_min_height = false, $calign = 'T', $valign = 'M');
1652 raphael 294
	}
295
 
296
 
1655 raphael 297
	// singe la propriété CSS3 "text-overflow" : "ellipsis"
298
	function elude_bis($intitule, $commentaire, $lignes = 3) {
1652 raphael 299
		// TODO: GetLineWidth, GetCharWidth()
1655 raphael 300
		$limite = $lignes /* lignes */ * 43 /* caractères */ - strlen($intitule);
301
		if(mb_strlen($commentaire) < $limite) return $commentaire;
302
		return mb_substr($commentaire, 0, $limite - 2) . '…';
1652 raphael 303
	}
304
 
305
 
306
	function export1($observations) {
307
		$pdf = &$this->pdf;
308
		// MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0)
309
 
310
		$pdf->setEqualColumns(2);
311
 
312
		$i = 0;
313
		while($i < count($observations)) {
314
			$obs = $observations[$i];
315
 
316
			$pdf->selectColumn(0);
317
			// Multicell test
318
			$pdf->MultiCell(0, 25, self::doTemplate($obs), 1, 'L', 1, 1, '', '', true);
319
			$pdf->MultiCell(0, 25, self::doTemplate($obs), 1, 'L', 1, 1, '', '', true);
320
			$pdf->MultiCell(0, 25, self::doTemplate($obs), 1, 'L', 1, 1, '', '', true);
321
			$pdf->Ln();
322
 
323
			$pdf->selectColumn(1);
324
			$pdf->MultiCell(0, 25, self::doTemplate($obs), 1, 'L', 0, 1, '', '', true);
325
			$pdf->MultiCell(0, 25, self::doTemplate($obs), 1, 'L', 0, 1, '', '', true);
326
			$pdf->MultiCell(0, 25, self::doTemplate($obs), 1, 'L', 0, 1, '', '', true);
327
 
328
			$i += 6;
329
			if(isset($observations[$i])) $pdf->AddPage();
330
		}
331
	}
332
 
333
	static function doTemplate($obs) {
334
		$pattern =
335
<<<EOF
336
Famille: %s (%d)
337
Espèce: %s
338
Collecteur: %s
339
Localité: %s
340
Observation: %s	 Date: %s
341
EOF;
342
		return sprintf($pattern,
343
 
344
					   $obs['famille'],
345
					   $obs['ordre'],
346
					   $obs['nom_ret'],
347
					   $obs['prenom_utilisateur'] . ' ' . $obs['nom_utilisateur'],
348
					   $obs['zone_geo'],
349
					   $obs['commentaire'],
350
					   strftime("%Y-%m-%d", strtotime($obs['date_observation']))
351
		);
352
 
353
	}
354
 
355
 
356
 
357
	function export2($observations) {
358
		$pdf = &$this->pdf;
359
 
360
		$pdf->setEqualColumns(2);
361
 
362
		$i = 0;
363
		$y = $pdf->getY();
364
		$x = $pdf->getX();
365
		while($i < count($observations)) {
366
			$obs = $observations[$i++];
367
 
368
			$pdf->selectColumn(0);
369
			// Multicell test
370
			$pdf->writeHTMLCell(0, 25, $x, $y + 25 * 0, self::doHTMLTemplate($obs), 1, 0, 0, true);
371
			$pdf->writeHTMLCell(0, 25, $x, $y + 25 * 1, self::doHTMLTemplate($obs), 1, 0, 0, true);
372
			$pdf->writeHTMLCell(0, 25, $x, $y + 25 * 2, self::doHTMLTemplate($obs), 1, 0, 0, true);
373
			//$pdf->Ln();
374
 
375
			$pdf->selectColumn(1);
376
			$pdf->writeHTMLCell(0, 25, $x, $y + 25 * 0, self::doHTMLTemplate($obs), 1, 1, 1, true);
377
			$pdf->writeHTMLCell(0, 25, $x, $y + 25 * 1, self::doHTMLTemplate($obs), 1, 1, 1, true);
378
			$pdf->writeHTMLCell(0, 25, $x, $y + 25 * 2, self::doHTMLTemplate($obs), 1, 1, 1, true);
379
 
380
			$i += 6;
381
			if(isset($observations[$i])) $pdf->AddPage();
382
		}
383
	}
384
 
385
	static function doHTMLTemplate($obs) {
386
		$pattern =
387
<<<EOF
388
<p>Famille: %s <span style="text-align: right">(%d)</span><br/>
389
Espèce: %s<br/>
390
Collecteur: %s<br/>
391
Localité: %s<br/>
392
Observation: %s	 Date: %s</p>
393
EOF;
394
		return sprintf($pattern,
395
 
396
					   $obs['famille'],
397
					   $obs['ordre'],
398
					   $obs['nom_ret'],
399
					   $obs['prenom_utilisateur'] . ' ' . $obs['nom_utilisateur'],
400
					   $obs['zone_geo'],
401
					   $obs['commentaire'],
402
					   strftime("%Y-%m-%d", strtotime($obs['date_observation']))
403
		);
404
 
405
	}
406
 
407
}