コード例 #1
0
ファイル: delete.php プロジェクト: mtaisigue/ads
require_once '../funciones.php';
$type = @$_GET['type'];
$id = @$_GET['id'];
if ($type == 'ad') {
    $sql = 'UPDATE anuncios SET fecha_eliminado = ' . time() . ' WHERE id_anuncio = ' . $id;
    if (!$usuario_isadmin) {
        $sql .= ' AND id_usuario = ' . $id_usuario;
    }
    eS($sql);
    $sql = 'SELECT * FROM anuncios WHERE id_anuncio = ' . $id;
    $r = eS($sql);
    $f = fetch($r);
    $location = 'index.php?p=' . $f['id_publicacion'];
} else {
    if ($usuario_isadmin) {
        if ($type == 'runsheet') {
            $sql = 'DELETE FROM publicaciones WHERE id_publicacion = ' . $id;
            eS($sql);
            $sql = 'DELETE FROM anuncios WHERE id_publicacion = ' . $id;
            eS($sql);
            $location = $type . 's.php';
        } else {
            if ($type == 'categories') {
                $sql = 'DELETE FROM categorias WHERE id_categoria = ' . $id;
                eS($sql);
                $location = $type . '.php';
            }
        }
    }
}
header('location:../' . $location);
コード例 #2
0
ファイル: index.php プロジェクト: mtaisigue/ads
    ?>
		<div class="table" id="main_table">
        	<div class="msg_error" id="main_msgerror"></div>
            <div class="clear"></div>
			<div class="row">
            	<div class="col1">Page</div>
                <div class="col2">Name Registrar</div>
                <div class="col3">Size</div>
                <div class="col4">Categories</div>
                <div class="col5"></div>
				<div class="clear"></div>
			</div>
	<?php 
    foreach ($paginas as $p) {
        $sql = 'SELECT * FROM anuncios WHERE id_publicacion = ' . $id_publicacion . ' AND id_pagina = ' . $p['id_pagina'] . ' AND fecha_eliminado = 0 ORDER BY id_anuncio';
        $anuncios = eS($sql);
        $sip = spaceInPage($id_publicacion, $p['id_pagina']);
        $f = 0;
        include 'adrow.php';
        // Fila Vacia
        while ($f = fetch($anuncios)) {
            include 'adrow.php';
        }
        // END WHILE
    }
    // END FOREACH
    ?>
    </div>
<?php 
}
// END IF
コード例 #3
0
ファイル: categories.php プロジェクト: mtaisigue/ads
require_once 'config.php';
require_once 'funciones.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<link type="text/css" rel="stylesheet" href="css/style.css" media="all" />
</head>
<body>
<a href="./">Back</a>
<?php 
$categorias = array();
$sql = 'SELECT * FROM categorias';
$r = eS($sql);
while ($f = fetch($r)) {
    $categorias[] = $f;
}
?>
<table>
	<thead>
        <tr>
            <th>Categories</th>
            <th>Actions</th>
        </tr>
    </thead>
    <tbody>
	<?php 
foreach ($categorias as $c) {
    ?>
コード例 #4
0
ファイル: funciones.php プロジェクト: mtaisigue/ads
function exceedCat($idcat, $idpub)
{
    $category = 0;
    global $samecat_limit;
    if ($idcat != 0) {
        $sql = 'SELECT * FROM anuncios WHERE id_publicacion = ' . $idpub . ' AND (id_categoria1 = ' . $idcat . ' OR id_categoria2 = ' . $idcat . ') AND fecha_eliminado = 0';
        $r = eS($sql);
        if (mysql_num_rows($r) > $samecat_limit) {
            while ($f = fetch($r)) {
                print_r($f);
                echo '<br/>';
            }
            echo mysql_num_rows($r) . '-' . $samecat_limit . '<br/>';
            $sql = 'SELECT * FROM categorias WHERE id_categoria = ' . $idcat;
            $r = eS($sql);
            $f = fetch($r);
            $category = $f['nombre'];
        }
    }
    return $category;
}