load_file($template_filename, "main"); include ("../content/header.php"); /** activation des boutons du menu **/ $fldid = get_param('id'); $fldref_produit = dlookup("prd_produit","ref_categorie","id=".tosql($fldid,"Nnumber")); switch($fldref_produit){ case 2: $tplheader->set_var("activ_btn_0",""); $tplheader->set_var("activ_btn_1",""); $tplheader->set_var("activ_btn_2","0"); $tplheader->set_var("activ_btn_3",""); $tplheader->set_var("activ_btn_4",""); break; case 3: $tplheader->set_var("activ_btn_0",""); $tplheader->set_var("activ_btn_1",""); $tplheader->set_var("activ_btn_2",""); $tplheader->set_var("activ_btn_3","0"); $tplheader->set_var("activ_btn_4",""); break; default: $tplheader->set_var("activ_btn_0",""); $tplheader->set_var("activ_btn_1","0"); $tplheader->set_var("activ_btn_2",""); $tplheader->set_var("activ_btn_3",""); $tplheader->set_var("activ_btn_4",""); } $sheader = $tplheader->parse("header",false); $sheader = $tplheader->return_var("header"); include ("../content/footer.php"); $sfooter = $tplheader->return_var("footer"); $tpl->set_var("header",$sheader); $tpl->set_var("footer",$sfooter); $sSQL = " select a.contenu as a_contenu "; $sSQL .= " from cnt_article a"; $sSQL .= " where a.id = 2"; $db->query($sSQL); $next_record = $db->next_record(); $fldcontenu = $db->f("a_contenu"); $tpl->set_var("contenu", $fldcontenu); projet_show($refProjet); $tpl->pparse("main", false); function projet_show($refProjet) { global $tpl; global $db; global $slistArticleErr; global $lang; $sWhere = ""; $sOrder = ""; $sSQL = ""; $HasParam = false; $iRecordsPerPage = 20; $iCounter = 0; $iPage = 0; $bEof = false; $iSort = ""; $iSorted = ""; $sDirection = ""; $sSortParams = ""; $fldid = get_param('id'); $fldref_produit = dlookup("prd_produit","ref_categorie","id=".tosql($fldid,"Nnumber")); $tpl->set_var("TransitParams", ""); $tpl->set_var("FormParams", ""); $sSQL = " select ppd.id as ppd_id , "; $sSQL .= " ppd.titre as ppd_titre, "; $sSQL .= " ppd.accroche as ppd_accroche, "; $sSQL .= " ppd.description1 as ppd_description1, "; $sSQL .= " ppd.description2 as ppd_description2, "; $sSQL .= " ppd.doc1 as ppd_doc1, "; $sSQL .= " ppd.type as ppd_type "; $sSQL .= " FROM prd_produit_details ppd "; $sSQL .= " WHERE ppd.ref_produit =".tosql($refProjet, "Number"); $sSQL .= " AND ref_lang=".tosql($lang,"Text"); $db->query($sSQL); $next_record = $db->next_record(); $fldid = $db->f("ppd_id"); $fldtitre = $db->f("ppd_titre"); $fldaccroche = $db->f("ppd_accroche"); $flddescription1 = $db->f("ppd_description1"); $flddescription2 = $db->f("ppd_description2"); $flddoc1 = $db->f("ppd_doc1"); $fldtype = $db->f("ppd_type"); $tpl->set_var("titre", $fldtitre); $tpl->set_var("accroche", $fldaccroche); $tpl->set_var("description1", $flddescription1); $tpl->set_var("description2", $flddescription2); if(strlen($fldtype) && $fldref_produit!=1){ $tpl->set_var('type_bien',$refProjet); $tpl->parse('BlockTypeBien',false); }else{ $tpl->set_var('BlockTypeBien',''); } $filename1 = "../upload/projet/doc/".$flddoc1; if($flddoc1!='' && file_exists($filename1)){ $tpl->set_var("doc1", $flddoc1); $tpl->parse("PlanMasse", false); }else{ $tpl->set_var("PlanMasse", ''); } $sSQL = " select pp.petite_photo as pp_petite_photo, "; $sSQL .= " pp.grande_photo as pp_grande_photo "; $sSQL .= " FROM prd_photo_produit ppp "; $sSQL .= " LEFT JOIN prd_photo pp on ppp.ref_photo = pp.id"; $sSQL .= " WHERE ref_produit=".tosql($refProjet, "Number"); $sSQL .= " and type=1"; $db->query($sSQL); $num_rows = $db->num_rows(); $num_block = 0; $counter = 0; if($num_rows<=6){ $tpl->set_var("GalleryimagePagin", ""); } if(!$next_record = $db->next_record()){ $tpl->set_var("Galleryimage", ""); $tpl->set_var("GalleryimagePagin", ""); $tpl->parse("Gellery", false); }else{ $tpl->set_var("Gelleryimage", ""); do{ if($counter %6 ==0 ){ $num_block++; $tpl->set_var("num_block_pagination", $num_block); if($num_rows > 6){ $tpl->parse("GalleryimagePagin", true); } } $counter++; $grande_photo = $db->f('pp_grande_photo'); $petite_photo = $db->f('pp_petite_photo'); $tpl->set_var("grande_photo", $grande_photo); $tpl->set_var("petite_photo", $petite_photo); $tpl->set_var("num_block", $num_block); $tpl->parse("Galleryimage", true); }while($next_record = $db->next_record()); $tpl->parse("Gellery", false); } $sSQL = " select pp.petite_photo as pp_petite_photo, "; $sSQL .= " pp.grande_photo as pp_grande_photo "; $sSQL .= " FROM prd_photo_produit ppp "; $sSQL .= " LEFT JOIN prd_photo pp on ppp.ref_photo = pp.id"; $sSQL .= " WHERE ref_produit=".tosql($refProjet, "Number"); $sSQL .= " and type=2"; $db->query($sSQL); if(!$next_record = $db->next_record()){ $tpl->set_var("PlanBien", ""); }else{ $grande_photo = $db->f('pp_grande_photo'); $tpl->set_var("doc2", $grande_photo); $tpl->set_var("display","block"); $tpl->parse("PlanBien", true); while($next_record = $db->next_record()){ $grande_photo = $db->f('pp_grande_photo'); $tpl->set_var("doc2", $grande_photo); $tpl->set_var("display","none"); $tpl->parse("PlanBien", true); } } $tpl->parse("Plan", false); } ?>