Example #1
0
function Main()
{
    global $TPLV, $bottom, $urls, $db, $migalha;
    $TPLV = new TemplatePower(TEMPLATE_PATH . "modulos/produtos.tpl");
    $TPLV->assignGlobal("uploadPath", UPLOAD_PATH);
    $TPLV->assignGlobal("uploadPath", UPLOAD_PATH_SITE);
    $TPLV->assignGlobal("imagePath", IMAGE_PATH);
    $TPLV->assignGlobal("swfPath", SWF_PATH);
    $TPLV->assignGlobal("localPath", LOCAL_PATH);
    $TPLV->assignGlobal("localPath", LOCAL_PATH_SITE);
    $TPLV->assignGlobal('navBottom', $bottom);
    $TPLV->assignGlobal($urls->var);
    $TPLV->prepare();
    $in = $_GET['in'];
    switch ($in) {
        default:
            /**- LISTA DE CATEGORIAS -**/
        /**- LISTA DE CATEGORIAS -**/
        case 'lista':
            lista();
            break;
        case 'nova':
            nova();
            break;
        case 'edita':
            edita();
            break;
        case 'salva':
            salva();
            break;
        case 'apagaFoto':
            apagaFoto();
            break;
        case 'deleta':
            deleta();
            break;
            /**- LISTA DE PRODUTOS -**/
        /**- LISTA DE PRODUTOS -**/
        case 'listar':
            listar();
            break;
        case 'novo':
            novo();
            break;
        case 'editar':
            editar();
            break;
        case 'download':
            download();
            break;
        case 'download_salvar':
            download_salvar();
            break;
        case 'download_deletar':
            download_deletar();
            break;
        case 'salvar':
            salvar();
            break;
        case 'deletar':
            deletar();
            break;
        case 'deletarNutricional':
            deletarNutricional();
            break;
        case 'apagarFoto':
            apagarFoto();
            break;
    }
}
Example #2
0
      <div class="row">
        <div class="col-xs-12">
          <table class="table table-bordered table-hover">
            <caption>Lista de membros</caption>
            <thead>
              <tr>
                <th class="identificador">#</th>
                <th>Nome</th>
                <th>Equipe</th>
                <th class="action">Editar</th>
                <th class="action">Excluir</th>
              </tr>
            </thead>
            <tbody>
            <?php 
