151 lines
3.6 KiB
PHTML
151 lines
3.6 KiB
PHTML
|
<div id="searchFiche">
|
||
|
|
||
|
<div class="fieldgrp">
|
||
|
<label>Identifiant / Mots clés</label>
|
||
|
<div class="field">
|
||
|
<input type="text" name="search" class="autocomplete"/>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<a href="#" id="newfiche">Aucun résultat, Créer une nouvelle fiche</a>
|
||
|
|
||
|
<div id="fiche" style="display:none;">
|
||
|
|
||
|
<form name="saveLienRef" action="<?=$this->url(array('controller'=>'saisie', 'action'=>'lienrefsave'), null, true)?>" method="post">
|
||
|
|
||
|
<fieldset>
|
||
|
<legend>Informations fiche</legend>
|
||
|
|
||
|
<div class="fieldgrp">
|
||
|
<label>Siren</label>
|
||
|
<div class="field">
|
||
|
<input type="text" name="siren"/> <a href="#">Obtention Raison Sociale</a>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="fieldgrp">
|
||
|
<label>Raison sociale / Nom</label>
|
||
|
<div class="field">
|
||
|
<input type="text" name="nom"/>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="fieldgrp">
|
||
|
<a href="<?=$this->url(array('controller'=>'saisie','action'=>'lienpp'))?>" class="lienRef">Personne physique</a>,
|
||
|
<a href="<?=$this->url(array('controller'=>'saisie','action'=>'lienetranger'))?>" class="lienRef">Société étrangère</a>
|
||
|
</div>
|
||
|
<div id="lienRef"></div>
|
||
|
|
||
|
<div class="fieldgrp">
|
||
|
<label>au capital de</label>
|
||
|
<div class="field">
|
||
|
<input type="text" name="capital" /> euros, en date du <input type="text" value="undefined"/>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="fieldgrp">
|
||
|
<label>découpé en</label>
|
||
|
<div class="field">
|
||
|
<input type="text" name="nbActions" /> action(s) de <input type="text" value="undefined"/> euros nominale
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="fieldgrp">
|
||
|
<label>Document de référence :</label>
|
||
|
<div class="field">
|
||
|
<select><option>-</option></select> en date du <input type="text"/>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
</fieldset>
|
||
|
|
||
|
<?php if ( $this->type=='participation' ) {?>
|
||
|
<fieldset>
|
||
|
<legend><i><u>Si disponible (holding, etc) saisir quelques éléments du bilan :</u></i></legend>
|
||
|
|
||
|
<div class="fieldgrp">
|
||
|
<label>Chiffre d'affaires</label>
|
||
|
<div class="field">
|
||
|
<input type="text"/> euros
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="fieldgrp">
|
||
|
<label>Résultat Net</label>
|
||
|
<div class="field">
|
||
|
<input type="text"/> euros
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="fieldgrp">
|
||
|
<label>Fonds Propres</label>
|
||
|
<div class="field">
|
||
|
<input type="text"/> euros
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="fieldgrp">
|
||
|
<label>Total Bilan</label>
|
||
|
<div class="field">
|
||
|
<input type="text"/> euros
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
</fieldset>
|
||
|
|
||
|
<?php }?>
|
||
|
|
||
|
<div style="text-align:right;">
|
||
|
<input type="submit" name="save" value="Créer la fiche"/>
|
||
|
</div>
|
||
|
|
||
|
</form>
|
||
|
</div>
|
||
|
|
||
|
<script>
|
||
|
$('input.autocomplete').autocomplete({
|
||
|
minLength:4,
|
||
|
delay:1000,
|
||
|
source: function(request, response) {
|
||
|
$.getJSON('<?=$this->url(array('controller'=>'saisie','action'=>'liensearch'),null,true)?>', { q: request.term },
|
||
|
function(data) { response(data); }
|
||
|
);
|
||
|
},
|
||
|
select: function(event, ui) {
|
||
|
$('div#searchFiche').replaceWith('<b>Fiche sélectionné id = '+ui.item.value+'.</b><input type="hidden" name="id2" value="'+ui.item.value+'"/>');
|
||
|
}
|
||
|
});
|
||
|
|
||
|
$('form[name=saveLienRef]').submit(function(e){
|
||
|
var form = $(this);
|
||
|
$.post(form.attr('action'), form.serialize(), function(data){
|
||
|
alert(data.id);
|
||
|
if(data.error==''){
|
||
|
$('div#searchFiche').replaceWith('<b>Fiche créée id = '+data.id+'</b><input type="hidden" name="id2" value="'+data.id+'"/>');
|
||
|
} else {
|
||
|
$('div#searchFiche').replaceWith(data.error);
|
||
|
}
|
||
|
}, 'json').error(function(){ alert('Unknow error'); });
|
||
|
|
||
|
return false;
|
||
|
});
|
||
|
|
||
|
$('a#newfiche').click(function(e){
|
||
|
e.preventDefault();
|
||
|
var display = $('div#fiche').css('display');
|
||
|
if (display=='none'){
|
||
|
$('div#fiche').css('display', 'block');
|
||
|
} else {
|
||
|
$('div#fiche').css('display', 'none');
|
||
|
}
|
||
|
});
|
||
|
|
||
|
$('a.lienRef').click(function(e){
|
||
|
e.preventDefault();
|
||
|
var url = $(this).attr('href');
|
||
|
$('div#lienRef').load(url);
|
||
|
|
||
|
});
|
||
|
</script>
|
||
|
|
||
|
</div>
|