[QUOTE]load_file($template_filename, "main"); //------------------------------- // Load HTML template of Header and Footer //------------------------------- //------------------------------- $tpl->set_var("FileName", $filename); //------------------------------- // Step through each form //------------------------------- Sito_show();Immagini_show(); //------------------------------- // Output the page to the browser //------------------------------- $tpl->pparse("main", false); // cerca1 Show end //******************************************************************************** //=============================== // Display Grid Form //------------------------------- function Immagini_show() { //------------------------------- // Initialize variables //------------------------------- global $tpl; global $db; global $sImmaginiErr; $sWhere = ""; $sOrder = ""; $sSQL = ""; $sFormTitle = "Immagini"; $HasParam = false; $bReq = true; $iRecordsPerPage = 15; $iCounter = 0; $iSort = ""; $iSorted = ""; $sDirection = ""; $sSortParams = ""; $tpl->set_var("TransitParams", "nomesito=" . tourl(get_param("nomesito")) . "&"); $tpl->set_var("FormParams", "nomesito=" . tourl(get_param("nomesito")) . "&"); //------------------------------- // Build WHERE statement //------------------------------- $pnomesito = get_param("nomesito"); if(strlen($pnomesito)) { $HasParam = true; $sWhere = $sWhere . "c.nomesito=" . tosql($pnomesito, "Text") . ""; } else { $bReq = false; } if($HasParam) $sWhere = " WHERE (" . $sWhere . ")"; //------------------------------- // Build ORDER BY statement //------------------------------- $iSort = get_param("FormImmagini_Sorting"); $iSorted = get_param("FormImmagini_Sorted"); if(!$iSort) { $tpl->set_var("Form_Sorting", ""); } else { if($iSort == $iSorted) { $tpl->set_var("Form_Sorting", ""); $sDirection = " DESC"; $sSortParams = "FormImmagini_Sorting=" . $iSort . "&FormImmagini_Sorted=" . $iSort . "&"; } else { $tpl->set_var("Form_Sorting", $iSort); $sDirection = " ASC"; $sSortParams = "FormImmagini_Sorting=" . $iSort . "&FormImmagini_Sorted=" . "&"; } } //------------------------------- // Build base SQL statement //------------------------------- $sSQL = "select c.immagine1 as c_immagine1, " . "c.nomesito as c_nomesito " . " from cdflegrei c "; //------------------------------- //------------------------------- // Assemble full SQL statement //------------------------------- $sSQL .= $sWhere . $sOrder; //------------------------------- $tpl->set_var("FormTitle", $sFormTitle); //------------------------------- // Process the parameters for sorting //------------------------------- $tpl->set_var("SortParams", $sSortParams); //------------------------------- //------------------------------- // Process if form has all required parameter //------------------------------- if(!$bReq) { $tpl->set_var("DListImmagini", ""); $tpl->parse("ImmaginiNoRecords", false); $tpl->parse("FormImmagini", false); return; } //------------------------------- //------------------------------- // Execute SQL statement //------------------------------- $db->query($sSQL); $next_record = $db->next_record(); //------------------------------- // Process empty recordset //------------------------------- if(!$next_record) { $tpl->set_var("DListImmagini", ""); $tpl->parse("ImmaginiNoRecords", false); $tpl->parse("FormImmagini", false); return; } //------------------------------- //------------------------------- // Initialize page counter and records per page //------------------------------- $iRecordsPerPage = 15; $iCounter = 0; //------------------------------- //------------------------------- // Display grid based on recordset //------------------------------- while($next_record && $iCounter < $iRecordsPerPage) { //------------------------------- // Create field variables based on database fields //------------------------------- $fldimmagine1_URLLink = $db->f("c_immagine1"); $fldimmagine1 = $db->f("c_immagine1"); $next_record = $db->next_record(); //------------------------------- // Replace Template fields with database values //------------------------------- $tpl->set_var("immagine1", $fldimmagine1); $tpl->set_var("immagine1_URLLink", $fldimmagine1_URLLink); //------------------------------- // Process the record separator //------------------------------- if(!$next_record || $iCounter == $iRecordsPerPage - 1) $tpl->set_var("ImmaginiRecordSeparator", ""); else $tpl->parse("ImmaginiRecordSeparator", false); //------------------------------- $tpl->parse("DListImmagini", true); //------------------------------- // Move to the next record and increase record counter //------------------------------- $iCounter++; } //------------------------------- // Finish form processing //------------------------------- $tpl->set_var( "ImmaginiNoRecords", ""); $tpl->parse( "FormImmagini", false); //------------------------------- // Immagini Close Event begin // Immagini Close Event end //------------------------------- } //=============================== //=============================== // Display Grid Form //------------------------------- function Sito_show() { //------------------------------- // Initialize variables //------------------------------- global $tpl; global $db; global $sSitoErr; $sWhere = ""; $sOrder = ""; $sSQL = ""; $sFormTitle = "Scheda Sito"; $HasParam = false; $bReq = true; $iRecordsPerPage = 15; $iCounter = 0; $iSort = ""; $iSorted = ""; $sDirection = ""; $sSortParams = ""; $tpl->set_var("TransitParams", "nomesito=" . tourl(get_param("nomesito")) . "&"); $tpl->set_var("FormParams", "nomesito=" . tourl(get_param("nomesito")) . "&"); //------------------------------- // Build WHERE statement //------------------------------- $pnomesito = get_param("nomesito"); if(strlen($pnomesito)) { $HasParam = true; $sWhere = $sWhere . "c.nomesito like " . tosql("%".$pnomesito ."%", "Text"); } else { $bReq = false; } if($HasParam) $sWhere = " WHERE (" . $sWhere . ")"; //------------------------------- // Build ORDER BY statement //------------------------------- $iSort = get_param("FormSito_Sorting"); $iSorted = get_param("FormSito_Sorted"); if(!$iSort) { $tpl->set_var("Form_Sorting", ""); } else { if($iSort == $iSorted) { $tpl->set_var("Form_Sorting", ""); $sDirection = " DESC"; $sSortParams = "FormSito_Sorting=" . $iSort . "&FormSito_Sorted=" . $iSort . "&"; } else { $tpl->set_var("Form_Sorting", $iSort); $sDirection = " ASC"; $sSortParams = "FormSito_Sorting=" . $iSort . "&FormSito_Sorted=" . "&"; } } //------------------------------- // Build base SQL statement //------------------------------- $sSQL = "select c.botanica as c_botanica, " . "c.comune as c_comune, " . "c.conservazione as c_conservazione, " . "c.geologia as c_geologia, " . "c.interesse as c_interesse, " . "c.nomesito as c_nomesito, " . "c.note as c_note, " . "c.rilevanza as c_rilevanza, " . "c.settori as c_settori, " . "c.toponimo as c_toponimo, " . "c.zoologia as c_zoologia " . " from cdflegrei c "; //------------------------------- //------------------------------- // Sito Open Event begin // Sito Open Event end //------------------------------- //------------------------------- // Assemble full SQL statement //------------------------------- $sSQL .= $sWhere . $sOrder; //------------------------------- $tpl->set_var("FormTitle", $sFormTitle); //------------------------------- // Process the parameters for sorting //------------------------------- $tpl->set_var("SortParams", $sSortParams); //------------------------------- //------------------------------- // Process if form has all required parameter //------------------------------- if(!$bReq) { $tpl->set_var("DListSito", ""); $tpl->parse("SitoNoRecords", false); $tpl->parse("FormSito", false); return; } //------------------------------- //------------------------------- // Execute SQL statement //------------------------------- $db->query($sSQL); $next_record = $db->next_record(); //------------------------------- // Process empty recordset //------------------------------- if(!$next_record) { $tpl->set_var("DListSito", ""); $tpl->parse("SitoNoRecords", false); $tpl->parse("FormSito", false); return; } //------------------------------- //------------------------------- // Initialize page counter and records per page //------------------------------- $iRecordsPerPage = 15; $iCounter = 0; //------------------------------- //------------------------------- // Display grid based on recordset //------------------------------- while($next_record && $iCounter < $iRecordsPerPage) { //------------------------------- // Create field variables based on database fields //------------------------------- $fldbotanica = $db->f("c_botanica"); $fldcomune = $db->f("c_comune"); $fldconservazione = $db->f("c_conservazione"); $fldgeologia = $db->f("c_geologia"); $fldinteresse = $db->f("c_interesse"); $fldnomesito = $db->f("c_nomesito"); $fldnote = $db->f("c_note"); $fldrilevanza = $db->f("c_rilevanza"); $fldsettori = $db->f("c_settori"); $fldtoponimo = $db->f("c_toponimo"); $fldzoologia = $db->f("c_zoologia"); $next_record = $db->next_record(); //------------------------------- // Sito Show begin //------------------------------- //------------------------------- // Sito Show Event begin // Sito Show Event end //------------------------------- //------------------------------- // Replace Template fields with database values //------------------------------- $tpl->set_var("nomesito", tohtml($fldnomesito)); $tpl->set_var("comune", tohtml($fldcomune)); $tpl->set_var("toponimo", tohtml($fldtoponimo)); $tpl->set_var("conservazione", tohtml($fldconservazione)); $tpl->set_var("interesse", tohtml($fldinteresse)); $tpl->set_var("settori", tohtml($fldsettori)); $tpl->set_var("rilevanza", tohtml($fldrilevanza)); $tpl->set_var("geologia", tohtml($fldgeologia)); $tpl->set_var("botanica", tohtml($fldbotanica)); $tpl->set_var("zoologia", tohtml($fldzoologia)); $tpl->set_var("note", tohtml($fldnote)); //------------------------------- // Process the record separator //------------------------------- if(!$next_record || $iCounter == $iRecordsPerPage - 1) $tpl->set_var("SitoRecordSeparator", ""); else $tpl->parse("SitoRecordSeparator", false); //------------------------------- $tpl->parse("DListSito", true); //------------------------------- // Sito Show end //------------------------------- //------------------------------- // Move to the next record and increase record counter //------------------------------- $iCounter++; } //------------------------------- // Finish form processing //------------------------------- $tpl->set_var( "SitoNoRecords", ""); $tpl->parse( "FormSito", false); //------------------------------- // Sito Close Event begin // Sito Close Event end //------------------------------- } //=============================== ?>[/QUOTE] [QUOTE] Campi Flegrei - Cerca nel DB
Stampa questa pagina Aggiungi questo sito ai tuoi preferiti Torna alla pagina precedente Torna alla home

Cd Campi Flegrei

{Header}
{FormTitle}
Nome del Sito
{nomesito} 
Comune
{comune} 
Toponimo
{toponimo} 
Stato di Conservazione
{conservazione} 
Interesse del Sito
{interesse} 
Settori di Interesse
{settori} 
Rilevanza del Sito
{rilevanza} 
Geologia
{geologia} 
Botanica
{botanica} 
Zoologia
{zoologia} 
Note
{note} 
 
No records
{FormTitle}
 
No records
{Footer}

 

 

 

[/QUOTE]