Files

82 lines
3.0 KiB
PHP

@extends('layouts.app')
@section('content')
<style>
tr {
border-bottom: 1px solid #000;
}
tbody tr:last-child {
border-bottom: none;
}
td {
padding-left: 10px; /* ou margin-left: 10px; */
}
</style>
<table class="w-full bg-jlg-dark-blue flex justify-center">
<thead>
<tr class="border-jlg-white h-64 top-0 w-full lg:w-2/3 fixed flex items-stretch justify-around text-left lg:text-xl uppercase bg-jlg-dark-blue">
<th class="flex items-end justify-start"></th>
<th class="flex items-end justify-start pb-4">Images</th>
<th class="flex items-end justify-start pb-4">Voix Off et In</th>
<th class="flex items-end justify-start pb-4">Bande Son</th>
<th class="flex items-end justify-start pb-4">Écrits</th>
<th class="flex items-end justify-start"></th>
</tr>
</thead>
<tbody class="w-full lg:w-2/3 block bg-jlg-dark-blue">
<?php
$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
'meta_key' => 'Index',
'meta_type' => 'NUMERIC',
'orderby' => 'meta_value',
'order' => 'ASC'
);
$query = new WP_Query($args);
if ($query->have_posts()) :
while ($query->have_posts()) : $query->the_post();
$contenu = get_the_content();
$infosArray = explode("---", $contenu); // Divise le contenu en fonction des séparateurs
// Initialisez des variables pour stocker les informations
$images = isset($infosArray[0]) ? $infosArray[0] : '';
$voixOffIn = isset($infosArray[1]) ? $infosArray[1] : '';
$bandeson = isset($infosArray[2]) ? $infosArray[2] : '';
$ecrits = isset($infosArray[3]) ? $infosArray[3] : '';
//lien pour le crayon
$edit_link = 'https://localhost/wp/wp-admin/admin.php?page=rvy-revisions&post='. get_the_ID() .'&action=revise';
?>
<tr class="border-jlg-white font-authentic-60 w-full flex flex-row py-6">
<td class="block text-sm pl-0 pr-6">{{ the_title()}}</td>
<td class="block pl-0 pr-6"><?php echo $images; ?></td>
<td class="block pl-0 pr-6"><?php echo $voixOffIn; ?></td>
<td class="block pl-0 pr-6"><?php echo $bandeson; ?></td>
<td class="block pl-0 pr-6"><?php echo $ecrits; ?></td>
<td class="block text-sm pl-0 pr-6"><?php if(is_user_logged_in()){ echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button">&#128393;</a>';} elseif (!is_user_logged_in()) { echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button xoo-el-login-tgr ">&#128393;</a>';}?></td>
</tr>
<?php
endwhile;
endif;
wp_reset_postdata();
?>
</tbody>
</table>
@if (! have_posts())
<x-alert type="warning">
{!! __('Sorry, no results were found.', 'sage') !!}
</x-alert>
{!! get_search_form(false) !!}
@endif
@endsection