83 lines
2.0 KiB
PHP
83 lines
2.0 KiB
PHP
|
<?php
|
|||
|
/*
|
|||
|
* Liste des commandes pass<EFBFBD>es sur infogreffe
|
|||
|
*
|
|||
|
*/
|
|||
|
?>
|
|||
|
<div id="center">
|
|||
|
<h1>Commandes INFOGREFFE</h1>
|
|||
|
<?php
|
|||
|
$usersAuthorized = array('fzicaro','jmartory','mheitz','mricois','ylenaour','mpurcarin','aegasse');
|
|||
|
if (!$_SESSION['connected'])
|
|||
|
{
|
|||
|
echo 'Vous devez <20>tre connect<63> afin de pouvoir utiliser cette fonctionnalit<69>';
|
|||
|
}
|
|||
|
elseif(!in_array($_SESSION['tabInfo']['login'], $usersAuthorized))
|
|||
|
{
|
|||
|
echo 'L\'acc<63>s <20> cette page est restreint';
|
|||
|
}
|
|||
|
//Affichage des commandes
|
|||
|
else
|
|||
|
{
|
|||
|
isset($_REQUEST['num'])? $num = trim($_REQUEST['num']) : $num = '';
|
|||
|
isset($_REQUEST['siren'])? $siren = trim(preg_replace('/[^0-9]/', '', $_REQUEST['siren'])) : $siren = '';
|
|||
|
?>
|
|||
|
<div class="block">
|
|||
|
<form name="" method="post" action="./?page=greffescmd">
|
|||
|
<label>Num<EFBFBD>ro de gestion</label><input type="text" name="num" value="<?=$num?>"/><br/>
|
|||
|
<label>Siren</lable><input type="text" name="siren" value="<?=$siren?>"/><br/>
|
|||
|
<input type="submit" name="submit" value="Rechercher"/>
|
|||
|
</form>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
<?php
|
|||
|
if(!empty($num) || !empty($siren))
|
|||
|
{
|
|||
|
|
|||
|
require_once 'dbbootstrap.php';
|
|||
|
setDbConn('sdv1');
|
|||
|
if( !empty($siren) && empty($num) )
|
|||
|
{
|
|||
|
$q = Doctrine_Query::create()->from('Commandes')->where('siren = ?', $siren);
|
|||
|
}elseif( empty($siren) && !empty($num) ){
|
|||
|
$q = Doctrine_Query::create()->from('Commandes')->where('idCommande = ?', $num);
|
|||
|
}else{
|
|||
|
$q = Doctrine_Query::create()->from('Commandes')->where('siren = ?', $siren)->andWhere('idCommande = ?', $num);
|
|||
|
}
|
|||
|
$commandes = $q->execute();
|
|||
|
|
|||
|
?>
|
|||
|
<div class="block">
|
|||
|
<table>
|
|||
|
<tr>
|
|||
|
<th>Num</th>
|
|||
|
<th>Siren</th>
|
|||
|
<th>emailCommande</th>
|
|||
|
<th>refDocument</th>
|
|||
|
<th>dateCommande</th>
|
|||
|
<th>dateReception</th>
|
|||
|
</tr>
|
|||
|
<?php
|
|||
|
foreach($commandes as $commande)
|
|||
|
{
|
|||
|
?>
|
|||
|
<tr>
|
|||
|
<td><?=$commande->idCommande?></td>
|
|||
|
<td><?=$commande->siren?></td>
|
|||
|
<td><?=$commande->emailCommande?></td>
|
|||
|
<td><?=$commande->refDocument?></td>
|
|||
|
<td><?=$commande->dateCommande?></td>
|
|||
|
<td><?=$commande->dateReception?></td>
|
|||
|
</tr>
|
|||
|
<?php
|
|||
|
}
|
|||
|
?>
|
|||
|
</table>
|
|||
|
</div>
|
|||
|
<?php
|
|||
|
}
|
|||
|
} // Fin permission d'acc<63>s
|
|||
|
?>
|
|||
|
</div>
|
|||
|
<?php
|