예제 #1
0
파일: impresion.php 프로젝트: vlad88sv/360
function IMPRIMIR_pedido()
{
    if (!isset($_GET['transaccion'])) {
        die;
    }
    $c = sprintf('SELECT provar.foto, provar.descripcion AS "variedad_titulo", provar.receta, procon.codigo_producto, procon.titulo AS "contenedor_titulo",`codigo_compra`, `codigo_usuario`, `codigo_variedad`, `precio_grabado`, `precio_envio`, `tipo_t_credito`, `fecha_exp_t_credito`, `nombre_t_credito`, `pin_4_reverso_t_credito`, `correo_contacto`, `direccion_entrega`, `fecha`, `fecha_entrega`, DATE_FORMAT(fecha,"%%e de %%M de %%Y [%%r]") fecha_formato, DATE_FORMAT(fecha_entrega,"%%e de %%M de %%Y") fecha_entrega_formato, `telefono_destinatario`, `telefono_remitente`, `tarjeta_de`, `tarjeta_para`, `tarjeta_cuerpo`, `estado`, `estado_notas`, `usuario_notas`, `transaccion` FROM `flores_SSL_compra_contenedor` AS comcon LEFT JOIN flores_producto_variedad AS provar USING(codigo_variedad) LEFT JOIN flores_producto_contenedor AS procon USING(codigo_producto) WHERE transaccion="%s" ORDER BY `fecha` DESC, `estado` DESC', db_codex($_GET['transaccion']));
    $r = db_consultar($c);
    $f = mysql_fetch_assoc($r);
    $buffer = '';
    $info_producto_foto = '<a href="' . PROY_URL . 'arreglos-florales-floristerias-en-el-salvador-' . SEO($f['contenedor_titulo'] . '-' . $f['codigo_producto']) . '">' . '<img style="width:133px;height:200px" src="' . imagen_URL($f['foto'], 133, 200) . '" /></a>' . '<p class="medio-oculto">
    <strong>Cod. Producto: </strong>' . $f['codigo_producto'] . BR . '<strong>Nombre producto</strong>' . BR . $f['contenedor_titulo'] . BR . '<strong>Nombre variedad</strong>' . BR . $f['variedad_titulo'] . BR . '</p>';
    $info_importante = '<table class="tabla-estandar" style="height:55px;width:99%">' . '<tr>' . '<td>' . '<p class="medio-oculto">' . '<strong>Fecha entrega:</strong><br />' . $f['fecha_entrega_formato'] . BR . '<strong>Fecha pedido:</strong><br />' . $f['fecha_formato'] . BR . '<strong>Correo contacto</strong><br />' . $f['correo_contacto'] . '</p>' . '</td>' . '<td>' . '<p class="medio-oculto">' . '<strong>Tarjeta De</strong><br />' . $f['tarjeta_de'] . BR . '<strong>Telefono remitente</strong><br />' . $f['telefono_remitente'] . BR . '</p>' . '</td>' . '<td>' . '<p class="medio-oculto">' . '<strong>Tarjeta Para </strong><br />' . $f['tarjeta_para'] . BR . '<strong>Telefono destinatario</strong><br />' . $f['telefono_destinatario'] . '</p>' . '</td>' . '</tr>' . '</table>' . '<p class="medio-oculto">' . '<strong>Tarjeta Cuerpo</strong>' . BR . ui_textarea('', $f['tarjeta_cuerpo'], '', 'width:98%;height:110px;') . BR . '<strong>Dirección entrega</strong>' . BR . ui_textarea('', $f['direccion_entrega'], '', 'width:98%;height:110px;') . BR . '<strong>Notas del comprador</strong>' . BR . ui_textarea('', $f['usuario_notas'], '', 'width:98%;height:110px;') . BR . '<strong>Elementos para preparación</strong>' . BR . ui_textarea('', $f['receta'], '', 'width:98%;height:55px;') . '</p>';
    echo '<style>*{background-color:#FFF !important;color:#000 !important}</style>';
    echo sprintf('
    <table style="height:350px;">
    <tr>
    <td style="border-right:1px solid #CCC;padding:0 0.1em;vertical-align:top;">
    %s
    </td>

    <td style="width:800px;">
    %s
    </td>
    </tr>
    </table>
    <hr /><br />
    <center><img src="IMG/portada/logo.jpg" alt="Logotipo Flor360.com"/></center>
    <p>Yo <strong>' . $f['tarjeta_para'] . '</strong>, firmo en constancia que he recibido un arreglo floral de <i>' . PROY_NOMBRE . '</i> el día <strong>' . strftime('%A %e de %B de %Y') . '</strong>.</p>
    <br /><br />
    _______________________<br />
    <strong>' . $f['tarjeta_para'] . '</strong>
    ', $info_producto_foto, $info_importante);
}
예제 #2
0
function RSS()
{
    header('Content-Type: application/xml');
    echo '<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>YoMachete.com</title>
<link>http://www.yomachete.com/</link>
<language>es-SV</language>
<description>Sitio de ventas en línea en El Salvador</description>
<generator>ENLACE WEB S.A. de C.V.</generator>
<atom:link href="http://yomachete.com/rss.xml" rel="self" type="application/rss+xml" />
';
    $r = db_consultar("SELECT pub.id_publicacion, pub.titulo, pub.fecha_ini, pub.descripcion_corta, pub.descripcion, cat.nombre AS categoria FROM ventas_publicaciones AS pub LEFT JOIN ventas_categorias AS cat ON pub.id_categoria = cat.id_categoria WHERE tipo IN (" . _A_aceptado . "," . _A_promocionado . ") AND fecha_fin >= CURDATE() ORDER BY promocionado DESC, fecha_ini DESC LIMIT 0,30");
    while ($f = mysql_fetch_assoc($r)) {
        $descripcion = substr($f['descripcion_corta'], 0, 300) . "...";
        $url = "clasificados-en-el-salvador-vendo-" . $f['id_publicacion'] . "_" . SEO($f['titulo']);
        echo '<item>
<title>' . $f['titulo'] . '</title>
<link>http://www.yomachete.com/' . $url . '</link>
<pubDate>' . date("D, j M Y H:i:s O", strtotime($f['fecha_ini'])) . '</pubDate>
<category>' . $f['categoria'] . '</category>
<description><![CDATA[' . $descripcion . ']]></description>
<guid>http://www.yomachete.com/' . $url . '</guid>
</item>
';
    }
    echo '</channel>
</rss>
';
}
예제 #3
0
 public function admincp_save()
 {
     //pr($_FILES,1);
     $perm = modules::run('admincp/chk_perm', $this->session->userdata('ID_Module'), 'w', 1);
     if ($perm == 'permission-denied') {
         print $perm;
         exit;
     }
     if ($_POST) {
         //Upload Image
         $fileName = array('thumbnail' => '', 'thumb' => '');
         if ($_FILES) {
             foreach ($fileName as $k => $v) {
                 if (isset($_FILES['fileAdmincp']['error'][$k])) {
                     $typeFileImage = strtolower(substr($_FILES['fileAdmincp']['type'][$k], 0, 5));
                     if ($typeFileImage == 'image' || strpos($_FILES['fileAdmincp']['type'][$k], 'x-shockwave-flash') !== false) {
                         $tmp_name[$k] = $_FILES['fileAdmincp']["tmp_name"][$k];
                         $file_name[$k] = $_FILES['fileAdmincp']['name'][$k];
                         $ext = strtolower(substr($file_name[$k], -4, 4));
                         if ($ext == 'jpeg') {
                             $fileName[$k] = time() . '_' . SEO(substr($file_name[$k], 0, -5)) . '.jpg';
                         } else {
                             $fileName[$k] = time() . '_' . SEO(substr($file_name[$k], 0, -4)) . $ext;
                         }
                     } else {
                         print 'Only upload Image.';
                         exit;
                     }
                 }
             }
         }
         //End Upload Image
         if ($this->model->saveManagement($fileName)) {
             //Upload Image
             if ($_FILES) {
                 foreach ($fileName as $k => $v) {
                     if (isset($_FILES['fileAdmincp']['error'][$k])) {
                         $upload_path = BASEFOLDER . DIR_UPLOAD_ADS;
                         //  return $upload_path;die;
                         move_uploaded_file($tmp_name[$k], $upload_path . $fileName[$k]);
                     }
                 }
             }
             //End Upload Image
             print 'success';
             exit;
         }
     }
 }
예제 #4
0
function Publicacion_Aprobar($id_publicacion)
{
    $id_usuario = db_obtener('ventas_publicaciones', 'id_usuario', "id_publicacion={$id_publicacion}");
    $DiasDeVigencia = db_obtener('ventas_usuarios', 'nDiasVigencia', "id_usuario={$id_usuario}");
    $c = "UPDATE ventas_publicaciones SET tipo=" . _A_aceptado . ", fecha_fin=date_add(CURDATE(), INTERVAL {$DiasDeVigencia} DAY) WHERE id_publicacion='{$id_publicacion}' AND id_usuario='{$id_usuario}' LIMIT 1";
    $r = db_consultar($c);
    $db_afectados_buffer = db_afectados();
    if ($db_afectados_buffer > 0) {
        require_once 'PHP/anunciadores.php';
        $c = "SELECT id_publicacion, titulo FROM ventas_publicaciones WHERE id_publicacion={$id_publicacion}";
        $r = db_consultar($c);
        $f = mysql_fetch_assoc($r);
        tweet('Nueva publicacion: ' . $f['titulo'] . ' | http://www.yomachete.com/clasificados-en-el-salvador-vendo-' . $f['id_publicacion'] . "_" . SEO($f['titulo']));
    }
    return $db_afectados_buffer;
}
예제 #5
0
 /**
  * Function used to crearte view topic link
  */
 function topic_link($tdetails)
 {
     if (SEO == yes) {
         return BASEURL . '/view_topic/' . SEO($tdetails['topic_title']) . '_tid_' . $tdetails['topic_id'];
     } else {
         return BASEURL . '/view_topic.php?tid=' . $tdetails['topic_id'];
     }
 }
예제 #6
0
function CONTENIDO_TIENDA()
{
    $data = '';
    $c = sprintf("SELECT * FROM ventas_tienda WHERE tiendaURL='%s' LIMIT 1", db_codex($_GET['tienda']));
    $r = db_consultar($c);
    if (mysql_num_rows($r) != 1) {
        echo Mensaje("La tienda solicitada [" . $_GET['tienda'] . "] no existe");
        return;
    }
    $Tienda = db_fila_a_array($r);
    $Vendedor = _F_usuario_datos($Tienda['id_usuario']);
    echo "Viendo tienda de: <b>" . $Vendedor['usuario'] . "</b><hr /><br />";
    $nivel = !empty($_GET['categoria']) ? "padre='" . db_codex($_GET['categoria']) . "' AND " : "";
    $c = "SELECT id_categoria, nombre FROM ventas_categorias WHERE {$nivel} id_categoria IN (SELECT padre FROM ventas_categorias WHERE id_categoria IN (SELECT id_categoria FROM ventas_publicaciones WHERE id_usuario='" . $Vendedor['id_usuario'] . "')) ORDER BY nombre";
    $resultado = db_consultar($c);
    $n_campos = mysql_num_rows($resultado);
    $data = ' <div id="secc_categorias">';
    $data .= !empty($_GET['categoria']) ? '<div class="item_cat item_cat_todos"><a href="./+' . $Tienda['tiendaURL'] . '">Ver todas las categorías</a><div style="clear:both"></div></div>' : "<h1>Categorías</h1>";
    $data .= "<div id=\"contenedor_categorias\">";
    for ($i = 0; $i < $n_campos; $i++) {
        $r = mysql_fetch_row($resultado);
        $data .= "<div class=\"item_cat\">" . ('<a title="' . $r[1] . '" href="+' . $Tienda['tiendaURL'] . '_dpt-' . $r[0] . '-' . SEO($r[1]) . '">' . $r[1] . '</a>') . "</div> ";
        //Importante!, no quitar el espacio despues del </div>!!!
    }
    $data .= '</div></div>';
    $categoria = !empty($_GET['categoria']) ? db_codex($_GET['categoria']) : 0;
    if ($categoria) {
        $c = "SELECT * FROM ventas_categorias WHERE id_categoria='{$categoria}'";
        $resultado = db_consultar($c);
        if (db_resultado($resultado, 'padre') > 0) {
            $data .= "<hr />";
            $data .= "Deseo publicar una <a href=\"./vender?op={$categoria}\">venta</a> en esta categoría<br />";
            $data .= "<hr />";
            $WHERE = "z.id_categoria='{$categoria}'";
        } else {
            $WHERE = "(SELECT padre FROM ventas_categorias AS b where b.id_categoria=z.id_categoria)='{$categoria}' AND tipo IN (" . _A_aceptado . "," . _A_promocionado . ")";
        }
    } else {
        $data .= "<h1>Artículos mas recientes</h1>";
        // Mostrar todos los articulos en la categoría
        $WHERE = "tipo IN (" . _A_aceptado . "," . _A_promocionado . ")";
    }
    $WHERE .= " AND id_usuario = " . $Tienda['id_usuario'];
    $data .= VISTA_ListaPubs($WHERE, "", "tienda", "", $Tienda['tiendaURL']);
    echo $data;
}
예제 #7
0
파일: retweet.php 프로젝트: vlad88sv/360
<?php

//exit;
require_once "PHP/vital.php";
set_time_limit(0);
$c = 'SELECT codigo_producto, titulo, descripcion FROM flores_producto_contenedor WHERE twitted=0 ORDER BY codigo_producto ASC LIMIT 1';
$r = db_consultar($c);
if (mysql_num_rows($r) == 0) {
    exit;
}
$f = mysql_fetch_assoc($r);
$status = preg_replace(array('/Medida.*/i', '/Tamaño.*/i'), '', PROY_URL . 'arreglos-florales-floristerias-en-el-salvador-' . SEO($f['titulo'] . '-' . $f['codigo_producto']) . ' - ' . $f['descripcion']);
tweet($status);
$datos['twitted'] = "1";
db_actualizar_datos(db_prefijo . 'producto_contenedor', $datos, 'codigo_producto=' . $f['codigo_producto']);
exit($status);
예제 #8
0
     $this->db->select('*');
     $this->db->where('active', 1);
     if ($hot != null) {
         $this->db->where('hot', $hot);
     }
     if ($limit) {
         $this->db->limit($limit);
     }
     $this->db->order_by('created_date', 'DESC');
     $query = $this->db->get(PREFIX . $this->table);
     if ($query->result()) {
         return $query->result_array();
     } else {
         return false;
     }
 }
