mwen gen on ti problem, mwen gen on problem afichaj m pa we kote problem lan ye. premyeman nan pati afichaj imaj yo, mwen vle mete si imaj image1_side1 egziste pran image1_side1, si li pa egziste se image1_style 1 ki egziste afiche li etc... menm jan nan pati text lan tou si para1_style1 egziste afiche li si se pa sa afiche para2_style1 etc... m pa konnen si se lojik ki gen prob banm on koud men mesi
<?php include('include/database.php'); ?>
<?php include('include/menu_adm.php') ?>
<!--cote administrateur-->
<div class="admin_page_prim">
<div class="admin_page">
<div class="filter_admin_page">
<ul>
<li>s</li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
<div class="box_admin_page">
<div class="box_admin_titre_button">
<h1>Page de la historicite</h1>
<div class="box_admin_button">
<!--<a href="">
<button class="voir">Voir</button>
</a>-->
<a href="adm_actualite_creer.php">
<button class="creer">Creer</button>
</a>
<!-- <a href="">
<button class="modifier">Modifier</button>
</a>
<a href="">
<button class="effacer">Effacer</button>
</a>-->
</div>
</div>
<form action="" method="POST">
<h2><img src="icon/points.png" alt=""> Presentation de la page qui retrace l'historicite de la CONALD</h2>
<div class="liste_background">
<?php
$query = $conn->prepare("SELECT * FROM actualite_prime");
$query->execute();
while ($actualite = $query->fetch()) {
?>
<div class="liste_actualite_box">
<div class="liste_background_image">
<?php
if (isset($actualite["image1_side1"])) {
?>
<img src="media/actualite/<?= $actualite['image1_side1'] ?>" alt="">
<?php
}
?>
<?php
if (!isset($actualite["image1_side1"]) and isset($actualite["image1_style1"])) {
?>
<img src="media/actualite/<?= $actualite['image1_style1'] ?>" alt="">
<?php
}
?>
<?php
if (!isset($actualite["image1_side1"]) and !isset($actualite["image1_style1"]) and isset($actualite["image2_style1"])) {
?>
<img src="media/actualite/<?= $actualite['image2_style1'] ?>" alt="">
<?php
}
?>
<?php
if (!isset($actualite["image1_side1"]) and !isset($actualite["image1_style1"]) and !isset($actualite["image2_style1"]) and isset($actualite["image3_style1"])) {
?>
<img src="media/actualite/<?= $actualite['image3_style1'] ?>" alt="">
<?php
}
?>
<?php
if (!isset($actualite["image1_side1"]) and !isset($actualite["image1_style1"]) and !isset($actualite["image2_style1"]) and !isset($actualite["image3_style1"]) and isset($actualite["image4_style1"])) {
?>
<img src="media/actualite/<?= $actualite['image4_style1'] ?>" alt="">
<?php
}
?>
<?php
if (!isset($actualite["image1_side1"]) and !isset($actualite["image1_style1"]) and !isset($actualite["image2_style1"]) and !isset($actualite["image3_style1"]) and !isset($actualite["image4_style1"]) and isset($actualite["image5_style1"])) {
?>
<img src="media/actualite/<?= $actualite['image5_style1'] ?>" alt="">
<?php
}
?>
<?php
if (!isset($actualite["image1_side1"]) and !isset($actualite["image1_style1"]) and !isset($actualite["image2_style1"]) and !isset($actualite["image3_style1"]) and !isset($actualite["image4_style1"]) and !isset($actualite["image5_style1"]) and isset($actualite["image6_style1"])) {
?>
<img src="media/actualite/<?= $actualite['image6_style1'] ?>" alt="">
<?php
}
?>
</div>
<div class="liste_background_text">
<div class="liste_background_text_titre_para">
<p class="date_adm_history"><?= $actualite['date_style1'] ?></p>
<h1><?= $actualite['titre_style1'] ?></h1>
<?php
if (isset($actualite["para1_style1"])) {
?>
<p><?php echo substr($actualite['para1_style1'], 0, 360); ?> ...</p>
<?php
}
?>
<?php
if (!isset($actualite["para1_style1"]) and isset($actualite["para2_style1"])) {
?>
<p><?php echo substr($actualite['para2_style1'], 0, 360); ?> ...</p>
<?php
}
?>
<?php
if (!isset($actualite["para1_style1"]) and !isset($actualite["para2_style1"]) and isset($actualite["para3_style1"])) {
?>
<p><?php echo substr($actualite['para3_style1'], 0, 360); ?> ...</p>
<?php
}
?>
<?php
if (!isset($actualite["para1_style1"]) and !isset($actualite["para2_style1"]) and !isset($actualite["para3_style1"]) and isset($actualite["para4_style1"])) {
?>
<p><?php echo substr($actualite['para4_style1'], 0, 360); ?> ...</p>
<?php
}
?>
</div>
<div class="liste_background_button">
<button class="modifier"><a href="adm_actualite_modifier.php?actualite=<?= $actualite['id_actualite'] ?>">Modifier</a></button>
<button class="effacer"><a href="adm_actualite_delete.php?actualite=<?= $actualite['id_actualite']; ?> &&delete=1300&&id_actualite=<?= $actualite['id_actualite']; ?>">Effacer</a></button>
</div>
</div>
</div>
<?php
}
?>
</div>
</form>
</div>
</div>
</div>
</body>
</html>
Huguens Paul 22 Mars 2023PHPNon résolu 6