extranet/www/pages/enquetec.php

406 lines
13 KiB
PHP
Raw Normal View History

<?php
if (!$_SESSION['connected']) die();
require_once(realpath(dirname(__FILE__).'/../../includes/').'/utils.php');
$siret=trim(preg_replace('/[^0-9]/', '', $_REQUEST['siret']));
if (strlen($siret)<>0 && strlen($siret)<>9 && strlen($siret)<>14) die('Param<61>tres incorrects !');
$idEntreprise=trim(preg_replace('/[^0-9]/', '', $_REQUEST['idEntreprise']))*1; // Si id=0 alors non communiqu<71>
if (($siret*1)==0 && $idEntreprise==0) die('Param<61>tres incorrects !');
$siren=substr($siret,0,9);
2009-04-30 13:50:00 +00:00
if($_REQUEST['siren']){
}else{
try {
$O = $client->getIdentite($siret, $idEntreprise);
2009-04-30 13:50:00 +00:00
$etab = $O['result'];
$firephp->log($etab,'etab');
} catch (SoapFault $fault) {
require_once 'soaperror.php';
processSoapFault($client,$fault,$tabInfo);
die();
}
2009-04-30 13:50:00 +00:00
$tabInfo=$_SESSION['tabInfo'];
try {
$O = $client->getInfosLogin($tabInfo['login']);
$user = $O['result'];
$firephp->log($user,'user');
} catch (SoapFault $fault) {
}
?>
<style>
#center { background: #ffffff; width:580px; padding:5px; }
#center h1 { margin:5px; padding:5px; background: #606060; color:#ffffff; font: 600 1.4em arial, verdana, sans-serif; }
#center h2 { margin:5px; padding:5px; background: #00008c; color:#ffffff; font: bold 1.2em arial, verdana, sans-serif; }
2009-04-30 13:50:00 +00:00
.infoTitle {clear:both; float:left; width:180px; margin-left:30px; padding:0 10px 0 0;}
.infoData {float:left; width:320px; margin:2px 0;}
2009-04-30 13:50:00 +00:00
form { }
form em { color:#FF0000;}
fieldset {border:0; margin:0; padding:0;}
2009-04-30 13:50:00 +00:00
fieldset legend{ padding:0 0 0 10px;}
.fieldgrp{clear:both; width:100%; margin-bottom:.5em; overflow:hidden;}
.fieldgrp:after{content:"."; display:block; clear:both; visibility:hidden; line-height:0; height:0; }
2009-04-30 13:50:00 +00:00
.fieldgrp label{font-weight:bold; margin-left:30px; width:180px; clear:both; padding:0 10px 0 0;line-height:22px;_padding-top:3px; float:left; display:block; font-size:108%;}
.fieldgrp label span{font-weight:normal;}
.fieldgrp label abbr{color:#4B911C; font-size:120%; vertical-align:middle;}
2009-04-30 13:50:00 +00:00
.field {width:320px; 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{ font-size:110%; margin:2px 0; }
2009-04-30 13:50:00 +00:00
.field input[type="radio"] { margin:0 5px 0 5px; }
div.submit{ margin-left:200px; padding-left:0px; margin-top:1em; }
div.submit p.submit-button{margin-top:0;}
div.submit p.details{font-size:85%;color:#666;margin:0;}
div.submit p.required-note{margin-top:1em;}
div.submit p.required-note span{color:#4B911C;_color:#666;font-size:170%;vertical-align:top;}
2009-04-30 13:50:00 +00:00
#autreProfil {display:none;}
#autrePrecisions {display:none;}
#fournisseur {display:none;}
#credit {display:none;}
#impayees {display:none;}
#retardpaiement {display:none;}
#litige {display:none;}
</style>
2009-04-30 13:50:00 +00:00
<script type="text/javascript">
$(document).ready(function(){
$("#profil").change(function() {
var val = $("#profil").val();
if (val == 'Autre'){
$("#autreProfil").css('display','block');
}else{
$("#autreProfil").css('display','none');
}
});
$("#precision").change(function() {
var val = $("#precision").val();
if (val == '5'){
$("#autrePrecisions").css('display','block');
}else{
$("#autrePrecisions").css('display','none');
}
if (val == '3' || val == '4'){
$("#fournisseur").css('display','block');
}else{
$("#fournisseur").css('display','none');
}
if (val == '1'){
$("#credit").css('display','block');
}else{
$("#credit").css('display','none');
}
});
$('input[type=radio][name=InfoEnq[ImpayeesChoix]]').change(function(){
var val = $(this).attr('value');
alert(val);
if (val == 'oui'){
$("#impayees").css('display','block');
}else{
$("#impayees").css('display','none');
}
});
$('input[type=radio][name=InfoEnq[RetardPaiementChoix]]').change(function(){
var val = $(this).attr('value');
if (val == 'oui'){
$("#retardpaiement").css('display','block');
}else{
$("#retardpaiement").css('display','none');
}
});
$('input[type=radio][name=InfoEnq[LitigeChoix]]').change(function(){
var val = $(this).attr('value');
if (val == 'oui'){
$("#litige").css('display','block');
}else{
$("#litige").css('display','none');
}
});
$('input[type=text][name=InfoEnq[Encours]]').blur(function(){
var val = $(this).val();
if ( val > 20000){
$('input[type=radio][name=InfoEnq[Type]]').val('gold').attr('checked', 'check');
}else{
$('input[type=radio][name=InfoEnq[Type]]').val('premier').attr('checked', 'check');
}
});
});
</script>
<div id="center">
<h1 class="titre">ENQU&Ecirc;TE COMMERCIALE</h1>
2009-04-30 13:50:00 +00:00
<form action="./?page=enquetec&siret=<?php print $siret;?>&idEntreprise=<?php print $idEntreprise;?>" method="POST" enctype="multipart/form-data">
<h2>Entreprise concern<EFBFBD>e : </h2>
<div class="infoTitle StyleInfoLib">Num&eacute;ro identifiant Siren</div>
2009-04-30 13:50:00 +00:00
<div class="infoData">
<?php print substr($etab['Siren'],0,3).' '.substr($etab['Siren'],3,3).' '.substr($etab['Siren'],6,3); ?>
<input type="hidden" name="siren" value="<?php print $etab['Siren']; ?>"/>
</div>
<div class="infoTitle StyleInfoLib">Num&eacute;ro identifiant Siret</div>
<div class="infoData"><?php print substr($etab['Siren'],0,3).' '.substr($etab['Siren'],3,3).' '.substr($etab['Siren'],6,3).'&nbsp; <i>'.substr($etab['Siret'],9,5).'</i>' ?></div>
<div class="infoTitle StyleInfoLib">Num&eacute;ro de TVA Intracom.</div>
<div class="infoData"><?php print substr($etab['TvaNumero'],0,2).' '.substr($etab['TvaNumero'],2,2).' '.substr($etab['TvaNumero'],-9); ?></div>
<div class="infoTitle StyleInfoLib">Raison Sociale</div>
<div class="infoData"><?php print $etab['Nom']; ?></div>
<div class="infoTitle StyleInfoLib">Adresse</div>
<div class="infoData"><?php print $etab['Adresse']; ?></div>
<div class="fieldgrp">
2009-04-30 13:50:00 +00:00
<label class="StyleInfoLib">T<EFBFBD>l<EFBFBD>phone <?php if (trim($etab['Tel'])==''){?><font color="Red">*</font><?php }?> / Fax</label>
<div class="field">
<?php if (trim($etab['Tel'])!=''){ print $etab['Tel']; }else{?><input type="text" name="InfoEnq[Entrep][Tel]"/><?php } ?> <b>/</b>
<?php if (trim($etab['Fax'])!=''){ print $etab['Fax']; }else{?><input type="text" name="InfoEnq[Entrep][Fax]"/><?php } ?>
</div>
2009-04-30 13:50:00 +00:00
</div>
<?php if (trim($etab['Tel'])!=''){?>
<div class="fieldgrp">
2009-04-30 13:50:00 +00:00
<label class="StyleInfoLib"> Autre t<EFBFBD>l<EFBFBD>phone :</label>
<div class="field"><input type="text" name="InfoEnq[Entrep][AutreTel]"/> </div>
</div>
2009-04-30 13:50:00 +00:00
<?php } ?>
<div class="fieldgrp">
<label class="StyleInfoLib">E-mail</label>
2009-04-30 13:50:00 +00:00
<div class="field"><?php if (trim($etab['Mail'])!=''){ print $etab['Mail']; }else{?><input type="text" name="InfoEnq[Entrep][Mail]"/><?php }?></div>
</div>
2009-04-30 13:50:00 +00:00
<?php if (trim($etab['Mail'])!=''){ ?>
<div class="fieldgrp">
<label class="StyleInfoLib">Autre e-mail</label>
<div class="field"><input type="text" name="InfoEnq[Entrep][AutreMail]"/></div>
</div>
<?php }?>
<div class="fieldgrp">
<label class="StyleInfoLib">Site Web</label>
<div class="field"><?php if (trim($etab['Web'])!=''){ print $etab['Web']; }else{?><input type="text" name="InfoEnq[Entrep][Web]"/><?php }?></div>
</div>
<div class="fieldgrp">
<label class="StyleInfoLib">Domiciliation bancaire</label>
2009-04-30 13:50:00 +00:00
<div class="field">
<input type="text" name="InfoEnq[Entrep][Rib][Banque]" maxlength="5" size="5"/>
<input type="text" name="InfoEnq[Entrep][Rib][Guichet]" maxlength="5" size="5"/>
<input type="text" name="InfoEnq[Entrep][Rib][Compte]" maxlength="11" size="11"/>
<input type="text" name="InfoEnq[Entrep][Rib][Cle]" maxlength="2" size="2"/>
</div>
</div>
<div class="fieldgrp">
<label class="StyleInfoLib">Encours</label>
2009-04-30 13:50:00 +00:00
<div class="field"><input type="text" name="InfoEnq[Encours]"/> &euro;</div>
</div>
<h2>Demandeur : </h2>
<div class="fieldgrp">
<label class="StyleInfoLib">Votre profil <font color="Red">*</font>:</label>
<div class="field">
2009-04-30 13:50:00 +00:00
<select id="profil" name="InfoUser[Profil]">
<option value="Achats">Service Achats</option>
<option value="Commerce">Commerce</option>
<option value="Recouvrement">Recouvrement</option>
<option value="Contentieux">Contentieux</option>
2009-04-30 13:50:00 +00:00
<option value="Autre">Autre</option>
</select>
</div>
</div>
2009-04-30 13:50:00 +00:00
<div id="autreProfil" class="fieldgrp">
<label class="StyleInfoLib">Pr<EFBFBD>cisez :</label>
<div class="field"><input type="text" name="InfoUser[ProfilAutre]" value="" /></div>
</div>
<div class="fieldgrp">
2009-04-30 13:50:00 +00:00
<label class="StyleInfoLib">Votre Identit<EFBFBD> :</label>
<div class="field"><input type="text" name="InfoUser[Identite]" value="<?php print $user['nom'].' '.$user['prenom']; ?>"/></div>
</div>
<div class="fieldgrp">
<label class="StyleInfoLib">T<EFBFBD>l<EFBFBD>phone <font color="Red">*</font>:</label>
2009-04-30 13:50:00 +00:00
<div class="field"><input type="text" name="InfoUser[Tel]" value="<?php print $user['tel']; ?>" /></div>
</div>
<div class="fieldgrp">
<label class="StyleInfoLib">E-mail <font color="Red">*</font>:</label>
2009-04-30 13:50:00 +00:00
<div class="field"><input type="text" name="InfoUser[Email]" value="<?php print $user['mail']; ?>"/></div>
</div>
<div class="fieldgrp">
<label class="StyleInfoLib">Fax :</label>
2009-04-30 13:50:00 +00:00
<div class="field"><input type="text" name="InfoUser[Fax]" value="<?php print $user['fax']; ?>"/></div>
</div>
<h2>Enqu<EFBFBD>te : </h2>
<div class="fieldgrp">
<label class="StyleInfoLib">Type d'enqu<EFBFBD>te</label>
<div class="field">
2009-04-30 13:50:00 +00:00
<input type="radio" name="InfoEnq[Type]" value="premier">PREMIER (24 h - encours inf<EFBFBD>rieur <EFBFBD> 20K&euro;)</input>
<br/>
<input type="radio" name="InfoEnq[Type]" value="gold">GOLD (72 h - encours sup<EFBFBD>rieur <EFBFBD> 20K&euro;)</input>
</div>
</div>
<div class="fieldgrp">
<label class="StyleInfoLib">Pr<EFBFBD>cisions sur la demande</label>
<div class="field">
<select id="precision" name="InfoEnq[Precisions]">
<option value="">Choisissez...</option>
<option value="1">Enqu<EFBFBD>te sur un client (contr<EFBFBD>le cr<EFBFBD>dit)</option>
<option value="2">Enqu<EFBFBD>te sur un prospect (ouverture de compte)</option>
<option value="3">Enqu<EFBFBD>te sur un fournisseur strat<EFBFBD>gique</option>
<option value="4">Enqu<EFBFBD>te sur un fournisseur non strat<EFBFBD>gique</option>
<option value="5">Autre type d'enqu<EFBFBD>te (Pr<EFBFBD>cisez...)</option>
</select>
</div>
</div>
2009-04-30 13:50:00 +00:00
<div id="fournisseur" class="fieldgrp">
<label class="StyleInfoLib">Montant du CA r<EFBFBD>alis<EFBFBD> avec le fournisseur :</label>
<div class="field"><input type="text" name="InfoEnq[Precisions][MontantCA]" value="" /> &euro;</div>
</div>
<div id="credit" class="fieldgrp">
<label class="StyleInfoLib">Motif du contr<EFBFBD>le :</label>
<div class="field"><textarea type="text" name="InfoEnq[Precisions][Motif]"></textarea></div>
</div>
<div id="autrePrecisions" class="fieldgrp">
<label class="StyleInfoLib">Pr<EFBFBD>cisez :</label>
<div class="field"><textarea name="InfoEnq[Precisions][Autre]"></textarea></div>
</div>
<div class="fieldgrp">
2009-04-30 13:50:00 +00:00
<label class="StyleInfoLib">Anciennet<EFBFBD> de la relation :</label>
<div class="field">
<input type="radio" name="InfoEnq[Anciennete]" value="Mois">Mois</input>
<input type="radio" name="InfoEnq[Anciennete]" value="Annees">Ann<EFBFBD>es</input>
</div>
</div>
<div class="fieldgrp">
2009-04-30 13:50:00 +00:00
<label class="StyleInfoLib">Impay<EFBFBD>es :</label>
<div class="field">
2009-04-30 13:50:00 +00:00
<input type="radio" name="InfoEnq[ImpayeesChoix]" value="oui">Oui</input>
<input type="radio" name="InfoEnq[ImpayeesChoix]" value="non" checked="ckeck">Non</input>
</div>
</div>
<div id="impayees">
<div class="fieldgrp">
<label class="StyleInfoLib">Montant :</label>
<div class="field"><input type="text" name="InfoEnq[Impayees][Montant]" value=""/> &euro;</div>
</div>
<div class="fieldgrp">
<label class="StyleInfoLib">Nombre :</label>
<div class="field"><input type="text" name="InfoEnq[Impayees][Nombre]"/></div>
</div>
<div class="fieldgrp">
<label class="StyleInfoLib">Date :</label>
<div class="field"><input type="text" name="InfoEnq[Impayees][Date]"/> (Format : JJ/MM/AAAA)</div>
</div>
</div>
<div class="fieldgrp">
<label class="StyleInfoLib">Retard de paiement :</label>
<div class="field">
<input type="radio" name="InfoEnq[RetardPaiementChoix]" value="oui">Oui</input>
<input type="radio" name="InfoEnq[RetardPaiementChoix]" value="non" checked="ckeck">Non</input>
</div>
</div>
<div id="retardpaiement">
<div class="fieldgrp">
<label class="StyleInfoLib">Montant :</label>
<div class="field"><input type="text" name="InfoEnq[RetardPaiement][Montant]" value=""/> &euro;</div>
</div>
<div class="fieldgrp">
<label class="StyleInfoLib">Nombre :</label>
<div class="field"><input type="text" name="InfoEnq[RetardPaiement][Nombre]"/></div>
</div>
<div class="fieldgrp">
<label class="StyleInfoLib">Date :</label>
<div class="field"><input type="text" name="InfoEnq[RetardPaiement][Date]"/> (Format : JJ/MM/AAAA)</div>
</div>
</div>
<div class="fieldgrp">
<label class="StyleInfoLib">Litiges techniques ou commerciaux :</label>
<div class="field">
<input type="radio" name="InfoEnq[LitigeChoix]" value="oui">Oui</input>
<input type="radio" name="InfoEnq[LitigeChoix]" value="non" checked="ckeck">Non</input>
</div>
</div>
2009-04-30 13:50:00 +00:00
<div id="litige">
<div class="fieldgrp">
<label class="StyleInfoLib">Pr<EFBFBD>cisions :</label>
<div class="field">
<textarea name="InfoEnq[Litige][Precisions]"></textarea>
</div>
</div>
</div>
<div class="fieldgrp">
<label class="StyleInfoLib">Observations ou questions sp<EFBFBD>ciales</label>
2009-04-30 13:50:00 +00:00
<div class="field"><textarea name="InfoEnq[Observation]"></textarea></div>
</div>
2009-04-30 13:50:00 +00:00
<div class="submit"><p class="submit-button"><input type="submit" value="Envoyer" /></p></div>
</form>
2009-04-30 13:50:00 +00:00
</div>
<?php
}
?>