2020-12-10 15:49:47 +01:00
< ? php
2020-12-11 23:30:55 +01:00
require_once ( 'lib/Gchange.class.php' );
2020-12-10 15:49:47 +01:00
include ( 'header.php' );
if ( ! isset ( $_POST [ 'city' ])) {
echo '
2020-12-11 23:30:55 +01:00
< h2 > Ça se passe près de chez vous & #8239;!</h2>
2020-12-10 15:49:47 +01:00
2020-12-11 23:30:55 +01:00
< form method = " get " action = " mytown.php " >
2020-12-10 15:49:47 +01:00
< p >
2020-12-11 23:30:55 +01:00
< label > Ville ou code postal & nbsp ; :
< input type = " text " name = " location " />
2020-12-10 15:49:47 +01:00
</ label >
</ p >
< p >
2020-12-11 23:30:55 +01:00
< input type = " submit " value = " Voir les annonces près de chez moi " />
2020-12-10 15:49:47 +01:00
</ p >
</ form > ' ;
}
2020-12-11 23:30:55 +01:00
$gchange = new Gchange ();
$offers = $gchange -> getShippable ();
echo '<h2>Livré à votre domicile</h2>' ;
echo '<p>Retrouvez ici toutes les annonces pour lesquelles le vendeur a mentionné "envoi possible" dans son annonce.</p>' ;
echo '<ol>' ;
foreach ( $offers as $offer ) {
$description = isset ( $offer -> _source -> description ) ? ' title="' . substr ( $offer -> _source -> description , 0 , 30 ) . '"' : '' ;
echo '
< li >
< a href = " https://www.gchange.fr/#/app/market/view/'. $offer->_id . '/ " '. $description .' >
' . $offer->_source->title . '
</ a >
</ li >
' ;
}
echo '</ol>' ;
$offers = $gchange -> getImmaterialOffers ();
echo '<h2>Productions immatérielles</h2>' ;
echo '<p>Retrouvez ici formations à distance, coaching, cours, prestations... bref, tout ce qui ressemble plus à de l\'information qu\'à de la matière.</p>' ;
echo '<ol>' ;
foreach ( $offers as $offer ) {
$description = isset ( $offer -> _source -> description ) ? ' title="' . substr ( $offer -> _source -> description , 0 , 30 ) . '"' : '' ;
echo '
< li >
< a href = " https://www.gchange.fr/#/app/market/view/'. $offer->_id . '/ " '. $description .' >
' . $offer->_source->title . '
</ a >
</ li >
' ;
}
echo '</ol>' ;
echo '<h2>Prochains événements monnaie libre</h2>' ;
echo '
< p >
Ces événements sont importés automatiquement depuis
< a href = " '. htmlspecialchars(CALENDAR_URL) .' " >
l\ ' Agenda du libre
</ a >
</ p > ' ;
$content = file_get_contents ( CALENDAR_RSS );
$x = new SimpleXmlElement ( $content );
echo '<ul>' ;
foreach ( $x -> item as $entry ) {
echo '
< li >
< a href = " '. $entry->link .' "
title = " '. substr(strip_tags( $entry->description ), 0, 30) . ' " >
'. $entry->title . '
</ a >
</ li > ' ;
}
echo '</ul>' ;
2020-12-10 15:49:47 +01:00
include ( 'footer.php' );