template_dir="_template/header_site"; $smarty->compile_dir="_template_c"; $action=$_GET['action']; $path=posix_getcwd().'/centralStorage/module/267'; $smarty->assign("rootUrl",$rootUrl); $smarty->assign("DOCUMENT_ROOT",posix_getcwd()); function getFiche($fic_id) { global $path; $bloc=new simpleDb('select * from bloc,typeBloc where typeBloc.typeb_id=bloc.typeb_id and fic_id='.$fic_id.' order by bloc.blo_ordre'); $res=array(); while($bloc->nextRecord()) { $tmp=$bloc->getRecord(); if($bloc->getFieldValue('blo_image')!='' && $bloc->getFieldValue('blo_image')!='0') { $size=getimagesize($path."/".$bloc->getFieldValue('blo_image')); $tmp['width']=$size[0]; $tmp['height']=$size[1]; } if($bloc->getFieldValue('typeb_key')=='texte') { $tmp['blo_intitule']=strtr($tmp['blo_intitule'],"

",""); array_push($res,$tmp); } elseif($bloc->getFieldValue('typeb_key')=='texte_enrichi') { $tmp['blo_intitule']=cleanBloc($tmp['blo_intitule']); array_push($res,$tmp); } elseif($bloc->getFieldValue('typeb_key')=='sommaire') { $query='select * from bloc where typeb_id=2 and fic_id='.$fic_id.' order by bloc.blo_ordre'; $sommaire=new simpleDb($query); $tmp['sommaire']=$sommaire->getArrayResult(); array_push($res,$tmp); } else array_push($res,$tmp); } return $res; } if($action=='') $con_intitule='metier'; else $con_intitule=$action; switch($action) { case "": $smarty->display("intro.html"); exit; break; case "metier": case "observatoire": case "client": case "mission": case "expertise": case "methode": $fiche=new simpleDb("select fiche.fic_id from fiche,connector where connector.con_id=fiche.con_id and connector.con_intitule='".$con_intitule."' and fiche.fic_default='1'"); $fiche->nextRecord(); if($fiche->countRows()!='0') { $fic_id=$fiche->getFieldValue('fic_id'); $fiche=new objectDb('fiche',$fic_id); $fiche->affect(); $smarty->assign('bloc',getFiche($fic_id)); } else $smarty->assign('bloc',array()); $smarty->display("accueil.html"); exit; break; } ?>