Пример #1
0
function Eliminar()
{
    $cat = new CL_CATEGORIA();
    $categorias = $cat->ObtenerCategorias();
    ?>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <h3 class="box-title">Eliminar Categorias</h3>
                    </div><!-- /.box-header -->
                    <div class="box-body">
                        <table id="example2" class="table table-bordered table-hover">
                            <thead>
                                <tr>
                                    <th align="center">Marca</th>
                                    <th align="center">Nombre</th>
                                    <th align="center">Eliminar</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php 
    for ($index = 0; $index < count($categorias); $index++) {
        ?>
                                    <tr>
                                        <td valign="center" align="center">
                                            <img src="<?php 
        echo $categorias[$index]->strImagen;
        ?>
" alt="User Image" width="40" height="40"/> </td>
                                        <td align="center"><?php 
        echo $categorias[$index]->strNombre;
        ?>
</td>
                                        <td align="center">
                                            <form action="./INCLUDES/Categorias.php?act=2" method="POST">

                                                <input type="hidden" name="id" value="<?php 
        echo $categorias[$index]->intId;
        ?>
 ">

                                                <input type="submit" value="eliminar" name="eliminar" class="btn btn-danger">
                                            </form>
                                        </td>
                                    </tr>
                                <?php 
    }
    ?>
                            </tbody>
                        </table>
                    </div><!-- /.box-body -->
                </div><!-- /.box -->
            </div><!-- /.col -->
        </div><!-- /.row -->
    </section><!-- /.content -->
    <?php 
}
Пример #2
0
function footer()
{
    ?>
            <div class="mail-section">
                <ul>
                    <li><i class="message"></i></li>
                    <li><a href=""><?php 
    echo $GLOBALS['Empresa']->strCorreo;
    ?>
</a></li>
                    <li><i class="phone"></i></li>
                    <li><?php 
    echo $GLOBALS['Empresa']->intTelefono;
    ?>
</li>
                </ul>
                <p><?php 
    echo $GLOBALS['Empresa']->strDireccion;
    ?>
</p>
            </div>
            <div class="stellar-section">
                <div class="thumb-box6" data-stellar-background-ratio="-0.2">
                    <div class="container">
                        <h2>Categorias</h2>
                        <div class="row">
                            <?php 
    $cat = new CL_CATEGORIA();
    $categorias = $cat->ObtenerCategorias();
    $bandera = FALSE;
    ?>
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-6">
                                <ul class="list1-2">    
                                    <?php 
    for ($index = 0; $index < count($categorias); $index++) {
        ?>
                                        <li><a href="./Productos.php?cat=<?php 
        echo $categorias[$index]->intId;
        ?>
"><?php 
        echo $categorias[$index]->strNombre;
        ?>
</a></li>
                                        <?php 
        if ($index > 0 && ($index + 1) % 7 == 0) {
            ?>
                                        </ul>
                                    </div>
                                    <div class="col-lg-3 col-md-3 col-sm-3 col-xs-6">
                                        <ul class="list1-2">
                                            <?php 
        }
    }
    ?>
                                </ul>
                            </div>          
                        </div>
                    </div>
                </div>
            </div>

            <!-- content-section-ends -->
            <div class="footer">
                <div class="copy-rights text-center">
                    <p>&copy; 2014 Design by <a href="http://w3layouts.com" target="target_blank">W3layouts</a></p>
                </div>			
            </div>
        </body>
    </html>
<?php 
}
Пример #3
0
function catalogo_cat()
{
    $cat = new CL_CATEGORIA();
    $categorias = $cat->ObtenerCategorias();
    ?>
    <div class="box box-danger">
        <div class="box-header with-border">
            <h3 class="box-title">Elegir Categoria</h3>
            <div class="box-tools pull-left">
                <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
            </div>
        </div><!-- /.box-header -->
        <div class="box-body no-padding">
            <ul class="users-list clearfix">
                <?php 
    for ($index = 0; $index < count($categorias); $index++) {
        ?>
                    <ul class="users-list clearfix">   
                        <li>
                            <img src="<?php 
        $pro = explode('/', $categorias[$index]->strImagen);
        echo $pro[0] . '/' . $pro[1] . '/ga_' . $pro[2];
        ?>
" alt="User Image" height="160" width="90"/>
                            <a class="users-list-name"><?php 
        echo $categorias[$index]->strNombre;
        ?>
</a>

                            <input type="checkbox" class="users-list"  name="Categoria[]" value="<?php 
        echo $categorias[$index]->intId;
        ?>
"/>

                        </li>   
                    <?php 
        if ($index > 0 && ($index + 1) % 4 == 0) {
            ?>
                        </ul>
                        <?php 
        }
    }
    ?>
            </ul><!-- /.users-list -->
        </div><!-- /.box-body -->
        <div class="box-footer text-center">
        </div><!-- /.box-footer -->
    </div><!--/.box -->
    <?php 
}
Пример #4
0
<?php

include '../CLASES/CL_CATEGORIA.php';
$actividad = $_GET['act'];
switch ($actividad) {
    case 1:
        $nombre = $_POST['nombre'];
        $imagen = $_POST['Imagen'][0];
        $cat = new CL_CATEGORIA();
        $cat->CrearCategoria($nombre, $imagen);
        header("Location:../CategoriaAdmin.php?act=3");
        break;
    case 2:
        $id = $_POST['id'];
        $cat = new CL_CATEGORIA();
        $cat->EliminarCategoria($id);
        header("Location:../CategoriaAdmin.php?act=1");
        break;
    case 3:
        $nombre = $_POST['nombre'];
        $imagen = $_POST['Imagen'][0];
        $categoria = $_POST['categoria'];
        $cat = new CL_CATEGORIA();
        $cat->ActualizarCategoria($nombre, $imagen, $categoria);
        header("Location:../CategoriaAdmin.php?act=2");
        break;
    default:
        break;
}