256 lines
7.5 KiB
PHTML

<?php if ($this->mode == 'new') {?>
<style>
form em {color:#FF0000;}
fieldset {border:1px solid; padding:5px;}
fieldset legend {padding:5px;}
.fieldgrp {clear:both; width:100%; margin-bottom:.5em; overflow:hidden;}
.fieldgrp:after {content:"."; display:block; clear:both; visibility:hidden; line-height:0; height:0; }
.fieldgrp label {clear:both; padding:0 10px 0 0; line-height:22px; _padding-top:3px; float:left; display:block;}
.fieldgrp label span {font-weight:normal;}
.fieldgrp label abbr {color:#4B911C; font-size:120%; vertical-align:middle;}
fieldset .fieldgrp {clear:both; width:100%; margin-bottom:.5em; overflow:hidden;}
fieldset .fieldgrp:after {content:"."; display:block; clear:both; visibility:hidden; line-height:0; height:0; }
fieldset .fieldgrp label { clear:both; padding:0 10px 0 0; line-height:22px; _padding-top:3px; float:left; display:block;}
fieldset .fieldgrp label span {font-weight:normal;}
fieldset .fieldgrp label abbr {color:#4B911C; font-size:120%; vertical-align:middle;}
.field {float:left; padding:0 10px 0 0;line-height:22px;_padding-top:3px;}
.field .longfield {width:215px;}
.field .longfield-select {width:220px;}
.field .smallfield {width:95px;}
.field .medfield {width:110px;}
.field input, .field select { margin:2px 0; }
.field input[type="radio"] { margin:0 5px 0 5px; }
div#pp { display:none; }
div#etranger { display:none; }
.ui-widget-content a {color:blue; text-decoration:underline;}
</style>
<div id="center">
<form name="saveLienRef" action="<?=$this->url(array('controller'=>'saisie', 'action'=>'lienrefsave'), null, true)?>" method="post">
<?php }?>
<div class="fieldgrp">
<label>Raison sociale</label>
<div class="field">
<input type="text" name="nom" value="<?=$this->RS?>"/>
<a href="#" id="google">Recherche Google</a>
</div>
</div>
<div class="fieldgrp">
<label>Adresse</label>
<div class="field">
<input type="text" name="adresse_num" size="4" value="<?=$this->adresse_num?>"/>
<input type="text" name="adresse_btq" size="1" value="<?=$this->adresse_btq?>"/>
<input type="text" name="adresse_codvoie" size="4" value="<?=$this->adresse_codvoie?>"/>
<input type="text" name="adresse_libvoie" size="32" value="<?=$this->adresse_libvoie?>"/>
</div>
</div>
<div class="fieldgrp">
<label>Adresse complément</label>
<div class="field">
<input type="text" name="adresse_comp" size="40" value="<?=$this->adresse_comp?>"/>
</div>
</div>
<div class="fieldgrp">
<label>CP</label>
<div class="field">
<input type="text" name="adresse_cp" value="<?=$this->adresse_cp?>"/>
</div>
</div>
<div class="fieldgrp">
<label>Ville</label>
<div class="field">
<input type="text" name="adresse_ville" value="<?=$this->adresse_ville?>"/>
</div>
</div>
<div class="fieldgrp">
<label>Pays</label>
<div class="field">
<select name="adresse_pays">
<option value="">-</option>
<?php foreach($this->countries as $code => $item) {?>
<?php $select = ''; if ($this->adresse_pays==$code) $select = 'selected';?>
<option value="<?=$code?>"<?=$select?>><?=$item['libPays']?></option>
<?php }?>
</select>
</div>
</div>
<div id="blocIdLocal">
<?php if ($this->edit) {?>
<?php for ($i=1;$i<=3;$i++) {?>
<div class="fieldgrp"><label>Identifiant local</label>
<div class="field"><input type="text" name="idLoc<?=$i?>Num" value="<?=$this->{'idLoc'.$i.'Num'}?>"/>
<select name="idLoc<?=$i?>Type">
<?php foreach($this->identifiant as $item) {?>
<option value="">-</option>
<?php $select =''; if ($item->internalId==$this->{'idLoc'.$i.'Type'}) $select = 'selected';?>
<option value="<?=$item->internalId?>"<?=$select?>><?=$item->name?></option>
<?php }?>
</select>
</div>
</div>
<?php }?>
<?php } else {?>
Selectionner un pays pour afficher les identifiants locaux
<?php }?>
</div>
<div class="fieldgrp">
<label>Téléphone</label>
<div class="field">
<input type="text" name="tel" value="<?=$this->tel?>"/> <span id="indTel"></span>
</div>
</div>
<div class="fieldgrp">
<label>Fax</label>
<div class="field">
<input type="text" name="fax" value="<?=$this->fax?>"/>
</div>
</div>
<div class="fieldgrp">
<label>Web</label>
<div class="field">
<input type="text" name="web" value="<?=$this->web?>"/>
</div>
</div>
<div class="fieldgrp">
<label>Mail</label>
<div class="field">
<input type="text" name="email" value="<?=$this->email?>"/>
</div>
</div>
<input type="hidden" name="deviseCapital" value="<?=$this->deviseCapital?>"/>
<div class="fieldgrp">
<label>au capital de</label>
<div class="field">
<input type="text" name="capital" value="<?=$this->capital?>"/> <span id="devise"></span>
</div>
</div>
<div class="fieldgrp">
<label> en date du</label>
<div class="field">
<input type="text" name="dateCapital" value="<?=$this->dateCapital?>"/> (JJ/MM/AAAA)
</div>
</div>
<div class="fieldgrp">
<label>découpé en</label>
<div class="field">
<input type="text" name="nbActions" value="<?=$this->nbActions?>" /> action(s),
</div>
</div>
<div class="fieldgrp">
<label>en date du </label>
<div class="field">
<input type="text" name="dateNbActions" value="<?=$this->dateNbActions?>"/> (JJ/MM/AAAA)
</div>
</div>
<?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" value="<?=$this->bilFL?>"/>
</div>
</div>
<div class="fieldgrp">
<label>Résultat Net</label>
<div class="field">
<input type="text" name="bilHN" value="<?=$this->bilHN?>"/>
</div>
</div>
<div class="fieldgrp">
<label>Fonds Propres</label>
<div class="field">
<input type="text" name="bilFPr" value="<?=$this->bilFPr?>"/>
</div>
</div>
<div class="fieldgrp">
<label>Total Bilan</label>
<div class="field">
<input type="text" name="bilEE" value="<?=$this->bilEE?>"/>
</div>
</div>
</fieldset>
<?php }?>
<?php if ($this->mode == 'new') {?>
</form>
</div>
<?php }?>
<script>
var countries = new Array();
<?php foreach ($this->countries as $code => $item) { ?>
countries['<?=$code?>'] = new Array();
<?php foreach($item as $key => $value) {?>
countries['<?=$code?>']['<?=$key?>'] = "<?=$value?>";
<?php }?>
<?php }?>
$('input[name=dateCapital]').datepicker($.datepicker.regional[ "fr" ]);
$('input[name=dateNbActions]').datepicker($.datepicker.regional[ "fr" ]);
$('select[name=adresse_pays]').change(function(e){
var code = $(this).val();
//Devise, indicatif téléphone
$('span#indTel').html('+'+countries[code]['indTel']);
$('span#devise').html(countries[code]['devise']);
//Local Id
$('div#blocIdLocal').html('');
AddSelectCountry(code);
});
$('div#blocIdLocal').on('click', 'a.addIdLocal', function(e){
e.preventDefault();
var country = $('select[name=adresse_pays]').val();
AddSelectCountry(country, $(this).attr('href'));
});
function AddSelectCountry(code, n){
if (!n) { n=1; }
if (n<=3){
var html = 'Aucun identifiant !';
$.getJSON('/saisie/countryid', {code: code}, function(data){
var option = '';
$.each(data, function(i, item){
option = option + '<option value="'+item.internalId+'">'+item.name+'</option>';
});
if (option!=''){
html = '<div class="fieldgrp"><label>Identifiant local</label>'+
'<div class="field"><input type="text" name="idLoc'+n+'Num"/>'+
'<select name="idLoc'+n+'Type">'+option+'</select><a href="'+n+'" class="addIdLocal">[+]</a></div></div>';
}
$('div#blocIdLocal').append(html);
});
}
}
$('a#google').on('click', function(e){
var val = $('input[name=nom]').val();
window.open('https://www.google.fr/#q='+encodeURIComponent(val));
});
</script>