예제 #9
0
            ?>
                                                         <?php 
            echo $rs->judul;
            ?>
                                                    </a>
                                                </li>
                                                <?php 
        }
        ?>
                                        </ul>
                                    </li>
                                <?php 
    } else {
        ?>
                                <li id="<?php 
        echo SEO(base_url()) . '-' . SEO2($row->url);
        ?>
"> 
                                    <a href="<?php 
        echo base_url() . $row->url;
        ?>
"> 
                                        <?php 
        echo $row->icon;
        ?>
                                        <span class="title">
                                            <?php 
        echo $row->judul;
        ?>
                                        </span> 
                                    </a> 
예제 #10
0
/**
 * Adds a new order for object
 * 
 * @author Fawaz Tahir <*****@*****.**>
 * @todo Add alias function for different objects
 * @global OBJECT $Cbucket
 * @param STRING $title
 * @param STRING $order
 * @param STRING $type
 * @param STRING $id
 * @return MIX
 */
function add_object_manager_order($title, $order, $type = 'video')
{
    global $Cbucket;
    if (!$title || !$order || !$type) {
        return false;
    }
    $seo_id = SEO(strtolower($title));
    $random_id = RandomString(5) . time();
    $order_array = array('title' => $title, 'order' => $order, 'id' => $type . '-' . $seo_id . '-' . $random_id, 'seo_id' => $seo_id, 'hash' => $random_id);
    $Cbucket->manager_orders[trim($type)][] = $order_array;
    return $Cbucket->manager_orders;
}
예제 #11
0
function view_playlist($playlist_id)
{
    $playlist_link = BASEURL;
    if (is_array($playlist_id) and isset($playlist_id['playlist_id'])) {
        $playlist = $playlist_id;
    } else {
        $playlist = get_playlist($playlist_id);
    }
    if (empty($playlist)) {
        return BASEURL;
    }
    $is_seo = SEO;
    $data = cb_do_action('view_playlist_link', array('playlist' => $playlist, 'seo_enabled' => $is_seo));
    if ($is_seo) {
        $playlist_link .= '/list/' . $playlist['playlist_id'] . '/' . SEO($playlist['playlist_name']);
    } else {
        $playlist_link .= '/view_playlist.php?list=' . $playlist_id;
    }
    $data = cb_do_action('view_playlist_link', array('playlist' => $playlist, 'seo_enabled' => $is_seo, 'playlist_link' => $playlist_link));
    if ($data) {
        return $data;
    }
    return $playlist_link;
}
예제 #12
0
function CONTENIDO_VENDER()
{
    global $arrJS, $arrHEAD;
    // Comprobamos que ya haya ingresado al sistema
    if (!S_iniciado()) {
        echo "Necesitas iniciar sesión para poder <b>publicar</b> y <b>vender</b>.<br />";
        require_once "PHP/inicio.php";
        CONTENIDO_INICIAR_SESION();
        return;
    }
    // --------------------------VARIABLES----------------------------
    $flag_op_y_saltar = false;
    $flag_enviar = isset($_POST['vender_enviar']);
    $flag_publicar = isset($_POST['vender_publicar']);
    $flag_modo_previsualizacion = isset($_POST['vender_previsualizar']);
    $flag_modo_escritura = (isset($_POST['vender_publicar']) || isset($_POST['vender_previsualizar'])) && !isset($_POST['vender_editar']);
    // --------------------------CATEGORIA-------------------------------
    if (!isset($_GET['op']) && !isset($_GET['ticket'])) {
        // Será que aún tiene ventas disponibles?
        if (ObtenerEstadisticasUsuario(_F_usuario_cache('id_usuario'), _EST_CANT_PUB_ACEPT) >= _F_usuario_cache('nPubMax')) {
            echo Mensaje("Ud. ha alcanzado su límite de publicaciones (" . _F_usuario_cache('nPubMax') . "), si desea agregar más publicaciones puede eliminar una publicación actual o adquirir una cuenta premium.");
        } else {
            // No ha escogido categoría, le mostramos las opciones.
            echo "<h1>Realizar una nueva publicación</h1>" . "Por favor seleccione la categoría mayor a la que pertenece su publicación. Esto es necesario para ofrecerle únicamente las opciones relevantes a su publicación, en el siguiente paso podrá definir la sub-categoría." . '<br />' . '<ul>' . '<li>' . ui_href("vender_ir_inmueble", "vender?op=inmueble", "Inmueble") . "<br /><span class='explicacion'>venta o alquiler de casas, apartamentos y demás bienes inmuebles</span></li>" . '<li>' . ui_href("vender_ir_inmueble", "vender?op=automotor", "Automotor") . "<br /><span class='explicacion'>venta o alquiler de automores (carros, vehículos, motocicletas y toda máquina propulsada por un motor)</span></li>" . '<li>' . ui_href("vender_ir_servicio", "vender?op=servicio", "Servicio") . " <br /><span class='explicacion'>servicios profesiales (electricista, programador, diseñador, albañil, constructor, arquitecto, etc.)</span></li>" . '<li>' . ui_href("vender_ir_articulo", "vender?op=articulo", "<strong>Artículo</strong>") . "<br /><span class='explicacion'>encontrarás sub categorías para todo lo que las anteriores 3 categorías mayores no cubren</span></li>" . '</ul>';
        }
        echo '<h1>Mis publicaciones</h1>';
        // Mostrar las ventas "vendidas":
        $c = "SELECT id_publicacion, titulo, id_categoria, DATE(fecha_fin) AS fecha_fin, IF((SELECT nombre FROM ventas_categorias AS b WHERE b.id_categoria = a.id_categoria) is NULL,'<sin categoría>',(SELECT nombre FROM ventas_categorias AS b WHERE b.id_categoria = a.id_categoria)) AS categoria, (SELECT rubro FROM ventas_categorias AS b WHERE b.id_categoria=a.id_categoria) AS rubro FROM ventas_publicaciones AS a WHERE id_usuario='" . _F_usuario_cache('id_usuario') . "' AND tipo=" . _A_vendido;
        $r = db_consultar($c);
        if (mysql_num_rows($r) > 0) {
            echo "<h2>Ventas realizadas y cerradas</h2>";
            echo '<table class="ancha">';
            echo '<tr><th>Título</th><th>Categoría</th><th>Tipo</th><th>Acciones</th></tr>';
            while ($f = mysql_fetch_array($r)) {
                echo "<tr><td><a href=\"clasificados-en-el-salvador-vendo-" . $f['id_publicacion'] . "_" . SEO($f['titulo']) . "\">" . htmlentities($f['titulo'], ENT_QUOTES, 'UTF-8') . "</a></td><td>" . htmlentities($f['categoria'], ENT_QUOTES, 'UTF-8') . "</td><td>" . htmlentities($f['rubro'], ENT_QUOTES, 'UTF-8') . "</td><td><a href=\"vender?ticket=" . $f['id_publicacion'] . "\">publicar nuevamente</a></td></tr>";
            }
            echo "</table>";
        }
        // Mostrar las ventas publicadas:
        $c = "SELECT id_publicacion, titulo, id_categoria, DATE(fecha_fin) AS fecha_fin, IF((SELECT nombre FROM ventas_categorias AS b WHERE b.id_categoria = a.id_categoria) is NULL,'<sin categoría>',(SELECT nombre FROM ventas_categorias AS b WHERE b.id_categoria = a.id_categoria)) AS categoria, (SELECT rubro FROM ventas_categorias AS b WHERE b.id_categoria=a.id_categoria) AS rubro FROM ventas_publicaciones AS a WHERE id_usuario='" . _F_usuario_cache('id_usuario') . "' AND tipo='" . _A_aceptado . "' AND fecha_fin >='" . mysql_datetime() . "'";
        $r = db_consultar($c);
        if (mysql_num_rows($r) > 0) {
            echo "<h2>Ventas publicadas actualmente</h2>";
            echo '<table class="ancha">';
            echo '<tr><th>Título</th><th>Expira</th><th>Categoría</th><th>Tipo</th><th>Acciones</th></tr>';
            while ($f = mysql_fetch_array($r)) {
                echo "<tr><td><a href=\"clasificados-en-el-salvador-vendo-" . $f['id_publicacion'] . "_" . SEO($f['titulo']) . "\">" . htmlentities($f['titulo'], ENT_QUOTES, 'UTF-8') . "</a></td><td>" . $f['fecha_fin'] . "</td><td>" . htmlentities($f['categoria'], ENT_QUOTES, 'UTF-8') . "</td><td>" . htmlentities($f['rubro'], ENT_QUOTES, 'UTF-8') . "</td><td><a href=\"clasificados-en-el-salvador-vendo-" . $f['id_publicacion'] . "_" . SEO($f['titulo']) . "?se=editar\">editar</a>|<a href=\"clasificados-en-el-salvador-vendo-" . $f['id_publicacion'] . "_" . SEO($f['titulo']) . "?se=cerrar\">¡vendido!</a>|" . ui_href("", "vender?ticket=" . $f['id_publicacion'] . "&eliminar=proceder", "eliminar") . "</td></tr>";
            }
            echo "</table>";
        }
        // Mostrar las ventas incompletas:
        $c = "SELECT id_publicacion, IF(titulo='','<sin título>', titulo) AS titulo2, id_categoria, IF((SELECT nombre FROM ventas_categorias AS b WHERE b.id_categoria = a.id_categoria) is NULL,'<sin categoría>',(SELECT nombre FROM ventas_categorias AS b WHERE b.id_categoria = a.id_categoria)) AS categoria, (SELECT rubro FROM ventas_categorias AS b WHERE b.id_categoria=a.id_categoria) AS rubro FROM ventas_publicaciones AS a WHERE id_usuario='" . _F_usuario_cache('id_usuario') . "' AND tipo='" . _A_temporal . "'";
        $r = db_consultar($c);
        if (mysql_num_rows($r) > 0) {
            echo "<h2>Publicaciones que no ha enviado a aprobación</h2>";
            echo '<table class="ancha">';
            echo '<tr><th>Título</th><th>Categoría</th><th>Tipo</th><th>Acciones</th></tr>';
            while ($f = mysql_fetch_array($r)) {
                echo "<tr><td>" . htmlentities($f['titulo2'], ENT_QUOTES, 'UTF-8') . "</td><td>" . htmlentities($f['categoria'], ENT_QUOTES, 'UTF-8') . "</td><td>" . htmlentities($f['rubro'], ENT_QUOTES, 'UTF-8') . "</td><td>" . ui_href("", "vender?ticket=" . $f['id_publicacion'], "continuar") . "|" . ui_href("", "vender?ticket=" . $f['id_publicacion'] . "&eliminar=proceder", "eliminar") . "</td></tr>";
            }
            echo "</table>";
        }
        // Mostrar las ventas esperando aprobación
        $c = "SELECT id_publicacion, (SELECT rubro FROM ventas_categorias AS b WHERE b.id_categoria=a.id_categoria) AS rubro, IF(titulo='','<sin título>', titulo) AS titulo2, id_categoria, IF((SELECT nombre FROM ventas_categorias AS b WHERE b.id_categoria = a.id_categoria) is NULL,'<sin categoría>',(SELECT nombre FROM ventas_categorias AS b WHERE b.id_categoria = a.id_categoria)) AS categoria FROM ventas_publicaciones AS a WHERE id_usuario='" . _F_usuario_cache('id_usuario') . "' AND tipo='" . _A_esp_activacion . "'";
        $r = db_consultar($c);
        if (mysql_num_rows($r) > 0) {
            echo "<h2>Publicaciones enviadas en espera de aprobación</h2>";
            echo '<table class="ancha">';
            echo '<tr><th>Título</th><th>Categoría</th><th>Tipo</th></tr>';
            while ($f = mysql_fetch_array($r)) {
                echo "<tr><td>" . htmlentities($f['titulo2'], ENT_QUOTES, 'UTF-8') . "</td><td>" . htmlentities($f['categoria'], ENT_QUOTES, 'UTF-8') . "</td><td>" . htmlentities($f['rubro'], ENT_QUOTES, 'UTF-8') . "</td></tr>";
            }
            echo "</table>";
        }
        // Mostrar las ventas caducadas
        $c = "SELECT id_publicacion, (SELECT rubro FROM ventas_categorias AS b WHERE b.id_categoria=a.id_categoria) AS rubro, IF(titulo='','<sin título>', titulo) AS titulo2, id_categoria, IF((SELECT nombre FROM ventas_categorias AS b WHERE b.id_categoria = a.id_categoria) is NULL,'<sin categoría>',(SELECT nombre FROM ventas_categorias AS b WHERE b.id_categoria = a.id_categoria)) AS categoria FROM ventas_publicaciones AS a WHERE id_usuario='" . _F_usuario_cache('id_usuario') . "' AND tipo = '" . _A_aceptado . "' AND fecha_fin < CURDATE()";
        $r = db_consultar($c);
        if (mysql_num_rows($r) > 0) {
            echo "<hr />";
            echo "<h2>Publicaciones que han caducado</h2>";
            echo '<table class="ancha">';
            echo '<tr><th>Título</th><th>Categoría</th><th>Tipo</th><th>Acciones</th></tr>';
            while ($f = mysql_fetch_array($r)) {
                echo "<tr><td><a href=\"clasificados-en-el-salvador-vendo-" . $f['id_publicacion'] . "_" . SEO($f['titulo2']) . "\">" . htmlentities($f['titulo2'], ENT_QUOTES, 'UTF-8') . "</a></td><td>" . htmlentities($f['categoria'], ENT_QUOTES, 'UTF-8') . "</td><td>" . htmlentities($f['rubro'], ENT_QUOTES, 'UTF-8') . "</td><td><a href=\"clasificados-en-el-salvador-vendo-" . $f['id_publicacion'] . "_" . SEO($f['titulo2']) . "?se=republicar\">republicar</a></td></tr>";
            }
            echo "</table>";
        }
        return;
    } elseif (isset($_GET['op']) && !isset($_GET['ticket'])) {
        $op = $_GET['op'];
        if (!is_numeric($op)) {
            $c = "SELECT id_categoria FROM ventas_categorias WHERE rubro='" . db_codex($op) . "' LIMIT 1";
        } else {
            $c = "SELECT id_categoria FROM ventas_categorias WHERE id_categoria='" . db_codex($op) . "' LIMIT 1";
        }
        $r = db_consultar($c);
        $f = mysql_fetch_row($r);
        if (!empty($f[0])) {
            $_POST["id_categoria"] = $f[0];
            $flag_modo_escritura = true;
            $flag_op_y_saltar = true;
        }
    } elseif (isset($_GET['op']) && isset($_GET['ticket'])) {
        $flag_modo_escritura = false;
        $flag_op_y_saltar = true;
    }
    // --------------------------TICKET-------------------------------
    // Creamos el Ticket Temporal de venta si no lo tenemos o validamos el actual
    $ticket = empty($_GET['ticket']) ? ObtenerTicketTMP(_F_usuario_cache('id_usuario')) : $_GET['ticket'];
    if (!ComprobarTicket($ticket)) {
        echo "La validación de su Ticket ha fallado.<br />";
        echo "Esto podría bien ser una falla del sistema o un error en su navegador.<br />";
        echo "Lo sentimos, por seguridad esta operación no continuará.";
        return;
    }
    db_consultar(sprintf('UPDATE ventas_publicaciones SET tipo=%s WHERE id_publicacion=%s', _A_temporal, $ticket));
    // ---Si el ticket es valido entoces rescatemos lo que lleva hecho---
    $arrHEAD[] = '<script type="text/javascript" src="JS/tiny_mce/tiny_mce_gzip.js"></script>
    <script type="text/javascript">
    tinyMCE_GZ.init({
            plugins : \'style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,\'+
            \'searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras\',
            themes : \'advanced\',
            languages : \'es\',
            disk_cache : true,
            debug : false
    });
    </script>
    <script type="text/javascript">
    tinyMCE.init({
        language : "es",
	elements : "descripcion",
        theme : "advanced",
        mode : "exact",
        plugins : "safari,style,layer,table,advhr,advimage,advlink,media,paste,directionality,fullscreen,visualchars,nonbreaking,xhtmlxtras,template",
        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect,cleanup,code",
        theme_advanced_buttons2 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,media,advhr,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons3 : "",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        button_tile_map : true,
    });</script>
    ';
    if (isset($_GET['eliminar'])) {
        if (!empty($_GET['ticket'])) {
            DestruirTicket($_GET['ticket']);
        }
        echo "La publicación ha sido cancelada y eliminada.<br />";
        echo ui_href("", "./", "Regresar a la página principal") . " / " . ui_href("", "./vender", "Regresar a ventas");
        return;
    }
    if (isset($_POST['vender_eliminar'])) {
        header("location: ./");
        if (!empty($_GET['ticket'])) {
            DestruirTicket($_GET['ticket']);
        }
        echo "Cancelando venta...";
        return;
    }
    /* Advertencia:
         Hay que recargar los datos luego de la edición para evitar problemas de que los cambios anteriores queden "en cache"
       */
    $Publicacion = ObtenerDatos($ticket);
    if ($flag_modo_escritura) {
        DescargarArchivos("vender_deshabilitar", $ticket, $Publicacion['id_usuario']);
        CargarArchivos("vender_imagenes", $ticket, $Publicacion['id_usuario']);
        CargarDatos($ticket, $Publicacion['id_usuario']);
        // Refrescamos los datos de la publicación
        $Publicacion = ObtenerDatos($ticket);
    }
    $Vendedor = _F_usuario_datos($Publicacion['id_usuario']);
    $imagenes = ObtenerImagenesArr($ticket, "");
    if ($flag_op_y_saltar) {
        header("location: ./vender?ticket={$ticket}");
    }
    if ($flag_modo_previsualizacion || $flag_publicar || $flag_enviar) {
        if (in_array(@$Publicacion["rubro"], array('articulo', 'automotor', 'inmueble')) && !count($imagenes)) {
            $flag_enviar = false;
            echo Mensaje("necesita agregar al menos una foto de su producto", _M_ERROR);
        }
        if (strlen($Publicacion['titulo']) < 20) {
            $flag_enviar = false;
            echo Mensaje("el título debe contener más de 20 letras", _M_ERROR);
        }
        if (strlen($Publicacion['titulo']) > 50) {
            $flag_enviar = false;
            echo Mensaje("el título no debe contener más de 100 letras", _M_ERROR);
        }
        if (strlen($Publicacion['descripcion_corta']) < 10) {
            $flag_enviar = false;
            echo Mensaje("la descripción corta debe contener más de 10 letras", _M_ERROR);
        }
        if (strlen($Publicacion['descripcion_corta']) > 300) {
            $flag_enviar = false;
            echo Mensaje("la descripción corta no debe contener más de 300 letras", _M_ERROR);
        }
    }
    if ($flag_enviar) {
        // Al fin lo terminó de editar y lo esta enviando... Aleluya!
        //-
        // Si es Admin entonces aprobar automaticamente, si no pues mandarlo a esperar activacion
        $c = "UPDATE ventas_publicaciones SET tipo='" . _A_esp_activacion . "' WHERE id_publicacion={$ticket} LIMIT 1";
        $r = db_consultar($c);
        if (db_afectados() == 1) {
            if (_F_usuario_cache('nivel') == _N_administrador) {
                Publicacion_Aprobar($ticket);
                echo Mensaje("Su venta ha sido publicada", _M_INFO);
            } else {
                $vendedor = _F_usuario_datos($Publicacion['id_usuario']);
                email($vendedor['email'], PROY_NOMBRE . ' - Publicación "' . $Publicacion['titulo'] . '" ha sido recibida', 'Su publicación ha sido recibida en nuestro sistema y se encuentra en proceso de activación.<br />\\nEsta activación puede demorar entre <strong>1 minuto y 1 hora</strong> dependiendo de la disponibilidad de los administradores en línea.<br />Esta corta espera es necesaria para realizar una revisión de las publiciaciones y así poder ofrecer el mejor contenido a nuestros visitantes.<br />\\n!Gracias por preferir ' . PROY_NOMBRE . ' para realizar sus publicaciones!');
                email_x_nivel(_N_administrador, 'Nueva publicacion: ' . $Publicacion['titulo'] . ' ' . crc32(microtime()), 'Estimado administrador de ' . PROY_NOMBRE . ', hay una nueva publicacion esperando aprobación: ' . $Publicacion['titulo'] . '.<br />Puede realizar la aprobación ingresando en la siguiente dirección: <a href="' . PROY_URL . 'admin_publicaciones_activacion">Administración: aprobacion de publicaciones</a>');
                echo Mensaje('Su venta ha sido exitosamente enviada para aprobación', _M_INFO);
            }
        } else {
            echo Mensaje("Su venta ha NO a sido enviada para aprobación, sucedió algún error", _M_ERROR);
        }
        echo "Continuar a: " . ui_href("", "vender", "publicar otra venta") . " / " . ui_href("", "./", "página principal") . "<br />";
        return;
    }
    if ($flag_modo_previsualizacion || $flag_publicar) {
        // Si es admin no verá el mensaje confuso.
        if ($Publicacion['id_usuario'] == _F_usuario_cache('id_usuario')) {
            echo mensaje("esta es una previsualización.<br />Su publicacion no será visible al publico hasta que presione el botón \"Enviar\".<br />Por favor revise una ultima ves su publicacion antes de enviarla.", _M_INFO);
        }
        echo '<hr />';
        echo "<p>Esta publicando en la categoría <strong>" . get_path(db_codex(@$Publicacion['id_categoria']), false) . "</strong></p>";
        echo "<h2>Vista preliminar de su publicación en las listas</h2>";
        echo VISTA_ListaPubs("id_publicacion={$ticket}", "", "previsualizacion", "Woops!, ¡problemas intentando cargar la previsualización!");
        echo "<h2>Vista preliminar de su publicación al ser accedida</h2>";
        echo '<div id="prev_pub">';
        require_once "PHP/contenido.php";
        $_GET['publicacion'] = $ticket;
        CONTENIDO_PUBLICACION("previsualizacion");
        echo "</div>";
        echo '<hr style="margin-bottom:50px" />';
    }
    // -----------------------------------------------------------------
    // Inicio de formulario
    echo "<form action=\"vender?ticket={$ticket}\" method=\"POST\" enctype=\"multipart/form-data\">";
    if ($flag_publicar) {
        $Aprobacion = _F_usuario_cache('nivel') == _N_administrador ? "Ud. es administrador, su publicación será aprobada automaticamente" : "No podrá editar su publicación de nuevo hasta que esta sea esta sea revisada y aprobada.";
        echo "<span class='explicacion'>Esta a punto de enviar su publicación a revisión. Puede seguir editando su publicación presionando el botón <b>Editar</b> o finalizar presionando el botón <b>Enviar</b>.<br />{$Aprobacion}</span>";
        echo "<br />";
        echo "<center>";
        echo ui_input("vender_editar", "Editar", "submit");
        echo ui_input("vender_enviar", "Enviar", "submit");
        echo "</center>";
        return;
    }
    echo "<ol class=\"ventas\">";
    echo "<li>Selección de categoría</li>";
    echo "<span class='explicacion'>Ubique su árticulo en la categoría que consideres apropiada.</span>";
    echo "Mi árticulo corresponde a la siguiente categoría<br />" . ui_combobox("id_categoria", join("", ver_hijos("", @$Publicacion["rubro"])), @$Publicacion["id_categoria"]) . "<br />";
    echo "<li>Precio</li>";
    echo "<span class='explicacion'>Précio en dólares de Estados Unidos de America (\$ USA).</span>";
    echo "Précio " . ui_input("precio", @$Publicacion["precio"], "", "", "width:30ex", "MAXLENGTH='30'") . "<br />";
    echo "<li>Título de la publicación</li>";
    echo "<span class='explicacion'>Utilice un título corto, descriptivo y llamativo, máximo 50 carácteres. No se admite código HTML.</span>";
    echo "Titulo " . ui_input("titulo", @$Publicacion["titulo"], "text", "", "width:50ex", "MAXLENGTH='50'") . "<br />";
    echo "<li>Tags (palabras clave) para publicación</li>";
    echo "<span class='explicacion'>Utilice 5 palabras (máximo) separadas por coma (,) que describan su producto. Para casos como 'El Salvador' ingreselo como 'El-Salvador'</span>";
    echo "Tags " . ui_input("tags", @$Publicacion["tags"], "text", "", "width:50ex", "MAXLENGTH='50'") . "<br />";
    echo "<li>Descripción corta de la publicación</li>";
    echo "<span class='explicacion'>Describa brevemente su venta (o prestación de servicio), solo los detalles más importantes, máximo 300 carácteres. No se admite código HTML.</span>";
    echo "Descripción corta " . ui_input("descripcion_corta", @$Publicacion["descripcion_corta"], "text", "", "width:70ex", "MAXLENGTH='300'") . "<br />";
    echo "<li>Descripción del artículo</li>";
    echo "<span class='explicacion'>Describa en detalle tu artículo, incluye todos los datos relevantes que desees, máximo 5000 carácteres.<br />¡Puedes usar <a href=\"http://www.bbcode-to-html.com/\">bbcode-to-html</a> para convertir tus mensajes de SVCommunity.org a HTML!, si lo haces de esta forma utiliza el botón \"html\" para ingresar el texto resultante.</span>";
    echo "Descripción larga<br />" . ui_textarea("descripcion", @$Publicacion["descripcion"], "", "width:100%;height:20em;") . "<br />";
    if (in_array(@$Publicacion["rubro"], array("articulo", "automotor"))) {
        echo "<li>Características del artículo</li>";
        echo "<span class='explicacion'>Seleccione solo las opciones que ayuden a describir de forma precisa tu producto.</span>";
        echo db_ui_checkboxes("venta[]", "ventas_flags", "id_flag", "nombrep", "descripcion", ObtenerFlags($ticket, "venta"), "", "tipo='venta'");
    }
    echo "<li>Formas de pago admitidas</li>";
    echo "<span class='explicacion'>Selecione solo las opciones de pago que admitirá.</span>";
    echo db_ui_checkboxes("pago[]", "ventas_flags", "id_flag", "nombrep", "descripcion", ObtenerFlags($ticket, "pago"), "", "tipo='pago'");
    if (in_array(@$Publicacion["rubro"], array("articulo"))) {
        echo "<li>Formas de entrega admitidas</li>";
        echo "<span class='explicacion'>Selecione solo las opciones de tipos de entrega que admitirá.</span>";
        echo db_ui_checkboxes("entrega[]", "ventas_flags", "id_flag", "nombrep", "descripcion", ObtenerFlags($ticket, "entrega"), "", "tipo='entrega'");
    }
    switch (@$Publicacion["rubro"]) {
        case "articulo":
            echo "<li>Fotografías del artículo</li>";
            break;
        case "automotor":
            echo "<li>Fotografías del automotor</li>";
            break;
        case "inmueble":
            echo "<li>Fotografías del inmueble</li>";
            break;
        case "servicio":
            echo "<li>Imagen relacionada con su servicio (logotipo, etc.)</li>";
            break;
    }
    echo '<span class="explicacion">Cargue las fotografías reales de su artículo, <strong style="color:#F00">necesita al menos una foto para que su publicacion sea aprobada y publicada</strong>.<br />Imagenes tomadas de la página del fabricante o similires son permitidas con un máximo de dos imagenes.<br />En total se admiten cinco imagenes</span>';
    echo "<br />";
    if (isset($imagenes) && is_array($imagenes)) {
        foreach ($imagenes as $archivo) {
            echo "<div style='display:inline-block'><a href=\"./imagen_" . $archivo . "\" title=\"IMAGEN CARGADA\" target=\"_blank\"><img src=\"./imagen_" . $archivo . "m\" /></a><br />" . ui_input("vender_deshabilitar[]", $archivo, "checkbox") . "&nbsp;Eliminar</div>";
        }
        echo "<div style=\"clear:both\"></div>";
    }
    $NoMaxImg = in_array(@$Publicacion["rubro"], array("servicio")) ? 1 : $Vendedor['nImgMax'];
    $inicio = isset($imagenes) ? count($imagenes) : 0;
    for ($i = $inicio; $i < $NoMaxImg; $i++) {
        echo "Imagen " . ($i + 1) . ": Cargar " . ui_input("vender_imagenes[]", "", "file") . "<br />";
    }
    // Si es admin solo verá "Guardar".
    if ($Publicacion['id_usuario'] == _F_usuario_cache('id_usuario')) {
        echo "<li>Previsualizar y Publicar</li>";
        echo "</li>";
        echo "<span class='explicacion'>Puede observar como quedaría su publicación utilizando el botón 'Previsualizar'.<br />Cuando este satisfecho con el resultado presione el botón 'Publicar'.</span>";
        echo "<br />";
        echo "<center>";
        echo ui_input("vender_previsualizar", "Vista previa", "submit");
        echo ui_input("vender_publicar", "Publicar", "submit");
    } else {
        echo ui_input("vender_previsualizar", "Guardar", "submit");
    }
    echo ui_input("vender_eliminar", "Eliminar", "submit");
    echo "</center>";
    echo "</form>";
}
예제 #13
0
 /**
  * Function used to create page link
  */
 function page_link($pdetails)
 {
     //baseurl/page/$id/page_name
     if (SEO == 'yes') {
         return BASEURL . '/page/' . $pdetails['page_id'] . '/' . SEO(strtolower($pdetails['page_name']));
     } else {
         return BASEURL . '/view_page.php?pid=' . $pdetails['page_id'];
     }
 }
예제 #14
0
/**
 * This function adds a new link in options for each at photos manager.
 * Callback is still in not working. I want to register both link and it's callback
 * using same function. 
 * 
 * PROBLEM:-
 * Problem is calling the callback function for certain link. Even if i figure out
 * a way to determine which callback to call, it will not be called because these
 * new links are being added inside display_manager_links() which is being called
 * inside smarty file.
 * 
 * SOLUTION:- ( to me, for the time being )
 * We don't use filters to add new links. Just calling add_photo_manager_link will
 * add new link inside $cbphoto->manager_links, so at admin_area/photo_manager.php
 * every link exists inside manager_links.
 * 
 * FINAL:-
 * Like my proposed solution. calling this function will do following
 *  |- Add new item in manager_links array
 *  |- Create a callback_id if callback exists using $callback.$link.$title and hashing with md5
 *  |- Add it's callback_id if exists into manager_link_callbacks array
 * 
 * To get details of each photo for link, you must use a function to create the link. Pass any
 * argument to function and it will hold details of each photo, e.g
 * 
 * function create_manager_link( $p ) {
 *  return '?_key'.$p['photo_key'];
 * }
 * 
 * @global OBJECT $cbphoto
 * @param STRING $title
 * @param STRING $link
 * @param STRING $callback
 * @param BOOLEAN $front_end
 * @return MIX
 */
function add_photo_manager_link($title, $link, $callback = false, $front_end = false)
{
    global $cbphoto;
    if (!$title || !$link) {
        return false;
    }
    /* Check which end we are adding this link */
    $which_end = $front_end === true ? 'front_end' : 'back_end';
    // Create callback id
    if ($callback) {
        $callback_id = md5($callback . $link . $which_end . SEO(strtolower($title)));
    }
    $cbphoto->manager_links[$which_end][] = array('title' => $title, 'id' => SEO(strtolower($title)) . '-' . time(), 'link' => $link, 'args' => $args, 'callback' => $callback, 'callback_id' => $callback_id);
    // Add callback
    if ($callback) {
        $cbphoto->manager_link_callbacks[$callback_id] = $callback;
    }
    return $cbphoto->manager_links;
}
예제 #15
0
/**
 * Category Link is used to return
 * Category based link
 */
function category_link($data, $type)
{
    switch ($type) {
        case 'video':
        case 'videos':
        case 'v':
            if (SEO == 'yes') {
                return BASEURL . '/videos/' . $data['category_id'] . '/' . SEO($data['category_name']) . '/' . $_GET['sort'] . '/' . $_GET['time'] . '/';
            } else {
                return BASEURL . '/videos.php?cat=' . $data['category_id'] . '&sort=' . $_GET['sort'] . '&time=' . $_GET['time'] . '&seo_cat_name=' . $_GET['seo_cat_name'];
            }
            break;
        case 'channels':
        case 'channel':
        case 'c':
        case 'user':
            if (SEO == 'yes') {
                return BASEURL . '/channels/' . $data['category_id'] . '/' . SEO($data['category_name']) . '/' . $_GET['sort'] . '/' . $_GET['time'] . '/';
            } else {
                return BASEURL . '/channels.php?cat=' . $data['category_id'] . '&sort=' . $_GET['sort'] . '&time=' . $_GET['time'] . '&seo_cat_name=' . $_GET['seo_cat_name'];
            }
            break;
        default:
            if (THIS_PAGE == 'photos') {
                $type = 'photos';
            }
            if (defined("IN_MODULE")) {
                $url = 'cat=' . $data['category_id'] . '&sort=' . $_GET['sort'] . '&time=' . $_GET['time'] . '&page=' . $_GET['page'] . '&seo_cat_name=' . $_GET['seo_cat_name'];
                global $prefix_catlink;
                $url = $prefix_catlink . $url;
                $rm_array = array("cat", "sort", "time", "page", "seo_cat_name");
                $p = "";
                if ($prefix_catlink) {
                    $rm_array[] = 'p';
                }
                $plugURL = queryString($url, $rm_array);
                return $plugURL;
            }
            if (SEO == 'yes') {
                return BASEURL . '/' . $type . '/' . $data['category_id'] . '/' . SEO($data['category_name']) . '/' . $_GET['sort'] . '/' . $_GET['time'] . '/';
            } else {
                return BASEURL . '/' . $type . '.php?cat=' . $data['category_id'] . '&sort=' . $_GET['sort'] . '&time=' . $_GET['time'] . '&seo_cat_name=' . $_GET['seo_cat_name'];
            }
            break;
    }
}
예제 #16
0
파일: vitrina.php 프로젝트: vlad88sv/360
}
$nVistas = SI_ADMIN('<p class="medio-oculto">Veces visto: ' . db_contar(db_prefijo . 'visita', 'codigo_producto=' . $contenedor['codigo_producto']) . '</p>');
$fbLike = '<iframe src="http://www.facebook.com/widgets/like.php?href=' . curPageURL(true) . '" scrolling="no" frameborder="0" style="border:none; width:450px; height:80px"></iframe>';
echo '<div style="width:100%;text-align:center">' . $IMG_CONTENEDOR . BR . $fbLike . BR . $nVistas;
echo '</div></td>';
echo '<td style="width:50%;vertical-align:top">';
echo '<h1>Detalles</h1>';
echo '<h2>Descripción</h2>';
echo '<center><p style="width:90%;text-align:justify;font-size:10pt;">' . nl2br($contenedor['descripcion']) . '</p></center>';
if ($contenedor['descontinuado'] == "no") {
    echo '<h2>Categoría(s)</h2>';
    echo $bCategoria;
    echo SI_ADMIN($VARIEDADES_ADMIN);
    echo '<h2>Seleccione la variedad</h2>';
    // Fin del area administrativa, inicio de las opciones de compra
    echo '<form action="' . PROY_URL . 'comprar-articulo-' . SEO($contenedor['titulo']) . '" method="POST">';
    echo $VARIEDADES;
    echo '<hr />';
    $bInfoCompra = '<table>
    <td id="izq-compra" class="medio-oculto">Podrá escoger el texto de la tarjeta (¡gratuita!) en la página de compra. Se aceptan todas las tarjetas de crédito y débito a nivel nacional e internacional.</td>
    <td>' . ui_input('btn_comprar_ahora', 'Comprar ahora', 'submit', 'btn') . '<br /><img src="' . PROY_URL . 'IMG/stock/credit_card_logos_4.gif"/></td>
    </table>

    <h2>¿Deseas realizar la compra vía telefónica?</h2>
    <p class="medio-oculto">Realiza tu compra vía llamada telefónica al número <strong>2243-6017</strong></p>

    <p class="medio-oculto">No olvides tener listos los siguientes datos:</p>

    <ul class="medio-oculto">
    <li>El código del producto que deseas comprar es: <strong>' . $contenedor['codigo_producto'] . '</strong></li>
    <li>La dirección <strong>exacta</strong> de entrega</li>
예제 #17
0
파일: buscar.php 프로젝트: vlad88sv/360
function BUSCAR_mostrar_resultados($r)
{
    global $modo;
    if ($modo == 'iconos') {
        $nElementos = mysql_num_rows($r);
        $nFilas = ceil($nElementos / opcion('categoria_articulos_por_fila', 4));
        $bELEMENTOS = '<table style="width:100%;table-layout:fixed;border-collapse:collapse;margin:0;border:none;padding:0">';
        for ($i = 0; $i < $nFilas; $i++) {
            $bELEMENTOS .= '<tr>';
            for ($j = 0; $j < opcion('categoria_articulos_por_fila', 4); $j++) {
                $bELEMENTOS .= '<td style="text-align:center;vertical-align:top;">';
                if ($f = mysql_fetch_assoc($r)) {
                    $bELEMENTOS .= '<div class="categoria-elemento">
                    <a href="' . PROY_URL . 'arreglos-florales-floristerias-en-el-salvador-' . SEO($f['contenedor_titulo'] . '-' . $f['codigo_producto']) . '">
                    <img style="height:200px;" title="' . $f['contenedor_descripcion'] . '" src="' . imagen_URL($f['variedad_foto'], 0, 200) . '" />
                    </a>';
                    $bELEMENTOS .= '<div class="titulo">' . $f['contenedor_titulo'] . '</div>';
                    $bELEMENTOS .= '<div class="precio">' . $f['precio_combinado'] . '</div>';
                    $bELEMENTOS .= '</div>';
                }
                $bELEMENTOS .= '</td>';
            }
            $bELEMENTOS .= '</tr>';
        }
        $bELEMENTOS .= '</table>';
        echo $bELEMENTOS;
    } else {
        echo '<table class="ancha">';
        echo '<tr><th>Fotografía</th><th>Título</th><th>Descripción</th><th>Color</th><th>Precio</th></tr>';
        while ($f = mysql_fetch_assoc($r)) {
            echo sprintf('<tr><td>%s</td><td nowrap="nowrap">%s</td><td>%s</td><td>%s</td><td nowrap="nowrap">%s</td></tr>', '<img style="height:100px" src="' . imagen_URL($f['variedad_foto'], 0, 100) . '" />', '<a href="' . PROY_URL . 'arreglos-florales-floristerias-en-el-salvador-' . SEO($f['contenedor_titulo'] . '-' . $f['codigo_producto']) . '">' . $f['contenedor_titulo'] . '</a>', nl2br($f['contenedor_descripcion']), $f['color'], $f['precio_combinado']);
        }
        echo '</table>';
    }
}
예제 #18
0
파일: lista.php 프로젝트: vlad88sv/360
echo '<table>';
while ($f = mysql_fetch_assoc($r)) {
    $escalado = 'IMG/fb/' . ($f['codigo_producto'] + 100) . '.jpg';
    $origen = 'IMG/i/' . $f['foto'];
    $ancho = 350;
    $alto = 525;
    if (!file_exists($escalado)) {
        $im = new Imagick($origen);
        $im->setCompression(Imagick::COMPRESSION_JPEG);
        $im->setCompressionQuality(90);
        $im->setImageFormat('jpeg');
        $im->stripImage();
        $im->sharpenImage(0.5, 1);
        $im->thumbnailImage($ancho, $alto, false);
        $im->writeImage($escalado);
    }
    $img = '<img src="' . PROY_URL . 'IMG/fb/' . ($f['codigo_producto'] + 100) . '.jpg" />';
    if (isset($_GET['h5'])) {
        $txt = '<textarea onClick="select();" style="height:20em;width:60em;">' . htmlentities($img . BR . "Te obsequio " . $f['titulo'] . BR . BR . $f['contenedor_descripcion'] . BR . BR . 'Descubre más regalos en <a href="' . PROY_URL . '">' . PROY_URL . '</a>', ENT_QUOTES, 'utf-8') . '</textarea>';
    } elseif (isset($_GET['fb'])) {
        $txt = '<textarea onClick="select();" style="height:20em;width:60em;">' . PROY_URL . 'arreglos-florales-floristerias-en-el-salvador-' . SEO($f['titulo'] . '-' . $f['codigo_producto']) . ' ' . 'Floristería Flor360.com le obsequia un arreglo floral virtual. ¡Le esperamos en ' . PROY_URL . '!.Aceptamos pedidos nacionales e internacionales a entregar en cualquier parte de El Salvador</textarea>';
    } else {
        $txt = '<textarea onClick="select();" style="height:20em;width:60em;">' . $f['titulo'] . "\n-\n" . $f['contenedor_descripcion'] . "\n-\nCódigo del producto: #" . $f['codigo_producto'] . "\n-\n" . PROY_URL . '</textarea><br /><input  onClick="select();" style="width:60em;" type="text" value="[url=' . PROY_URL . 'arreglos-florales-floristerias-en-el-salvador-' . SEO($f['titulo'] . '-' . $f['codigo_producto']) . '][img]' . PROY_URL . 'imagen_350_525_' . $f['foto'] . '.jpg[/img][/url]"/><br />' . $f['precio_combinado'];
    }
    echo sprintf('<tr><td>%s</td><td>%s</td><td>%s</td></tr>', $f['codigo_producto'], $img, $txt);
}
echo '</table>';
?>
</body>
</html>
예제 #19
0
 function createNewMenu($params = NULL)
 {
     if ($params == NULL) {
         $params = $_POST;
     }
     if (empty($params['menuName'])) {
         e("menu_name_is_empty");
         return false;
     } else {
         $name = $params['menuName'];
         $file = BASEDIR . "/includes/templates/" . strtolower(SEO($name)) . $this->fileExt;
         if (file_exists($file)) {
             e("Menu with <strong>" . $name . "</strong> name already exists");
         } else {
             $fopen = fopen($file, 'w+');
             if ($fopen) {
                 e(lang("New Menu Added"), "m");
             }
             fclose($fopen);
         }
     }
 }
예제 #20
0
파일: catalogo.php 프로젝트: vlad88sv/360
/* Workhorse */
$nElementos = mysql_num_rows($r);
$nFilas = ceil($nElementos / opcion('categoria_articulos_por_fila', 4));
$bELEMENTOS .= '<table style="width:100%;table-layout:fixed;border-collapse:collapse;margin:0;border:none;padding:0">';
for ($i = 0; $i < $nFilas; $i++) {
    $bELEMENTOS .= '<tr>';
    for ($j = 0; $j < opcion('categoria_articulos_por_fila', 4); $j++) {
        $bELEMENTOS .= '<td style="text-align:center;vertical-align:top;">';
        if ($f = mysql_fetch_assoc($r)) {
            if (empty($f['variedad_foto'])) {
                $f['variedad_foto'] = 'IMG/stock/sin_imagen_133_200.jpg';
            } else {
                $f['variedad_foto'] = 'imagen_133_200_' . $f['variedad_foto'];
            }
            $bELEMENTOS .= '<div class="categoria-elemento">
                <a href="' . PROY_URL . 'arreglos-florales-floristerias-en-el-salvador-' . SEO($f['contenedor_titulo'] . '-' . $f['codigo_producto']) . '">
                <img style="width:133px;height:200px;" title="' . $f['contenedor_descripcion'] . '" src="' . $f['variedad_foto'] . '" />
                </a>';
            $bELEMENTOS .= '<div class="titulo">' . $f['contenedor_titulo'] . '</div>';
            $bELEMENTOS .= '<div class="precio">' . $f['precio_combinado'] . '</div>';
            if (isset($_GET['no_cantidad'])) {
                $f['variedad_receta'] = preg_replace(array('/[^\\w,\\s]/', '/\\d\\s{0,1}/'), '', $f['variedad_receta']);
            }
            $bELEMENTOS .= '<center><div style="text-align:center;width:133px;height:60px;">' . $f['variedad_receta'] . '</div></center>';
            $bELEMENTOS .= '</div>';
        }
        $bELEMENTOS .= '</td>';
    }
    $bELEMENTOS .= '</tr>';
}
$bELEMENTOS .= '</table>';
예제 #21
0
/**
 * @name slug
 * @todo generate slug
 * @param STRING title
 */
function slug($title)
{
    $title = SEO($title, false, false);
    $title = SEO(clean(str_replace(' ', '-', $title)), false, false);
    if (substr($title, strlen($title) - 1, 1) == '-') {
        $title = substr($title, 0, strlen($title) - 1);
    }
    $title = mb_strtolower($title, 'UTF-8');
    return $title;
}
예제 #22
0
/**
 * Function used to get video link
 * @param ARRAY video details
 */
function video_link($vdetails, $type = NULL)
{
    global $myquery;
    #checking what kind of input we have
    if (is_array($vdetails)) {
        if (empty($vdetails['title'])) {
            #check for videoid
            if (empty($vdetails['videoid']) && empty($vdetails['vid']) && empty($vdetails['videokey'])) {
                return BASEURL;
            } else {
                if (!empty($vdetails['videoid'])) {
                    $vid = $vdetails['videoid'];
                } elseif (!empty($vdetails['vid'])) {
                    $vid = $vdetails['vid'];
                } elseif (!empty($vdetails['videokey'])) {
                    $vid = $vdetails['videokey'];
                } else {
                    return BASEURL;
                }
            }
        }
    } else {
        if (is_numeric($vdetails)) {
            $vid = $vdetails;
        } else {
            return BASEURL;
        }
    }
    #checking if we have vid , so fetch the details
    if (!empty($vid)) {
        $vdetails = get_video_details($vid);
    }
    //calling for custom video link functions
    $functions = cb_get_functions('video_link');
    if ($functions) {
        foreach ($functions as $func) {
            $array = array('vdetails' => $vdetails, 'type' => $type);
            if (function_exists($func['func'])) {
                $returned = $func['func']($array);
                if ($returned) {
                    $link = $returned;
                    return $link;
                    break;
                }
            }
        }
    }
    $plist = "";
    if (SEO == 'yes') {
        if ($vdetails['playlist_id']) {
            $plist = '?&play_list=' . $vdetails['playlist_id'];
        }
        $vdetails['title'] = strtolower($vdetails['title']);
        switch (config('seo_vido_url')) {
            default:
                $link = BASEURL . '/video/' . $vdetails['videokey'] . '/' . SEO(clean(str_replace(' ', '-', $vdetails['title']))) . $plist;
                break;
            case 1:
                $link = BASEURL . '/' . SEO(clean(str_replace(' ', '-', $vdetails['title']))) . '_v' . $vdetails['videoid'] . $plist;
                break;
            case 2:
                $link = BASEURL . '/video/' . $vdetails['videoid'] . '/' . SEO(clean(str_replace(' ', '-', $vdetails['title']))) . $plist;
                break;
            case 3:
                $link = BASEURL . '/video/' . $vdetails['videoid'] . '_' . SEO(clean(str_replace(' ', '-', $vdetails['title']))) . $plist;
                break;
        }
    } else {
        if ($vdetails['playlist_id']) {
            $plist = '&play_list=' . $vdetails['playlist_id'];
        }
        $link = BASEURL . '/watch_video.php?v=' . $vdetails['videokey'] . $plist;
    }
    if (!$type || $type == 'link') {
        return $link;
    } elseif ($type == 'download') {
        return BASEURL . '/download.php?v=' . $vdetails['videokey'];
    }
}
예제 #23
0
?>
" />
	  <?php 
$baglan = @mysql_connect($host, $dbuser, $dbpass);
mysql_query("SET NAMES UTF8");
if (!$baglan) {
    die("Mysql Baglantisi Yapilamadi");
}
@mysql_select_db($database, $baglan) or die("Veri Tabanina Baglanti Yapilamadi");
$sqlsorgu = mysql_query("SELECT * FROM soru Where kategori_id=" . $kategori . " Order By okunma desc limit 10");
$ilk = 1;
while ($yazdir = mysql_fetch_array($sqlsorgu)) {
    $metin = $yazdir['soru'];
    $id2 = $yazdir['soru_id'];
    if ($id2 != $id) {
        $konu_basligi = $metin;
        $url = SEO($konu_basligi);
        if ($ilk == 1) {
            $ilk = 5;
            echo '<div id="yan">
            <h4 class="yanbaslik1">Benzer Sorular </h4>';
        } else {
            $ilk = -10;
        }
        $konuresmi = $yazdir['resim_url'];
        echo '<a class="menu_link" href="../soru-cevap/' . $url . '-t' . $id2 . '.html" title="' . $metin . '"><img src="' . $konuresmi . '" width="50" height="35" alt="' . $konu_basligi . '" style="border-radius:50px;float:right;padding-right:5px;margin-top:' . $ilk . 'px" /><h3 class="dikkatceken" title="' . $metin . '">' . $metin . '</h3></a>';
    }
}
if ($ilk != 1) {
    echo "</div>";
}
예제 #24
0
<?php

protegerme();
$c = 'SELECT var.foto AS foto, con.`titulo`,con.`codigo_producto`, (SELECT count(*) FROM `flores_visita` AS vis WHERE vis.codigo_producto=con.codigo_producto) AS vistas FROM `flores_producto_contenedor` AS con LEFT JOIN `flores_producto_variedad` AS var USING(codigo_producto) WHERE 1 GROUP BY var.codigo_producto ORDER BY vistas DESC';
$pmv = db_consultar($c);
$c = 'SELECT MIN(precio) AS min, FORMAT(AVG(precio),2) avg, MAX(precio) max FROM flores_producto_variedad WHERE precio > 0';
$epre = db_consultar($c);
$epreassoc = mysql_fetch_assoc($epre);
$c = 'SELECT flores_producto_contenedor.codigo_producto, titulo, flores_producto_contenedor.descripcion, foto, precio FROM flores_producto_contenedor LEFT JOIN flores_producto_variedad USING(codigo_producto) WHERE precio > 0 ORDER BY precio ASC LIMIT 1';
$emin = mysql_fetch_assoc(db_consultar($c));
$c = 'SELECT flores_producto_contenedor.codigo_producto, titulo, flores_producto_contenedor.descripcion, foto, precio FROM flores_producto_contenedor LEFT JOIN flores_producto_variedad USING(codigo_producto) WHERE precio > 0 ORDER BY precio DESC LIMIT 1';
$emax = mysql_fetch_assoc(db_consultar($c));
echo '<h1>Precios</h1>';
echo sprintf('El precio mas bajo en el sistema es: $%s, el precio promedio es: $%s, el mas alto es: $%s', $epreassoc['min'], $epreassoc['avg'], $epreassoc['max']);
echo '<hr />';
echo '<table style="text-align:center;width:100%;table-layout:fixed;">';
echo '<td>Arreglo mas barato:<br /><a href="' . PROY_URL . 'arreglos-florales-floristerias-en-el-salvador-' . SEO($emin['titulo'] . '-' . $emin['codigo_producto']) . '"><img src="' . PROY_URL . 'imagen_133_200_' . $emin['foto'] . '.jpg" /></a></td>';
echo '<td>Arreglo mas caro:<br /><a href="' . PROY_URL . 'arreglos-florales-floristerias-en-el-salvador-' . SEO($emax['titulo'] . '-' . $emax['codigo_producto']) . '"><img src="' . PROY_URL . 'imagen_133_200_' . $emax['foto'] . '.jpg" /></a></td>';
echo '</table>';
echo '<h1>Los productos mas vistos</h1>';
echo '<table class="tabla-estandar ancha">';
echo '<tr><th>Fotografia</th><th>Titulo del producto</th><th>No. Visitas</th></tr>';
while ($f = mysql_fetch_assoc($pmv)) {
    echo sprintf('<tr><td>%s</td><td>%s</td><td>%s</td></tr>', '<img src="' . PROY_URL . 'imagen_133_200_' . $f['foto'] . '.jpg" />', '#' . $f['codigo_producto'] . ' ~ <a href="' . PROY_URL . 'arreglos-florales-floristerias-en-el-salvador-' . SEO($f['titulo'] . '-' . $f['codigo_producto']) . '">' . $f['titulo'] . '</a>', $f['vistas']);
}
echo '</table>';
예제 #25
0
/**
 * Display dashboard for specific place. If not place is provided,
 * we'll try to look if some dashboard is registered for current
 * page using THIS_PAGE constant.
 * 
 * @todo Add open close toggler, configurations for widgets
 * @param string $place
 * @return string|boolean
 */
function display_dashboard($place = null)
{
    if (is_null($place)) {
        $place = THIS_PAGE;
    }
    $dashboard = get_dashboard($place);
    if ($dashboard) {
        $importance = get_dashboard_widget_importance();
        $dashboard['place'] = $place;
        $dashboard = apply_filters($dashboard, 'dashboard');
        $closed = get_closed_boxes($place);
        $output = '<div id="dashboard-container" class="dashboard-container" data-place="' . $place . '">';
        // Dashboard widgets output
        foreach ($importance as $important) {
            if (isset($dashboard[$important])) {
                $dashboard_widgets = $dashboard[$important];
                $total_dashboard_widgets = count($dashboard_widgets);
                if ($dashboard_widgets) {
                    $output .= '<div id="' . $place . '-' . $important . '-importance" class="dashboard-widgets dashboard-widgets-' . $important . '-importance ' . $place . '-widgets has-widgets widgets-' . $total_dashboard_widgets . '" data-importance="' . $important . '">';
                    foreach ($dashboard_widgets as $dashboard_widget) {
                        $hidden = $closed ? in_array($dashboard_widget['id'], $closed) ? ' closed' : '' : '';
                        $output .= '<div id="' . $dashboard_widget['id'] . '-' . $dashboard_widget['importance'] . '" class="dashboard-widget ' . SEO(strtolower($dashboard_widget['name'])) . ' ' . $dashboard_widget['id'] . ' is-' . $important . '' . $hidden . '" data-id="' . $dashboard_widget['id'] . '">';
                        $output .= '<div class="dashboard-widget-toggler"> <b></b> </div>';
                        $output .= '<div class="dashboard-widget-handler"><b></b></div>';
                        $output .= '<h3 class="dashboard-widget-name">' . $dashboard_widget['name'] . '</h3>';
                        $output .= '<div class="dashboard-content" id="' . $place . '-' . $dashboard_widget['importance'] . '-' . $dashboard_widget['id'] . '">';
                        if ($dashboard_widget['switch_link']) {
                            $output .= $dashboard_widget['switch_link'];
                        }
                        $output .= $dashboard_widget['display_callback']($dashboard_widget);
                        $output .= '</div>';
                        $output .= '</div>';
                    }
                    $output .= '</div>';
                }
            }
        }
        $output .= "</div>";
        return $output;
    }
    return false;
}
예제 #26
0
function VISTA_ArticuloEnBarra($Where = "1", $Limite = "LIMIT 6", $SiVacio = "No se encontraron publicaciones")
{
    $data = '';
    $c = "SELECT id_categoria, id_publicacion, (SELECT id_img FROM ventas_imagenes as b WHERE b.id_publicacion = a.id_publicacion ORDER BY RAND() LIMIT 1) as imagen, titulo, precio FROM ventas_publicaciones AS a WHERE {$Where} ORDER BY promocionado DESC, RAND() {$Limite}";
    $r = db_consultar($c);
    if (mysql_num_rows($r) < 1) {
        return Mensaje($SiVacio, _M_INFO);
    }
    while ($f = mysql_fetch_array($r)) {
        $titulo = $f['titulo'];
        $lnkTitulo = "clasificados-en-el-salvador-vendo-" . $f['id_publicacion'] . "_" . SEO($f['titulo']);
        $precio = $f['precio'];
        $ubicacion = get_path($f['id_categoria']);
        $id_publicacion = $f['id_publicacion'];
        // ->
        $data .= "<div style='display:inline-block;margin:0 10px;'><a href=\"./{$lnkTitulo}\"><img src=\"./imagen_" . $f['imagen'] . "m\" /></a></div>";
    }
    $data .= "<div style=\"clear:both\"></div>";
    return $data;
}
예제 #27
0
 /**
  * Function used return collection links
  */
 function collection_links($details, $type = NULL)
 {
     if (is_array($details)) {
         if (empty($details['collection_id'])) {
             return BASEURL;
         } else {
             $cdetails = $details;
         }
     } else {
         if (is_numeric($details)) {
             $cdetails = $this->get_collection($details);
         } else {
             return BASEURL;
         }
     }
     if (!empty($cdetails)) {
         if ($type == NULL || $type == "main") {
             if (SEO == 'yes') {
                 return BASEURL . "/collections";
             } else {
                 return BASEURL . "/collections.php";
             }
         } elseif ($type == "vc" || $type == "view_collection" || $type == "view") {
             if (SEO == 'yes') {
                 return BASEURL . "/collection/" . $cdetails['collection_id'] . "/" . $cdetails['type'] . "/" . SEO($cdetails['collection_name']) . "";
             } else {
                 return BASEURL . "/view_collection.php?cid=" . $cdetails['collection_id'] . "&type=" . $cdetails['type'];
             }
         } elseif ($type == "vi" || $type == "view_item" || $type == "item") {
             //$item_type = $this->get_collection_field($cdetails['collection_id'],'type');
             if ($cdetails['videoid']) {
                 $item_type = 'videos';
             } else {
                 $item_type = 'photos';
             }
             switch ($item_type) {
                 case "videos":
                 case "v":
                     if (SEO == "yes") {
                         return BASEURL . "/item/" . $item_type . "/" . $details['collection_id'] . "/" . $details['videokey'] . "/" . SEO(clean(str_replace(' ', '-', $details['title'])));
                     } else {
                         return BASEURL . "/view_item.php?item=" . $details['videokey'] . "&type=" . $item_type . "&collection=" . $details['collection_id'];
                     }
                     break;
                 case "photos":
                 case "p":
                     if (SEO == "yes") {
                         return BASEURL . "/item/" . $item_type . "/" . $details['collection_id'] . "/" . $details['photo_key'] . "/" . SEO(clean(str_replace(' ', '-', $details['photo_title'])));
                     } else {
                         return BASEURL . "/view_item.php?item=" . $details['photo_key'] . "&type=" . $item_type . "&collection=" . $details['collection_id'];
                     }
                     break;
             }
         } elseif ($type == 'load_more' || $type == 'more_items' || $type == 'moreItems') {
             if (empty($cdetails['page_no'])) {
                 $cdetails['page_no'] = 2;
             }
             if (SEO == 'yes') {
                 return "?cid=" . $cdetails['collection_id'] . "&type=" . $cdetails['type'] . "&page=" . $cdetails['page_no'];
             } else {
                 return "?cid=" . $cdetails['collection_id'] . "&type=" . $cdetails['type'] . "&page=" . $cdetails['page_no'];
             }
         } else {
             if ($type == 'edit' || $type == 'edit_collection') {
                 return cblink(array('name' => 'edit_collection')) . $cdetails['collection_id'];
             } else {
                 if ($type == 'manage_items') {
                     return sprintf(cblink(array('name' => 'manage_items')), $cdetails['collection_id'], $cdetails['type']);
                 }
             }
         }
     } else {
         return BASEURL;
     }
 }
예제 #28
0
</table>
<?php 
echo '<div id="menu_superior">';
// Menues dinamicos
$c = 'SELECT fcat.`codigo_categoria`, fcat.`titulo`, fcat.`descripcion`, fmenu.`codigo_menu`, fmenu.`titulo` AS "menu" FROM `flores_categorias` AS fcat LEFT JOIN `flores_menu` fmenu ON fcat.codigo_menu = fmenu.codigo_menu  WHERE 1 ORDER BY fmenu.`posicion` ASC';
$r = db_consultar($c);
while ($f = mysql_fetch_assoc($r)) {
    $menu[$f['menu']][] = array('menu' => $f['menu'], 'codigo_menu' => $f['codigo_menu'], 'codigo_categoria' => $f['codigo_categoria'], 'titulo' => $f['titulo']);
}
echo '<ul id="nav" class="dropdown dropdown-horizontal">';
foreach ($menu as $clave => $componentes) {
    echo '<li class="dir"><a href="' . PROY_URL . 'categoria-superior-' . SEO($componentes[0]['menu'] . '-' . $componentes[0]['codigo_menu']) . '" title="' . $clave . '">' . $clave . '</a>';
    echo '<ul>';
    echo '<li><a href="' . PROY_URL . 'categoria-superior-' . SEO($componentes[0]['menu'] . '-' . $componentes[0]['codigo_menu']) . '">Todas</a></li>';
    foreach ($componentes as $item) {
        echo '<li><a href="' . PROY_URL . 'categoria-' . SEO($item['titulo'] . '-' . $item['codigo_categoria']) . '" title="' . $item['titulo'] . '">' . $item['titulo'] . '</a></li>';
    }
    echo '</ul></li>';
}
/************* ADMINISTRACION ***************************/
if (in_array(_F_usuario_cache('nivel'), array(_N_administrador, _N_vendedor))) {
    echo '<li class="dir lidestacado"><a href="' . PROY_URL . 'ventas?fecha_entrega=now" title="Obtener lista de compra-venta en espera">Ventas</a></li>';
}
if (_F_usuario_cache('nivel') == _N_administrador) {
    echo '<li class="dir"><a href="' . PROY_URL . '~administracion" title="administración">Admin</a>
			<ul>
                	<li><a href="' . PROY_URL . '~contenedores?agregar" title="Agregar contenedor">Nuevo contenedor</a></li>
                	<li><a href="' . PROY_URL . '~contenedores" title="Contenedores">Contenedores</a></li>
                	<li><a href="' . PROY_URL . '~variedades" title="Variedades">Variedades</a></li>
                	<li><a href="' . PROY_URL . '~accesorios" title="Accesorios">Accesorios</a></li>
                	<li><a href="' . PROY_URL . '~categorias" title="Categorias">Categorias</a></li>
예제 #29
0
    ?>
</li>
                <!--<li><i class="fa fa-tags"></i> Metronic, Keenthemes, UI Design</li>-->
            </ul>
            <p>
                <?php 
    echo PotongKata($row->berita_penuh, 50);
    ?>
                <a class="more" href="<?php 
    echo base_url();
    ?>
frontend/berita_detail/<?php 
    echo $row->id_berita;
    ?>
/<?php 
    echo SEO($row->judul);
    ?>
">Selengkapnya... <i class="icon-angle-right"></i></a>
            </p>
            
        </div>
    </div>
    <hr class="blog-post-sep">
    <?php 
}
?>
    <ul class="pagination">
    	<?php 
echo $paging;
?>
    </ul>
예제 #30
0
function SSL_COMPRA_PROCESAR()
{
    global $variedad;
    if (isset($_POST['btn_cancelar'])) {
        if (isset($_POST['variedad'])) {
            $c = 'SELECT titulo, descripcion FROM flores_producto_contenedor LEFT JOIN flores_producto_variedad USING (codigo_producto) WHERE codigo_variedad="' . db_codex($_POST['variedad']) . '"';
            $r = mysql_fetch_assoc(db_consultar($c));
            $location = PROY_URL . 'arreglos-florales-floristerias-en-el-salvador-' . SEO($f['titulo'] . '-' . $f['codigo_producto']);
        } else {
            $location = PROY_URL;
        }
        header("Location: " . $location);
        ob_end_clean;
        exit;
    }
    if (!isset($_POST['btn_comprar']) || !isset($_POST['variedad'])) {
        return false;
    }
    // Revisamos si ya envió la compra, no vaya a ser doble compra.
    if (db_contar(db_prefijo . 'SSL_compra_contenedor', 'transaccion="' . db_codex($_POST['transaccion']) . '"')) {
        header("Location: " . PROY_URL);
        exit;
    }
    // Verificamos que todos los datos sean válidos
    $ERRORES = array();
    require_once 'PHP/ssl.vericard.php';
    $_POST['txt_numero_t_credito'] = preg_replace('/[^\\d]/', '', $_POST['txt_numero_t_credito']);
    if (!checkCreditCard($_POST['txt_numero_t_credito'], $_POST['cmb_tipo_t_credito'], $ccerror, $ccerrortext)) {
        $ERRORES[] = $ccerrortext;
    }
    // Tratamos de ver si la direccion de entrega es valida
    if (strlen(preg_replace('[^\\w]', '', $_POST['txt_direccion_entrega'])) < 10) {
        $ERRORES[] = 'Por favor revise que la dirección de entrega sea correcta y suficimientemente detallada.';
    }
    // Tratamos de ver si la direccion de entrega es valida
    if (!preg_match('/^\\d{4}-\\d{2}-\\d{2}$/', $_POST['txt_fecha_entrega'])) {
        $ERRORES[] = 'Por favor revise que la fecha de entrega sea en este formato: año-mes-dia.';
    }
    if (!preg_match('/^\\d{2}\\/\\d{2}$/', $_POST['txt_fecha_expiracion'])) {
        $ERRORES[] = 'Por favor revise que la fecha de expiración de la tarjeta de crédito sea en el formato MES/AÑO incluyendo la pleca (/).';
    }
    if (!preg_match('/^\\d{3,4}$/', $_POST['txt_ccv'])) {
        $ERRORES[] = 'Por favor revise que el número de verificación de la tarjeta de crédito sean tres (3) números. Sirvase de las instrucciones para encontrar este número en su tarjeta de crédito.';
    }
    if (strlen($_POST['txt_nombre_t_credito']) < 10) {
        $ERRORES[] = 'El nombre del acreedor de la tarjeta de crédito parece inválido';
    }
    /*
        if (!validcorreo($_POST['txt_correo_contacto']))
        {
            $ERRORES[] = 'El correo ingresado no parece valido, por favor compruebelo.';
        }
    */
    if (count($ERRORES) > 0) {
        echo '<h1>Lo sentimos, hay errores en los datos ingresados</h1>';
        echo '<p>Hemos detectado los siguientes errores en los datos introducidos y no podremos procesar su compra a menos que sean corregidos:</p>';
        echo '<p class="error">' . join('</p><p class="error">', $ERRORES) . '</p>';
        return;
    }
    // Encriptamos la tarjeta de credito
    $t_credito = db_codex(preg_replace('/[^\\d]/', '', trim($_POST['txt_numero_t_credito'])));
    $c = sprintf('SELECT AES_ENCRYPT("%s","%s") AS t_credito_AES', $t_credito, db__key_str);
    $r = db_consultar($c);
    $f = mysql_fetch_assoc($r);
    $DATOS['codigo_compra'] = '0';
    $DATOS['codigo_usuario'] = '0';
    $DATOS['estado'] = 'nuevo';
    $DATOS['fecha'] = mysql_datetime();
    $DATOS['codigo_variedad'] = @$variedad['codigo_variedad'];
    $DATOS['precio_grabado'] = @$variedad['precio'];
    $DATOS['n_credito'] = @$f['t_credito_AES'];
    $DATOS['tipo_t_credito'] = @$_POST['cmb_tipo_t_credito'];
    $DATOS['telefono_destinatario'] = @$_POST['txt_telefono_destinatario'];
    $DATOS['telefono_remitente'] = @$_POST['txt_telefono_remitente'];
    $DATOS['fecha_exp_t_credito'] = @$_POST['txt_fecha_expiracion'];
    $DATOS['nombre_t_credito'] = @$_POST['txt_nombre_t_credito'];
    $DATOS['pin_4_reverso_t_credito'] = @$_POST['txt_ccv'];
    $DATOS['direccion_entrega'] = @$_POST['txt_direccion_entrega'];
    $DATOS['fecha_entrega'] = @$_POST['txt_fecha_entrega'];
    $DATOS['tarjeta_de'] = @$_POST['txt_tarjeta_de'];
    $DATOS['tarjeta_para'] = @$_POST['txt_tarjeta_para'];
    $DATOS['tarjeta_cuerpo'] = @$_POST['txt_tarjeta_cuerpo'];
    $DATOS['usuario_notas'] = @$_POST['txt_usuario_notas'];
    $DATOS['correo_contacto'] = @$_POST['txt_correo_contacto'];
    $DATOS['transaccion'] = @$_POST['transaccion'];
    $DATOS['precio_envio'] = @(double) $_POST['destino'];
    if ($_POST['txt_numero_t_credito'] == str_repeat('1', 16)) {
        return '<p>ERROR</p>';
    }
    return db_agregar_datos(db_prefijo . 'SSL_compra_contenedor', $DATOS);
}