Beispiel #1
0
 public function getBread()
 {
     // HTML, OPEN IN HEAD
     // BODY, OPEN IN HEAD
     // HOLDER, OPEN IN HEAD
     // CONTENT, OPEN IN HEAD
     // RIGHT
     // rightPadding
     $out[] = '
                                 <div id="bread"><p>
                                 ';
     // INDEX
     if (!isset($_GET['m'])) {
         $out[] = '';
         $out[] = lang('indice');
         $out[] = '';
     }
     // ACTIONS
     if (isset($_GET['m']) && isset($_GET['action'])) {
         // LIST
         if ($_GET['action'] == "list") {
             // NO CAT
             if (!$this->catId) {
                 $out[] = '';
                 $out[] = '<a href="' . ROOT . 'admin/">' . lang('indice') . '</a> > ';
                 $out[] = '' . lang(formatear_string($_GET['m'], ' ')) . '';
                 $out[] = '';
             }
             // CAT
             if ($this->catId) {
                 $out[] = '';
                 $out[] = '<a href="' . ROOT . 'admin/">' . lang('indice') . '</a> >';
                 $out[] = '<a href="' . ROOT . 'admin/?m=' . $_GET['m'] . '&amp;action=list">' . lang(formatear_string($_GET['m'], ' ')) . '</a> >';
                 $out[] = '' . $this->getCategorieName() . '';
                 $out[] = '';
             }
         }
         // SHOW ALL
         if ($_GET['action'] == "showAll") {
             $out[] = '';
             $out[] = '<a href="' . ROOT . 'admin/">' . lang('indice') . '</a> >';
             $out[] = '' . lang(formatear_string($_GET['m'], ' ')) . '';
             $out[] = '';
         }
         // CREATE
         if ($_GET['action'] == "create") {
             $out[] = '';
             $out[] = '<a href="' . ROOT . 'admin/">' . lang('indice') . '</a> >';
             $out[] = '<a href="' . ROOT . 'admin/?m=' . $_GET['m'] . '&amp;action=list">' . lang(formatear_string($_GET['m'], ' ')) . '</a> >';
             if ($this->catId) {
                 $out[] = '<a href="' . ROOT . 'admin/?m=' . $_GET['m'] . '&amp;action=list&amp;cat_id=' . $this->catId . '">' . $this->getCategorieName() . '</a> >';
             }
             $out[] = '' . lang('crear contenido') . '';
             $out[] = '';
         }
         // EDIT
         if ($_GET['action'] == "edit") {
             $out[] = '';
             $out[] = '<a href="' . ROOT . 'admin/">' . lang('indice') . '</a> >';
             $out[] = '<a href="' . ROOT . 'admin/?m=' . $_GET['m'] . '&amp;action=list">' . lang(formatear_string($_GET['m'], ' ')) . '</a> >';
             if ($this->catId) {
                 $out[] = '<a href="' . ROOT . 'admin/?m=' . $_GET['m'] . '&amp;action=list&amp;cat_id=' . $this->catId . '">' . $this->getCategorieName() . '</a> >';
             }
             $out[] = '' . lang('editar contenido') . '';
             $out[] = '';
         }
     }
     $out[] = '
                                 </p></div>
                                 ';
     // rightPadding
     // RIGHT
     // CONTENT, CLOSED IN FOOTER
     // HOLDER, CLOSED IN FOOTER
     // BODY, CLOSED IN FOOTER
     // HTML, CLOSED IN FOOTER
     return join("\n", $out);
 }
 public function getMenu()
 {
     // HTML, OPEN IN HEAD
     // BODY, OPEN IN HEAD
     // HOLDER, OPEN IN HEAD
     // CONTENT, OPEN IN HEAD
     // LEFT
     $out[] = '
                         <div id="left">
                         ';
     // MENU
     $out[] = '
                             <ul id="menu">
                             ';
     // 1 INDEX LINK
     $out[] = '
                                 <li class="titulo-3">
                                     <a href="' . ROOT . 'admin/">
                                         <img src="' . ICONSPATH . 'home.png" alt=""/>' . lang('indice') . '
                                     </a>
                                 </li>
                                 ';
     // 2 MODULES
     if ($this->config['modulos']) {
         $out[] = '
                                         <li class="titulo">
                                             <img src="' . ICONSPATH . 'modulos.png" alt=""/>' . lang('modulos') . '
                                         </li>
                                         ';
         // 3 VERIFY FULL ACCESS
         if ($_SESSION['permisos'] == 1) {
             // MODULES LINKS
             foreach ($this->config['modulos'] as $modulo) {
                 $out[] = '
                                                 <li class="titulo-2">
                                                     <a href="' . ROOT . 'admin/?m=' . $modulo . '&amp;action=list">
                                                         <img src="' . ICONSPATH . 'cog_go.png" alt=""/>' . lang(formatear_string($modulo, ' ')) . '
                                                     </a>
                                                 </li>
                                                 ';
             }
         }
     }
     // 2 SUPER ADMIN
     if ($this->config['modulosAdmin']) {
         $out[] = '
                                         <li class="titulo">
                                             <img src="' . ICONSPATH . 'user_gray.png" alt=""/>' . lang('administración') . '
                                         </li>
                                         ';
         // 3 VERIFY FULL ACCESS
         if ($_SESSION['permisos'] == 1) {
             // ADMIN MODULES LINKS
             foreach ($this->config['modulosAdmin'] as $modulo) {
                 $out[] = '
                                                 <li class="titulo-2">
                                                     <a href="' . ROOT . 'admin/?m=' . $modulo . '&amp;action=list">
                                                         <img src="' . ICONSPATH . $modulo . '.png" alt=""/>' . lang(formatear_string($modulo, ' ')) . '
                                                     </a>
                                                 </li>
                                                 ';
             }
         }
     }
     // 1 LOGOUT LINK
     $out[] = '
                                 <li class="titulo-3">
                                     <a href="' . ROOT . 'admin/logout.php">
                                         <img src="' . ICONSPATH . 'key.png" alt=""/>' . lang('Cerrar Sesión') . '
                                     </a>
                                 </li>
                                 ';
     // EO MENU
     $out[] = '
                             </ul>
                             ';
     // EO LEFT
     $out[] = '
                         </div>
                         ';
     // CONTENT, CLOSED IN FOOTER
     // HOLDER, CLOSED IN FOOTER
     // BODY, CLOSED IN FOOTER
     // HTML, CLOSED IN FOOTER
     return join("\n", $out);
 }
