2012-01-24 17:10:14 +00:00

37 lines
1.0 KiB
PHTML

<?php if ($this->isPost) :?>
<div style="text-align:center;">
<?php if ($this->image):?>
<img src="/fichier/logo/<?=$this->image?>"/>
<br/>
<a id="logo_crop" href="<?=$this->url(array('controller'=>'logo', 'action'=>'crop', 'image'=>$this->image), null, true)?>">
Editer l'image</a>
<?php else:?>
Erreur
<?php endif;?>
</div>
<?php else:?>
<form id="uploadForm" name="uploadForm" action="<?=$this->url(array('controller'=>'logo','action'=>'upload'), null, true)?>" method="post" enctype="multipart/form-data">
<input name="MAX_FILE_SIZE" value="100000" type="hidden">
<input type="hidden" name="siren" value="<?=$this->siren?>"/>
<label>Fichier:</label><input name="file" type="file">
<input value="Envoyer" type="submit">
</form>
<div id="uploadOutput"></div>
<script type="text/javascript">
$('#uploadForm').ajaxForm({
dataType: 'html',
target: '#uploadOutput',
beforeSubmit: function(a,f,o) {
$('#uploadOutput').html('Envoi en cours...');
},
success: function(data) {
$('#uploadOutput').html(data);
return false;
}
});
</script>
<?php endif;?>