<?

    //include("authentication.php");

	include("conexao_e_agenda.php");

    include("funcoes.php");

//-------------------------------fim da autenticação---------------------//

if ($_SERVER["SERVER_ADDR"] == '127.0.0.1' ){

$filename = "../outdoors.xml";//banner_outdoors/big2.xml";//"../bossbanner/big2t.xml";

}else{

$filename = "/home/msoftx/public_html/adrianosoutoimoveis.com.br/outdoors.xml";

}

$handle = fopen ("$filename", "w");

        

   //XML

   $xml  = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";

   $xml .= "<slideshow>\n";

   

 $sql="select * from banner_outdoors_fotos where categoria='banner_outdoors' and destaque='d' order by ordem asc";

 //EXECUTA A QUERY               

 $sql = mysqli_query($conexao,$sql);

 $linha_f=mysqli_fetch_array($sql);

 $row = mysqli_num_rows($sql);    



//VERIFICA SE VOLTOU ALGO 

 

if($row) { 

    //$xml .= "<pic>\n";  //  name=\"Introducing Seattle\"           

//---

   //PERCORRE ARRAY            

   for($i=0; $i<$row; $i++) { 

   $c = $i + 1; 

      $titulo    = mysqli_result($sql, $i, "link");

	  $target    = mysqli_result($sql, $i, "target");  

      $foto    = mysqli_result($sql, $i, "caminho_foto"); 

      //$xml .= "<photo image=\"images/".$foto."\" url=\"http://www.fenzzofranquias.com\" target=\"_self\" duration=\"4\"/>\n";               

      $xml .= "<photo image=\"banner_outdoors/images/".$foto."\" url=\"$titulo\" target=\"$target\" duration=\"4\"/>\n";  

	  //$xml .= "<![CDATA[<head><b>".$titulo."</b></head><body>".$texto."</body>]]>\n";

      //$xml.= "</photo>\n";

   }//FECHA FOR                 

   

   //$xml.= "</pic>\n";

 } //FECHA IF (row)

//} 

   $xml.= "</slideshow>\n";

   //CABEÇALHO

   Header("Content-type: application/xml; charset=utf-8"); 

     

		if (is_writable($filename)) {



        // Escrevendo $$registro para o arquivo aberto.

        if (!fwrite($handle, $xml, 200024)) {

        print "Erro escrevendo no arquivo ($filename)";

        exit;

    	}

}



    fclose($handle);   

//------------------------------------------------------------

/*

if ($_SERVER["SERVER_ADDR"] == '127.0.0.1' ){

$filename = "../bossbanner/thumbs2.xml";//"../bossbanner/thumbs2t.xml";

}else{

$filename = "/home/msoftx/public_html/e_clube/thumbs2.xml";

}

$handle = fopen ("$filename", "w");

        

   //XML

   

   $xml2 .= "<images>\n";

   

 $sql="select * from banner_parceiros_fotos where categoria='banner_chamadas' order by dt_banner desc";

 //EXECUTA A QUERY               

 $sql = mysqli_query($conexao,$sql);

 $linha_f=mysqli_fetch_array($sql);

 $row = mysqli_num_rows($sql);    

//VERIFICA SE VOLTOU ALGO 

 

if($row) { 

    //$xml .= "<pic>\n";  //  name=\"Introducing Seattle\"           

//---

//<photo>

//<![CDATA[<thumbHead>Primeira Meia Maratona</thumbHead><thumbBody>Evento de 2008</thumbBody>]]></photo>

   //PERCORRE ARRAY            

   for($i=0; $i<$row; $i++) { 

   $c = $i + 1; 

      $titulo    = mysqli_result($sql, $i, "titulo");

	  $texto    = mysqli_result($sql, $i, "texto");  

	  $xml2.= "<photo>\n";          

      $xml2 .= "<![CDATA[<thumbHead>".$titulo."</thumbHead><thumbBody>".$texto."</thumbBody>]]>\n";

      $xml2.= "</photo>\n";

   }//FECHA FOR                 

   

   //$xml.= "</pic>\n";

 } //FECHA IF (row)

//} 

   $xml2.= "</images>\n";

   //CABEÇALHO

   Header("Content-type: application/xml; charset=utf-8"); 

     

		if (is_writable($filename)) {



        // Escrevendo $$registro para o arquivo aberto.

        if (!fwrite($handle, $xml2, 200024)) {

        print "Erro escrevendo no arquivo ($filename)";

        exit;

    	}

}



    fclose($handle);   

*/	   

//---------------------------------------------------------                                   

 header("location:cad_banner_outdoors_alt.php?id_c=$_GET[id_tcomp]");           

?>