//$mail->AddAddress("*****@*****.**","VENTAS - Web Form - ENVASES POLIVERSAL S.A.");
//$mail->AddAddress("*****@*****.**","VENTAS - Web Form - ENVASES POLIVERSAL S.A.");
$mail->AddAddress("*****@*****.**", "VENTAS - Web Form - ENVASES POLIVERSAL S.A.");
//$mail->AddAddress("*****@*****.**","VENTAS - Web Form - ENVASES POLIVERSAL S.A.");
$mail->AddReplyTo($_POST['email'] ? $_POST['email'] : $config['phpmailer']['replyToName'], $_POST['nombre'] ? $_POST['nombre'] . ' ' . $_POST['apellido'] : $config['phpmailer']['replyToEmail']);
//$mail->AddCC($config['phpmailer']['toCCEmail'],$config['phpmailer']['toCCName']);
//$mail->AddBCC($config['phpmailer']['toBCCEmail'],$config['phpmailer']['toBCCName']);
//$mail->AddAttachment($config['phpmailer']['attachmentPath']);
$mail->Host = $config['phpmailer']['host'];
$mail->Username = $config['phpmailer']['username'];
$mail->Password = $config['phpmailer']['password'];
$mail->Port = $config['phpmailer']['port'];
$body = array();
$body[] = '<h1>' . $config['phpmailer']['subject'] . '</h1>';
foreach ($_POST as $k => $v) {
    $body[] = '<p><strong>' . formatear_string($k) . ': </strong>' . formatear_string($v) . '</p>';
}
//$body[] = '<br/><br/><p>Mensaje enviado el día: '.date('d-m-Y H:i:s').'</p>';
$body[] = '<p>Remote IP Address: ' . $_SERVER['REMOTE_ADDR'] . '</p>';
$body[] = '<p>Remote Port: ' . $_SERVER['REMOTE_PORT'] . '</p>';
$body[] = '<p>Remote ISP Name: ' . gethostbyaddr($_SERVER['REMOTE_ADDR']) . '</p>';
$body = join("\n", $body);
$mail->MsgHTML($body);
if ($mail->Send()) {
    //if($config['phpmailer']['writeLog']) {
    //$file = fopen('sendLog.txt','a');
    //fwrite($file,strip_tags($body));
    //fwrite($file,"\n\n");
    //fclose($file);
    //}
    header("Location: ../?sent=true");
function makeSearchQuery($selectString = "id", $fromString = "files", $whereString = "1=1", $orderByString = "id", $limit = "20", $term = array(), $fields = array())
{
    $term = formatear_string($term, " ", true);
    $term = explode(" ", trim($term));
    if ($term[0]) {
        foreach ($term as $keyword) {
            if ($keyword) {
                if ($fields) {
                    $fieldsSql = '';
                    foreach ($fields as $f) {
                        $fieldsSql[] = " " . $f . " like '%" . $keyword . "%' ";
                    }
                }
                $searchingWord[] = implode(" OR ", $fieldsSql);
            }
        }
        $searchingWord = implode(" ) AND ( ", $searchingWord);
    } else {
        return;
    }
    $query = "\r\n    select \r\n        " . $selectString . " \r\n    from \r\n        " . $fromString . " \r\n    where \r\n        " . $whereString . " \r\n    and \r\n        (" . $searchingWord . ") \r\n    order by \r\n        " . $orderByString . " \r\n    limit \r\n        " . $limit . "\r\n    ";
    return $query;
    //$items = q("select id, nombre, apellido, biografia from artistas where ".$query." order by nombre, apellido limit 200");
}
Beispiel #5
0
<?php

// INCLUDE GENERAL CONFIG
require_once '../admin/config/general/config.php';
// INCLUDE ALL
if ($_SERVER['SERVER_ADDR'] == '127.0.0.1') {
    require_once $_SERVER['DOCUMENT_ROOT'] . $config['localCorePath'] . 'includes/include.AllBackEnd.php';
} else {
    require_once $_SERVER['DOCUMENT_ROOT'] . $config['root'] . 'admin/includes/include.AllBackEnd.php';
}
if (!$_POST['termino']) {
    die;
}
$out = array();
//$_POST['termino'] = mb_convert_encoding($_POST['termino'], "ISO-8859-1", "UTF-8");
$arrayTerm = explode(" ", formatear_string($_POST['termino'], " ", true));
// PRODUCTOS
$query = '';
foreach ($arrayTerm as $keyword) {
    $query[] = " (nombre like '%" . $keyword . "%' or resumen like '%" . $keyword . "%' or descripcion like '%" . $keyword . "%') ";
}
$query = implode(" AND ", $query);
$items = q("select * from productos where " . $query . " order by nombre");
if ($items) {
    //$out .= '<h3><a href="#">Contenidos</a></h3>';
    foreach ($items as $item) {
        $foto = array();
        $img = a("select nombre, tabla from files where item_id = " . $item['id'] . " AND tipo = 'imagenes' and tabla = 'productos' order by orden");
        $phpt = new PhpT();
        $phpt->fileName = $img['nombre'];
        $phpt->fileTitle = $item['nombre'];