HEX
Server: Apache
System: Linux ns308404 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
User: root (0)
PHP: 8.3.31
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/onlinedev.com/httpdocs/admin/templates/list.phtml
<div class="head">
	<h1>Editer les News</h1>
	<a href="<?php echo App::getUrl('news', 'edit', array('parent_id' => $_REQUEST['parent_id'])) ?>" title="Button 4" class="but3">Ajouter</a>
</div>
<p>
	<a href="<?php echo App::getUrl('news', 'list') ?>" style="color: #000000;">Articles Principales</a> <?php if ($_REQUEST['parent_id']) { $n = new News(); $n->get($_REQUEST['parent_id']); echo '&gt;&gt; '.$n->title; }?>
</p>	
	<div class="items">
		<table border="0" cellspacing="0" cellpadding="0" class="pages">
			<tr>
				<td>Page:</td>
				<td><a href="<?php echo App::getUrl('news', 'list', array('parent_id' => $_REQUEST['parent_id'], 'start' => ($page > 1) ? ($page - 1) * 20 : '0' )) ?>" title="Previous"><img src="images/icon_prew.gif" alt="Previous" /></a> 
				<input type="text" size="2" value="<?php echo $page; ?>" readonly="readonly" /> <a href="<?php echo App::getUrl('news', 'list', array('parent_id' => $_REQUEST['parent_id'], 'start' => ($page < $totalpages) ? ($start + 20) : $start  )) ?>" title="Next"><img src="images/icon_next.gif" alt="Next" /></a></td>
				<td>de <span><?php echo $totalpages; ?></span> pages |</td>
				<td>Total: <span><?php echo $totalitems; ?></span></td>
			</tr>
		</table>
	</div>

	<table border="0" cellspacing="0" cellpadding="0" class="list1">
		<tr>
			<th align="left">Titre</th>
			<th width="130" align="left">Date de creation</th>
			<th width="120">Action</th>
		</tr>
		<?php $i = 0; foreach ($news as $item): ?>	
		<tr class="<?php echo  $i%2 == 0 ? 'r1' : 'r2'; ?>">
			<td><?php echo $item['title'] ?></td>
			<td><?php echo format_date($item['created_at']); ?></td>
			<td align="center">
			<?php if (!$_REQUEST['parent_id']): ?>
			<a href="<?php echo App::getUrl('news', 'list', array('parent_id' => $item['id'])) ?>" title="Sous-articles"><img src="<?php echo App::getBaseUrl() ?>images/icon_nav.gif" alt="Sous-articles"  /></a>&nbsp;
			<?php endif; ?>
			 <a href="<?php echo App::getUrl('news', 'edit', array('id' => $item['id'])) ?>" title="Editer"><img src="<?php echo App::getBaseUrl() ?>images/icon_edit.gif" alt="Editer" /></a> &nbsp; 
			<a href="#" onclick="del(<?php echo $item['id'] ?>)" title="Supprimer"><img src="<?php echo App::getBaseUrl() ?>images/icon_delete.gif" alt="Supprimer" /></a></td>
		</tr>
		<?php $i++; endforeach; ?>
		<?php for($j = $i; $j < 20; $j++): ?>
		<tr class="<?php echo  $j%2 == 0 ? 'r1' : 'r2'; ?>">
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
		<?php endfor; ?>
	</table>
	
	<script type="text/javascript">
	function del(id)
	{
		if (confirm('Supprimer cette actualite ?'))
		{
			window.location = '<?php echo App::getUrl('news', 'delete');  ?>&id=' + id;
		}
	}
	</script>