83 lines
2.0 KiB
PHP
83 lines
2.0 KiB
PHP
<?php
|
|
/*
|
|
* Liste des commandes passé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 être connecté afin de pouvoir utiliser cette fonctionnalité';
|
|
}
|
|
elseif(!in_array($_SESSION['tabInfo']['login'], $usersAuthorized))
|
|
{
|
|
echo 'L\'accès à 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é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ès
|
|
?>
|
|
</div>
|
|
<?php
|