$membros = listar("membros");
foreach ($membros as $membro) {
    ?>
              <tr>
                <th class="identificador" scope="row">
                  <?php 
    echo $membro->id;
    ?>
                  <input type="hidden" class="id" value="<?php 
    echo $membro->id;
    ?>
">
                </th>
                <td>
                  <?php 
    echo $membro->nome;
 public function niveis()
 {
     $campo = "id";
     $resultado = listar('nivel_acesso', $campo);
     return $resultado;
 }
Example #4
0
/**
 * Modifica una tarea
 * 
 * @param int    $identificador Identificador de la tarea
 * @param string $texto         Nuevo texto de la tarea
 * @param int    $estado        estado de la tarea
 * 
 * @return json
 */
function modificar($identificador, $texto, $estado)
{
    $salida = 0;
    try {
        $task = ORM::for_table(TABLA)->where('id', $identificador)->find_one();
        $task->texto = $texto;
        $task->estado = $estado;
        $task->save();
        $salida = listar();
    } catch (Exception $e) {
    }
    return $salida;
}
<?php

require "../../include/banco.php";
session_start();
$id = $_POST['id'];
$lista = listar('clientes', '00198500', 'clientes.dia_semana', array('id' => $id, 'id_empresa' => $_SESSION['usuario_logado']['id']), array('id'), null, 'true');
foreach ($lista as $chave => $valor) {
    $dados[$chave] = $valor;
}
echo json_encode($dados);
Example #6
0
    </div>
<div class="col-md-7">
  <h2 class="sub-header">Lista de Usuarios</h2>
  <table class="table table-bordered table-striped table-hover">
    <thead>
      <tr>
        <td>#</td>
        <td>Nome</td>
        <td>Email</td>
        <td>Nascimento</td>
        <td>EXCLUIR</td>
      </tr>
    </thead>
    <tbody>
      <?php 
$usuarios = listar();
?>
       <?php 
if ($usuarios) {
    ?>
         <?php 
    foreach ($usuarios as $usuario) {
        ?>
          <tr>
            <td><a href="editar.php?id=<?php 
        echo $usuario['id'];
        ?>
"><?php 
        echo $usuario['id'];
        ?>
</a></td>
Example #7
0
    <div class="ui-field-contain">
    <label for="textarea-14">Horas :</label>
    <input data-clear-btn="true" data-mini="true" name="horas" id="text-15" value="" type="text">
    </div>
  
   <p class="pull-right">
  <button type="submit" class="btn btn-info">Cadastrar</button>
   <img src="../img/loading.gif" /> class="load" alt="Carregando" style="display: none" />
  </p>
    </form>
      <?php 
        break;
    case 'listar':
        //listando
        if (listar()) {
            $admin = listar();
            foreach ($admin as $adm) {
                //$data_mysql =  $adm -> 	data; ;
                //$timestamp = strtotime($data_mysql); // Gera o timestamp de $data_mysql
                ?>
		 		<tr>
		 		<td><a href="#" id="btn_edit_perfil"  data-id="<?php 
                echo $adm->id;
                ?>
">
 				<img src="https://graph.facebook.com/<?php 
                echo $adm->facebook;
                ?>
/picture?type=square" alt="Matheus" class="img-rounded" width="45" height="45"></td>
               	<!--td class="info"><a href="#" id="btn_edit_perfil" 	data-id="<?php 
                echo $adm->id;
Example #8
0
<?php

$posts_encontrados = listar("posts");
if (!empty($posts_encontrados)) {
    foreach ($posts_encontrados as $post) {
        ?>

    <div class="post">
        <h2><?php 
        echo $post->titulo_post;
        ?>
</h2>
        <p><?php 
        echo $post->conteudo_post;
        ?>
</p>
        <span><a href="?p=alterar&id=<?php 
        echo $post->id;
        ?>
">Alterar</a></span> |      |   <span><a href="?p=deletar&id=<?php 
        echo $post->id;
        ?>
">Deletar</a></span>
    </div>
        <?php 
    }
} else {
    ?>
    nenhum post cadastrado
    <?php 
}
Example #9
0
            $erro = "Já existe uma categoria com esse nome.";
        }
    } else {
        $erro = $obrigatorio;
    }
} else {
}
?>

<div class="formularioAlterar">
	<h2>: .ALTERAR CATEGORIA .:</h2>
	<?php 
// require_once '../bibliotecas/Pager/Pager/Pager.php';
// require_once '../bibliotecas/Pager/Pager/Pager/Common.php';
// require_once '../bibliotecas/Pager/Pager/Pager/Jumping.php';
$dadosCategoria = listar("categories");
?>

	<table width="300">
		<tr class="cabecalho">
			<td class="cell_pequena">Nome</td>
			<td>Alterar</td>
		</tr>

		<?php 
$params = array('mode' => 'Jumping', 'perPage' => 10, 'delta' => 5, 'itemData' => $dadosCategoria);
$pager = @Pager::factory($params);
$data = $pager->getPageData();
//var_dump($data);
foreach ($data as $d) {
    ?>
Example #10
0
        } else {
            throw new Exception("O numero passado pela url deve ser inteiro");
        }
    } catch (Exception $e) {
        echo "Erro: " . $e->getMessage();
    }
}
?>

<div class="formularioDeletar">
	<h2>:. DELETAR ADMINISTRADOR .:</h2>
	

		<table width="600">
			<?php 
