milfs/css/estilos.php

78 lines
1.7 KiB
PHP
Raw Normal View History

2014-10-05 19:54:15 +00:00
<?php
header("Content-Type: text/css");
echo dibuja_clase();
function dibuja_clase(){
$link=Conectarse();
mysqli_query("SET NAMES 'utf8'");
2014-10-05 19:54:15 +00:00
$consulta = "SELECT elemento FROM estilos GROUP BY elemento";
$sql=mysqli_query($consulta,$link);
2014-10-05 19:54:15 +00:00
if (mysql_num_rows($sql)!='0'){
mysql_data_seek($sql, 0);
while( $row = mysql_fetch_array( $sql ) ) {
$elemento= dibuja_elemento($row[elemento]);
2014-10-05 19:54:15 +00:00
$resultado .= "$row[elemento]{
$elemento
}\n";
}
}
print $resultado;
return;
}
function dibuja_elemento($elemento){
$link=Conectarse();
mysqli_query("SET NAMES 'utf8'");
2014-10-05 19:54:15 +00:00
$consulta = "SELECT * FROM estilos WHERE elemento = '$elemento' ";
$sql=mysqli_query($consulta,$link);
2014-10-05 19:54:15 +00:00
if (mysql_num_rows($sql)!='0'){
while( $row = mysql_fetch_array( $sql ) ) {
if($row[color] !=='') {$color = "$row[color]";}else{$color="";}
2014-10-05 19:54:15 +00:00
$resultado .= "$row[label]:$row[valor] $color ;\n";
}
2014-10-05 19:54:15 +00:00
}
return $resultado;
}
2014-10-05 19:54:15 +00:00
function Conectarse(){
$servidor = "";
$usuario = "";
$password = "";
$db = "";
2014-10-05 19:54:15 +00:00
if ( !isset ( $link ) ) {
@include("includes/datos.php");
if(!isset($db)) {
include("../milfs/includes/datos.php");
}
if (!($link=mysqli_connect($servidor,$usuario,$password,$db)))
2014-10-05 19:54:15 +00:00
{
echo "Error conectando a la base de datos.";
exit();
}
/* if (!mysqli_select_db($db,$link))
2014-10-05 19:54:15 +00:00
{
echo "Error seleccionando la base de datos.";
exit();
}
*/
$_SESSION['path']= $path_instalacion;
$_SESSION['path_images_secure']= $path_images_secure;
$_SESSION['url']= $url;
$_SESSION['site']= $site;
$_SESSION['analizador']= "$codigo_analizador";
$_SESSION['upload_size']= $upload_size;
2014-10-05 19:54:15 +00:00
return $link;
}
}
?>