396 lines
12 KiB
PHP
396 lines
12 KiB
PHP
|
<?php
|
|||
|
if (!$_SESSION['connected']) die();
|
|||
|
|
|||
|
if($_REQUEST['submit']){
|
|||
|
//Affichage de la demande
|
|||
|
|
|||
|
|
|||
|
|
|||
|
}else{
|
|||
|
|
|||
|
require_once 'dbbootstrap.php';
|
|||
|
require_once 'graydon/graydonws.php';
|
|||
|
|
|||
|
$tabInfo=$_SESSION['tabInfo'];
|
|||
|
|
|||
|
//@TODO : R<>ception du code pays
|
|||
|
$pays = $_SESSION['graydon']['pays'];
|
|||
|
$pays = 'Algeria';
|
|||
|
|
|||
|
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; }
|
|||
|
|
|||
|
.infoTitle {clear:both; float:left; width:180px; margin-left:30px; padding:0 10px 0 0;}
|
|||
|
.infoData {float:left; width:320px; margin:2px 0;}
|
|||
|
|
|||
|
form { }
|
|||
|
form em { color:#FF0000;}
|
|||
|
fieldset {border:0; margin:0; padding:0;}
|
|||
|
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; }
|
|||
|
.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;}
|
|||
|
.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; }
|
|||
|
.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;}
|
|||
|
|
|||
|
#autreProfil {display:none;}
|
|||
|
#autrePrecisions {display:none;}
|
|||
|
#fournisseur {display:none;}
|
|||
|
#credit {display:none;}
|
|||
|
#impayees {display:none;}
|
|||
|
#retardpaiement {display:none;}
|
|||
|
#litige {display:none;}
|
|||
|
|
|||
|
</style>
|
|||
|
<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');
|
|||
|
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ÊTE TERRAIN</h1>
|
|||
|
|
|||
|
<form action="./?page=international_enquetet" method="POST" enctype="multipart/form-data">
|
|||
|
|
|||
|
<h2>Entreprise concern<EFBFBD>e : </h2>
|
|||
|
|
|||
|
<div class="fieldgrp">
|
|||
|
<label class="StyleInfoLib">Raison Sociale :</label>
|
|||
|
<div class="field"><input type="text" name="InfoEnq[Name]"/></div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="fieldgrp">
|
|||
|
<label class="StyleInfoLib">Adresse <font color="Red">*</font></label>
|
|||
|
<div class="field">
|
|||
|
<input type="text" name="InfoEnq[Entrep][Adresse]"/>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="fieldgrp">
|
|||
|
<label class="StyleInfoLib">Pays <font color="Red">*</font></label>
|
|||
|
<div class="field">
|
|||
|
<select name="InfoEnq[Entrep][Pays]"></select>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="fieldgrp">
|
|||
|
<label class="StyleInfoLib">T<EFBFBD>l<EFBFBD>phone <font color="Red">*</font> / Fax</label>
|
|||
|
<div class="field">
|
|||
|
<input type="text" name="InfoEnq[Entrep][Tel]"/> <b>/</b>
|
|||
|
<input type="text" name="InfoEnq[Entrep][Fax]"/>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="fieldgrp">
|
|||
|
<label class="StyleInfoLib"> Autre t<EFBFBD>l<EFBFBD>phone :</label>
|
|||
|
<div class="field"><input type="text" name="InfoEnq[Entrep][AutreTel]"/> </div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="fieldgrp">
|
|||
|
<label class="StyleInfoLib">E-mail</label>
|
|||
|
<div class="field"><input type="text" name="InfoEnq[Entrep][Mail]"/></div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="fieldgrp">
|
|||
|
<label class="StyleInfoLib">Autre e-mail</label>
|
|||
|
<div class="field"><input type="text" name="InfoEnq[Entrep][AutreMail]"/></div>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
<div class="fieldgrp">
|
|||
|
<label class="StyleInfoLib">Site Web</label>
|
|||
|
<div class="field"><input type="text" name="InfoEnq[Entrep][Web]"/></div>
|
|||
|
</div>
|
|||
|
|
|||
|
<h2>Demandeur : </h2>
|
|||
|
|
|||
|
<div class="fieldgrp">
|
|||
|
<label class="StyleInfoLib">Votre profil <font color="Red">*</font>:</label>
|
|||
|
<div class="field">
|
|||
|
<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>
|
|||
|
<option value="Autre">Autre</option>
|
|||
|
</select>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<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">
|
|||
|
<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>
|
|||
|
<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>
|
|||
|
<div class="field"><input type="text" name="InfoUser[Email]" value="<?php print $user['mail']; ?>"/></div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="fieldgrp">
|
|||
|
<label class="StyleInfoLib">Fax :</label>
|
|||
|
<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">
|
|||
|
<?php
|
|||
|
setDbConn('intersud');
|
|||
|
//@TODO : R<>ception du code pays
|
|||
|
$paysCode = 'DZ';
|
|||
|
$q = Doctrine_Query::Create()
|
|||
|
->select('id, intersud_country')
|
|||
|
->from('Country')
|
|||
|
->where('code = ?', $paysCode);
|
|||
|
$result = $q->fetchOne();
|
|||
|
|
|||
|
$idPays = $result->id;
|
|||
|
|
|||
|
$q = Doctrine_Query::Create()
|
|||
|
->from('Price')
|
|||
|
->where('country_id = ?', $idPays);
|
|||
|
$price = $q->fetchOne();
|
|||
|
|
|||
|
$q = Doctrine_Query::Create()
|
|||
|
->from('Delais')
|
|||
|
->where('country_id = ?', $idPays);
|
|||
|
$delais = $q->fetchOne();
|
|||
|
|
|||
|
if($result && $price && $delais){
|
|||
|
?>
|
|||
|
<input type="radio" name="InfoEnq[Type]" value="normal">Normal (<?php print $price->normal; ?> €, D<>lais : <?php if($delais->normalDe==0){ print $delais->normalA.' jours'; }else{ print $delais->normalDe.' <20> '.$delais->normalA.' jours'; } ?>)
|
|||
|
<br/>
|
|||
|
<input type="radio" name="InfoEnq[Type]" value="rapide">Rapide (<?php print $price->rapide; ?> €, D<>lais : <?php if($delais->rapideDe==0){ print $delais->rapideA.' jours'; }else{ print $delais->rapideDe.' <20> '.$delais->rapideA.' jours'; } ?>)
|
|||
|
<?php
|
|||
|
}
|
|||
|
?>
|
|||
|
</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>
|
|||
|
|
|||
|
<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="" /> €</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">
|
|||
|
<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">
|
|||
|
<label class="StyleInfoLib">Impay<EFBFBD>es :</label>
|
|||
|
<div class="field">
|
|||
|
<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=""/> €</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=""/> €</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>
|
|||
|
|
|||
|
|
|||
|
<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>
|
|||
|
<div class="field"><textarea name="InfoEnq[Observation]"></textarea></div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="submit"><p class="submit-button"><input type="submit" name="submit" value="Envoyer" /></p></div>
|
|||
|
|
|||
|
</form>
|
|||
|
</div>
|
|||
|
|
|||
|
<?php
|
|||
|
}
|
|||
|
?>
|