Compare commits
29 Commits
3e65bf1fcf
...
d915fd4c64
Author | SHA1 | Date |
---|---|---|
poka | d915fd4c64 | |
poka | b509f655f9 | |
poka | 449201652d | |
poka | 5b3332b798 | |
poka | f3728dd939 | |
poka | 65fa534743 | |
poka | 022cf49eea | |
poka | 1987ca71b3 | |
poka | 46a4b54118 | |
poka | b035d4022d | |
poka | f73d15220e | |
nox | e557174e96 | |
nox | a2121389bb | |
nox | e4e2ae854a | |
poka | 49ea6216d6 | |
nox | 4f7d557147 | |
poka | 7984a95d17 | |
nox | 8770a46caa | |
poka | b42726ff2d | |
poka | f371847214 | |
poka | 6296f10b3f | |
poka | 7e3d9537c7 | |
poka | 8eeafbe1fb | |
poka | bf21fcf396 | |
poka | 6cdfb46025 | |
poka | 24d3336d00 | |
nox | c06fe37d69 | |
poka | 7da07e5b16 | |
poka | 48668e7433 |
|
@ -1,8 +1,10 @@
|
|||
config/config.php
|
||||
config/conf.php
|
||||
scripts/.loc_hash
|
||||
.idea
|
||||
/public/uploads
|
||||
public/uploads/*
|
||||
!public/uploads/default.png
|
||||
/tmp
|
||||
vendor
|
||||
composer.json
|
||||
composer.lock
|
||||
/src/Framework/SwiftMailerFactory.php
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# Plateforme événementielle de mise en relation des Ḡmarchés.
|
||||
|
||||
## Site en construction
|
||||
### TODO: README
|
|
@ -1,4 +0,0 @@
|
|||
<?php
|
||||
return [
|
||||
'gmarche.prefix' => '/news'
|
||||
];
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
include 'config.php';
|
||||
|
||||
use App\Framework\Twig\UrlExtension;
|
||||
use Framework\Middleware\CsrfMiddleware;
|
||||
use Framework\Renderer\RendererInterface;
|
||||
use Framework\Renderer\TwigRendererFactory;
|
||||
use Framework\Router;
|
||||
use Framework\Router\RouterFactory;
|
||||
use Framework\Router\RouterTwigExtension;
|
||||
use Framework\Session\PHPSession;
|
||||
use Framework\Session\SessionInterface;
|
||||
use Framework\Twig\{
|
||||
CsrfExtension, FlashExtension, FormExtension, PagerFantaExtension, TextExtension, TimeExtension
|
||||
};
|
||||
|
||||
return [
|
||||
'env' => \DI\env('ENV', 'production'),
|
||||
'database.host' => "$db_server",
|
||||
'database.username' => "$db_username",
|
||||
'database.password' => "$db_password",
|
||||
'database.name' => "$db_name",
|
||||
'views.path' => dirname(__DIR__) . '/views',
|
||||
'twig.extensions' => [
|
||||
\DI\get(RouterTwigExtension::class),
|
||||
\DI\get(PagerFantaExtension::class),
|
||||
\DI\get(TextExtension::class),
|
||||
\DI\get(TimeExtension::class),
|
||||
\DI\get(FlashExtension::class),
|
||||
\DI\get(FormExtension::class),
|
||||
\DI\get(CsrfExtension::class),
|
||||
\DI\get(UrlExtension::class)
|
||||
],
|
||||
SessionInterface::class => \DI\object(PHPSession::class),
|
||||
CsrfMiddleware::class => \DI\object()->constructor(\DI\get(SessionInterface::class)),
|
||||
Router::class => \DI\factory(RouterFactory::class),
|
||||
RendererInterface::class => \DI\factory(TwigRendererFactory::class),
|
||||
\PDO::class => function (\Psr\Container\ContainerInterface $c) {
|
||||
return new PDO(
|
||||
'mysql:host='. $c->get('database.host') . ';dbname=' . $c->get('database.name'),
|
||||
$c->get('database.username'),
|
||||
$c->get('database.password'),
|
||||
[
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ,
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
|
||||
]
|
||||
);
|
||||
},
|
||||
// MAILER
|
||||
'mail.to' => 'admin@gmarche-testmail.com',
|
||||
'mail.from' => '$mail_from',
|
||||
Swift_Mailer::class => \DI\factory(\Framework\SwiftMailerFactory::class)
|
||||
];
|
|
@ -1,5 +0,0 @@
|
|||
<?php
|
||||
$host = '';
|
||||
$username = '';
|
||||
$password = '';
|
||||
$database_name = '';
|
|
@ -1,52 +1,7 @@
|
|||
<?php
|
||||
|
||||
use App\Framework\Twig\UrlExtension;
|
||||
use Framework\Middleware\CsrfMiddleware;
|
||||
use Framework\Renderer\RendererInterface;
|
||||
use Framework\Renderer\TwigRendererFactory;
|
||||
use Framework\Router;
|
||||
use Framework\Router\RouterFactory;
|
||||
use Framework\Router\RouterTwigExtension;
|
||||
use Framework\Session\PHPSession;
|
||||
use Framework\Session\SessionInterface;
|
||||
use Framework\Twig\{
|
||||
CsrfExtension, FlashExtension, FormExtension, PagerFantaExtension, TextExtension, TimeExtension
|
||||
};
|
||||
|
||||
return [
|
||||
'env' => \DI\env('ENV', 'production'),
|
||||
'database.host' => '',
|
||||
'database.username' => '',
|
||||
'database.password' => '',
|
||||
'database.name' => '',
|
||||
'views.path' => dirname(__DIR__) . '/views',
|
||||
'twig.extensions' => [
|
||||
\DI\get(RouterTwigExtension::class),
|
||||
\DI\get(PagerFantaExtension::class),
|
||||
\DI\get(TextExtension::class),
|
||||
\DI\get(TimeExtension::class),
|
||||
\DI\get(FlashExtension::class),
|
||||
\DI\get(FormExtension::class),
|
||||
\DI\get(CsrfExtension::class),
|
||||
\DI\get(UrlExtension::class)
|
||||
],
|
||||
SessionInterface::class => \DI\object(PHPSession::class),
|
||||
CsrfMiddleware::class => \DI\object()->constructor(\DI\get(SessionInterface::class)),
|
||||
Router::class => \DI\factory(RouterFactory::class),
|
||||
RendererInterface::class => \DI\factory(TwigRendererFactory::class),
|
||||
\PDO::class => function (\Psr\Container\ContainerInterface $c) {
|
||||
return new PDO(
|
||||
'mysql:host='. $c->get('database.host') . ';dbname=' . $c->get('database.name'),
|
||||
$c->get('database.username'),
|
||||
$c->get('database.password'),
|
||||
[
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ,
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
|
||||
]
|
||||
);
|
||||
},
|
||||
// MAILER
|
||||
'mail.to' => 'admin@gmarche-testmail.com',
|
||||
'mail.from' => 'no-reply@admin.fr',
|
||||
Swift_Mailer::class => \DI\factory(\Framework\SwiftMailerFactory::class)
|
||||
];
|
||||
$db_server = '';
|
||||
$db_username = '';
|
||||
$db_password = '';
|
||||
$db_name = '';
|
||||
$mail_from = '';
|
||||
$g1_node = 'https://duniter-g1.p2p.legal';
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
.mapael .map {
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
padding: 15px;
|
||||
margin-bottom: 10px;
|
||||
position: relative;
|
||||
width: 60%;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
border-radius: 10%;
|
||||
}
|
||||
|
||||
.home_map {
|
||||
font-size:1.2rem;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
/* For all zoom buttons */
|
||||
.mapael .zoomButton {
|
||||
background-color: #fff;
|
||||
border: 1px solid #ccc;
|
||||
color: #000;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
line-height: 15px;
|
||||
text-align: center;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
font-weight: bold;
|
||||
left: 10px;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select : none;
|
||||
-moz-user-select: none;
|
||||
-o-user-select : none;
|
||||
user-select: none;
|
||||
}
|
||||
/* Reset Zoom button first */
|
||||
.mapael .zoomReset {
|
||||
top: 10px;
|
||||
}
|
||||
/* Then Zoom In button */
|
||||
.mapael .zoomIn {
|
||||
top: 30px;
|
||||
}
|
||||
/* Then Zoom Out button */
|
||||
.mapael .zoomOut {
|
||||
top: 50px;
|
||||
}
|
||||
.mapael .mapTooltip {
|
||||
position: absolute;
|
||||
background-color: #1D1D1D;
|
||||
moz-opacity: 0.70;
|
||||
opacity: 0.70;
|
||||
filter: alpha(opacity=70);
|
||||
border-radius: 10px;
|
||||
padding: 10px;
|
||||
z-index: 1000;
|
||||
max-width: 200px;
|
||||
display: none;
|
||||
color: #fff;
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
.container_main {
|
||||
background-color: #2E2E2E;
|
||||
}
|
||||
.tableau {
|
||||
width:100%;
|
||||
background-color: white;
|
||||
table-layout: fixed;
|
||||
border-collapse: collapse;
|
||||
/* border-spacing: 1px; // pour contrer les style de base */
|
||||
}
|
||||
/* Entête */
|
||||
.tableau th {
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
padding: 0rem;
|
||||
text-align: center;
|
||||
border-left: lightgray 1px solid;
|
||||
background-color:#999690;
|
||||
color:#fff;
|
||||
}
|
||||
.tableau .colonne_image {
|
||||
padding: 0; !important;
|
||||
}
|
||||
.tableau td {
|
||||
border-bottom: solid 1px black;
|
||||
border-left: lightgray 1px solid;
|
||||
padding-left: 0.7rem;
|
||||
}
|
||||
.align_droite {
|
||||
|
||||
text-align: right;
|
||||
padding-right: 2rem;
|
||||
}
|
||||
.breadcrumb {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.toggle_radio {
|
||||
position: relative;
|
||||
background: rgba(0,0,0,.1);
|
||||
margin: -3px auto 4px 10px;
|
||||
overflow: hidden;
|
||||
padding: 0 !important;
|
||||
border-radius: 50px;
|
||||
height: 28px;
|
||||
width: 215px;
|
||||
}
|
||||
.toggle_radio > * {
|
||||
float: left;
|
||||
}
|
||||
.toggle_radio input[type=radio]{
|
||||
display: none;
|
||||
}
|
||||
.toggle_radio label{
|
||||
color: rgba(0,0,0,.9);
|
||||
z-index: 0;
|
||||
display: block;
|
||||
width: 100px;
|
||||
height: 20px;
|
||||
margin: 3px 3px;
|
||||
border-radius: 50px;
|
||||
cursor: pointer;
|
||||
z-index: 1;
|
||||
text-align: center;
|
||||
}
|
||||
.toggle_option_slider{
|
||||
width: 100px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
border-radius: 50px;
|
||||
transition: all .4s ease;
|
||||
}
|
||||
|
||||
#first_toggle:checked ~ .toggle_option_slider{
|
||||
background: rgba(0,0,0,.3);
|
||||
left: 3px;
|
||||
}
|
||||
#second_toggle:checked ~ .toggle_option_slider{
|
||||
background: rgba(0,0,0,.3);
|
||||
left: 109px;
|
||||
}
|
|
@ -19,10 +19,19 @@ btn-custom {
|
|||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
#logo_home {
|
||||
width:30rem;
|
||||
margin: 0 auto;
|
||||
margin-top: -15px;
|
||||
margin-bottom: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#la_page {
|
||||
text-align: center;
|
||||
width: 1174px;
|
||||
|
@ -30,6 +39,7 @@ img {
|
|||
height:auto;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
opacity:0.9;
|
||||
}
|
||||
|
||||
#la_page a {
|
||||
|
@ -58,7 +68,9 @@ li {
|
|||
background-size: 100% auto;
|
||||
font-family: Bree Serif, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
opacity:0.97;
|
||||
}
|
||||
|
||||
header.header {
|
||||
width: 389px;
|
||||
height: 259px;
|
||||
|
@ -86,19 +98,24 @@ header.header img {
|
|||
font-size: 26px;
|
||||
}
|
||||
|
||||
.article {
|
||||
width:auto;
|
||||
height:auto;
|
||||
font-size: 24px;
|
||||
}
|
||||
.article2 {
|
||||
.article .article2 {
|
||||
width:auto;
|
||||
height:auto;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.container {
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
.container.home {
|
||||
font-family: Arial, sans-serif;
|
||||
height:auto;
|
||||
width:60rem;
|
||||
text-align:center;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
.profil_user {
|
||||
height: 400px;
|
||||
width: 900px;
|
||||
|
@ -169,7 +186,7 @@ header.header img {
|
|||
}
|
||||
|
||||
body.loading .loadingPubkey {
|
||||
overflow: hidden;
|
||||
overflow: hidden;
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,7 @@ require 'vendor/autoload.php';
|
|||
$chemin = $_SERVER['DOCUMENT_ROOT'];
|
||||
$chemin_new = substr($chemin,0,-6);
|
||||
|
||||
$app = (new \Framework\App( $chemin_new .'/config/config.php'))
|
||||
//$app = (new \Framework\App( '../config/config.php'))
|
||||
$app = (new \Framework\App( $chemin_new .'config/apply.php'))
|
||||
->addModule(AdminModule::class)
|
||||
->addModule(ContactModule::class)
|
||||
->addModule(ProductModule::class)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
function connexion(nom_connecte, mdp) {
|
||||
|
||||
$.post("/ajax/connexion.php", {
|
||||
function connexion(nom_connecte, mdp, chemin) {
|
||||
$.post('/models/connexion.php', {
|
||||
nom_connecte: nom_connecte,
|
||||
mdp: mdp
|
||||
}, function (data, status) {
|
||||
|
|
|
@ -9,7 +9,7 @@ function addRecord(antenne_slug, antenne_id, nom_connecte, id_user) {
|
|||
var quantite = $("#quantite").val();
|
||||
var prix = $("#prix").val();
|
||||
// Add record
|
||||
$.post("/ajax/addRecord.php", {
|
||||
$.post("/models/addRecord.php", {
|
||||
produit: produit,
|
||||
image: nom_image,
|
||||
vendeur: vendeur,
|
||||
|
@ -46,7 +46,7 @@ function addRecord2(antenne_slug, antenne_id, nom_connecte, id_user) {
|
|||
var quantite = $("#quantite").val();
|
||||
var prix = $("#prix").val();
|
||||
// Add record
|
||||
$.post("/ajax/addRecord2.php", {
|
||||
$.post("/models/addRecord2.php", {
|
||||
produit: produit,
|
||||
image: nom_image,
|
||||
acheteur: acheteur,
|
||||
|
@ -75,7 +75,7 @@ function addRecord2(antenne_slug, antenne_id, nom_connecte, id_user) {
|
|||
|
||||
// READ records
|
||||
function readRecords(antenne_slug, nom_connecte) {
|
||||
$.get("/ajax/readRecords.php", {
|
||||
$.get("/models/readRecords.php", {
|
||||
antenne_slug: antenne_slug,
|
||||
nom_connecte: nom_connecte
|
||||
}, function (data, status) {
|
||||
|
@ -84,7 +84,7 @@ function readRecords(antenne_slug, nom_connecte) {
|
|||
}
|
||||
// READ records2
|
||||
function readRecords2(antenne_slug, nom_connecte) {
|
||||
$.get("/ajax/readRecords2.php", {
|
||||
$.get("/models/readRecords2.php", {
|
||||
antenne_slug: antenne_slug,
|
||||
nom_connecte: nom_connecte
|
||||
}, function (data, status) {
|
||||
|
@ -96,7 +96,7 @@ function DeleteProduits(id, antenne_slug, nom_image) {
|
|||
$("#hidden_antenne_slug").val(antenne_slug);
|
||||
var conf = confirm("Etes-vous sûr(e) de vouloir supprimer ce bien ou service ?");
|
||||
if (conf == true) {
|
||||
$.post("/ajax/deleteProduits.php", {
|
||||
$.post("/models/deleteProduits.php", {
|
||||
id: id,
|
||||
antenne_slug: antenne_slug,
|
||||
nom_image: nom_image
|
||||
|
@ -114,7 +114,7 @@ function DeleteRecherches(id, antenne_slug, nom_image) {
|
|||
$("#hidden_antenne_slug_r").val(antenne_slug);
|
||||
var conf = confirm("Etes-vous sûr(e) de vouloir supprimer ce bien ou service ?");
|
||||
if (conf == true) {
|
||||
$.post("/ajax/deleteRecherches.php", {
|
||||
$.post("/models/deleteRecherches.php", {
|
||||
id_r: id,
|
||||
antenne_slug: antenne_slug,
|
||||
nom_image: nom_image
|
||||
|
@ -132,7 +132,7 @@ function GetProduitsDetails(id, antenne_slug, nom_image) {
|
|||
$("#hidden_user_id").val(id);
|
||||
$("#hidden_antenne_slug").val(antenne_slug);
|
||||
$("#hidden_image_name").val(nom_image);
|
||||
$.post("/ajax/readProduitsDetails.php", {
|
||||
$.post("/models/readProduitsDetails.php", {
|
||||
id: id
|
||||
},
|
||||
function (data, status) {
|
||||
|
@ -153,7 +153,7 @@ function GetRecherchesDetails(id, antenne_slug, nom_image) {
|
|||
$("#hidden_user_id_r").val(id);
|
||||
$("#hidden_antenne_slug_r").val(antenne_slug);
|
||||
$("#hidden_image_name_r").val(nom_image);
|
||||
$.post("/ajax/readRecherchesDetails.php", {
|
||||
$.post("/models/readRecherchesDetails.php", {
|
||||
id_r: id
|
||||
},
|
||||
function (data, status) {
|
||||
|
@ -180,7 +180,7 @@ function UpdateProduitsDetails(nom_connecte) {
|
|||
// Champs cachés
|
||||
var id = $("#hidden_user_id").val();
|
||||
var antenne_slug = $("#hidden_antenne_slug").val();
|
||||
$.post("/ajax/updateProduitsDetails.php", {
|
||||
$.post("/models/updateProduitsDetails.php", {
|
||||
id: id,
|
||||
produit: produit,
|
||||
image: nom_image,
|
||||
|
@ -208,7 +208,7 @@ function UpdateRecherchesDetails(nom_connecte) {
|
|||
var id = $("#hidden_user_id_r").val();
|
||||
var antenne_slug = $("#hidden_antenne_slug_r").val();
|
||||
// Update the details by requesting to the server using ajax
|
||||
$.post("/ajax/updateRecherchesDetails.php", {
|
||||
$.post("/models/updateRecherchesDetails.php", {
|
||||
id: id,
|
||||
produit: produit,
|
||||
image: nom_image,
|
||||
|
@ -252,7 +252,7 @@ $(document).ready(function () {
|
|||
|
||||
// requête AJAX pour copier la photo et l'afficher
|
||||
$.ajax({
|
||||
url: '/ajax/upload.php',
|
||||
url: '/models/upload.php',
|
||||
type: 'post',
|
||||
data: fd_add,
|
||||
contentType: false,
|
||||
|
@ -283,7 +283,7 @@ $(document).ready(function () {
|
|||
fd.append('source',source);
|
||||
// requête AJAX pour copier la photo et l'afficher
|
||||
$.ajax({
|
||||
url: '/ajax/upload.php',
|
||||
url: '/models/upload.php',
|
||||
type: 'post',
|
||||
data: fd,
|
||||
contentType: false,
|
||||
|
|
|
@ -3,8 +3,8 @@ ini_set('display_errors', 0);
|
|||
|
||||
if ($_POST['produit']!== '' && $_POST['vendeur']!== null && $_POST['quantite']>0 && $_POST['prix']>=0) {
|
||||
// Connexion à la base de données
|
||||
include '../../config/conf.php';
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
include '../../config/config.php';
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
|
||||
// Récupération des informations du formulaire
|
||||
$params = array();
|
|
@ -3,8 +3,8 @@
|
|||
if(isset($_POST['produit']) && isset($_POST['acheteur']) && isset($_POST['quantite']) )
|
||||
{
|
||||
// Connexion à la base de données
|
||||
include '../../config/conf.php';
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
include '../../config/config.php';
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
|
||||
// Récupération des informations du formulaire
|
||||
$params = array();
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
include '../../config/conf.php';
|
||||
include '../../config/config.php';
|
||||
|
||||
try {
|
||||
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
if (isset($_POST['nom_connecte']) && isset($_POST['mdp']) != "") {
|
||||
|
||||
$params["username"] = $_POST['nom_connecte'];
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
include '../../config/conf.php';
|
||||
include '../../config/config.php';
|
||||
|
||||
if($_POST['id'] !== null)
|
||||
{
|
||||
// Connexion à la base de données
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
|
||||
$params['product_id'] = $_POST['id'];
|
||||
$filename = $_POST['nom_image'];
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
include '../../config/conf.php';
|
||||
include '../../config/config.php';
|
||||
|
||||
if($_POST['id_r'] !== null)
|
||||
{
|
||||
// Connexion à la base de données
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
|
||||
$params['souhait_id'] = $_POST['id_r'];
|
||||
$filename = $_POST['nom_image'];
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
ini_set('display_errors', 0);
|
||||
include '../../config/conf.php';
|
||||
include '../../config/config.php';
|
||||
if(isset($_GET['vendeur']))
|
||||
{
|
||||
// Get public key from pseudo
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
include '../../config/conf.php';
|
||||
include '../../config/config.php';
|
||||
|
||||
try {
|
||||
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
if (isset($_POST['id']) && isset($_POST['id']) != "") {
|
||||
|
||||
$product_id = $_POST['id'];
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
include '../../config/conf.php';
|
||||
include '../../config/config.php';
|
||||
|
||||
try {
|
||||
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
if (isset($_POST['id_r']) && isset($_POST['id_r']) != "") {
|
||||
|
||||
$souhait_id = $_POST['id_r'];
|
|
@ -1,9 +1,10 @@
|
|||
<?php
|
||||
session_start();
|
||||
ini_set('display_errors', 0);
|
||||
include '../../config/conf.php';
|
||||
include '../../config/config.php';
|
||||
$antenne_slug = $_GET['antenne_slug'];
|
||||
$nom_connecte = $_GET['nom_connecte'];
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$nom_connecte = $_SESSION['user'];
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
|
||||
// Affichage des intitulés de colonnes
|
||||
$data = '<table class="table table-bordered table-striped">
|
||||
|
@ -17,12 +18,12 @@
|
|||
<th>Prix en junes</th>';
|
||||
|
||||
$params["antenne_slug"] = $antenne_slug;
|
||||
$requete = "SELECT products.*, users.username, users.pubkey
|
||||
FROM products
|
||||
LEFT JOIN antennes
|
||||
ON antennes.id = products.antenne_id
|
||||
LEFT JOIN users
|
||||
ON users.id = products.user_id
|
||||
$requete = "SELECT products.*, users.username, users.pubkey
|
||||
FROM products
|
||||
LEFT JOIN antennes
|
||||
ON antennes.id = products.antenne_id
|
||||
LEFT JOIN users
|
||||
ON users.id = products.user_id
|
||||
WHERE antennes.slug = :antenne_slug";
|
||||
$stmt = $bdd->prepare($requete);
|
||||
$stmt2 = $bdd->prepare($requete);
|
||||
|
@ -50,18 +51,29 @@
|
|||
<td>$number</td>";
|
||||
$prix = $row['prix'];
|
||||
$vendeur = $row['username'];
|
||||
$produit = $row['name'];
|
||||
$quantite = $row['quantite'];
|
||||
if ($quantite == "0") {
|
||||
$produit = "[Vendu] ";
|
||||
} else {
|
||||
$produit = "";
|
||||
}
|
||||
$produit .= $row['name'];
|
||||
$pubkey = $row['pubkey'];
|
||||
$pubkeyShort = substr($pubkey, 0, 8);
|
||||
$vendeur_format = "<a target=\"_blank\" href=\"https://g1.duniter.fr/#/app/wot/$pubkey/\">$vendeur</a>";
|
||||
$cle_pub_format = "<a target=\"_blank\" href=\"https://g1.duniter.fr/api/#/v1/payment/$pubkey?amount=$prix&name=$vendeur&comment=[Achat GMarche] : $produit&preferred_node=https://g1.librelois.fr&redirect_url=https://gmarche.monnaie-libre.fr\" title=$pubkey> $pubkeyShort... </a>";
|
||||
$data .= '<td>'.$produit.'</td>';
|
||||
$data .= '<td><img src="/uploads/products/'.$antenne_slug.'/'.$row['image'].'" width="100" height="100" /></td>';
|
||||
$imagep = '../uploads/products/'.$antenne_slug.'/'.$row['image'].'';
|
||||
if (file_exists($imagep) && $row['image']) {
|
||||
$data .= '<td><img src="/uploads/products/'.$antenne_slug.'/'.$row['image'].'" width="100" height="100" /></td>';
|
||||
} else {
|
||||
$data .= '<td><img src="/uploads/default.png" width="30" height="30" /></td>';
|
||||
}
|
||||
$data .= '<td>'.$vendeur_format.'</td>';
|
||||
$data .= '<td>'.$cle_pub_format.'</td>';
|
||||
$data .= '<td>'.$row['quantite'].'</td>';
|
||||
$data .= '<td>'.$quantite.'</td>';
|
||||
$data .= '<td>'.$prix.'</td>';
|
||||
if ($row['username'] == $_GET['nom_connecte'] ) {
|
||||
if ($row['username'] == $nom_connecte ) {
|
||||
$data .= '<td>';
|
||||
$data .= '<button onclick="GetProduitsDetails(\'';
|
||||
$data .= $row['id'];
|
|
@ -1,9 +1,10 @@
|
|||
<?php
|
||||
session_start();
|
||||
ini_set('display_errors', 0);
|
||||
include '../../config/conf.php';
|
||||
include '../../config/config.php';
|
||||
$antenne_slug = $_GET['antenne_slug'];
|
||||
$nom_connecte = $_GET['nom_connecte'];
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$nom_connecte = $_SESSION['user'];
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
|
||||
// Affichage des intitulés de colonnes
|
||||
$data = '<table class="table table-bordered table-striped">
|
||||
|
@ -18,11 +19,11 @@
|
|||
|
||||
$params["antenne_slug"] = $antenne_slug;
|
||||
$requete = "SELECT souhaits.*, users.username, users.pubkey
|
||||
FROM souhaits
|
||||
LEFT JOIN antennes
|
||||
ON antennes.id = souhaits.antenne_id
|
||||
LEFT JOIN users
|
||||
ON users.id = souhaits.user_id
|
||||
FROM souhaits
|
||||
LEFT JOIN antennes
|
||||
ON antennes.id = souhaits.antenne_id
|
||||
LEFT JOIN users
|
||||
ON users.id = souhaits.user_id
|
||||
WHERE antennes.slug = :antenne_slug";
|
||||
$stmt = $bdd->prepare($requete);
|
||||
$stmt2 = $bdd->prepare($requete);
|
||||
|
@ -54,12 +55,17 @@
|
|||
$vendeur_format = "<a target=\"_blank\" href=\"https://g1.duniter.fr/#/app/wot/$pubkey/\">$vendeur</a>";
|
||||
$pubkeyShort = substr($pubkey, 0, 8);
|
||||
$data .= '<td>'.$produit.'</td>';
|
||||
$data .= '<td><img src="/uploads/recherches/'.$antenne_slug.'/'.$row['image'].'" width="100" height="100" /></td>';
|
||||
$imagep = '../uploads/recherches/'.$antenne_slug.'/'.$row['image'].'';
|
||||
if (file_exists($imagep) && $row['image']) {
|
||||
$data .= '<td><img src="/uploads/recherches/'.$antenne_slug.'/'.$row['image'].'" width="100" height="100" /></td>';
|
||||
} else {
|
||||
$data .= '<td><img src="/uploads/default.png" width="30" height="30" /></td>';
|
||||
}
|
||||
$data .= '<td>'.$vendeur_format.'</td>';
|
||||
$data .= '<td>'.$pubkeyShort.'...</td>';
|
||||
$data .= '<td>'.$row['quantite'].'</td>';
|
||||
$data .= '<td>'.$prix.'</td>';
|
||||
if ($row['username'] == $_GET['nom_connecte'] ) {
|
||||
if ($row['username'] == $nom_connecte ) {
|
||||
$data .= '<td>';
|
||||
$data .= '<button onclick="GetRecherchesDetails(\'';
|
||||
$data .= $row['id'];
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
include '../../config/conf.php';
|
||||
include '../../config/config.php';
|
||||
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
|
||||
if(isset($_POST))
|
||||
{
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
include '../../config/conf.php';
|
||||
include '../../config/config.php';
|
||||
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
|
||||
if(isset($_POST))
|
||||
{
|
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
|
@ -0,0 +1,63 @@
|
|||
#!/bin/bash
|
||||
|
||||
[ "$EUID" -ne 0 ] && sudo="sudo" || sudo=""
|
||||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
|
||||
|
||||
start=`date +%s`
|
||||
date=$(date +'%d-%m-%y à %H:%M')
|
||||
echo "### $date ###"
|
||||
|
||||
## Initialisation
|
||||
DUNITER=$(grep g1_node $SCRIPTPATH/../config/config.php | awk '{ print $3}' | tr -d ';' | tr -d "'")
|
||||
TXBLOCKS=$(curl -s $DUNITER/blockchain/with/tx | jq '.result.blocks[]')
|
||||
TXBLOCKS=$(echo "$TXBLOCKS" | tail -n 2 | tr '\n' ' ')
|
||||
keyword="\[Achat GMarche] : "
|
||||
[ ! -e $SCRIPTPATH/.loc_hash ] && touch $SCRIPTPATH/.loc_hash
|
||||
|
||||
## Récupération des transactions avec commentaire GMarche
|
||||
|
||||
for i in $TXBLOCKS; do
|
||||
result=$(curl -s $DUNITER/blockchain/block/$i | jq '.transactions[].hash, .transactions[].comment' | grep -v '""' | tr -d '"' | grep -B1 "$keyword")
|
||||
rhash=$(echo "$result" | head -n1)
|
||||
rcom=$(echo "$result" | tail -n1)
|
||||
if [[ ! -z $result && -z $(grep $rhash $SCRIPTPATH/.loc_hash) ]]; then
|
||||
isSell+=$(echo -e "$rcom;")
|
||||
echo "$rhash" >> $SCRIPTPATH/.loc_hash
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
## Ajout des transactions en piscine pour les users GMarche
|
||||
|
||||
req="SELECT pubkey FROM users;"
|
||||
usersPubkeys=$($sudo mysql --database gmarche -e "$req" | grep .)
|
||||
|
||||
for i in $usersPubkeys; do
|
||||
result=$(curl -s $DUNITER/tx/history/$i/pending | jq '. | select(.history.sending == [])' | jq '.history.pending[].hash,.history.pending[].comment' | tr -d '"')
|
||||
rhash=$(echo "$result" | head -n1)
|
||||
rcom=$(echo "$result" | tail -n1)
|
||||
if [[ ! -z $result && -z $(grep $rhash $SCRIPTPATH/.loc_hash) ]]; then
|
||||
isSell+=$(echo -e "$rcom;")
|
||||
echo "$rhash" >> $SCRIPTPATH/.loc_hash
|
||||
fi
|
||||
done
|
||||
|
||||
## Retrait de l'identifiant gmarche des commentaires
|
||||
isSell=$(echo $isSell | sed "s/$keyword//g")
|
||||
|
||||
[[ ! -z $isSell ]] && echo "$isSell est vendu"
|
||||
|
||||
## Retrait d'un quantité pour les articles vendu
|
||||
IFS=';'; ADDR=($isSell); unset IFS;
|
||||
for i in "${ADDR[@]}"; do
|
||||
#req="UPDATE products SET status = 'solde' WHERE name = '$i';"
|
||||
req="UPDATE products SET quantite = CASE WHEN quantite = 0 THEN quantite ELSE quantite - 1 END WHERE name = '$i';"
|
||||
$sudo mysql --database gmarche -e "$req"
|
||||
done
|
||||
|
||||
#$sudo mysql --database gmarche -e "SELECT name,status FROM products;"
|
||||
|
||||
end=`date +%s`
|
||||
runtime=$((end-start))
|
||||
echo "Temps d'execution: ${runtime}s"
|
||||
exit 0
|
|
@ -44,7 +44,7 @@ textInput.onkeyup = function (e) {
|
|||
}
|
||||
}
|
||||
$body.addClass("loading");
|
||||
xmlhttp.open("GET","/ajax/getG1PubKey.php?vendeur="+textInput.value,true);
|
||||
xmlhttp.open("GET","/models/getG1PubKey.php?vendeur="+textInput.value,true);
|
||||
xmlhttp.send();
|
||||
}, 800);
|
||||
};
|
||||
|
|
|
@ -50,7 +50,10 @@ class LoginAttemptAction
|
|||
$params = $request->getParsedBody();
|
||||
$user = $this->auth->login($params['username'], $params['password']);
|
||||
if ($user) {
|
||||
$path = $this->session->get('auth.redirect');
|
||||
if(!isset($_SESSION)) {
|
||||
session_start();
|
||||
}
|
||||
$nom_user = $_SESSION['user'] = $params['username'];
|
||||
$path = $this->session->get('auth.redirect') ?? $this->router->generateUri('gmarche.index');
|
||||
$this->session->delete('auth.redirect');
|
||||
return new RedirectResponse($path);
|
||||
|
|
|
@ -14,7 +14,7 @@ class NotFoundMiddleware {
|
|||
background:url(\'/images/bildreich_1275.jpg\') no-repeat;background-size: cover;">
|
||||
<div class="container" style="padding: 2rem;margin: 5rem 2rem;width:15rem;height:14rem;background-color: #c9c9c9;">
|
||||
<h4>Erreur 404</h4><br />Cette url n\'existe pas.<br /><br />
|
||||
<a class="btn btn-primary btn-md" href="https://gmarche.monnaie-libre.fr/france" role="button">
|
||||
<a class="btn btn-primary btn-md" href="/" role="button">
|
||||
Retour à l\'accueil</a></div></div></html>');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ class TrailingSlashMiddleware {
|
|||
public function __invoke(ServerRequestInterface $request, callable $next)
|
||||
{
|
||||
$uri = $request->getUri()->getPath();
|
||||
if (!empty($uri) && $uri[-1] === "/") {
|
||||
if (!empty($uri) && $uri[-1] === "/" && $uri !== "/") {
|
||||
return (new \GuzzleHttp\Psr7\Response())
|
||||
->withStatus(301)
|
||||
->withHeader('Location', substr($uri, 0, -1));
|
||||
|
@ -16,4 +16,4 @@ class TrailingSlashMiddleware {
|
|||
return $next($request);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,44 +1,31 @@
|
|||
<?php
|
||||
namespace App\Gmarche\Actions;
|
||||
|
||||
use App\Gmarche\Table\RegionTable;
|
||||
use Framework\Actions\RouterAwareAction;
|
||||
use Framework\Renderer\RendererInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
class RegionIndexAction
|
||||
{
|
||||
|
||||
/**
|
||||
* @var RendererInterface
|
||||
*/
|
||||
private $renderer;
|
||||
|
||||
/**
|
||||
* @var RegionTable
|
||||
*/
|
||||
private $regionTable;
|
||||
|
||||
use RouterAwareAction;
|
||||
|
||||
public function __construct(
|
||||
RendererInterface $renderer,
|
||||
RegionTable $regionTable
|
||||
RendererInterface $renderer
|
||||
) {
|
||||
$this->renderer = $renderer;
|
||||
$this->regionTable = $regionTable;
|
||||
$this->renderer = $renderer;
|
||||
}
|
||||
|
||||
public function __invoke(Request $request)
|
||||
public function __invoke()
|
||||
{
|
||||
$params = $request->getQueryParams();
|
||||
$regions = $this->regionTable->findAll()->paginate(15, $params['p'] ?? 1);
|
||||
session_start();
|
||||
if (isset($_SESSION['user'])) {
|
||||
$nom_user = $_SESSION['user'];
|
||||
} else {
|
||||
$nom_user = '';
|
||||
}
|
||||
return $this->renderer->render('@gmarche/index', compact('nom_user','regions'));
|
||||
return $this->renderer->render('@gmarche/index', compact('nom_user'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ class GmarcheModule extends Module
|
|||
$gmarchePrefix = $container->get('gmarche.prefix');
|
||||
$container->get(RendererInterface::class)->addPath('gmarche', __DIR__ . '/views');
|
||||
$router = $container->get(Router::class);
|
||||
$router->get( "$gmarchePrefix", RegionIndexAction::class, 'gmarche.index');
|
||||
$router->get("$gmarchePrefix/{slug:[a-z\-0-9]+}", AntenneShowAction::class, 'gmarche.antenne');
|
||||
$router->get("$gmarchePrefix", RegionIndexAction::class, 'gmarche.index');
|
||||
$router->get("$gmarchePrefix{france}/{slug:[a-z\-0-9]+}", AntenneShowAction::class, 'gmarche.antenne');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,5 +5,5 @@ use function \Di\object;
|
|||
use function \Di\get;
|
||||
/* Chemin */
|
||||
return [
|
||||
'gmarche.prefix' => '/france'
|
||||
'gmarche.prefix' => '/'
|
||||
];
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
}
|
||||
.main {
|
||||
grid-area: main;
|
||||
/*justify-self: start;
|
||||
align-self: start;*/
|
||||
grid-column: 1 / 2;
|
||||
}
|
||||
.sidebar {
|
||||
|
@ -67,9 +65,6 @@
|
|||
</ul>
|
||||
</div>
|
||||
<footer class="footer">
|
||||
<!-- if antennes
|
||||
paginate(antennes, 'gmarche.antenne', {slug: slug})
|
||||
endif -->
|
||||
</footer>
|
||||
</article>
|
||||
|
||||
|
|
|
@ -4,19 +4,108 @@
|
|||
Ğ1-Marché : Régions {% if page > 1 %}, page {{ page }} {% endif %}
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
<div class="container" style="height:auto; width:24rem; text-align:center;border: 0px">
|
||||
<img src="\images\logo_home.jpg" style="width:24rem;margin-left: 0px;"/>
|
||||
<div class="row card" style="width: 22rem;margin-left: 0.1rem;">
|
||||
<div class="container home">
|
||||
<img id="logo_home" src="\images\logo_home.jpg"/>
|
||||
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for region in regions %}
|
||||
<a style="color:black;" href="{{ path('gmarche.antenne', {slug: region.slug, id: region.id} ) }}" title="{{ region.name }}">
|
||||
<li class="liste_regions list-group-item" style="padding: .2rem 1.25rem;">
|
||||
{{ region.name }}
|
||||
</li>
|
||||
</a>
|
||||
{% endfor %}
|
||||
<div class="mapcontainer">
|
||||
<div class="map">
|
||||
<span>Alternative content for the map</span>
|
||||
</div>
|
||||
<div class="areaLegend"></div>
|
||||
<div class="plotLegend"></div>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- paginate(regions, 'gmarche.index') -->
|
||||
|
||||
<script type="text/javascript">
|
||||
$(".container").mapael({
|
||||
map: {
|
||||
name: 'france_regions_2016',
|
||||
zoom: {
|
||||
//enabled: true
|
||||
},
|
||||
defaultArea: {
|
||||
attrs: {
|
||||
'fill': '#517C2D',
|
||||
'stroke': '#F5D6C6',
|
||||
'stroke-width': 0.6,
|
||||
'cursor': 'pointer'
|
||||
},
|
||||
attrsHover: {
|
||||
'stroke-width': 2.5,
|
||||
'fill': '#3b7dd8',
|
||||
'animDuration' : 100
|
||||
}
|
||||
}
|
||||
},
|
||||
areas: {
|
||||
'region-84': {
|
||||
value: "Auvergne-Rhône-Alpes",
|
||||
href: "france/auvergne-rhone-alpes",
|
||||
tooltip: {content: "<span class='home_map'> Auvergne-Rhône-Alpes</span>"}
|
||||
},
|
||||
'region-53': {
|
||||
value: "Bretagne",
|
||||
href: "france/bretagne",
|
||||
tooltip: {content: "<span class='home_map'>Bretagne</span>"}
|
||||
},
|
||||
'region-27': {
|
||||
value: "Bourgogne-Franche-Comté",
|
||||
href: "france/bourgogne-franche-comte",
|
||||
tooltip: {content: "<span class='home_map'>Bourgogne-Franche-Comté</span>"}
|
||||
},
|
||||
'region-24': {
|
||||
value: "Centre-Val de Loire",
|
||||
href: "france/centre-val-de-loire",
|
||||
tooltip: {content: "<span class='home_map'>Centre-Val de Loire</span>"}
|
||||
},
|
||||
'region-94': {
|
||||
value: "Corse",
|
||||
href: "france/corse",
|
||||
tooltip: {content: "<span class='home_map'>Corse</span>"}
|
||||
},
|
||||
'region-44': {
|
||||
value: "Grand-Est",
|
||||
href: "france/grand-est",
|
||||
tooltip: {content: "<span class='home_map'>Grand-Est</span>"}
|
||||
},
|
||||
'region-32': {
|
||||
value: "Hauts-de-France",
|
||||
href: "france/hauts-de-france",
|
||||
tooltip: {content: "<span class='home_map'>Hauts-de-France</span>"}
|
||||
},
|
||||
'region-11': {
|
||||
value: "Ile-de-France",
|
||||
href: "france/ile-de-france",
|
||||
tooltip: {content: "<span class='home_map'>Ile-de-France</span>"}
|
||||
},
|
||||
'region-28': {
|
||||
value: "Normandie",
|
||||
href: "france/normandie",
|
||||
tooltip: {content: "<span class='home_map'>Normandie</span>"}
|
||||
},
|
||||
'region-75': {
|
||||
value: "Nouvelle-Aquitaine",
|
||||
href: "france/nouvelle-aquitaine",
|
||||
tooltip: {content: "<span class='home_map'>Nouvelle-Aquitaine</span>"}
|
||||
},
|
||||
'region-76': {
|
||||
value: "Occitanie",
|
||||
href: "france/occitanie",
|
||||
tooltip: {content: "<span class='home_map'>Occitanie</span>"}
|
||||
},
|
||||
'region-52': {
|
||||
value: "Pays de la Loire",
|
||||
href: "france/pays-de-la-loire",
|
||||
tooltip: {content: "<span class='home_map'>Pays de la Loire</span>"}
|
||||
},
|
||||
'region-93': {
|
||||
value: "Provence-Alpes-Côte d'Azur",
|
||||
href: "france/provence-alpes-cote-d-azur",
|
||||
tooltip: {content: "<span class='home_map'>Provence-Alpes-Côte d'Azur</span>"}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
@ -16,14 +16,11 @@ class ProductModule extends Module
|
|||
|
||||
public function __construct(ContainerInterface $container)
|
||||
{
|
||||
$gmarchePrefix = $container->get('gmarche.prefix');
|
||||
$gmarchePrefix = $container->get('gmarche.prefix').'france/';
|
||||
|
||||
$container->get(RendererInterface::class)->addPath('product', __DIR__ . '/views');
|
||||
$router = $container->get(Router::class);
|
||||
$router->get("$gmarchePrefix/{region:[a-z\-0-9]+}/{slug:[a-z\-0-9]+}/produits", ProductIndexAction::class, 'product.ville');
|
||||
$router->get("$gmarchePrefix/{region:[a-z\-0-9]+}/{slug:[a-z\-0-9]+}/recherches", RechIndexAction::class, 'product.recherches');
|
||||
|
||||
// $router->crud("$gmarchePrefix/{region:[a-z\-]+}/{slug:[a-z\-0-9]+}/{antenne:[0-9]{1,}}",[LoggedInMiddleware::class, ProductCrudAction::class],'product.admin');
|
||||
$router->get("$gmarchePrefix{region:[a-z\-0-9]+}/{slug:[a-z\-0-9]+}/produits", ProductIndexAction::class, 'product.ville');
|
||||
$router->get("$gmarchePrefix{region:[a-z\-0-9]+}/{slug:[a-z\-0-9]+}/recherches", RechIndexAction::class, 'product.recherches');
|
||||
}
|
||||
}
|
||||
// $router->get("$gmarchePrefix/{region:[a-z\-0-9]+}/{slug:[a-z\-0-9]+}/{antenne:[0-9]{1,}}", ProductIndexAction::class, 'product.index');
|
||||
|
|
|
@ -2,98 +2,16 @@
|
|||
{% extends 'layout.twig' %}
|
||||
{% block title "Ğ1-Marché - Produits" %}
|
||||
|
||||
|
||||
{% block body %}
|
||||
<style>
|
||||
.tableau {
|
||||
width:100%;
|
||||
background-color: white;
|
||||
table-layout: fixed;
|
||||
border-collapse: collapse;
|
||||
/* border-spacing: 1px; // pour contrer les style de base */
|
||||
}
|
||||
/* Entête */
|
||||
.tableau th {
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
padding: 0rem;
|
||||
text-align: center;
|
||||
border-left: lightgray 1px solid;
|
||||
background-color:#999690;
|
||||
color:#fff;
|
||||
}
|
||||
.tableau .colonne_image {
|
||||
padding: 0; !important;
|
||||
}
|
||||
.tableau td {
|
||||
border-bottom: solid 1px black;
|
||||
border-left: lightgray 1px solid;
|
||||
padding-left: 0.7rem;
|
||||
}
|
||||
.align_droite {
|
||||
|
||||
text-align: right;
|
||||
padding-right: 2rem;
|
||||
}
|
||||
.breadcrumb {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.toggle_radio {
|
||||
position: relative;
|
||||
background: rgba(0,0,0,.1);
|
||||
margin: -3px auto 4px 10px;
|
||||
overflow: hidden;
|
||||
padding: 0 !important;
|
||||
border-radius: 50px;
|
||||
height: 28px;
|
||||
width: 215px;
|
||||
}
|
||||
.toggle_radio > * {
|
||||
float: left;
|
||||
}
|
||||
.toggle_radio input[type=radio]{
|
||||
display: none;
|
||||
}
|
||||
.toggle_radio label{
|
||||
/* font: 90%/1.618 "Source Sans Pro";*/
|
||||
color: rgba(0,0,0,.9);
|
||||
z-index: 0;
|
||||
display: block;
|
||||
width: 100px;
|
||||
height: 20px;
|
||||
margin: 3px 3px;
|
||||
border-radius: 50px;
|
||||
cursor: pointer;
|
||||
z-index: 1;
|
||||
text-align: center;
|
||||
}
|
||||
.toggle_option_slider{
|
||||
width: 100px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
border-radius: 50px;
|
||||
transition: all .4s ease;
|
||||
}
|
||||
|
||||
#first_toggle:checked ~ .toggle_option_slider{
|
||||
background: rgba(0,0,0,.3);
|
||||
left: 3px;
|
||||
}
|
||||
#second_toggle:checked ~ .toggle_option_slider{
|
||||
background: rgba(0,0,0,.3);
|
||||
left: 109px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script type="text/javascript" src="/js/script.js"></script>
|
||||
<div class="container_main" style="background-color: black;">
|
||||
<div class="container_main">
|
||||
<!-- Fil d'Ariane -->
|
||||
<div class="breadcrumbs" >
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ gmarchePrefix }}">France</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ gmarchePrefix }}/{{ region_slug }}">{{ region_name }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ gmarchePrefix }}france/{{ region_slug }}">{{ region_name }}</a></li>
|
||||
<li class="breadcrumb-item active">G-Marché de {{ antenne_name }}</li>
|
||||
|
||||
<div class="toggle_radio">
|
||||
|
@ -102,7 +20,7 @@
|
|||
<label for="first_toggle"><p>PRODUITS</p></label>
|
||||
<label for="second_toggle">
|
||||
<p>
|
||||
<a style="color:black;" href="{{ gmarchePrefix }}/{{ region_slug }}/{{ antenne_slug }}/recherches">RECHERCHES</a>
|
||||
<a style="color:black;" href="{{ gmarchePrefix }}france/{{ region_slug }}/{{ antenne_slug }}/recherches">RECHERCHES</a>
|
||||
</p>
|
||||
</label>
|
||||
<div class="toggle_option_slider">
|
||||
|
@ -241,10 +159,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<!--
|
||||
crochet% set token_input = csrf_input %crochet
|
||||
|
||||
paginate(items, routePrefix ~ '.index', {id: item.id, region: explodeUrl()[2],
|
||||
slug: explodeUrl()[3], antenne: explodeUrl()[4]}) -->
|
||||
crochet% set token_input = csrf_input %crochet-->
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -3,104 +3,21 @@
|
|||
{% block title "Ğ1-Marché - Recherches" %}
|
||||
|
||||
{% block body %}
|
||||
<style>
|
||||
.tableau {
|
||||
width:100%;
|
||||
background-color: white;
|
||||
table-layout: fixed;
|
||||
border-collapse: collapse;
|
||||
/* border-spacing: 1px; // pour contrer les style de base */
|
||||
}
|
||||
/* Entête */
|
||||
.tableau th {
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
padding: 0rem;
|
||||
text-align: center;
|
||||
border-left: lightgray 1px solid;
|
||||
background-color:#999690;
|
||||
color:#fff;
|
||||
}
|
||||
.tableau .colonne_image {
|
||||
padding: 0; !important;
|
||||
}
|
||||
.tableau td {
|
||||
border-bottom: solid 1px black;
|
||||
border-left: lightgray 1px solid;
|
||||
padding-left: 0.7rem;
|
||||
}
|
||||
.align_droite {
|
||||
|
||||
text-align: right;
|
||||
padding-right: 2rem;
|
||||
}
|
||||
.breadcrumb {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.toggle_radio {
|
||||
position: relative;
|
||||
background: rgba(0,0,0,.1);
|
||||
margin: -3px auto 4px 10px;
|
||||
overflow: hidden;
|
||||
padding: 0 !important;
|
||||
border-radius: 50px;
|
||||
height: 28px;
|
||||
width: 215px;
|
||||
}
|
||||
.toggle_radio > * {
|
||||
float: left;
|
||||
}
|
||||
.toggle_radio input[type=radio]{
|
||||
display: none;
|
||||
}
|
||||
.toggle_radio label{
|
||||
/* font: 90%/1.618 "Source Sans Pro";*/
|
||||
color: rgba(0,0,0,.9);
|
||||
z-index: 0;
|
||||
display: block;
|
||||
width: 100px;
|
||||
height: 20px;
|
||||
margin: 3px 3px;
|
||||
border-radius: 50px;
|
||||
cursor: pointer;
|
||||
z-index: 1;
|
||||
text-align: center;
|
||||
}
|
||||
.toggle_option_slider{
|
||||
width: 100px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
border-radius: 50px;
|
||||
transition: all .4s ease;
|
||||
}
|
||||
|
||||
#first_toggle:checked ~ .toggle_option_slider{
|
||||
background: rgba(0,0,0,.3);
|
||||
left: 3px;
|
||||
}
|
||||
#second_toggle:checked ~ .toggle_option_slider{
|
||||
background: rgba(0,0,0,.3);
|
||||
left: 109px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script type="text/javascript" src="/js/script.js"></script>
|
||||
<div class="container_main" style="background-color: black;">
|
||||
<div class="container_main">
|
||||
<!-- Fil d'Ariane -->
|
||||
<div class="breadcrumbs" >
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ gmarchePrefix }}">France</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ gmarchePrefix }}/{{ region_slug }}">{{ region_name }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ gmarchePrefix }}france/{{ region_slug }}">{{ region_name }}</a></li>
|
||||
<li class="breadcrumb-item active">G-Marché de {{ antenne_name }}</li>
|
||||
|
||||
<div class="toggle_radio">
|
||||
<input type="radio" class="toggle_option" id="first_toggle" name="toggle_option">
|
||||
<input style="color:black;" type="radio" checked class="toggle_option" id="second_toggle" name="toggle_option">
|
||||
<label for="first_toggle">
|
||||
<a style="color:black;" href="{{ gmarchePrefix }}/{{ region_slug }}/{{ antenne_slug }}/produits">PRODUITS</a>
|
||||
<a style="color:black;" href="{{ gmarchePrefix }}france/{{ region_slug }}/{{ antenne_slug }}/produits">PRODUITS</a>
|
||||
</label>
|
||||
<label for="second_toggle">
|
||||
<p>RECHERCHES</p>
|
||||
|
|
|
@ -91,12 +91,12 @@ abstract class RegexBasedAbstract implements DataGenerator
|
|||
|
||||
if (isset($this->methodToRegexToRoutesMap[$httpMethod])) {
|
||||
foreach ($this->methodToRegexToRoutesMap[$httpMethod] as $route) {
|
||||
if ($route->matches($routeStr)) {
|
||||
throw new BadRouteException(sprintf(
|
||||
'Static route "%s" is shadowed by previously defined variable route "%s" for method "%s"',
|
||||
$routeStr, $route->regex, $httpMethod
|
||||
));
|
||||
}
|
||||
// if ($route->matches($routeStr)) {
|
||||
// throw new BadRouteException(sprintf(
|
||||
// 'Static route "%s" is shadowed by previously defined variable route "%s" for method "%s"',
|
||||
// $routeStr, $route->regex, $httpMethod
|
||||
// ));
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,9 @@
|
|||
<link rel="shortcut icon" type="image/x-icon" href="\images\favicon.ico">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Bree+Serif&display=swap">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Kalam&display=swap">
|
||||
<link rel="stylesheet" href="\css\style.css">
|
||||
<link rel="stylesheet" href="/css/mapael.css">
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
<link rel="stylesheet" href="/css/products.css">
|
||||
<style>
|
||||
body {
|
||||
padding-top: 5rem;
|
||||
|
@ -27,10 +29,12 @@
|
|||
grid-column: 2 / 3;
|
||||
}
|
||||
</style>
|
||||
<!--<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>-->
|
||||
|
||||
<script type="text/javascript" src="/js/jquery-3.4.1.min.js"></script>
|
||||
<script type="text/javascript" src="/js/connex.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.2.7/raphael.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-mapael/2.1.0/js/jquery.mapael.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="https://rawgit.com/neveldo/mapael-maps/master/france/france_regions_2016.js" charset="utf-8"></script>
|
||||
</head>
|
||||
<body class="fond page">
|
||||
<div class="site">
|
||||
|
@ -50,7 +54,6 @@
|
|||
<div class="navbar-text" style="color:lightgray;margin-right:15px; margin-top:3px;">
|
||||
{{ "now"|date('d/m/y') }}
|
||||
</div>
|
||||
<!--{pourcent if current_user() pourcent}-->
|
||||
{% if nom_user != '' %}
|
||||
<!-- <button style="background-color: transparent;padding:0;border:0;" -->
|
||||
<form method="post" style="margin-top:5px;" action="{{ path('account.profil') }}">
|
||||
|
@ -114,14 +117,16 @@
|
|||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
|
||||
<button type="button" class="btn btn-primary"
|
||||
onclick="connexion(document.getElementById('pseudo').value,document.getElementById('mdp').value)">Valider</button>
|
||||
<button type="submit" value="submit" class="btn btn-primary"
|
||||
onclick="connexion(document.getElementById('pseudo').value,document.getElementById('mdp').value)">Valider</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue