if ($Err = NormaliserTel($ValTelR)) { array_push($CodErrInval, $Err); $ValidTelR = FLECHE; } } $ValMailR = trim($MailR); if (($ValFaxR = trim($FaxR)) != '' && ($Err = NormaliserTel($ValFaxR))) { array_push($CodErrInval, $Err); $ValidFaxR = FLECHE; } if (!count($CodErrVide)) { // Validation des valeurs des attributs } if (!($CodErrVide || $CodErrInval)) { $ObjTuple = new CEntreprise(); $ObjTuple->SetPK_Entreprise($ValPK_Entreprise); $ObjTuple->SetNomE(ProtectApos($ValNomE)); $ObjTuple->SetCivilite($ValCivilite); $ObjTuple->SetNomR(ProtectApos($ValNomR)); $ObjTuple->SetPrenomR(ProtectApos($ValPrenomR)); $ObjTuple->SetAdr1(ProtectApos($ValAdr1)); $ObjTuple->SetAdr2(ProtectApos($ValAdr2)); $ObjTuple->SetCP($ValCP); $ObjTuple->SetVille(ProtectApos($ValVille)); $ObjTuple->SetTelR($ValTelR); $ObjTuple->SetMailR($ValMailR); $ObjTuple->SetFaxR($ValFaxR); $ObjTuple->SetPresentEntreprise($ValPresentEntreprise); if (substr($ValSiteEntreprise, 0, 7) != 'http://') { $ValSiteEntreprise = 'http://' . $ValSiteEntreprise; }
function RecupOldEntreprises() { global $ConnectStages; /* * / $ReqOldSocs = $ConnectStages->query("SELECT oldtabentreprises.*, oldtabstages.NomEtudiant, oldtabstages.Annee FROM oldtabentreprises, oldtabstages WHERE oldtabentreprises.NomEntreprise = oldtabstages.NomEntreprise AND oldtabstages.Annee > 1999 ORDER BY oldtabstages.Annee DESC, oldtabentreprises.NomEntreprise"); /* */ /* */ // $ReqOldSocs = $ConnectStages->query("SELECT DISTINCT oldtabentreprises.* // FROM oldtabentreprises, oldtabstages // WHERE oldtabentreprises.NomEntreprise = oldtabstages.NomEntreprise // AND oldtabstages.Annee > 1999 // ORDER BY oldtabentreprises.NomEntreprise"); $ReqOldSocs = $ConnectStages->query("SELECT DISTINCT oldtabentreprises.*\n\t FROM oldtabentreprises, oldtabstages \n\t\t\t\t\t\t WHERE oldtabentreprises.NomEntreprise = oldtabstages.NomEntreprise\n\t\t\t\t\t\t\t AND oldtabstages.Annee > 1999\n\t\t\t\t\t\t\t ORDER BY oldtabentreprises.NomEntreprise"); /* */ ?> <table> <tr> <th>Is_Valide</th> <th>NomEntreprise</th> <th>NomRespAdmin</th> <th>NomEtudiant</th> <th>Annee</th> </tr> <?php while ($ObjReq = $ReqOldSocs->fetch()) { $ObjSoc = new CEntreprise(); $ObjSoc->SetPK_Entreprise(0); $ObjSoc->SetNomE($ObjReq['NomEntreprise']); $ObjSoc->SetNomR($ObjReq['NomRespAdmin']); $ObjSoc->SetPrenomR($ObjReq['PrenomRespAdmin']); $ObjSoc->SetAdr1($ObjReq['Adr1']); $ObjSoc->SetAdr2($ObjReq['Adr2']); $ObjSoc->SetCP($ObjReq['CP']); $ObjSoc->SetVille($ObjReq['Ville']); $ObjSoc->SetTelR($ObjReq['TelRespAdmin']); $ObjSoc->SetMailR($ObjReq['emailRespAdmin']); $ObjSoc->Insert(); ?> <tr> <td><?php echo $ObjReq['Is_Valide']; ?> </td> <td><?php echo $ObjReq['NomEntreprise']; ?> </td> <td><?php echo $ObjReq['NomRespAdmin']; ?> </td> <td><?php echo $ObjReq['NomEtudiant']; ?> </td> <td><?php echo $ObjReq['Annee']; ?> </td> </tr> <?php } ?> </table> <?php }