167 lines
4.1 KiB
PHTML
167 lines
4.1 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 id="infors" 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" name="dateCapital" value=""/> (JJ/MM/AAAA)
|
|
</div>
|
|
</div>
|
|
|
|
<div class="fieldgrp">
|
|
<label>découpé en</label>
|
|
<div class="field">
|
|
<input type="text" name="nbActions" value="" /> action(s), en date du <input type="text" name="dateNbActions" value=""/> (JJ/MM/AAAA)
|
|
</div>
|
|
</div>
|
|
|
|
<div class="fieldgrp">
|
|
<label>Document de référence :</label>
|
|
<div class="field">
|
|
<select><option value="">-</option></select>
|
|
</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" name="bilFL"/> euros
|
|
</div>
|
|
</div>
|
|
|
|
<div class="fieldgrp">
|
|
<label>Résultat Net</label>
|
|
<div class="field">
|
|
<input type="text" name="bilHN"/> euros
|
|
</div>
|
|
</div>
|
|
|
|
<div class="fieldgrp">
|
|
<label>Fonds Propres</label>
|
|
<div class="field">
|
|
<input type="text" name="bilFPr"/> euros
|
|
</div>
|
|
</div>
|
|
|
|
<div class="fieldgrp">
|
|
<label>Total Bilan</label>
|
|
<div class="field">
|
|
<input type="text" name="bilEE"/> 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) {
|
|
$('form[name=lien]').prepend('<input type="hidden" name="id2" value="'+ui.item.value+'"/>');
|
|
$('div#searchFiche').replaceWith('<b>Fiche sélectionnée id = '+ui.item.value+'</b>');
|
|
}
|
|
});
|
|
|
|
$('form[name=saveLienRef]').submit(function(e){
|
|
e.preventDefault();
|
|
var form = $(this);
|
|
$.post(form.attr('action'), form.serialize(), function(data){
|
|
if(data.error==''){
|
|
$('form[name=lien]').prepend('<input type="hidden" name="id2" value="'+data.id+'"/>');
|
|
$('div#searchFiche').replaceWith('<b>Fiche créée id = '+data.id+'</b>');
|
|
} 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);
|
|
|
|
});
|
|
|
|
$('a#infors').click(function(e){
|
|
e.preventDefault();
|
|
alert('OK');
|
|
var siren = $('form[name=saveLienRef] input[name=siren]').val();
|
|
if(siren.length==9) {
|
|
$.post('/dashboard/rs', {siren: siren }, function success(data) {
|
|
$('form[name=saveLienRef] input[name=nom]').val(data);
|
|
});
|
|
} else {
|
|
alert('Siren faux!');
|
|
return false;
|
|
}
|
|
});
|
|
</script>
|
|
|
|
</div>
|