$admin = listar("administrador");
if (!empty($admin)) {
    ?>
			<tr class="cabecalho">
				<td>Nome</td>
				<td>Deletar</td>
			</tr>

			<?php 
    $params = array('mode' => 'Jumping', 'perPage' => 10, 'delta' => 5, 'itemData' => $admin);
    $pager = @Pager::factory($params);
    $data = $pager->getPageData();
    //var_dump($data);
    if (!empty($admin)) {
        foreach ($admin as $c) {
            ?>
Example #11
0
    unset($_SESSION);
}
?>

<script type="text/javascript" src="/treinos/php/siteCompleto/admin/inc/js/tiny_mce/tinymce.min.js"></script>
<script type="text/javascript" src="/treinos/php/siteCompleto/admin/inc/js/tiny.js"></script>

<div class="formulario_cadastro">
	<div class="formCadastro">
		<form action="" method="post" enctype="multipart/form-data">
			<!-- enctype -> pegar os dados das fotos -->
			<label for="category">Categoria:</label>
			<select name="category">
				<option value="" selected="selected">Escolha  uma categoria:</option>
				<?php 
$dados = listar("categories");
if ($dados) {
    var_dump($dados);
    foreach ($dados as $d) {
        ?>
						<option value="<?php 
        echo $d['category_id'];
        ?>
"><?php 
        echo $d['category_name'];
        ?>
</option>
						<?php 
    }
} else {
    ?>
Example #12
0
        <table class="table table-bordered table-hover">
            <caption>Lista de Maratonas</caption>
            <thead>
            <tr>
                <th class="identificador">#</th>
                <th>Nome</th>
                <th>Juiz</th>
                <th>Data Inicio</th>
                <th>Data Fim</th>
                <th class="action">Editar</th>
                <th class="action">Excluir</th>
            </tr>
            </thead>
            <tbody>
            <?php 
$maratona = listar("maratona");
foreach ($maratona as $maratonas) {
    ?>
                <tr>
                    <th class="identificador" scope="row">
                        <?php 
    echo $maratonas->id;
    ?>
                        <input type="hidden" class="id" value="<?php 
    echo $maratonas->id;
    ?>
">
                    </th>
                    <td>
                        <?php 
    echo $maratonas->nome;
Example #13
0
			<table >
				<thead>
					<tr>
					
						<th>Descrição</th>
						<th>Duração</th>					
						<th>Limite Jogadores</th>
						<th>Funcionando?</th>
						<th>Excluir</th>
					</tr>
				</thead>
				<tbody>
					<?php 
$campos = array("id_empresa" => $_SESSION['usuario_logado']['id']);
$ordem = array('descricao');
$quadras = listar('clientes', '00198500', 'clientes.quadra', $campos, $ordem);
foreach ($quadras as $quadra) {
    echo "<tr id='quadra{$quadra['id']}' onclick='alterarQuadra({$quadra['id']})'><td><a href='#quadra{$quadra['id']}'>{$quadra['descricao']}</a></td>";
    echo "<td>{$quadra['duracao']}</td>";
    echo "<td>" . (empty($quadra['qtde_limite']) ? "Ilimitado" : $quadra['qtde_limite']) . "</td>";
    echo "<td>" . ($quadra['funciona'] ? "Funcionando" : "Desativada") . "</td>";
    echo "<td class='last'> <input type='button' onclick='deletaQuadra({$quadra['id']})' value='x' id='excluir'></td></tr>";
}
?>
				
						
					</tr>
				</tbody>
			</table>	
        </div>
    </div>
Example #14
0
		<form action="" method="post" enctype="multipart/form-data">
			<input type="hidden" name="id" value="<?php 
    echo $d['pizza_id'];
    ?>
">
			<tr>
				<td><input type="text" name="name_pizza" value="<?php 
    echo $d['pizza_name'];
    ?>
" class="txt_field" /> </td>
				<input type="hidden" name="url">
				<td>
					<?php 
    // LISTAGEM DAS CATEGORIAS
    $cat = listar('categories');
    //var_dump($cat);
    ?>
					<select name="category_pizza" class="select_field">
						<?php 
    foreach ($cat as $c) {
        ?>
	

						<option value="<?php 
        echo $c['category_id'];
        ?>
" <?php 
        echo $c['category_name'] == $d['category_name'] ? "selected='selected'" : $c['category_name'];
        ?>
>
Example #15
0
    ?>
			</span><br />
		</a>
		<?php 
    $d->next();
    ?>
	<?php 
}
?>
	</div>
</div>
<!--  FIM DESTAQUES DA SEMANA -->
<div id="pizzas_amostra">
	<h1>Conheça nossas pizzas!</h1>
	<?php 
$dados = listar("pizzas", "ORDER BY RAND() DESC LIMIT 6");
$d = new ArrayIterator($dados);
while ($d->valid()) {
    ?>
	<div class="pizzas">
		<a href="http://localhost/treinos/php/siteCompleto/detalhes/<?php 
    echo strtolower(urlencode($d->current()->pizza_name_url));
    ?>
">
			<img src='<?php 
    echo $d->current()->pizza_foto_inicio;
    ?>
' >
			<span class="namePizza">
				<?php 
    echo $d->current()->pizza_name;
Example #16
0
function logoutUser($request)
{
    if (isset($_COOKIE['usuarioid'])) {
        unset($_COOKIE['usuarioid']);
        setcookie('usuarioid', $_POST['usuarioid'], time() - 1);
    }
    session_destroy();
    redirect("../index.php");
}
$request = new Request();
$action = $request->action;
switch ($action) {
    case "redirecRegistrar":
        redirecRegistro($request);
        break;
    case "nuevoUser":
        nuevoUser($request);
        break;
    case "validar":
        validateUser($request);
        break;
    case "actualizar":
        updateUser($request);
        break;
    case "logout":
        logoutUser($request);
        break;
    default:
        listar($request);
        break;
}
Example #17
0
        <div class="span12">
			<table >
				<thead>
					<tr>
					
						<th>Feriado</th>
						<th>Data</th>					
						<th>Excluir?</th>
					</tr>
				</thead>
				<tbody>
					<?php 
$campos = array("id_empresa" => $_SESSION['usuario_logado']['id']);
$camposEspeciais = array('feriado' => ' IS NOT NULL');
$ordem = array('feriado', 'descricao');
$dias = listar('clientes', '00198500', 'clientes.dia_semana', $campos, $ordem, null, null, $camposEspeciais);
foreach ($dias as $dia) {
    echo "<tr id='dia{$dia['id']}' ><td>{$dia['descricao']}</td>";
    echo "<td>{$dia['feriado']}</td>";
    echo "<td class='last'> <input type='button' onclick='excluirFeriado({$dia['id']})' value='x' id='excluir'></td></tr>";
}
?>
				
						
					</tr>
				</tbody>
			</table>	
        </div>
    </div>
</div>
Example #18
0
<?php

require "../../include/banco.php";
session_start();
$id = $_POST['id'];
$lista = listar('clientes', '00198500', 'clientes.quadra', array('id' => $id, 'id_empresa' => $_SESSION['usuario_logado']['id']), array('descricao'), null, 'true');
foreach ($lista as $chave => $valor) {
    $dados[$chave] = $valor;
}
echo json_encode($dados);
Example #19
0
        } else {
            throw new Exception("O numero passado pela url deve ser inteiro");
        }
    } catch (Exception $e) {
        echo "Erro: " . $e->getMessage();
    }
}
?>

<div class="formularioDeletar">
	<h2>:. DELETAR CATEGORIA .:</h2>
	

	<table width="600">
		<?php 
$categories = listar("categories");
if (!empty($categories)) {
    ?>
			<tr class="cabecalho">
				<td>Nome</td>
				<td>Deletar</td>
			</tr>

			<?php 
    $params = array('mode' => 'Jumping', 'perPage' => 10, 'delta' => 5, 'itemData' => $categories);
    $pager = @Pager::factory($params);
    $data = $pager->getPageData();
    //var_dump($data);
    if (!empty($categories)) {
        foreach ($categories as $c) {
            ?>
Example #20
0
    <div class="col-xs-12">
        <table class="table table-bordered table-hover">
            <caption>Lista de dificuldades</caption>
            <thead>
            <tr>
                <th class="identificador">#</th>
                <th>Descrição</th>
                <th>Peso</th>
                <th>Cor</th>
                <th class="action">Editar</th>
                <th class="action">Excluir</th>
            </tr>
            </thead>
            <tbody>
            <?php 
$dificuldades = listar("dificuldade");
foreach ($dificuldades as $dificuldade) {
    if ($dificuldade->cor == 'green') {
        $soverte = 'green';
    } elseif ($dificuldade->cor == 'yellow') {
        $soverte = 'yellow';
    } else {
        $soverte = 'red';
    }
    ?>
                <tr>
                    <th class="identificador" scope="row">
                        <?php 
    echo $dificuldade->id;
    ?>
                        <input type="hidden" class="id" value="<?php 
Example #21
0
 * PHP version 5
 * 
 * @category MyCategory
 * @package  MyPackage
 * @author   Salvador Camacho <*****@*****.**>
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
 * @link     http://salvacam.tk/todo_list/api/index.php 
 */
// define la zona horaria
date_default_timezone_set('Europe/Madrid');
// requerimientos de archivos
require 'src/Nanite.php';
require 'src/functions.php';
Nanite::get('/', function () {
    header("Content-Type: application/json");
    echo listar();
});
Nanite::get('/delete/([a-zA-Z0-9]+)', function ($id) {
    header("Content-Type: application/json");
    if ($id == 'All') {
        echo borrarAll();
    } else {
        if ($id == 'Active' || $id == 'Completed') {
            echo borrarEstado($id);
        } else {
            echo borrar($id);
        }
    }
});
Nanite::post('/new', function () {
    header("Content-Type: application/json");
Example #22
0
        } else {
            throw new Exception("O numero passado pela url deve ser inteiro");
        }
    } catch (Exception $e) {
        echo "Erro: " . $e->getMessage();
    }
}
?>

<div class="formularioDeletar">
	<h2>:. DELETAR CLIENTE .:</h2>
	

		<table width="600">
			<?php 
$clients = listar("clients");
if (!empty($clients)) {
    ?>
			<tr class="cabecalho">
				<td>Nome</td>
				<td>Cidade</td>
				<td>Deletar</td>
			</tr>

			<?php 
    $params = array('mode' => 'Jumping', 'perPage' => 10, 'delta' => 5, 'itemData' => $clients);
    $pager = @Pager::factory($params);
    $data = $pager->getPageData();
    //var_dump($data);
    if (!empty($clients)) {
        foreach ($clients as $c) {
Example #23
0
<?php

$transacoes = listar($conexao);
?>

	<div class="navbar-default sidebar" role="navigation">
		<div class="sidebar-nav navbar-collapse">
			<ul class="nav in" id="side-menu">
				<li><a href="../usuarios"><i class="fa fa-user fa-fw"></i>Usuários</a></li>
				<li><a href="../cursos"><i class="fa fa-edit fa-fw"></i>Cursos</a></li>
				<li><a href="../programas"><i class="fa fa-file fa-fw"></i>Programas</a></li>
				<li><a href="../disciplinas"><i class="fa fa-book fa-fw"></i>Disciplinas</a></li>
				<li><a href="../perfis"><i class="fa fa-user fa-fw"></i>Perfis</a></li>
			</ul>
		</div>
	</div>
</nav>
Example #24
0
        } else {
            throw new Exception("O numero passado pela url deve ser inteiro");
        }
    } catch (Exception $e) {
        echo "Erro: " . $e->getMessage();
    }
}
?>

<div class="formularioDeletar">
	<h2>:. DELETAR FOTO .:</h2>
	

		<table width="600">
			<?php 
$pizzas = listar("pizzas", $parametros = ' INNER JOIN categories ON pizzas.pizza_categories = categories.category_id');
if (!empty($pizzas)) {
    ?>
			<tr class="cabecalho">
				<td>Foto</td>
				<td>Nome</td>
				<td>Deletar</td>
			</tr>

			<?php 
    $params = array('mode' => 'Jumping', 'perPage' => 10, 'delta' => 5, 'itemData' => $pizzas);
    $pager = @Pager::factory($params);
    $data = $pager->getPageData();
    //var_dump($data);
    foreach ($pizzas as $p) {
        ?>
Example #25
0
        } else {
            $erro = "Já existe um cliente com esse nome";
        }
    } else {
        $erro = $obrigatorio;
    }
}
?>

<div class="formularioAlterar">
<h2>: .ALTERAR CLIENTE .:</h2>
<?php 
// require_once '../bibliotecas/Pager/Pager/Pager.php';
// require_once '../bibliotecas/Pager/Pager/Pager/Common.php';
// require_once '../bibliotecas/Pager/Pager/Pager/Jumping.php';
$dadosClient = listar("clients");
?>

<table width="600">
	<tr class="cabecalho">
		<td>Nome</td>
		<td>Cidade</td>
		<td>UF</td>
		<td>Bairro</td>
		<td>CEP</td>
		<td>Tel</td>
		<td>Cell</td>
		<td>Endereço</td>
		<td>Login</td>
		<td>Senha</td>
		<td>Alterar</td>
Example #26
0
      <div class="row">
        <div class="col-xs-12">
          <table class="table table-bordered table-hover">
            <caption>Lista de equipes</caption>
            <thead>
              <tr>
                <th class="identificador">#</th>
                <th>Nome</th>
                <th>Técnico</th>
                <th class="action">Editar</th>
                <th class="action">Excluir</th>
              </tr>
            </thead>
            <tbody>
            <?php 
$equipes = listar("equipe");
foreach ($equipes as $equipe) {
    ?>
              <tr>
                <th class="identificador" scope="row">
                  <?php 
    echo $equipe->id;
    ?>
                  <input type="hidden" class="id" value="<?php 
    echo $equipe->id;
    ?>
">
                </th>
                <td>
                  <?php 
    echo $equipe->nome;
Example #27
0
<?php

include './includes/global.php';
include './includes/Estoque.php';
$title = "Controle de Estoque";
include './template/header.php';
?>
<div class="center">
    <table style="width: 100%;">
        <tr style="background: #CCC;">
        <th></th>
        <th>Id</th>
        <th>Nome</th>
        <th>Valor</th>
        <th>Quantidade</th>
        <th>Data de Validade</th>            
        </tr>
    <?php 
listar();
excluir();
?>
    </table>
</div>

<?php 
include './template/footer.php';
Example #28
0
<?php

include 'banco.php';
$supports = listar('ubuntu', '123456');
header("content-type:application/json");
echo json_encode($supports);
?>

Example #29
0
    $resultado = pg_query($conexao, "SELECT nome, pontos FROM ranking ORDER BY pontos DESC");
    $retorno = array();
    while ($linha = pg_fetch_array($resultado, NULL, PGSQL_ASSOC)) {
        $retorno[] = (object) $linha;
    }
    return $retorno;
}
$nome = $_GET['nome'];
$pontuacao = $_GET['pontuacao'];
// Verifica se é necessário realizar a insersão.
if (strlen($nome)) {
    // Insere registro.
    $ok = inserir($conexao, $nome, $pontuacao);
}
// Lista os todos os rankings.
$listagem = listar($conexao);
?>
<html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="pt-br" xml:lang="pt-br">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <center>
        <table>
            <td width="258">
            <a href=""><img src="banner3.png" border="0" title="	"></a>
            </td>
        </table>
    	</center>
   <head>
      <link rel="stylesheet" href="estilo.css">
   </head>
   <body>
			<td>Classificação</td>
			<td>Tombamento</td>
			<td>Codigo Titulo</td>
			<td>Titulo</td>
			<td>Autor</td>
			<td>Local Publicacao</td>
			<td>Editora</td>
			<td>Ano Publicacao</td>
			<td>Excluir</td>
			<td>Editar</td>

		</tr>
	</thead>
	<tbody>
		<?php 
    $listarClientes = listar($tabela);
    $cliente2 = null;
    foreach ($listarClientes as $cliente) {
        ?>

		<tr>
			<td><?php 
        echo $cliente->classificacao;
        ?>
 </td>
			<td><?php 
        echo $cliente->tombamento;
        ?>
 </td>
			<td><?php 
        echo $cliente->codigo_titulo;