1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| function test(){
<?php
$total = 0;
?>
if (document.getElementsByName("prevention_formu")[0].checked){
document.getElementById('myDiv').innerHTML +='<?php
$cnx = odbc_connect( "projet", "root", "" ) or die ("Impossible de se connecter à la bas de donnée") ;
$result = " SELECT Prix_devis
FROM Parametre
WHERE Denomination_parametre = 'Plan_de_prevention'
";
$connexion = odbc_do($cnx,$result) or die (odbc_error());
echo odbc_result($connexion,1);
?>' ;
}
if (document.getElementsByName("conformite")[0].checked){
document.getElementById('myDiv').innerHTML +='<?php
$cnx = odbc_connect( "projet", "root", "" ) or die ("Impossible de se connecter à la bas de donnée") ;
$result2 = "SELECT Prix_devis
FROM Parametre
WHERE Denomination_parametre = 'Controle_conformite'
";
$connexion2 = odbc_exec($cnx,$result2) or die (odbc_error());
echo odbc_result($connexion2,1);
?>' ;
}
}
function VoirChamp(l3){
if(l3.options.selectedIndex>=0 && (l3.options[l3.options.selectedIndex].value == "prevention")){
alert('Vous allez rentrer les informations de la catégorie "Prévention" ');
document.getElementById('myDiv').innerHTML +='<br><BIG><B>PARTIE PREVENTION DU DEVIS</B></BIG>';
document.getElementById('myDiv').innerHTML +='<br><br>Souhaitez-vous : ';
document.getElementById('myDiv').innerHTML +='<form> <p> Un plan de prévention ? <input type="radio" name="prevention_formu" value="oui" id="oui" /> Oui <input type="radio" name="prevention_formu" value="non" id="non" /> Non </p> <p> Un contrôle de conformité ? <input type="radio" name="conformite" value="oui" id="oui" /> Oui <input type="radio" name="conformite" value="non" id="non" /> Non </p> <p><input type="button" value="Valider" onClick="test()"/></p> </form>';
}
} |
Partager