100 lines
3.5 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>
2011-09-01 14:07:23 +00:00
<form id="saisie" name="saisie" action="<?=$this->url(array('controller'=>'saisie', 'action'=>'annonce'), null, true)?>" method="post">
2011-07-01 12:44:12 +00:00
<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 <?=$this->idan?> de <?=$this->siret?> sur un nouveau siren.
2011-07-01 12:44:12 +00:00
</div>
<br/>
2011-09-01 14:07:23 +00:00
<form id="saisie" name="saisie" action="<?=$this->url(array('controller'=>'saisie', 'action'=>'annonce'), null, true)?>" method="post">
2011-07-01 12:44:12 +00:00
<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') {?>
2011-09-01 14:07:23 +00:00
<?php if (empty($this->message)){ ?>
<link rel="stylesheet" type="text/css" media="all" href="/themes/default/styles/saisie.css"/>
<script type="text/javascript" src="/themes/default/scripts/saisie.js"></script>
2011-09-01 14:07:23 +00:00
<form id="saisie" name="saisie" action="<?=$this->url(array('controller'=>'saisie', 'action'=>'annonce'), null, true)?>" method="post">
<input type="hidden" name="op" value="<?=$this->op?>" />
<input type="hidden" name="siret" value="<?=$this->siret?>"/>
<input type="hidden" name="idan" value="<?=$this->idan?>">
<?=$this->action('form', 'saisie', null, array('siret'=>$this->siret))?>
</form>
<?php } else { echo $this->message; }?>
2011-09-01 14:07:23 +00:00
<?php } elseif ($this->op == 'even') {?>
<div id="result">
Modification du type d'évenement sur l'annonce <?=$this->idan?> de <?=$this->siret?>.<br/>
Attention à bien vérifier ce qui est fait !
2011-12-12 16:50:10 +00:00
</div>
<br/>
<form id="saisie" name="saisie" action="<?=$this->url(array('controller'=>'saisie', 'action'=>'annonce'), null, true)?>" 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?>" />
<label>Type d'événement</label><br/>
<select name="even[]" multiple="multiple" size="10" style="width:600px;">
<option value="">-</option>
<?php foreach ($this->evens as $code => $lib):?>
<option value="<?=$code?>"><?=$lib?></option>
<?php endforeach;?>
</select>
</form>
<br/>
<span id="selectItem"></span>
<script>
$('select[name="even[]"]').change(function(){
var uniqueIsSelect = false;
var values = $(this).val();
var nbSelect = (values!=null) ? values.length : 0;
if (nbSelect>0) {
for (var i in values) {
item = values[i];
if (item.charAt(0)=='1') {
uniqueIsSelect = true;
break;
}
}
$('span#selectItem').html(values.join(', '));
}
if (nbSelect>1 && uniqueIsSelect){
alert('Un seul évenement peut être sélectionné lorsque un code de type 1xxx est présent !');
$('select[name="even[]"] option:selected').removeAttr('selected');
}
});
</script>
2011-07-01 12:44:12 +00:00
<?php }?>
2011-09-01 14:07:23 +00:00
<script type="text/javascript" src="/libs/form/jquery.form.js"></script>
2011-07-01 12:44:12 +00:00
<script>
$('form#saisie').bind('submit', function(){
var options = {
target: '#result',
beforeSubmit: function(data){},
2011-07-01 12:44:12 +00:00
success: function(data){ $('#result').html(data); }
};
$(this).ajaxSubmit(options);
return false;
});
</script>