</td> </tr> <tr> <td class="art_contents"> <a href="<?php echo SITE_URL; ?> faq_news/<?php echo $art['id']; ?> "> <?php if ($this->show_photo()) { ?> <img style="float:left; margin:5px 5px 5px 0px" alt="" src="<?php echo foto($art['photo'], 130, 130); ?> " /> <?php } ?> <?php echo substr(strip_tags($art['txt']), 0, 500); ?> ...</a></td> </tr> <?php } ?> </table> <?php
<table class="tbl_arts"> <tr> <td class="art_contents"> <?php if ($this->show_photo()) { ?> <img style="float:left; margin:5px 5px 5px 0px" alt="" src="<?php echo foto($art['photo'], 160, 160); ?> " /> <?php } ?> <?php echo $art['txt']; ?> </td> </tr> <tr> <td class="art_back"><a href="faq_news/page/1">посмотреть все вопросы</a></td> </tr> </table>
} } /*Obtener y cargar preguntas*/ for ($i = 0; $i < count($ids); $i++) { $id_pregunta = $ids[$i]; $enunciado = $enunciados[$i]; $tipo_respuesta = $tipos[$i]; /*print "<br><br><br>"; print "PREGUNTA INICIO<br><br>"; print $id_pregunta."<br>"; print $enunciado."<br>"; print $tipo_respuesta."<br>";*/ /*Llamando a la funcion constructora dependiendo del tipo de respuesta*/ switch ($tipo_respuesta) { case 'FOTO': foto($id_pregunta, $modo); break; case 'DIBUJO': dibujo($id_pregunta, $modo); break; case 'TITULO': titulo($id_pregunta, $enunciado, $modo); break; case 'TEXTO': texto($id_pregunta, $enunciado, $modo); break; case 'AREA': area($id_pregunta, $enunciado, $modo); break; case 'MULTIPLE': /*Seleccionamos las alternativas de la seleccion multiple*/
$ids_ar = array_unique($_SESSION['vs_prds']); $prds = $this->db->get_rows("SELECT * FROM " . TABLE_PRODUCTS . " WHERE id IN (" . implode(', ', $ids_ar) . ")"); $html = '<table class="prd_vs">'; $prd_va_params = array('Фото' => 'foto', 'Наименование' => 'title', 'Цена' => 'tsena'); $chars = $this->db->get_rows("\nSELECT " . TABLE_CHARS . ".name, " . TABLE_CHARS . ".char_id\nFROM " . TABLE_PRODUCTS . ", " . TABLE_CHARS . "\nWHERE " . TABLE_PRODUCTS . ".id=" . $prds['0']['id'] . " && " . TABLE_CHARS . ".cat_id = " . TABLE_PRODUCTS . ".cat_id\n "); $chars_values = $this->db->get_rows("SELECT * FROM " . TABLE_CHARS_VALUES . " WHERE prd_id IN (" . implode(', ', $ids_ar) . ")"); $chars_vals = array(); foreach ($chars_values as $id => $value) { $chars_vals[$value['prd_id']][$value['char_id']] = $value['value']; } foreach ($prd_va_params as $param_name => $param) { $html .= '<tr>'; $html .= '<td>' . $param_name . '</td>'; foreach ($prds as $prd) { if ($param == 'foto') { $html .= '<td><img src="' . foto($prd[$param], 100, 100) . '" alt="" /></td>'; } elseif ($param == 'tsena') { $html .= '<td>' . $this->s_price($prd[$param], $prd['skidka']) . '</td>'; } else { $html .= '<td>' . $prd[$param] . '</td>'; } } $html .= '</tr>'; } foreach ($chars as $char_id => $char) { $html .= '<tr>'; $html .= '<td>' . $char['name'] . '</td>'; foreach ($prds as $prd) { $value = isset($chars_vals[$prd['id']][$char['char_id']]) ? $chars_vals[$prd['id']][$char['char_id']] : ''; $html .= '<td>' . $value . '</td>'; }
function getImage($width = 100, $height = 100) { return '<a href="' . $this->getLink() . '"><img alt="" src="' . foto($this->getPhoto(), $width, $height, $this->getTitle()) . '" /></a>'; }