2009-12-04 17:17:09 +00:00
|
|
|
<?php
|
|
|
|
/*
|
2010-02-10 17:27:03 +00:00
|
|
|
* Liste des commandes passées sur infogreffe
|
2010-04-16 08:06:40 +00:00
|
|
|
*
|
2009-12-04 17:17:09 +00:00
|
|
|
*/
|
2010-02-10 17:27:03 +00:00
|
|
|
|
|
|
|
if(isset($_REQUEST['submit']) && $_REQUEST['submit']=='comment')
|
|
|
|
{
|
|
|
|
require_once 'dbbootstrap.php';
|
2010-04-16 08:06:40 +00:00
|
|
|
setDbConn('sdv1');
|
2010-02-10 17:27:03 +00:00
|
|
|
$q = Doctrine_Query::create()
|
|
|
|
->update('Commandes')
|
|
|
|
->set('statutCommande', '?', $_REQUEST['statutCommande'])
|
|
|
|
->set('commentaire', '?', $_REQUEST['commentaire'])
|
|
|
|
->where('idCommande = ?', $_REQUEST['idCommande']);
|
|
|
|
//echo $q->getSql();
|
2010-04-16 08:06:40 +00:00
|
|
|
//print_r($q->getFlattenedParams());
|
2010-02-10 17:27:03 +00:00
|
|
|
echo $rows = $q->execute();
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(isset($_REQUEST['ajax']))
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<form>
|
|
|
|
<span id="message"></span><br/>
|
|
|
|
<input type="hidden" name="idCommande" value="<?=$_REQUEST['id']?>"/>
|
|
|
|
<input type="hidden" name="statutCommande" value="<?=$_REQUEST['erreur']?>"/>
|
|
|
|
Commentaire sur la commande G<?=$_REQUEST['id']?><br/>
|
|
|
|
<textarea name="commentaire" cols="40" rows="3"></textarea>
|
|
|
|
</form>
|
2010-04-16 08:06:40 +00:00
|
|
|
<?php
|
2010-02-10 17:27:03 +00:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2009-12-04 17:17:09 +00:00
|
|
|
?>
|
2010-02-02 10:56:42 +00:00
|
|
|
<style type="text/css">
|
2010-04-16 08:06:40 +00:00
|
|
|
table {width:100%; border-collapse:collapse; margin:5px 0;}
|
2010-04-19 16:01:10 +00:00
|
|
|
table tr.odd {background-color:#e6eeee;}
|
|
|
|
table tr.even {}
|
2010-04-20 12:22:50 +00:00
|
|
|
table tr.un {
|
|
|
|
border-top:2px solid;
|
|
|
|
}
|
|
|
|
table tr.deux {
|
|
|
|
vertical-align:top;
|
|
|
|
border-bottom:2px solid;
|
|
|
|
}
|
|
|
|
table th, table td {border:1px dashed; padding:5px;}
|
2010-04-16 08:06:40 +00:00
|
|
|
select {font-size:11px;}
|
2010-02-02 10:56:42 +00:00
|
|
|
</style>
|
2010-02-10 17:27:03 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function()
|
|
|
|
{
|
|
|
|
$('.changeEtat').each(function(){
|
|
|
|
var $link = $(this);
|
|
|
|
var $dialog = $('<div></div>')
|
|
|
|
.dialog({
|
|
|
|
autoOpen: false,
|
|
|
|
title: $link.attr('title'),
|
|
|
|
width: 400,
|
|
|
|
height: 200,
|
2010-04-16 08:06:40 +00:00
|
|
|
open: function(event, ui) {
|
|
|
|
$(this).load($link.attr('href'));
|
2010-02-10 17:27:03 +00:00
|
|
|
},
|
|
|
|
buttons: {
|
|
|
|
'Placer la commande en erreur': function() {
|
2010-04-16 08:06:40 +00:00
|
|
|
$.post('./pages/greffescmd.php',
|
|
|
|
{
|
|
|
|
idCommande: $('input[name=idCommande]').val(),
|
2010-02-10 17:27:03 +00:00
|
|
|
commentaire: $('textarea[name=commentaire]').val(),
|
2010-04-16 08:06:40 +00:00
|
|
|
statutCommande: $('input[name=statutCommande]').val(),
|
|
|
|
submit: 'comment'
|
|
|
|
},
|
2010-02-10 17:27:03 +00:00
|
|
|
function(data){
|
|
|
|
if(data==1){ $dialog.dialog('close'); }
|
|
|
|
else $('#message').html('Erreur...');
|
|
|
|
}
|
2010-04-16 08:06:40 +00:00
|
|
|
);
|
2010-02-10 17:27:03 +00:00
|
|
|
},
|
|
|
|
'Annuler': function() { $(this).dialog('close'); }
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$link.click(function() {
|
|
|
|
$dialog.dialog('open');
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
2010-04-16 08:06:40 +00:00
|
|
|
|
2010-04-19 16:01:10 +00:00
|
|
|
var url = './pages/ajax/greffescmd_courrier.php';
|
|
|
|
|
|
|
|
$('.changeEtatC').change(function(){
|
|
|
|
var newEtat = $(this).val();
|
|
|
|
var name = $(this).attr('name');
|
|
|
|
$.post(url, { changeEtat: newEtat },
|
|
|
|
function(data){ $('select[name='+name+']').replaceWith(data); }
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
2010-02-10 17:27:03 +00:00
|
|
|
});
|
|
|
|
</script>
|
2009-12-04 17:17:09 +00:00
|
|
|
<div id="center">
|
2010-04-19 16:01:10 +00:00
|
|
|
<h1>Commandes INFOGREFFE<?=hasModeEdition()?' - Interface de production':''?></h1>
|
2010-04-16 08:06:40 +00:00
|
|
|
<?php
|
2009-12-04 17:17:09 +00:00
|
|
|
if (!$_SESSION['connected'])
|
|
|
|
{
|
2010-02-10 17:27:03 +00:00
|
|
|
echo 'Vous devez être connecté afin de pouvoir utiliser cette fonctionnalité';
|
2009-12-04 17:17:09 +00:00
|
|
|
}
|
2010-02-10 17:27:03 +00:00
|
|
|
elseif(!hasModeEdition())
|
2009-12-04 17:17:09 +00:00
|
|
|
{
|
2010-02-10 17:27:03 +00:00
|
|
|
echo 'L\'accès à cette page est restreint';
|
2009-12-04 17:17:09 +00:00
|
|
|
}
|
|
|
|
//Affichage des commandes
|
|
|
|
else
|
|
|
|
{
|
2010-04-20 10:19:53 +00:00
|
|
|
require_once 'infogreffe/gestion.php';
|
|
|
|
|
2010-04-16 08:06:40 +00:00
|
|
|
isset($_REQUEST['num'])?
|
|
|
|
$num = trim($_REQUEST['num']) :
|
2010-02-10 17:27:03 +00:00
|
|
|
$num = '';
|
2010-04-16 08:06:40 +00:00
|
|
|
isset($_REQUEST['siren'])?
|
|
|
|
$siren = trim(preg_replace('/[^0-9]/','', $_REQUEST['siren'])) :
|
2010-02-10 17:27:03 +00:00
|
|
|
$siren = '';
|
2010-04-20 10:19:53 +00:00
|
|
|
$siren = str_replace(' ', '',$siren);
|
|
|
|
$type = isset($_REQUEST['type']) ? $_REQUEST['type'] : '';
|
|
|
|
|
2010-04-16 08:06:40 +00:00
|
|
|
isset($_REQUEST['cmd'])?
|
|
|
|
$cmd = $_REQUEST['cmd'] :
|
|
|
|
$cmd = '';
|
|
|
|
|
2010-04-20 10:19:53 +00:00
|
|
|
if (isset($_REQUEST['cmd_recherche'])){
|
|
|
|
$num = strtoupper($_REQUEST['num']);
|
|
|
|
$commandes = commandesRecherche($num, $siren, $type);
|
|
|
|
} elseif (isset($_REQUEST['cmd_liste'])){
|
|
|
|
$etat = isset($_REQUEST['etat']) ? $_REQUEST['etat'] : '';
|
|
|
|
$date = isset($_REQUEST['date']) ? $_REQUEST['date'] : '';
|
|
|
|
$typeCommande = isset($_REQUEST['typeCommande'])? $_REQUEST['typeCommande'] : '';
|
|
|
|
$commandes = commandesListe($type, $etat, $date, $typeCommande);
|
|
|
|
}
|
2010-04-19 16:01:10 +00:00
|
|
|
|
2009-12-04 17:17:09 +00:00
|
|
|
?>
|
2010-04-16 08:06:40 +00:00
|
|
|
<h2>Rechercher une commande</h2>
|
|
|
|
<div class="blockh2">
|
|
|
|
|
|
|
|
<form name="cmd_recherche" method="post" action="./?page=greffescmd">
|
|
|
|
<label>Commande</label>
|
2010-02-10 17:27:03 +00:00
|
|
|
<input type="text" name="num" value="<?=$num?>"/>
|
2010-04-16 08:06:40 +00:00
|
|
|
ou <label>SIREN</label>
|
|
|
|
<input type="text" name="siren" size="9" value="<?=$siren?>" />
|
|
|
|
<label>Type</label>
|
|
|
|
<select name="type">
|
2010-04-20 12:22:50 +00:00
|
|
|
<option value="greffe-bilans"<?=($type=='greffe-bilans')? ' selected':'';?>>
|
|
|
|
Comptes annuels</option>
|
|
|
|
<option value="greffe-actes"<?=($type=='greffe-actes')? ' selected':'';?>>
|
|
|
|
Actes & Statuts</option>
|
2010-04-19 07:54:41 +00:00
|
|
|
<!--
|
2010-04-16 08:06:40 +00:00
|
|
|
<option value="pieces-kbis">Kbis</option>
|
|
|
|
<option value="pieces-priv">Privilèges</option>
|
2010-04-19 07:54:41 +00:00
|
|
|
-->
|
2010-04-16 08:06:40 +00:00
|
|
|
</select>
|
|
|
|
<input type="submit" name="cmd_recherche" value="Rechercher"/>
|
2009-12-04 17:17:09 +00:00
|
|
|
</form>
|
2010-04-16 08:06:40 +00:00
|
|
|
<br/>
|
|
|
|
|
|
|
|
<form name="cmd_liste" method="post" action="./?page=greffescmd">
|
2010-04-19 16:01:10 +00:00
|
|
|
<label>Lister les commandes de</label>
|
2010-04-16 08:06:40 +00:00
|
|
|
<select name="type">
|
2010-04-20 12:22:50 +00:00
|
|
|
<option value="greffe-bilans"<?=($type=='greffe-bilans')? ' selected':'';?>>
|
|
|
|
comptes annuels</option>
|
|
|
|
<option value="greffe-actes"<?=($type=='greffe-actes')? ' selected':'';?>>
|
|
|
|
actes & statuts</option>
|
2010-04-19 07:54:41 +00:00
|
|
|
<!--
|
2010-04-16 08:06:40 +00:00
|
|
|
<option value="pieces-kbis">Kbis</option>
|
|
|
|
<option value="pieces-priv">Privilèges</option>
|
2010-04-19 07:54:41 +00:00
|
|
|
-->
|
2010-04-16 08:06:40 +00:00
|
|
|
</select>
|
2010-04-19 16:01:10 +00:00
|
|
|
<?php
|
|
|
|
$cStatuts = listStatus();
|
|
|
|
?>
|
2010-04-16 08:06:40 +00:00
|
|
|
<select name="etat">
|
2010-04-20 12:22:50 +00:00
|
|
|
<option value="commande"<?=($etat=='commande')? ' selected' : '';?>>
|
|
|
|
en cours</option>
|
|
|
|
<option value="reception"<?=($etat=='reception')? ' selected' : '';?>>
|
2010-04-20 12:51:59 +00:00
|
|
|
envoyés</option>
|
2010-04-20 12:22:50 +00:00
|
|
|
<option value="erreur"<?=($etat=='erreur')? ' selected' : '';?>>
|
|
|
|
en erreur</option>
|
2010-04-19 16:01:10 +00:00
|
|
|
<?php
|
|
|
|
if (count($cStatuts)>0 && hasModeEdition()){
|
|
|
|
?>
|
|
|
|
<option value="-">-</option>
|
|
|
|
<?php
|
|
|
|
foreach($cStatuts as $cStatut){
|
2010-04-20 12:22:50 +00:00
|
|
|
$select = '';
|
|
|
|
if ($etat == 'C-'.$cStatut->id){
|
|
|
|
$select = ' selected';
|
|
|
|
}
|
2010-04-19 16:01:10 +00:00
|
|
|
?>
|
2010-04-20 12:22:50 +00:00
|
|
|
<option value="C-"<?=$cStatut->id?><?=$selected?>>
|
|
|
|
<?=$cStatut->libStatut?></option>
|
2010-04-19 16:01:10 +00:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
2010-04-16 08:06:40 +00:00
|
|
|
</select>
|
2010-04-19 16:01:10 +00:00
|
|
|
|
|
|
|
<?php
|
|
|
|
if (hasModeEdition()){
|
|
|
|
?>
|
|
|
|
<label>demandé par</label>
|
|
|
|
<select name="typeCommande">
|
|
|
|
<option value="-">-</option>
|
2010-04-20 12:22:50 +00:00
|
|
|
<option value="G"<?=($typeCommande=='G')? ' selected':'';?>>courrier infogreffe</option>
|
|
|
|
<option value="C"<?=($typeCommande=='C')? ' selected':'';?>>courrier S&D</option>
|
|
|
|
<option value="E"<?=($typeCommande=='E')? ' selected':'';?>>e-mail</option>
|
2010-04-19 16:01:10 +00:00
|
|
|
</select>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
2010-04-20 10:19:53 +00:00
|
|
|
<label>commandé au mois de</label>
|
2010-04-16 08:06:40 +00:00
|
|
|
<select name="date">
|
|
|
|
<?php
|
|
|
|
$dateToday = date('m');
|
|
|
|
$dateIntervalle = 12;
|
2010-04-19 16:01:10 +00:00
|
|
|
if (hasModeEdition()){ $dateIntervalle = 24;}
|
2010-04-16 08:06:40 +00:00
|
|
|
for($i=$dateToday-$dateIntervalle; $i<=$dateToday; $i++)
|
|
|
|
{
|
|
|
|
$dateTime = mktime(0, 0, 0, $i+1, 0, date('Y'));
|
|
|
|
$selected = '';
|
2010-04-20 12:51:59 +00:00
|
|
|
if ($date=='' && $i==$dateToday ){ $selected = 'selected'; }
|
|
|
|
if ($date!='' && $i=$date){ $selected = 'selected'; }
|
2010-04-16 08:06:40 +00:00
|
|
|
?>
|
|
|
|
<option value="<?=$dateTime?>" <?=$selected?>>
|
|
|
|
<?=date('m/Y', $dateTime)?>
|
|
|
|
</option>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
<input type="submit" name="cmd_liste" value="Afficher"/>
|
|
|
|
</form>
|
|
|
|
|
2009-12-04 17:17:09 +00:00
|
|
|
</div>
|
|
|
|
|
2010-04-16 08:06:40 +00:00
|
|
|
<h2>Commandes</h2>
|
|
|
|
<div class="blockh2">
|
|
|
|
<?php
|
|
|
|
if (count($commandes)>0){
|
|
|
|
?>
|
2009-12-04 17:17:09 +00:00
|
|
|
<table>
|
2010-04-19 07:54:41 +00:00
|
|
|
<tbody>
|
2010-04-16 08:06:40 +00:00
|
|
|
<?php
|
2010-04-19 07:54:41 +00:00
|
|
|
foreach($commandes as $commande){
|
|
|
|
echo afficheCommande($commande, $type);
|
2009-12-04 17:17:09 +00:00
|
|
|
}
|
2010-02-10 17:27:03 +00:00
|
|
|
?>
|
2010-04-19 07:54:41 +00:00
|
|
|
</tbody>
|
2010-02-10 17:27:03 +00:00
|
|
|
</table>
|
2010-04-19 07:54:41 +00:00
|
|
|
<?php
|
|
|
|
} else {
|
|
|
|
?>
|
|
|
|
Aucune commande.
|
|
|
|
<?php
|
|
|
|
}
|
2010-04-16 08:06:40 +00:00
|
|
|
|
2010-02-10 17:27:03 +00:00
|
|
|
} // Fin permission d'accès
|
2009-12-04 17:17:09 +00:00
|
|
|
?>
|
|
|
|
</div>
|
2010-04-16 08:06:40 +00:00
|
|
|
</div>
|