99 lines
3.7 KiB
PHTML
Raw Normal View History

2011-07-01 12:44:12 +00:00
<?php if ($this->op == 'delete') {?>
<div id="result">
Êtes-vous sur de vouloir supprimer l'annonce <?=$this->idan?>, source <?=$this->source?> ?
</div>
<form id="saisie" name="saisie" action="<?=$this->url(array('controller'=>'saisie', 'action'=>'annonce'))?>" method="post">
<input type="hidden" name="op" value="<?=$this->op?>" />
<input type="hidden" name="idan" value="<?=$this->idan?>" />
<input type="hidden" name="siret" value="<?=$this->siret?>" />
<input type="hidden" name="source" value="<?=$this->source?>" />
</form>
<?php } elseif ($this->op == 'copy'){ ?>
<div id="result">
Affecte l'annonce <?=$idan?> de <?=$siret?> sur un nouveau siren.
</div>
<br/>
<form id="saisie" name="saisie" action="<?=$this->url(array('controller'=>'saisie', 'action'=>'annonce'))?>" method="post">
<input type="hidden" name="op" value="<?=$this->op?>" />
<input type="hidden" name="idan" value="<?=$this->idan?>" />
<input type="hidden" name="source" value="<?=$this->source?>" />
<input type="hidden" name="siretIn" value="<?=$this->siret?>" />
Siren / Siret : <input type="text" name="siretOut" value="" />
</form>
<?php } elseif ($this->op == 'edit') {?>
<?php
/*
$siren = substr($siret,0,9);
$nic = substr($siret,10,5);
if ( !empty($idan) ) {
$idanResult = getAnnonceCollecte($idan, $siret);
FB::log($idanResult, 'result');
//Limitation des événements
$eventLimits = array('5500');
foreach ( $eventLimits as $eventLimit )
{
if ( in_array($eventLimit, $idanResult['even']) && in_array($idanResult['source'], array('JT', 'ANTE')))
{
echo '<link rel="stylesheet" type="text/css" media="all" href="css/saisie.css"/>';
echo '<script type="text/javascript" src="js/saisieajax.js"></script>';
echo '<form id="saisie" name="saisie" action="/?page=saisieajax&q=annonces/edit" method="post">';
echo '<input type="hidden" name="siret" value="'.$siret.'"/>';
echo '<input type="hidden" name="idan" value="'.$idan.'">';
//Mapper idanResult dans le tableau de saisie
require_once 'common/dates.php';
$saisie = array(
'source' => isset($_SESSION['source']) ? $_SESSION['source'] : $idanResult['source'],
'dateParution' => isset($_SESSION['dateParution']) ? $_SESSION['dateParution'] :
WDate::dateT('Y-m-d', 'd/m/Y', substr($idanResult['dateSource'],0,10)),
'numParution' => isset($_SESSION['numParution']) ? $_SESSION['numParution'] : '',
'dateJugement' => WDate::dateT('Y-m-d', 'd/m/Y', $idanResult['dateEffetFinP']),
'tribunal' => $idanResult['tribunal'],
'even' => $idanResult['even'],
'eventNum' => $eventLimit,
'comp' => $idanResult['complement'],
'montant' => $idanResult['montant'],
'dateFinPeriode' => WDate::dateT('Y-m-d', 'd/m/Y', $idanResult['dateJugement']),
);
$intervenants = array();
for ( $i=0 ; $i<3 ; $i++ ) {
$intervenants[$i] = array(
'type' => $idanResult['inter'.($i+1).'type'],
'id' => $idanResult['inter'.($i+1).'id'],
'nom' => $idanResult['inter'.($i+1).'nom'],
);
}
require_once realpath(dirname(__FILE__)).'/constantes.php';
require_once realpath(dirname(__FILE__)).'/saisie_form_event.php';
echo '</form>';
break;
} else {
$message = "Source : ".$idanResult['source']."<br/>";
$message.= "Evénement(s) non éditable : <br/>";
foreach($idanResult['even'] as $code => $event){
$message.= $code." - ".$event."<br/>";
}
echo $message;
}
}
}
*/?>
<?php }?>
<script type="text/javascript" src="/themes/default/scripts/jquery.form.js"></script>
<script>
$('form#saisie').bind('submit', function(){
var options = {
target: '#result',
beforeSubmit: function(formData){},
success: function(data){ $('#result').html(data); }
};
$(this).ajaxSubmit(options);
return false;
});
</script>