Ajout visualisation Produits/Recherches + table 'souhaits'
This commit is contained in:
parent
529b80375f
commit
eb59327952
|
@ -1,4 +1,5 @@
|
|||
config/config.php
|
||||
config/conf.php
|
||||
.idea
|
||||
/public/uploads
|
||||
/tmp
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
$host = 'localhost';
|
||||
$username = 'guser';
|
||||
$password = 'kptgT81U7nzYWHBdQ9';
|
||||
//$username = 'guser';
|
||||
$username = 'root';
|
||||
//$password = 'kptgT81U7nzYWHBdQ9';
|
||||
$password = 'root';
|
||||
$database_name = 'gmarche';
|
||||
|
|
|
@ -6,12 +6,6 @@ ini_set('display_errors', 0);
|
|||
include '../../config/conf.php';
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
|
||||
//$params1['slug'] = $_POST['antenne_slug'];
|
||||
// Récupération de l'id de l'antenne à partir de son slug
|
||||
//$req_search = "SELECT id FROM antennes WHERE slug = :slug";
|
||||
//$stmt = $bdd->prepare($req_search);
|
||||
//$antenne_id = $stmt->execute($params1);
|
||||
|
||||
// Récupération des informations du formulaire
|
||||
$params = array();
|
||||
$params['name'] = $params['slug'] = $_POST['produit'];
|
||||
|
@ -25,8 +19,6 @@ ini_set('display_errors', 0);
|
|||
$params['content'] = '';
|
||||
|
||||
// Insertion dans la base
|
||||
/*$requete = "INSERT INTO products(name, user_id, quantite, prix, created_at, antenne_id)
|
||||
VALUES(':nom_produit', ':vendeur', ':quantite', :prix, ':created_at', ':antenne_id')";*/
|
||||
$fields = array_keys($params);
|
||||
|
||||
$values = join(', ', array_map(function ($field) {
|
||||
|
|
|
@ -11,12 +11,7 @@
|
|||
$cle_pub_r = $_POST['cle_pub_r'];
|
||||
$prix_r = $_POST['prix_r'];
|
||||
|
||||
$query = "INSERT INTO recherches(produit, vendeur, cle_pub, prix) VALUES('$produit_r', '$vendeur_r', '$cle_pub_r', $prix_r)";
|
||||
//echo "Query = ".$query."////";
|
||||
//exit;
|
||||
if (!$result = mysqli_query($db,$query)) {
|
||||
exit(mysqli_connect_error());
|
||||
}
|
||||
echo "1 enregistrement ajouté !";
|
||||
$query = "INSERT INTO souhaits(produit, vendeur, cle_pub, prix) VALUES('$produit_r', '$vendeur_r', '$cle_pub_r', $prix_r)";
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -1,34 +1,32 @@
|
|||
<?php
|
||||
// include Database connection file
|
||||
include("db_connection.php");
|
||||
|
||||
// check request
|
||||
if(isset($_POST['id_r']) && isset($_POST['id_r']) != "")
|
||||
{
|
||||
// get Recherches ID
|
||||
$id_r = $_POST['id_r'];
|
||||
include '../../config/conf.php';
|
||||
|
||||
// Get Recherches Details
|
||||
$query = "SELECT * FROM recherches WHERE id = '$id_r'";
|
||||
if (!$result = mysqli_query($db,$query)) {
|
||||
exit(mysqli_connect_error());
|
||||
}
|
||||
$response = array();
|
||||
if(mysqli_num_rows($result) > 0) {
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
$response = $row;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
try {
|
||||
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
if (isset($_POST['id_r']) && isset($_POST['id_r']) != "") {
|
||||
|
||||
$souhait_id = $_POST['id_r'];
|
||||
$params["souhait_id"] = $souhait_id;
|
||||
|
||||
$requete = "SELECT souhaits.*, users.username
|
||||
FROM souhaits
|
||||
LEFT JOIN users
|
||||
ON users.id = souhaits.user_id
|
||||
WHERE souhaits.id = :souhait_id";
|
||||
$query = $bdd->prepare($requete);
|
||||
$query->execute($params);
|
||||
$results = array();
|
||||
while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
|
||||
$results = $row;
|
||||
};
|
||||
echo json_encode($results);
|
||||
} else {
|
||||
$response['status'] = 200;
|
||||
$response['message'] = "Data not found!";
|
||||
$response['message'] = "Invalid Request!";
|
||||
}
|
||||
// display JSON data
|
||||
echo json_encode($response);
|
||||
}
|
||||
else
|
||||
{
|
||||
$response['status'] = 200;
|
||||
$response['message'] = "Invalid Request!";
|
||||
} catch (PDOException $e) {
|
||||
echo "Erreur : " . $e->getMessage() . "<br/>";
|
||||
}
|
||||
|
||||
|
|
|
@ -1,54 +1,94 @@
|
|||
<?php
|
||||
// include Database connection file
|
||||
include("db_connection.php");
|
||||
ini_set('display_errors', 0);
|
||||
include '../../config/conf.php';
|
||||
$antenne_slug = $_GET['antenne_slug'];
|
||||
|
||||
// Design initial table header
|
||||
$data = '<table class="table table-bordered table-striped">
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
|
||||
// Design initial table header
|
||||
$data = '<table class="table table-bordered table-striped">
|
||||
<tr style="color: black;">
|
||||
<th>No.</th>
|
||||
<th>Bien ou service recherché</th>
|
||||
<th>Bien/service recherché</th>
|
||||
<th>Photo</th>
|
||||
<th>Acheteur</th>
|
||||
<th>Clé publique</th>
|
||||
<th>Prix en junes</th>
|
||||
<th>Mise à jour</th>
|
||||
<th>Suppression</th>
|
||||
<th>Quantité</th>
|
||||
<th>Prix en Ğ1</th>
|
||||
<th colspan="2" style="text-align: center;">Actions</th>
|
||||
</tr>';
|
||||
|
||||
$query = "SELECT * FROM recherches";
|
||||
$params["antenne_slug"] = $antenne_slug;
|
||||
|
||||
if (!$result = mysqli_query($db,$query)) {
|
||||
exit(mysqli_connect_error());
|
||||
}
|
||||
$requete = "SELECT souhaits.*, users.username
|
||||
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);
|
||||
$stmt->execute($params);
|
||||
$count = $stmt->rowCount();
|
||||
|
||||
// if query results contains rows then fetch those rows
|
||||
if(mysqli_num_rows($result) > 0)
|
||||
{
|
||||
$number = 1;
|
||||
while($row = mysqli_fetch_assoc($result))
|
||||
{
|
||||
$data .= '<tr style="background:lightblue;color:black;">
|
||||
<td>'.$number.'</td>
|
||||
<td>'.$row['produit'].'</td>
|
||||
<td>'.$row['vendeur'].'</td>
|
||||
<td>'.$row['cle_pub'].'</td>
|
||||
<td>'.$row['prix'].'</td>
|
||||
<td>
|
||||
<button onclick="GetRecherchesDetails('.$row['id'].')" class="btn btn-warning">Mettre à jour</button>
|
||||
</td>
|
||||
<td>
|
||||
<button onclick="DeleteRecherches('.$row['id'].')" class="btn btn-danger">Supprimer</button>
|
||||
</td>
|
||||
</tr>';
|
||||
$number++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// records now found
|
||||
$data .= "<tr style='color:white;'><td colspan='6'>Pas d'enregistrement</td></tr>";
|
||||
}
|
||||
if ($count > 0)
|
||||
{
|
||||
$number = 1;
|
||||
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
$data .= '</table>';
|
||||
$data .= "<tr style='background:lightblue;color:black;'>
|
||||
<td>$number</td>";
|
||||
|
||||
echo $data;
|
||||
$data .= '<td>'.$row['name'].'</td>';
|
||||
$data .= '<td><img src="/uploads/recherches/'.$antenne_slug.'/'.$row['image'].'" width="100" height="100" /></td>';
|
||||
$data .= '<td>'.$row['username'].'</td>';
|
||||
$data .= '<td></td>';
|
||||
$data .= '<td>'.$row['quantite'].'</td>';
|
||||
$data .= '<td>'.$row['prix'].'</td>';
|
||||
$data .= '<td>';
|
||||
$data .= '<button onclick="GetRecherchesDetails(\'';
|
||||
$data .= $row['id'];
|
||||
$data .= "'";
|
||||
$data .= ',';
|
||||
$data .= "'$antenne_slug'";
|
||||
$data .= ",'";
|
||||
$data .= $row['image'];
|
||||
$data .= "'";
|
||||
if ($row['username'] == $_GET['nom_connecte'] ) {
|
||||
$data .= ')" class=\'btn btn-primary\'';
|
||||
} else {
|
||||
$data .= ')" class=\'btn btn-info\' disabled=true';
|
||||
}
|
||||
$data .= '>Modifier';
|
||||
$data .= '</button>';
|
||||
$data .= '</td><td>';
|
||||
$data .= '<button onclick="DeleteRecherches(\'';
|
||||
$data .= $row['id'];
|
||||
$data .= "'";
|
||||
$data .= ',';
|
||||
$data .= "'$antenne_slug'";
|
||||
$data .= ",'";
|
||||
$data .= $row['image'];
|
||||
$data .= "'";
|
||||
if ($row['username'] == $_GET['nom_connecte'] ) {
|
||||
$data .= ')" class=\'btn btn-danger\'';
|
||||
} else {
|
||||
$data .= ')" class=\'btn btn-info\' disabled=true';
|
||||
}
|
||||
$data .= '>Supprimer</button>';
|
||||
$data .= '</td>';
|
||||
$data .= '</tr>';
|
||||
|
||||
$number++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Il n'y a pas encore de biens/services recherchés saisis
|
||||
$data .= "<tr style='background-color:lightblue;text-align:left;color:black;'><td colspan='10'>Aucun enregistrement saisi</td></tr>";
|
||||
}
|
||||
|
||||
$data .= '</table>';
|
||||
|
||||
echo $data;
|
||||
?>
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
// include Database connection file
|
||||
include("db_connection.php");
|
||||
|
||||
// Design initial table header
|
||||
$data = '<table class="table table-bordered table-striped">
|
||||
<tr style="color: black;">
|
||||
<th>No.</th>
|
||||
<th>Bien ou service recherché</th>
|
||||
<th>Acheteur</th>
|
||||
<th>Clé publique</th>
|
||||
<th>Prix en junes</th>
|
||||
<th>Mise à jour</th>
|
||||
<th>Suppression</th>
|
||||
</tr>';
|
||||
|
||||
$query = "SELECT * FROM recherches";
|
||||
|
||||
if (!$result = mysqli_query($db,$query)) {
|
||||
exit(mysqli_connect_error());
|
||||
}
|
||||
|
||||
// if query results contains rows then fetch those rows
|
||||
if(mysqli_num_rows($result) > 0)
|
||||
{
|
||||
$number = 1;
|
||||
while($row = mysqli_fetch_assoc($result))
|
||||
{
|
||||
$data .= '<tr style="background:lightblue;color:black;">
|
||||
<td>'.$number.'</td>
|
||||
<td>'.$row['produit'].'</td>
|
||||
<td>'.$row['vendeur'].'</td>
|
||||
<td>'.$row['cle_pub'].'</td>
|
||||
<td>'.$row['prix'].'</td>
|
||||
<td>
|
||||
<button onclick="GetRecherchesDetails('.$row['id'].')" class="btn btn-warning">Mettre à jour</button>
|
||||
</td>
|
||||
<td>
|
||||
<button onclick="DeleteRecherches('.$row['id'].')" class="btn btn-danger">Supprimer</button>
|
||||
</td>
|
||||
</tr>';
|
||||
$number++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// records now found
|
||||
$data .= "<tr style='color:white;'><td colspan='6'>Pas d'enregistrement</td></tr>";
|
||||
}
|
||||
|
||||
$data .= '</table>';
|
||||
|
||||
echo $data;
|
||||
?>
|
|
@ -1,20 +1,19 @@
|
|||
<?php
|
||||
// include Database connection file
|
||||
include("db_connection.php");
|
||||
|
||||
// check request
|
||||
include '../../config/conf.php';
|
||||
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
|
||||
if(isset($_POST))
|
||||
{
|
||||
// get values
|
||||
$id_r = $_POST['id_r'];
|
||||
$produit_r = $_POST['produit_r'];
|
||||
$vendeur_r = $_POST['vendeur_r'];
|
||||
$cle_pub_r = $_POST['cle_pub_r'];
|
||||
$prix_r = $_POST['prix_r'];
|
||||
// Updaste User details
|
||||
$params["id"] = $_POST['id_r'];
|
||||
$name = $_POST['produit_r'];
|
||||
$vendeur = $_POST['vendeur_r'];
|
||||
$cle_pub = $_POST['cle_pub_r'];
|
||||
$prix = $_POST['prix_r'];
|
||||
|
||||
$query = "UPDATE recherches SET produit = '$produit_r', vendeur = '$vendeur_r', cle_pub = '$cle_pub_r', prix = $prix_r WHERE id = '$id_r'";
|
||||
if (!$result = mysqli_query($db,$query)) {
|
||||
exit(mysqli_connect_error());
|
||||
}
|
||||
// Update table Souhaits
|
||||
$requete = "UPDATE souhaits SET name = '$name', vendeur = '$vendeur', cle_pub = '$cle_pub', prix = $prix WHERE id = :id";
|
||||
$query = $bdd->prepare($requete);
|
||||
$query->execute($params);
|
||||
}
|
||||
|
|
|
@ -43,8 +43,8 @@ li {
|
|||
background-attachment:fixed;
|
||||
background-position: center;
|
||||
background-size: 100% auto;
|
||||
font-family: Bree serif,"Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 18px;
|
||||
font-family: Bree Serif, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
}
|
||||
header.header {
|
||||
width: 389px;
|
||||
|
@ -92,9 +92,9 @@ header.header img {
|
|||
font-size: 24px;
|
||||
}
|
||||
.container {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
.records_content th {
|
||||
.records_content th, .records_content2 th {
|
||||
background-color: lightgray;
|
||||
color: rgba(0,0,0,0.85);
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ function addRecord2() {
|
|||
prix_r: prix_r
|
||||
}, function (data, status) {
|
||||
// close the popup
|
||||
$("#add_new_record_modal2").modal("hide");
|
||||
$("#add_new_record_modal").modal("hide");
|
||||
|
||||
// read records again
|
||||
readRecords2();
|
||||
|
@ -76,8 +76,11 @@ function readRecords(antenne_slug, nom_connecte) {
|
|||
});
|
||||
}
|
||||
// READ records2
|
||||
function readRecords2() {
|
||||
$.get("ajax/readRecords2.php", {}, function (data, status) {
|
||||
function readRecords2(antenne_slug, nom_connecte) {
|
||||
$.get("/ajax/readRecords2.php", {
|
||||
antenne_slug: antenne_slug,
|
||||
nom_connecte: nom_connecte
|
||||
}, function (data, status) {
|
||||
$(".records_content2").html(data);
|
||||
});
|
||||
}
|
||||
|
@ -104,12 +107,12 @@ function DeleteProduits(id, antenne_slug, nom_image) {
|
|||
function DeleteRecherches(id) {
|
||||
var conf = confirm("Etes-vous sûr(e) de vouloir supprimer ce bien ou service ?");
|
||||
if (conf == true) {
|
||||
$.post("ajax/deleteRecherches.php", {
|
||||
$.post("/ajax/deleteRecherches.php", {
|
||||
id_r: id
|
||||
},
|
||||
function (data, status) {
|
||||
// reload Recherches by using readRecords2();
|
||||
readRecords2();
|
||||
readRecords2(antenne_slug, nom_connecte);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -138,7 +141,7 @@ function GetProduitsDetails(id, antenne_slug, nom_image) {
|
|||
function GetRecherchesDetails(id) {
|
||||
// Champ caché de l'id
|
||||
$("#hidden_user_id_r").val(id);
|
||||
$.post("ajax/readRecherchesDetails.php", {
|
||||
$.post("/ajax/readRecherchesDetails.php", {
|
||||
id_r: id
|
||||
},
|
||||
function (data, status) {
|
||||
|
@ -152,7 +155,7 @@ function GetRecherchesDetails(id) {
|
|||
}
|
||||
);
|
||||
// Ouverture de la fenêtre modale
|
||||
$("#update_user_modal2").modal("show");
|
||||
$("#update_user_modal").modal("show");
|
||||
}
|
||||
function UpdateProduitsDetails(nom_connecte) {
|
||||
|
||||
|
@ -191,7 +194,7 @@ function UpdateRecherchesDetails() {
|
|||
var id = $("#hidden_user_id_r").val();
|
||||
|
||||
// Update the details by requesting to the server using ajax
|
||||
$.post("ajax/updateRecherchesDetails.php", {
|
||||
$.post("/ajax/updateRecherchesDetails.php", {
|
||||
id_r: id,
|
||||
produit_r: produit,
|
||||
image_r: image,
|
||||
|
@ -201,9 +204,9 @@ function UpdateRecherchesDetails() {
|
|||
},
|
||||
function (data, status) {
|
||||
// hide modal popup
|
||||
$("#update_user_modal2").modal("hide");
|
||||
$("#update_user_modal").modal("hide");
|
||||
// reload Recherches by using readRecords2();
|
||||
readRecords2();
|
||||
readRecords2(antenne_slug, nom_connecte);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -212,11 +215,16 @@ $(document).ready(function () {
|
|||
// On récupère le nom de l'antenne dans l'url pour afficher les biens/services de celle-ci
|
||||
var url = document.location.href;
|
||||
var antenne_slug = url.split('/')[5];
|
||||
var affichage_slug = url.split('/')[6];
|
||||
|
||||
var nom_connecte = $("#nom_connecte").text();
|
||||
$("#hidden_antenne_slug").val(antenne_slug);
|
||||
// READ records on page load
|
||||
readRecords(antenne_slug, nom_connecte);
|
||||
//readRecords2();
|
||||
if (affichage_slug == 'produits') {
|
||||
readRecords(antenne_slug, nom_connecte);
|
||||
} else {
|
||||
readRecords2(antenne_slug, nom_connecte);
|
||||
}
|
||||
$('#add_image').change(function(){
|
||||
|
||||
var fd_add = new FormData();
|
||||
|
|
|
@ -11,10 +11,10 @@ class NotFoundMiddleware {
|
|||
return new Response(404, [], '<html><head><link rel="stylesheet"
|
||||
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css"></head>
|
||||
<div style="padding: 5rem; height:100%; width:100%;
|
||||
background:url(\'../images/bildreich_1275.jpg\') no-repeat;background-size: cover;">
|
||||
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/gmarche" role="button">
|
||||
<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">
|
||||
Retour à l\'accueil</a></div></div></html>');
|
||||
}
|
||||
}
|
|
@ -20,8 +20,8 @@ class Router
|
|||
public function __construct(?string $cache = null)
|
||||
{
|
||||
$this->router = new FastRouteRouter(null, null, [
|
||||
// FastRouteRouter::CONFIG_CACHE_ENABLED => !is_null($cache),
|
||||
// FastRouteRouter::CONFIG_CACHE_FILE => $cache
|
||||
//FastRouteRouter::CONFIG_CACHE_ENABLED => !is_null($cache),
|
||||
//FastRouteRouter::CONFIG_CACHE_FILE => $cache
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -99,10 +99,6 @@ class Router
|
|||
*/
|
||||
public function match(ServerRequestInterface $request): ?Route
|
||||
{
|
||||
//echo "<br />request = ";
|
||||
//echo "<br />";
|
||||
//var_dump($request);
|
||||
//die();
|
||||
$result = $this->router->match($request);
|
||||
if ($result->isSuccess()) {
|
||||
return new Route(
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
namespace App\Product\Actions;
|
||||
|
||||
use App\Gmarche\Table\AntenneTable;
|
||||
use App\Gmarche\Table\RegionTable;
|
||||
use App\Product\Table\RechTable;
|
||||
use Framework\Actions\RouterAwareAction;
|
||||
use Framework\Renderer\RendererInterface;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
class RechIndexAction
|
||||
{
|
||||
|
||||
/**
|
||||
* @var RendererInterface
|
||||
*/
|
||||
private $renderer;
|
||||
|
||||
/**
|
||||
* @var RechTable
|
||||
*/
|
||||
private $rechTable;
|
||||
|
||||
use RouterAwareAction;
|
||||
|
||||
public function __construct(
|
||||
RendererInterface $renderer,
|
||||
RechTable $rechTable,
|
||||
AntenneTable $antenneTable,
|
||||
RegionTable $regionTable,
|
||||
ContainerInterface $container
|
||||
) {
|
||||
$this->renderer = $renderer;
|
||||
$this->rechTable = $rechTable;
|
||||
$this->antenneTable = $antenneTable;
|
||||
$this->regionTable = $regionTable;
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
public function __invoke(Request $request)
|
||||
{
|
||||
$params = $request->getQueryParams();
|
||||
$gmarchePrefix = $this->container->get('gmarche.prefix');
|
||||
$antenne_slug =$request->getAttribute('slug');
|
||||
$region_slug =$request->getAttribute('region');
|
||||
|
||||
$requete = $this->antenneTable->findBy('slug', $antenne_slug);
|
||||
$antenne_name = $requete->name;
|
||||
$antenne_id = $requete->id;
|
||||
$requete_region = $this->regionTable->findBy('slug', $region_slug);
|
||||
$region_name = $requete_region->name;
|
||||
$page = $params['p'] ?? 1;
|
||||
//$routePrefix = 'product.admin';
|
||||
//$routePrefix = 'product.index';
|
||||
$viewPath = '@product/admin/recherches';
|
||||
$items = $this->rechTable->findByAntenneId('antenne_id', $antenne_id)->paginate(20, $page);
|
||||
|
||||
return $this->renderer->render($viewPath.'/index', compact('antenne_slug','gmarchePrefix','region_name','region_slug','antenne_id','antenne_name','viewPath', 'items' ));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
<?php
|
||||
|
||||
namespace App\Product\Entity;
|
||||
|
||||
class Rech
|
||||
{
|
||||
|
||||
public $id;
|
||||
|
||||
public $name;
|
||||
|
||||
public $slug;
|
||||
|
||||
public $quantite;
|
||||
|
||||
public $prix;
|
||||
|
||||
public $image;
|
||||
|
||||
public $content;
|
||||
|
||||
public $createdAt;
|
||||
|
||||
public $updatedAt;
|
||||
|
||||
public $soldAt;
|
||||
|
||||
public $vendeurId;
|
||||
|
||||
public $userId;
|
||||
|
||||
public $antenneId;
|
||||
|
||||
public $strCreatedAt;
|
||||
|
||||
public $strUpdatedAt;
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getUserId(): ?int
|
||||
{
|
||||
return $this->userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $userId
|
||||
*/
|
||||
public function setUserId(int $userId)
|
||||
{
|
||||
$this->userId = $userId;
|
||||
}
|
||||
|
||||
|
||||
public function getAntenneId(): ?int
|
||||
{
|
||||
return $this->antenneId;
|
||||
}
|
||||
|
||||
public function setAntenneId(int $antenneId): void
|
||||
{
|
||||
$this->antenneId = $antenneId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \DateTime|null
|
||||
*/
|
||||
public function getCreatedAt(): ?\DateTime
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
public function setCreatedAt($datetime)
|
||||
{
|
||||
if (is_string($datetime)) {
|
||||
$this->createdAt = new \DateTime($datetime);
|
||||
} else {
|
||||
$this->createdAt = $datetime;
|
||||
}
|
||||
}
|
||||
|
||||
public function setUpdatedAt($datetime)
|
||||
{
|
||||
if (is_string($datetime)) {
|
||||
$this->updatedAt = new \DateTime($datetime);
|
||||
} else {
|
||||
$this->updatedAt = $datetime;
|
||||
}
|
||||
}
|
||||
|
||||
public function setSoldAt($datetime)
|
||||
{
|
||||
if (is_string($datetime)) {
|
||||
$this->soldAt = new \DateTime($datetime);
|
||||
} else {
|
||||
$this->soldAt = $datetime;
|
||||
}
|
||||
}
|
||||
|
||||
public function getThumb()
|
||||
{
|
||||
['filename' => $filename, 'extension' => $extension] = pathinfo($this->image);
|
||||
return '/uploads/recherches/' . $filename . '_thumb.' . $extension;
|
||||
}
|
||||
|
||||
public function getImageUrl()
|
||||
{
|
||||
return '/uploads/recherches/' . $this->image;
|
||||
}
|
||||
}
|
|
@ -1,16 +1,11 @@
|
|||
<?php
|
||||
namespace App\Product;
|
||||
|
||||
use App\Admin\AdminTwigExtension;
|
||||
use App\Product\Actions\ProductCrudAction;
|
||||
use App\Product\Actions\ProductIndexAction;
|
||||
use Framework\Auth\LoggedInMiddleware;
|
||||
use Framework\Middleware\CombinedMiddleware;
|
||||
use App\Product\Actions\RechIndexAction;
|
||||
use Framework\Module;
|
||||
use Framework\Renderer\RendererInterface;
|
||||
use Framework\Renderer\TwigRenderer;
|
||||
use Framework\Router;
|
||||
use GuzzleHttp\Psr7\ServerRequest;
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
class ProductModule extends Module
|
||||
|
@ -25,15 +20,10 @@ class ProductModule extends Module
|
|||
|
||||
$container->get(RendererInterface::class)->addPath('product', __DIR__ . '/views');
|
||||
$router = $container->get(Router::class);
|
||||
//$router->get("$gmarchePrefix/{region:[a-z\-0-9]+}/{antenne:[a-z\-0-9]+}", ProductIndexAction::class, 'product.index');
|
||||
//$router->get("$gmarchePrefix/{region:[a-z\-]+}/{slug:[a-z\-]+}", ProductIndexAction::class, 'product.ville');
|
||||
$router->get("/france/{region:[a-z\-0-9]+}/{slug:[a-z\-0-9]+}/produits", ProductIndexAction::class, 'product.ville');
|
||||
// comb $router->get("$gmarchePrefix/{region:[a-z\-0-9]+}/{slug:[a-z\-0-9]+}/produits", new CombinedMiddleware($container, [ProductIndexAction::class]), 'product.ville');
|
||||
|
||||
// $router->get("$gmarchePrefix/{region:[a-z\-0-9]+}/{antenne:[a-z\-0-9]+}/{slug:[a-z\-0-9]+}", ProductIndexAction::class, 'product.admin');
|
||||
|
||||
// $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->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]+}/{antenne:[0-9]{1,}}", ProductIndexAction::class, 'product.index');
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
|
||||
namespace App\Product\Table;
|
||||
|
||||
use App\Auth\UserTable;
|
||||
use App\Gmarche\Table\AntenneTable;
|
||||
use App\Gmarche\Table\RegionTable;
|
||||
use App\Product\Entity\Rech;
|
||||
use Framework\Database\Query;
|
||||
use Framework\Database\Table;
|
||||
|
||||
class RechTable extends Table
|
||||
{
|
||||
|
||||
protected $entity = Rech::class;
|
||||
|
||||
protected $table = 'souhaits';
|
||||
|
||||
public function findAll(): Query
|
||||
{
|
||||
$user = new UserTable($this->pdo);
|
||||
$antenne = new AntenneTable($this->pdo);
|
||||
$region = new RegionTable($this->pdo);
|
||||
return $this->makeQuery()
|
||||
->join($user->getTable().' as u' , 'u.id = rech.user_id')
|
||||
->join($antenne->getTable().' as a' , 'a.id = rech.antenne_id')
|
||||
->join($region->getTable().' as reg' , 'reg.id = a.region_id')
|
||||
->select('rech.*, u.username, a.name as antenne_name, reg.name as region_name' )
|
||||
->order('rech.created_at DESC');
|
||||
}
|
||||
|
||||
public function findByAntenneId($field, $value): Query
|
||||
{
|
||||
$user = new UserTable($this->pdo);
|
||||
$antenne = new AntenneTable($this->pdo);
|
||||
$region = new RegionTable($this->pdo);
|
||||
return $this->makeQuery()
|
||||
->join($user->getTable().' as u' , 'u.id = rech.user_id')
|
||||
->join($antenne->getTable().' as a' , 'a.id = rech.antenne_id')
|
||||
->join($region->getTable().' as reg' , 'reg.id = rech.region_id')
|
||||
->select('rech.*, u.username, a.name as antenne_name, reg.name as region_name' )
|
||||
->where("$field = $value" )
|
||||
->order('rech.created_at DESC');
|
||||
}
|
||||
}
|
|
@ -53,7 +53,6 @@
|
|||
}
|
||||
.toggle_radio input[type=radio]{
|
||||
display: none;
|
||||
/*position: fixed;*/
|
||||
}
|
||||
.toggle_radio label{
|
||||
/* font: 90%/1.618 "Source Sans Pro";*/
|
||||
|
@ -66,10 +65,7 @@
|
|||
border-radius: 50px;
|
||||
cursor: pointer;
|
||||
z-index: 1;
|
||||
/*background: rgba(0,0,0,.1);*/
|
||||
text-align: center;
|
||||
/*margin: 0 2px;*/
|
||||
/*background: blue;*/ /*make it blue*/
|
||||
}
|
||||
.toggle_option_slider{
|
||||
width: 100px;
|
||||
|
@ -91,191 +87,191 @@
|
|||
|
||||
</style>
|
||||
<script type="text/javascript" src="/js/script.js"></script>
|
||||
<!-- 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 active">G-Marché de {{ antenne_name }}</li>
|
||||
<div class="container_main" style="background-color: black;">
|
||||
<!-- 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 active">G-Marché de {{ antenne_name }}</li>
|
||||
|
||||
<div class="toggle_radio">
|
||||
<input type="radio" checked class="toggle_option" id="first_toggle" name="toggle_option">
|
||||
<input style="color:black;" type="radio" class="toggle_option" id="second_toggle" name="toggle_option">
|
||||
<label for="first_toggle"><p>PRODUITS</p></label>
|
||||
<label for="second_toggle">
|
||||
recherches
|
||||
<p>
|
||||
<li>
|
||||
<!-- <a href="/gmarche/{{ region_slug }}/{{ antenne_slug }}/1">RECHERCHES</a>-->
|
||||
</li>
|
||||
</p>
|
||||
</label>
|
||||
<div class="toggle_option_slider">
|
||||
<div class="toggle_radio">
|
||||
<input type="radio" checked class="toggle_option" id="first_toggle" name="toggle_option">
|
||||
<input style="color:black;" type="radio" class="toggle_option" id="second_toggle" name="toggle_option">
|
||||
<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>
|
||||
</p>
|
||||
</label>
|
||||
<div class="toggle_option_slider">
|
||||
</div>
|
||||
<!--<li class="breadcrumb-item active">PRODUITS</li>
|
||||
<span style="margin-left:20px;">
|
||||
<li class="breadcrumb-item"><a href="/gmarche/{{ region_slug }}/{{ antenne_slug }}/1">RECHERCHES</a></li>
|
||||
</span>-->
|
||||
</div>
|
||||
<!--<li class="breadcrumb-item active">PRODUITS</li>
|
||||
<span style="margin-left:20px;">
|
||||
<li class="breadcrumb-item"><a href="/gmarche/{{ region_slug }}/{{ antenne_slug }}/1">RECHERCHES</a></li>
|
||||
</span>-->
|
||||
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
<div id="la_page">
|
||||
<!--<div class="label" style="background-color: white;">
|
||||
<h4>G-Marché de antenne_name </h4>
|
||||
</div>-->
|
||||
{% if antenne_name == 'Paris' %}
|
||||
<script type="text/javascript">
|
||||
$('.fond').css('background-image', "url('/images/toureiffel.jpeg')");
|
||||
</script>
|
||||
{% endif %}
|
||||
<div class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="container" style="font-size:18px; color:white;line-height:1.4rem;">
|
||||
<div>Tous les mois, la Toile Francilienne organise des rencontres entre utilisateurs de la Monnaie Libre.</div>
|
||||
C'est l'occasion rêvée d'échanger avec d'autres membres !
|
||||
{{ annonce_ligne1 }}
|
||||
{{ annonce_ligne2 }}
|
||||
{{ annonce_ligne3 }}
|
||||
<p></p>
|
||||
<div>Consultez, rajoutez, modifiez vos propositions dans la liste du mois.</div>
|
||||
Mettez bien le pseudo, la clé publique, le bien ou service, et le prix en june.
|
||||
</div>
|
||||
<p>
|
||||
{% if current_user() %}
|
||||
<button style="color:white; font-size: 14px;" class="btn btn-primary" data-toggle="modal" data-target="#add_new_record_modal">Ajouter un bien ou service
|
||||
{% else %}
|
||||
<div class="btn btn-primary">
|
||||
<a class="nav-link" style="color: white; font-size: 14px;" href="{{ path('auth.login') }}">Veuillez vous identifier pour ajouter un bien/service</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</button>
|
||||
</p>
|
||||
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
<div id="la_page">
|
||||
<!--<div class="label" style="background-color: white;">
|
||||
<h4>G-Marché de antenne_name </h4>
|
||||
</div>-->
|
||||
{% if antenne_name == 'Paris' %}
|
||||
<script type="text/javascript">
|
||||
$('.fond').css('background-image', "url('/images/toureiffel.jpeg')");
|
||||
</script>
|
||||
{% endif %}
|
||||
<div class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="container" style="color:white;line-height:1rem;">
|
||||
Tous les mois, la Toile Francilienne organise des rencontres entre utilisateurs de la Monnaie Libre.
|
||||
C'est l'occasion rêvée d'échanger avec d'autres membres !
|
||||
{{ annonce_ligne1 }}
|
||||
{{ annonce_ligne2 }}
|
||||
{{ annonce_ligne3 }}
|
||||
<p></p>
|
||||
Consultez, rajoutez, modifiez vos propositions dans la liste du mois.
|
||||
Mettez bien le pseudo, la clé publique, le bien ou service, et le prix en june.
|
||||
</div>
|
||||
<p>
|
||||
{% if current_user() %}
|
||||
<button style="color:white; font-size: 14px;" class="btn btn-primary" data-toggle="modal" data-target="#add_new_record_modal">Ajouter un bien ou service
|
||||
{% else %}
|
||||
<div class="btn btn-primary">
|
||||
<a class="nav-link" style="color: white; font-size: 14px;" href="{{ path('auth.login') }}">Veuillez vous identifier pour ajouter un bien/service</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</button>
|
||||
</p>
|
||||
|
||||
<div class="records_content"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="add_new_record_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="modal-dialog" role="document" style="color: black;">
|
||||
<div class="modal-content" style="text-align: left;">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel">Ajouter une ligne</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="vendeur">Vendeur</label>
|
||||
<input type="text" id="vendeur" disabled="disabled" placeholder="{{ current_user().username }}" class="form-control"/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="produit">Bien ou service</label>
|
||||
<input type="text" id="produit" placeholder="Bien ou service" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-7">
|
||||
<form method='post' action='' enctype="multipart/form-data">
|
||||
Choisir l'image : <input type='file' name='file' id='add_image' class='form-control' ><br>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div id="add_preview" style="border:1px solid black;width:160px;height:160px;"> </div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="cle_pub">Clé publique</label>
|
||||
<input type="text" id="cle_pub" placeholder="Clé publique" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="quantite">Quantité</label>
|
||||
<input type="number" id="quantite" placeholder="Quantité" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group has-error has-feedback">
|
||||
<label for="prix">Prix en junes</label>
|
||||
<input type="number" id="prix" placeholder="prix" class="form-control"/>
|
||||
</div>
|
||||
<div class="alert alert-block alert-danger" style="display:none">
|
||||
<h4>Erreur !</h4>
|
||||
Vous devez entrer un nombre !
|
||||
</div>
|
||||
</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="addRecord('{{ antenne_slug }}','{{ antenne_id }}','{{ current_user().username }}','{{ current_user().id }}')">Ajouter</button>
|
||||
<div class="records_content"></div>
|
||||
<div class="records_content2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="update_user_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="modal-dialog" role="document" style="color: black;">
|
||||
<div class="modal-content" style="text-align: left;">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel">Mettre à jour</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<div class="modal fade" id="add_new_record_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="modal-dialog" role="document" style="color: black;">
|
||||
<div class="modal-content" style="text-align: left;">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel">Ajouter une ligne</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="vendeur">Vendeur</label>
|
||||
<input type="text" id="vendeur" disabled="disabled" placeholder="{{ current_user().username }}" class="form-control"/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="produit">Bien ou service</label>
|
||||
<input type="text" id="produit" placeholder="Bien ou service" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-7">
|
||||
<form method='post' action='' enctype="multipart/form-data">
|
||||
Choisir l'image : <input type='file' name='file' id='add_image' class='form-control' ><br>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div id="add_preview" style="border:1px solid black;width:160px;height:160px;"> </div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="cle_pub">Clé publique</label>
|
||||
<input type="text" id="cle_pub" placeholder="Clé publique" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="quantite">Quantité</label>
|
||||
<input type="number" id="quantite" placeholder="Quantité" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group has-error has-feedback">
|
||||
<label for="prix">Prix en junes</label>
|
||||
<input type="number" id="prix" placeholder="prix" class="form-control"/>
|
||||
</div>
|
||||
<div class="alert alert-block alert-danger" style="display:none">
|
||||
<h4>Erreur !</h4>
|
||||
Vous devez entrer un nombre !
|
||||
</div>
|
||||
</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="addRecord('{{ antenne_slug }}','{{ antenne_id }}','{{ current_user().username }}','{{ current_user().id }}')">Ajouter</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="update_vendeur">Vendeur</label>
|
||||
<input type="input" disabled="disabled" id="update_vendeur" placeholder="Vendeur" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="update_produit">Bien ou service</label>
|
||||
<input type="text" id="update_produit" placeholder="Bien ou service proposé" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-7">
|
||||
<form method='post' action='' enctype="multipart/form-data">
|
||||
Choisir l'image : <input type='file' name='file' id='image' class='form-control' ><br>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="update_user_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="modal-dialog" role="document" style="color: black;">
|
||||
<div class="modal-content" style="text-align: left;">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel">Mettre à jour</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div id="preview" style="border:1px solid black;width:160px;height:160px;"> </div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="update_vendeur">Vendeur</label>
|
||||
<input type="input" disabled="disabled" id="update_vendeur" placeholder="Vendeur" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="update_produit">Bien ou service</label>
|
||||
<input type="text" id="update_produit" placeholder="Bien ou service proposé" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-7">
|
||||
<form method='post' action='' enctype="multipart/form-data">
|
||||
Choisir l'image : <input type='file' name='file' id='image' class='form-control' ><br>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div id="preview" style="border:1px solid black;width:160px;height:160px;"> </div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group has-error has-feedback">
|
||||
<label for="update_quantite">Quantité</label>
|
||||
<input type="number" id="update_quantite" placeholder="Quantité" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group has-error has-feedback">
|
||||
<label for="update_prix">Prix en junes</label>
|
||||
<input type="number" id="update_prix" placeholder="Prix" class="form-control"/>
|
||||
</div>
|
||||
</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="UpdateProduitsDetails('{{ current_user().username }}')" >Sauvegarder</button>
|
||||
<input type="hidden" id="hidden_user_id">
|
||||
<input type="hidden" id="hidden_antenne_slug">
|
||||
<input type="hidden" id="hidden_image_name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group has-error has-feedback">
|
||||
<label for="update_quantite">Quantité</label>
|
||||
<input type="number" id="update_quantite" placeholder="Quantité" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group has-error has-feedback">
|
||||
<label for="update_prix">Prix en junes</label>
|
||||
<input type="number" id="update_prix" placeholder="Prix" class="form-control"/>
|
||||
</div>
|
||||
</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="UpdateProduitsDetails('{{ current_user().username }}')" >Sauvegarder</button>
|
||||
<input type="hidden" id="hidden_user_id">
|
||||
<input type="hidden" id="hidden_antenne_slug">
|
||||
<input type="hidden" id="hidden_image_name">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <table style="padding:0.15rem;" class="table-striped tableau">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:8rem;">Produit</th>
|
||||
<th style="width:8rem;">Photo</th>
|
||||
<th style="width:7rem;">Vendeur</th>
|
||||
<th style="width:5rem;">Quantité</th>
|
||||
<th style="width:6rem;">Prix</th>
|
||||
<th style="width:6rem;">Màj le</th>
|
||||
<th style="width:12rem;" colspan="2">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
crochet% set token_input = csrf_input %crochet
|
||||
|
||||
paginate(items, routePrefix ~ '.index', {id: item.id, region: explodeUrl()[2],
|
||||
slug: explodeUrl()[3], antenne: explodeUrl()[4]}) -->
|
||||
</div>
|
||||
|
||||
<!-- <table style="padding:0.15rem;" class="table-striped tableau">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:8rem;">Produit</th>
|
||||
<th style="width:8rem;">Photo</th>
|
||||
<th style="width:7rem;">Vendeur</th>
|
||||
<th style="width:5rem;">Quantité</th>
|
||||
<th style="width:6rem;">Prix</th>
|
||||
<th style="width:6rem;">Màj le</th>
|
||||
<th style="width:12rem;" colspan="2">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
crochet% set token_input = csrf_input %crochet
|
||||
|
||||
paginate(items, routePrefix ~ '.index', {id: item.id, region: explodeUrl()[2],
|
||||
slug: explodeUrl()[3], antenne: explodeUrl()[4]}) -->
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -0,0 +1,277 @@
|
|||
|
||||
{% extends 'layout.twig' %}
|
||||
{% 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: 26px;
|
||||
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: 3px;
|
||||
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;">
|
||||
<!-- 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 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>
|
||||
</label>
|
||||
<label for="second_toggle">
|
||||
<p>RECHERCHES</p>
|
||||
</label>
|
||||
<div class="toggle_option_slider">
|
||||
</div>
|
||||
<!--<li class="breadcrumb-item active">PRODUITS</li>
|
||||
<span style="margin-left:20px;">
|
||||
<li class="breadcrumb-item"><a href="/gmarche/{{ region_slug }}/{{ antenne_slug }}/1">RECHERCHES</a></li>
|
||||
</span>-->
|
||||
</div>
|
||||
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
<div id="la_page">
|
||||
<!--<div class="label" style="background-color: white;">
|
||||
<h4>G-Marché de antenne_name </h4>
|
||||
</div>-->
|
||||
{% if antenne_name == 'Paris' %}
|
||||
<script type="text/javascript">
|
||||
$('.fond').css('background-image', "url('/images/toureiffel.jpeg')");
|
||||
</script>
|
||||
{% endif %}
|
||||
<div class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="container" style="font-size:18px; color:white;line-height:1.4rem;">
|
||||
<div>Tous les mois, la Toile Francilienne organise des rencontres entre utilisateurs de la Monnaie Libre.</div>
|
||||
C'est l'occasion rêvée d'échanger avec d'autres membres !
|
||||
{{ annonce_ligne1 }}
|
||||
{{ annonce_ligne2 }}
|
||||
{{ annonce_ligne3 }}
|
||||
<p></p>
|
||||
<div>Consultez, rajoutez, modifiez vos propositions dans la liste du mois.</div>
|
||||
Mettez bien le pseudo, la clé publique, le bien ou service, et le prix en june.
|
||||
</div>
|
||||
<p>
|
||||
{% if current_user() %}
|
||||
<button style="color:white; font-size: 14px;" class="btn btn-primary" data-toggle="modal" data-target="#add_new_record_modal">Ajouter un bien ou service
|
||||
{% else %}
|
||||
<div class="btn btn-primary">
|
||||
<a class="nav-link" style="color: white; font-size: 14px;" href="{{ path('auth.login') }}">Veuillez vous identifier pour ajouter un bien/service</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</button>
|
||||
</p>
|
||||
|
||||
|
||||
<div class="records_content2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="add_new_record_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="modal-dialog" role="document" style="color: black;">
|
||||
<div class="modal-content" style="text-align: left;">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel">Ajouter une ligne</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="acheteur">Acheteur</label>
|
||||
<input type="text" id="acheteur" disabled="disabled" placeholder="{{ current_user().username }}" class="form-control"/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="produit">Bien / service recherché</label>
|
||||
<input type="text" id="produit" placeholder="Bien / service que vous recherchez" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-7">
|
||||
<form method='post' action='' enctype="multipart/form-data">
|
||||
Choisir l'image : <input type='file' name='file' id='add_image' class='form-control' ><br>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div id="add_preview" style="border:1px solid black;width:160px;height:160px;"> </div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="cle_pub">Clé publique</label>
|
||||
<input type="text" id="cle_pub" placeholder="Clé publique" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="quantite">Quantité</label>
|
||||
<input type="number" id="quantite" placeholder="Quantité" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group has-error has-feedback">
|
||||
<label for="prix">Prix en junes</label>
|
||||
<input type="number" id="prix" placeholder="prix" class="form-control"/>
|
||||
</div>
|
||||
<div class="alert alert-block alert-danger" style="display:none">
|
||||
<h4>Erreur !</h4>
|
||||
Vous devez entrer un nombre !
|
||||
</div>
|
||||
</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="addRecord('{{ antenne_slug }}','{{ antenne_id }}','{{ current_user().username }}','{{ current_user().id }}')">Ajouter</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="update_user_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="modal-dialog" role="document" style="color: black;">
|
||||
<div class="modal-content" style="text-align: left;">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel">Mettre à jour</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="update_acheteur">Acheteur</label>
|
||||
<input type="input" disabled="disabled" id="update_acheteur" placeholder="Acheteur" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="update_produit">Bien ou service</label>
|
||||
<input type="text" id="update_produit" placeholder="Bien ou service proposé" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-7">
|
||||
<form method='post' action='' enctype="multipart/form-data">
|
||||
Choisir l'image : <input type='file' name='file' id='image' class='form-control' ><br>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div id="preview" style="border:1px solid black;width:160px;height:160px;"> </div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group has-error has-feedback">
|
||||
<label for="update_quantite">Quantité</label>
|
||||
<input type="number" id="update_quantite" placeholder="Quantité" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group has-error has-feedback">
|
||||
<label for="update_prix">Prix en junes</label>
|
||||
<input type="number" id="update_prix" placeholder="Prix" class="form-control"/>
|
||||
</div>
|
||||
</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="UpdateRecherchesDetails('{{ current_user().username }}')" >Sauvegarder</button>
|
||||
<input type="hidden" id="hidden_user_id">
|
||||
<input type="hidden" id="hidden_antenne_slug">
|
||||
<input type="hidden" id="hidden_image_name">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <table style="padding:0.15rem;" class="table-striped tableau">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:8rem;">Produit</th>
|
||||
<th style="width:8rem;">Photo</th>
|
||||
<th style="width:7rem;">Vendeur</th>
|
||||
<th style="width:5rem;">Quantité</th>
|
||||
<th style="width:6rem;">Prix</th>
|
||||
<th style="width:6rem;">Màj le</th>
|
||||
<th style="width:12rem;" colspan="2">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
crochet% set token_input = csrf_input %crochet
|
||||
|
||||
paginate(items, routePrefix ~ '.index', {id: item.id, region: explodeUrl()[2],
|
||||
slug: explodeUrl()[3], antenne: explodeUrl()[4]}) -->
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue