LI_LEMONDE /DEV/LIB/homegallery_get_cache.class.php

Language PHP Lines 548
MD5 Hash 4fe7a39ac9aae526da257f4bd62f3598 Estimated Cost $8,033 (why?)
Repository https://github.com/chrisbst35/LI_LEMONDE.git View Raw File View Project SPDX
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
<?php
/*
Class de gestion de la galerie de la home logic-immo V6 (même si ce n'est pas une V6 gnagnagna)
@Version : V1.0.0
@Creator : SOFLOU
@Date : 2009-12-17
*/

if (isset($_GET['isAjax']) && $_GET['isAjax'] == 'yes') {
    include(dirname(realpath(__FILE__))."./../DISPLAY/modules/includes.php");
}


Class _Home_Gallery {

	private $CookieName  = "LISearchHistoryCookie"; //Cookie name who save the last search
    
	private $path_cache; //Path du cache
    
	private $arr_ads_toprint;
    
    private $firstvisit;

    private $paramsearch;
	

	public function __construct($val_cookie='', $univers=1,  $val_zipcode = '')
	{	
		
		if ($univers == 1)
		{
			$path_univers = "sale";
		}
		else if ($univers == 2)
		{
			$path_univers = "rent";	
		}
		else 
		{
			$path_univers = "coloc";	
		}
		
		$this->path_cache = URL_DATA."fr/cache_homegallery/".$path_univers."/"; //Path du cache
		
        // revisite (apres recherche)
        
		if (trim($val_cookie) <> "") {
            
            $this->firstvisit = false;
            
			$this->paramsearch = $this->Get_last_search($val_cookie);
            
            // echo "<hr>"; var_dump($this->paramsearch); echo "<hr>"; 
            if (
                    (!isset($this->paramsearch['loc_key1']) || empty($this->paramsearch['loc_key1']) || ($this->paramsearch['loc_key1']=='_'))
            ) {
                // cookie a moitie vide (arrive notamment quand on fait une 1ere visite puisqu'on clique sur le bon plan et qu'on retourne en HP)
                
                $this->firstvisit = true;
                
                $user_loc_data = get_object_vars(geoLocateByIp());
            
                if (is_array($user_loc_data) && !empty($user_loc_data['postalCode'])) {
                    $this->paramsearch['szip'] = substr($user_loc_data['postalCode'], 0,2);
                    for($i=2; $i>=0; $i--){
                        // var_dump($user_loc_data["loc_id_$i"]);
                        if($user_loc_data["loc_id_$i"]) {
                            $this->paramsearch['loc_key1'] = $user_loc_data["loc_id_$i"]."_$i";
                            break;
                        }
                    }
                } else {
                    // on part sur Paris, a defaut d'avoir un service de geoloc
                    $this->paramsearch['szip'] = '75';
                    $this->paramsearch['loc_key1'] = '100_1';
                }
                
            }
            
		} else {
            
            // premiere recherche
            
            $this->firstvisit = true;
            
            $user_loc_data = get_object_vars(geoLocateByIp());
            
            if (is_array($user_loc_data) && !empty($user_loc_data['postalCode'])) {
                $this->paramsearch['szip'] = substr($user_loc_data['postalCode'], 0,2);
                for($i=2; $i>=0; $i--){
                    // var_dump($user_loc_data["loc_id_$i"]);
                    if($user_loc_data["loc_id_$i"]) {
                        $this->paramsearch['loc_key1'] = $user_loc_data["loc_id_$i"]."_$i";
                        break;
                    }
                }
            } else {
                // on part sur Paris, a defaut d'avoir un service de geoloc
                $this->paramsearch['szip'] = '75';
                $this->paramsearch['loc_key1'] = '100_1';
            }
            
        }
		
		$this->arr_ads_toprint = $this->getAdsbyLoc($this->paramsearch['szip']);
		
		$this->arr_ads_toprint = $this->OptimizeGallery($this->firstvisit);
                
		if (is_array($this->arr_ads_toprint))
		{
			$this->PrintGallery($this->arr_ads_toprint);
		}
        
	}
    
	
	/* Décomposition du cookies */
	public function Get_last_search($val_cookie)
	{
		global $_global;

		//The real last serach is always at the row number 0		
        $last_search = fetchcookie(SEARCH_HISTORY_COOKIE_NAME);        
		$last_search = unserialize($last_search[0]);		
		
		if (!isset($last_search['szip']))
		{
			$last_search['szip'] = '75';
                        $last_search['loc_key1'] = '100_1';
		}else if($last_search['szip'] > 95) { // DOM TOM
                    $last_search['szip'] = substr($last_search['lzip'], 0, 3);
                }
		
		return $last_search;
	}
	

	/* Find Ads from SZIP */
	function getAdsbyLoc($szip = '75')
	{
		
        $arr_gallery = array();
        
        $file_cache = $this->path_cache.$szip.'/gallery.php';
        
        if (file_exists($file_cache)) {
            
            include($file_cache);
            //echo "file_cache = $file_cache<br>\n";
            // l'include retourne un $arr_gallery
            
        }
        
        return $arr_gallery;
        
	}
	
    
	/* Try to optimize the gallery array */
	public function OptimizeGallery($is_firstvisit=true)
	{
		global $_global;
        
        $gallery = $this->arr_ads_toprint;
        
        if ($is_firstvisit) { // 1ere visite (pas de recherche)
            
            $value_ads_loc_key = $this->paramsearch['loc_key1'];
            list($value_ads_loc_id, $value_ads_loc_level) = explode('_', $value_ads_loc_key);
            //echo 'loc_key = '; print_r($value_ads_loc_id); echo '_'; print_r($value_ads_loc_level);
            
            // types de bien Appartement, Maison, Villa
            $array_ads_property_type = array(1, 2, 7);
            
            $opti_gallery = $this->OptimizeGalleryCritera(
                                $gallery,
                                $array_ads_property_type,
                                $value_ads_loc_id,
                                $value_ads_loc_level
                            );
            
            //echo "Cas 0 : "; //print_r($opti_gallery); echo "<hr>";
            
            if(empty($opti_gallery)){
                $opti_gallery = $gallery;
            }
            
        } else { // revisite (apres recherche)
            
            $opti_gallery = array();
            
            // recherche de la localité par loc_id (si loc_level = 1 ou 2) ou lgc_id et lgn_id (si loc_level = 98 ou 99)
            $value_ads_loc_key = $this->paramsearch['loc_key1'];
            list($value_ads_loc_id, $value_ads_loc_level) = explode('_', $value_ads_loc_key);
            //echo 'loc_key = '; print_r($value_ads_loc_id); echo '_'; print_r($value_ads_loc_level);
            
            // recherche du (des) type(s) de bien, si spécifié(s)
            $array_ads_property_type = getPropertiesValuesFromCkPropertyType($this->paramsearch['ck_property_type'], $_global['univers']);
            //print_r($array_ads_property_type);

            // recherche du prix min et max, si spécifié(s)
            $value_ads_price_min = $this->paramsearch['price_min'];
            $value_ads_price_max = $this->paramsearch['price_max'];

            // recherche de la surface min et max, si spécifiée(s)
            $value_ads_area_min = $this->paramsearch['area_min'];
            $value_ads_area_max = $this->paramsearch['area_max'];
            
            //echo "LOC: ".$value_ads_loc_id.' - '.$value_ads_loc_level; echo "<br>";
            //echo "TYPE: ".print_r($array_ads_property_type, true); echo "<br>";
            //echo "PRICE: ".$value_ads_price_min.' - '.$value_ads_price_max; echo "<br>";
            //echo "AREA: ".$value_ads_area_min.' - '.$value_ads_area_max; echo "<br>";
            
            $opti_gallery = $this->OptimizeGalleryCritera(
                                $gallery,
                                $array_ads_property_type,
                                $value_ads_loc_id,
                                $value_ads_loc_level,
                                $value_ads_price_min,
                                $value_ads_price_max,
                                $value_ads_area_min,
                                $value_ads_area_max
                            );
            
            //echo "Cas 1 : "; //print_r($opti_gallery); echo "<hr>";
            
            // pas d'annonce => surface min diminuée de 20 %, surface max augmentée de 20%
            if (empty($opti_gallery)) {
                
                $value_ads_area_min = (!empty($this->paramsearch['area_min']) ? (int) ((1-0.2) * $this->paramsearch['area_min']) : '');
                $value_ads_area_max = (!empty($this->paramsearch['area_max']) ? (int) ((1+0.2) * $this->paramsearch['area_max']) : '');
                
                //echo "LOC: ".$value_ads_loc_id.' - '.$value_ads_loc_level; echo "<br>";
                //echo "TYPE: ".print_r($array_ads_property_type, true); echo "<br>";
                //echo "PRICE: ".$value_ads_price_min.' - '.$value_ads_price_max; echo "<br>";
                //echo "AREA: ".$value_ads_area_min.' - '.$value_ads_area_max; echo "<br>";
                
                $opti_gallery = $this->OptimizeGalleryCritera(
                                    $gallery,
                                    $array_ads_property_type,
                                    $value_ads_loc_id,
                                    $value_ads_loc_level,
                                    $value_ads_price_min,
                                    $value_ads_price_max,
                                    $value_ads_area_min,
                                    $value_ads_area_max
                                );
                
                //echo "Cas 2 : "; //print_r($opti_gallery); echo "<hr>";
                
            }
            
            // tjs pas d'annonce => prix min diminué de 20 %, prix max augmenté de 20%
            // (avec meme plage de surface que calcule precedemment)
            if (empty($opti_gallery)) {
                
                $value_ads_price_min = (!empty($this->paramsearch['price_min']) ? (int) ((1-0.2) * $this->paramsearch['price_min']) : '');
                $value_ads_price_max = (!empty($this->paramsearch['price_max']) ? (int) ((1+0.2) * $this->paramsearch['price_max']) : '');
                
                //echo "LOC: ".$value_ads_loc_id.' - '.$value_ads_loc_level; echo "<br>";
                //echo "TYPE: ".print_r($array_ads_property_type, true); echo "<br>";
                //echo "PRICE: ".$value_ads_price_min.' - '.$value_ads_price_max; echo "<br>";
                //echo "AREA: ".$value_ads_area_min.' - '.$value_ads_area_max; echo "<br>";
                
                $opti_gallery = $this->OptimizeGalleryCritera(
                                    $gallery,
                                    $array_ads_property_type,
                                    $value_ads_loc_id,
                                    $value_ads_loc_level,
                                    $value_ads_price_min,
                                    $value_ads_price_max,
                                    $value_ads_area_min,
                                    $value_ads_area_max
                                );
                
                //echo "Cas 3 : "; //print_r($opti_gallery); echo "<hr>";
                
            }
            
            // tjs pas d'annonce => remonter d'un niveau de hiérarchie de localité (si ville => departement)
            // (avec meme plage de prix et de surface que calcule precedemment)
            if (empty($opti_gallery)) {
                
                if (in_array($value_ads_loc_level, array(2, 98, 99))) {
                    
                    list($value_ads_loc_id, $value_ads_loc_level) = array();
                    
                    // requete, afin de recuperer l'id parent (departement)
                    $infos_ads_loc_key = get_loc_key($this->paramsearch['loc_key1']);
                    $value_ads_loc_parent_id = $infos_ads_loc_key['lct_parent_id'];
                    if (($value_ads_loc_parent_id >= 23) && ($value_ads_loc_parent_id <= 120)) {
                        $value_ads_loc_parent_level = 1; // departement
                        list($value_ads_loc_id, $value_ads_loc_level) = array($value_ads_loc_parent_id, $value_ads_loc_parent_level);
                    }
                    //echo 'loc_key = '; print_r($value_ads_loc_id); echo '_'; print_r($value_ads_loc_level);
                    
                    //echo "LOC: ".$value_ads_loc_id.' - '.$value_ads_loc_level; echo "<br>";
                    //echo "TYPE: ".print_r($array_ads_property_type, true); echo "<br>";
                    //echo "PRICE: ".$value_ads_price_min.' - '.$value_ads_price_max; echo "<br>";
                    //echo "AREA: ".$value_ads_area_min.' - '.$value_ads_area_max; echo "<br>";
                    
                    $opti_gallery = $this->OptimizeGalleryCritera(
                                        $gallery,
                                        $array_ads_property_type,
                                        $value_ads_loc_id,
                                        $value_ads_loc_level,
                                        $value_ads_price_min,
                                        $value_ads_price_max,
                                        $value_ads_area_min,
                                        $value_ads_area_max
                                    );
                    
                    //echo "Cas 4 : "; //print_r($opti_gallery); echo "<hr>";
                    
                } // sinon, on devrait avoir $value_ads_loc_level = 1
                
            }
            
            // tjs pas d'annonce => tirage au hasard d'une annonce du meme departement
            // (sans aucune plage de prix et de surface)
            if (empty($opti_gallery)) {
                
                $array_ads_property_type = array();
                
                $value_ads_price_min = $value_ads_price_max = '';
                
                $value_ads_area_min = $value_ads_area_max = '';
                
                //echo "LOC: ".$value_ads_loc_id.' - '.$value_ads_loc_level; echo "<br>";
                //echo "TYPE: ".print_r($array_ads_property_type, true); echo "<br>";
                //echo "PRICE: ".$value_ads_price_min.' - '.$value_ads_price_max; echo "<br>";
                //echo "AREA: ".$value_ads_area_min.' - '.$value_ads_area_max; echo "<br>";
                
                $opti_gallery = $this->OptimizeGalleryCritera(
                                    $gallery,
                                    $array_ads_property_type,
                                    $value_ads_loc_id,
                                    $value_ads_loc_level,
                                    $value_ads_price_min,
                                    $value_ads_price_max,
                                    $value_ads_area_min,
                                    $value_ads_area_max
                                );
                
                //echo "Cas 5 : "; //print_r($opti_gallery); echo "<hr>";
                
            }
            
            // Si tjs pas d'annonce, on prend toutes les annonces presentes dans le ficher de cache
            if (empty($opti_gallery) && !empty($gallery)) {
                
                $opti_gallery = $gallery; 
                
                //echo "Cas 6 : "; //print_r($opti_gallery); echo "<hr>";
                
            } else
                
            // Si tjs pas d'annonce on prend Paris par defaut
            if (empty($gallery)) {
                
                $file_cache = $this->path_cache.'/75/gallery.php';
                
                if (file_exists($file_cache)) {
                    
                    include($file_cache);
                    $opti_gallery = $arr_gallery;
                    
                    //echo "Cas 7 : "; //print_r($opti_gallery); echo "<hr>";
                    
                }
                
            }
            
        }
        
        // Bon plan jour = on ne garde que les 3 annonces les moins cheres
        //ON SUPPRIMME LE TRI SUR 3 ANNONCES MAIS ON GARDE LE SHUFFLE
		//$opti_gallery = array_slice($opti_gallery, 0, 3);
        //print_r($opti_gallery);
        
		shuffle($opti_gallery);
		
        // Bon plan jour = 1 annonce parmi parmi les 3 restantes
		$opti_gallery = array_slice($opti_gallery, 0, 1);
        //print_r($opti_gallery);
		
		return $opti_gallery;
        
	}
	
    
	/* Return ads filtered by critera */
	public function OptimizeGalleryCritera(
                                $gallery,
                                $array_ads_property_type,
                                $value_ads_loc_id,
                                $value_ads_loc_level,
                                $value_ads_price_min='',
                                $value_ads_price_max='',
                                $value_ads_area_min='',
                                $value_ads_area_max='') {
        
            //echo "LOC: ".$value_ads_loc_id.' - '.$value_ads_loc_level; echo "<br>";
            //echo "TYPE: ".print_r($array_ads_property_type, true); echo "<br>";
            //echo "PRICE: ".$value_ads_price_min.' - '.$value_ads_price_max; echo "<br>";
            //echo "AREA: ".$value_ads_area_min.' - '.$value_ads_area_max; echo "<br>";
            
            $opti_gallery = array();
        
            foreach ($gallery as $ad) {
                
                if (
                    (
                        (!empty($value_ads_loc_id) && !empty($value_ads_loc_level)) &&
                        // filtrage sur le loc_id (si loc_level = 1 ou 2)
                        (in_array($value_ads_loc_level, array(1, 2)) && ($ad['hierarchy'][$value_ads_loc_level]['lct_id'] == $value_ads_loc_id)) ||
                        // filtrage sur le lgc_id (si loc_level = 98)
                        (in_array($value_ads_loc_level, array(98)) && ($ad['lgc_id'] == $value_ads_loc_id)) ||
                        // filtrage sur le lgn_id (si loc_level = 99)
                        (in_array($value_ads_loc_level, array(99)) && ($ad['lgn_id'] == $value_ads_loc_id))
                    ) &&
                    // filtrage sur type(s) de bien, si spécifié
                    (empty($array_ads_property_type) || in_array($ad['property_type_id_orig'], $array_ads_property_type)) &&
                    // filtrage sur prix min, si spécifié
                    (empty($value_ads_price_min) || ($ad['real_price'] >= $value_ads_price_min)) &&
                    // filtrage sur prix max, si spécifié
                    (empty($value_ads_price_max) || ($ad['real_price'] <= $value_ads_price_max)) &&
                    // filtrage sur surface min, si spécifiée
                    (empty($value_ads_area_min) || ($ad['area'] >= $value_ads_area_min)) &&
                    // filtrage sur surface max, si spécifiée
                    (empty($value_ads_area_max) || ($ad['area'] <= $value_ads_area_max))
                ) {
                        //echo "[".$ad['lgc_id'].":".$ad['idx']."]"."\n";
                        array_push($opti_gallery, $ad);
                        
                }
                
            }
            
            return $opti_gallery;
        
    }
    
    
	/* Print Gallery */
	public function PrintGallery($tab_ads)
	{
		global $_global;
		
		if($_global['univers']==1) {
			$gallery_univers = "vente";
			$xitiClickImgId = 36;
		}
		else if($_global['univers']==2) {
			$gallery_univers = "location";
			$xitiClickImgId = 72;
		}
		else if($_global['univers']==8) {
			$gallery_univers = "colocation";
			$xitiClickImgId = 108;
		}
        
		foreach ($tab_ads as $ad) {
			
            // gallery datas
			$gallery_locality = ($ad["default_town_2"] == "" ? $ad["default_town_1"] : $ad["default_town_2"]);
			$gallery_zip_code = $ad["lzip"];
			$gallery_property_type = $ad["property_type"];
			$gallery_area = ($ad["area"] == 0? "" : $ad["area"]." m²");
			$gallery_nb_rooms = ($ad["nb_rooms"] == 0? "" : $ad["nb_rooms"]." pièce".($ad["nb_rooms"] > 1 ? "s" : ""));
			$gallery_id_photo = $ad["photos_id"][0];
			$gallery_price = ($ad["price"] == 0? "" : $ad["price"]." &euro;");
            
			// link to the detail page
			$gallery_detail_link = URL_SITE."detail-".$gallery_univers."-".strtolower($ad["id"]).".htm?ext=1";
            
			// bloc infos
			$temporary = array();
			if ($gallery_property_type != '') {
				$temporary[] = $gallery_property_type;
			}
			if ($gallery_area != 0) {
				$temporary[] = $gallery_area;
			}
			if ($gallery_nb_rooms != 0) {
				$temporary[] = $gallery_nb_rooms;
			}
			$gallery_infos	= implode(' &#9679; ', $temporary);
			
            // bloc text
            $gallery_local = '';
            if (!empty($gallery_locality) && !empty($gallery_zip_code)) {
                $gallery_local_title = $gallery_local = $gallery_locality.' ('.$gallery_zip_code.')';
                if (strlen($gallery_local) > 25) { // trop long, on ne garde que le nom
                    $gallery_local = $gallery_locality;
                    if (strlen($gallery_local) > 25) { // encore trop long, on tronque le nom
                        $gallery_local = truncate($gallery_local, 25);
                    }
                }
            } else if (!empty($gallery_locality)) {
                $gallery_local_title = $gallery_local = $gallery_locality;
            } else if (!empty($gallery_zip_code)) {
                $gallery_local_title = $gallery_local = $gallery_zip_code;
            }
            
            // links title
            $gallery_title = $gallery_local_title.(!empty($gallery_infos) ? ' - '.$gallery_infos : '').(!empty($gallery_price) ? ' - '.$gallery_price : '');
            
            // url photo
            $gallery_photo_url = get_urlmmf_anc_seo(MMF_FORMAT_FR_ANC_CROP_GALLERY, $gallery_id_photo, $ad["id"], $gallery_property_type, $gallery_locality, 'FR');
            
            
            // html content
            $content = "";
            $content .= "   <div class=\"spir_title spir_title-big\">L'ANNONCE DU JOUR</div>\n";
			$content .= "   <div class=\"container\">\n";
            if (!empty($gallery_photo_url)) {
                
                $img_alt = ucfirst($gallery_univers)." ".$gallery_property_type." ".$gallery_locality." ".$gallery_area." ".$gallery_nb_rooms;
                $content .= "       <a onclick=\"".getXitiClick($xitiClickImgId)."\" href=\"".$gallery_detail_link."\" title=\"".stripslashes($gallery_title)."\" class=\"img\">\n";
                $content .= "           <img width=\"280\" height=\"205\" border=\"0\" src=\"".$gallery_photo_url."\" alt=\"".stripslashes($img_alt)."\"/>\n";
                $content .= "       </a>\n";
            }
            
            if (!empty($gallery_detail_link) && !empty($gallery_title)) {
                $content .= "       <a href=\"".$gallery_detail_link."\" title=\"".stripslashes($gallery_title)."\" class=\"crit\">\n";
                $content .= "           <div class=\"crit\">\n";
                if (!empty($gallery_price)) {
                    $content .= "           <p class=\"crit_price\">".$gallery_price."</p>\n";
                }
                if (!empty($gallery_local)) {
                    $content .= "           <p class=\"crit_local\">".stripslashes($gallery_local)."</p>\n";
                }
                if (!empty($gallery_infos)) {
                    $content .= "           <p class=\"crit_infos\">".stripslashes($gallery_infos)."</p>\n";
                }
                $content .= "           </div>\n";
                $content .= "       </a>\n";
            }
			$content .= "</div>\n";
		}
		
		echo $content;
	}
    
}

?>
Back to Top