77 lines
2.9 KiB
PHP
77 lines
2.9 KiB
PHP
<?php
|
||
$strPage = 'popup.php';
|
||
$strLangue = 'fr';
|
||
|
||
require_once('php/inc_functions.php');
|
||
require_once('php/inc_fx_messages.php');
|
||
|
||
// v<>rifier les param<61>tres
|
||
if (!empty($_GET['t']))
|
||
$strTable = $_GET['t'];
|
||
else
|
||
$strTable = '';
|
||
|
||
if (!empty($_GET['a']))
|
||
$strAction = $_GET['a'];
|
||
else
|
||
$strAction = '';
|
||
|
||
require_once('inc_header.php');
|
||
?>
|
||
|
||
<div id="main">
|
||
<div id="main_inner" class="fluid">
|
||
<div id="primaryContent_columnless">
|
||
<div id="columnA_columnless">
|
||
<?php
|
||
switch ($strAction) {
|
||
case 'add':
|
||
case 'mod':
|
||
fxShowForm($strAction, $strTable, $strLangue);
|
||
break;
|
||
|
||
case 'list':
|
||
// r<>cup<75>rer les donn<6E>es pour cr<63>er la liste
|
||
if (isset($_GET['pg']))
|
||
$intPage = $_GET['pg'];
|
||
else
|
||
$intPage = 1;
|
||
|
||
$strOrder = $strWhere = '';
|
||
|
||
// v<>rifier la clause WHERE
|
||
if (isset($_GET['btn_search'])) {
|
||
$tabWhere = array();
|
||
$tabFields = fxGetFormFields('search', $strTable);
|
||
|
||
for ($intCtr = 1; $intCtr <= count($tabFields); $intCtr++) {
|
||
// former le WHERE si la valeur n'est pas vide
|
||
if (trim($_GET[$tabFields[$intCtr]['name']]) != '')
|
||
if ($tabFields[$intCtr]['numeric'] == 1)
|
||
$tabWhere[] = fxUnescape($tabFields[$intCtr]['name']) . ' = ' . intval($_GET[$tabFields[$intCtr]['name']]);
|
||
else
|
||
$tabWhere[] = fxUnescape($tabFields[$intCtr]['name']) . " LIKE '%" . $GLOBALS['db']->fxEscape(trim($_GET[$tabFields[$intCtr]['name']])) . "%'";
|
||
}
|
||
|
||
// pousser le WHERE dans une variable
|
||
if (count($tabWhere) > 0)
|
||
$strWhere = implode(',', $tabWhere);
|
||
}
|
||
|
||
$intLimitStart = ($intPage * $intLimitNb) - $intLimitNb;
|
||
$tabResults = fxGetListData($strTable, $strOrder, $strWhere, $intLimitStart, $intLimitNb, $strLangue, $_GET['id']);
|
||
|
||
fxShowList($tabResults, $strTable, $strOrder, $strWhere, $intLimitStart, $intLimitNb, $intPage, $strLangue);
|
||
break;
|
||
}
|
||
?>
|
||
<p> </p>
|
||
<br class="clear" />
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<?php require_once('inc_footer.php'); ?>
|