ClaveAudio_Web/faq.php

79 lines
1.9 KiB
PHP
Raw Normal View History

<?php
include('db.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.E1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: 14px;
color: #00539E;
width:100%;
border-bottom:1px solid #eeeeee;
margin-top: 3px;
}
.question, .answer {
position: relative;
font-size: 12px;
font-family: Georgia, "Times New Roman", Times, serif;
}
.question {
float:left;
font-weight:bold;
width:168px;
text-align:right;
}
.answer {
float:right;
width:348px;
}
-->
</style>
</head>
<body>
<?php
$conn = db_connect();
if($conn) {
$query = "SELECT faq_seccion, faq_pregunta, faq_respuesta, faq_enlace FROM shoop_faq ORDER BY faq_seccion, faq_id";
$result = mysql_query($query, $conn);
$num_results = mysql_num_rows($result);
$curSeccion = '';
$secciones = array( '',
'Sobre nosotros',
'Sobre los pedidos',
'Sobre la forma de pago',
'Sobre los env&iacute;os',
'Sobre los productos',
'Otras preguntas');
for ($i=0; $i <$num_results; $i++)
{
$row = mysql_fetch_array($result);
$faq_seccion = $row['faq_seccion'];
$faq_pregunta = $row['faq_pregunta'];
$faq_respuesta = $row['faq_respuesta'];
$faq_enlace = $row['faq_enlace'];
if($faq_seccion != $curSeccion) {
$curSeccion = $faq_seccion;
?>
<div class="E1"><?php echo $secciones[$curSeccion]; ?></div>
<?php
}
?>
<div class="faq">
<div class="question"><?php echo str_replace("\r", "<br>", str_replace("\n", "<br>", stripslashes($faq_pregunta))); ?></div>
<div class="answer"><?php echo $faq_respuesta; ?></div>
<div style="clear:both; font-size:7px;">&nbsp;</div>
</div>
<?php
} // FOR
}
?>
</table>
</body>
</html>