1
0
Fork 0

Implementacion de CSS desde Mysql

This commit is contained in:
humano 2014-10-05 14:54:15 -05:00
parent d93fde9522
commit 57a2dd3836
4 changed files with 62 additions and 4 deletions

58
milfs/css/estilos.php Normal file
View File

@ -0,0 +1,58 @@
<?php
header("Content-Type: text/css");
echo dibuja_clase();
function dibuja_clase(){
$link=Conectarse();
mysql_query("SET NAMES 'utf8'");
$consulta = "SELECT elemento FROM estilos GROUP BY elemento";
$sql=mysql_query($consulta,$link);
if (mysql_num_rows($sql)!='0'){
mysql_data_seek($sql, 0);
while( $row = mysql_fetch_array( $sql ) ) {
$elemento= dibuja_elemento($row[elemento]);
$resultado .= "$row[elemento]{
$elemento
}\n";
}
}
print $resultado;
return;
}
function dibuja_elemento($elemento){
$link=Conectarse();
mysql_query("SET NAMES 'utf8'");
$consulta = "SELECT * FROM estilos WHERE elemento = '$elemento' ";
$sql=mysql_query($consulta,$link);
if (mysql_num_rows($sql)!='0'){
while( $row = mysql_fetch_array( $sql ) ) {
if($row[color] !=='') {$color = "$row[color]";}else{$color="";}
$resultado .= "$row[label]:$row[valor] $color ;\n";
}
}
return $resultado;
}
function Conectarse(){
if ( !isset ( $link ) ) {
include("../includes/datos.php");
if (!($link=mysql_connect($servidor,$usuario,$password)))
{
echo "Error conectando a la base de datos.";
exit();
}
if (!mysql_select_db($db,$link))
{
echo "Error seleccionando la base de datos.";
exit();
}
return $link;
}
}
?>

View File

@ -399,10 +399,10 @@ $html = html_entity_decode($html);
$resultado .= "
<div class='row'>
<div class='col-sx-4 '>
<h3>$campo_nombre[0]</h4>
<span class='campo_nombre' id='nombre_$row[id_campo]'>$campo_nombre[0]</span>
</div>
<div class='col-sx-8'>
$contenido
<span class='campo_contenido' id='contenido_$row[id_campo]'>$contenido</span>
</div>
</div>";
}

View File

@ -29,6 +29,7 @@ $xajax->processRequests();
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/estilos.php" rel="stylesheet">
<style type="text/css">
body { padding: 0; margin: 0; }
html, body, #cupcake-map { z-index: 10; position:absolute; top:0; bottom:0px; width:100%; }

View File

@ -3,7 +3,6 @@ session_start();
//ini_set('display_errors', 'On');
require ('xajax/xajax.inc.php');
$xajax = new xajax();
require ('funciones/funciones.php');
require ('funciones/convert.php');
require ('funciones/login.php');
@ -24,7 +23,7 @@ $xajax->processRequests();
<link rel="apple-touch-icon-precomposed" href="favicon-152.png">
<link href="css/font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="http://getbootstrap.com/examples/sticky-footer-navbar/sticky-footer-navbar.css" rel="stylesheet">
<link href="css/estilos.php?d" rel="stylesheet">
<style>
#map {width: 500px;height:200px;}