function Main() { global $TPLV, $bottom, $urls, $db, $migalha; $TPLV = new TemplatePower(TEMPLATE_PATH . "modulos/categoria.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: case 'lista': lista(); break; case 'novo': novo(); break; case 'editar': editar(); break; case 'salvar': salvar(); break; case 'deletar': deletar(); break; } }
<?php function salvar() { echo "salvar"; } function salvar($nome) { echo "salvar({$nome})"; } salvar("sistemas");
function salvarDificuldade($id, $descricao, $peso, $cor) { $fields = array("descricao", "peso", "cor"); $values = array($descricao, $peso, $cor); if (is_null($id) || $id == '') { return salvar("dificuldade", $fields, $values); } return alterar("dificuldade", $fields, $values, "where id = '{$id}'"); }
<?php include './include/global.php'; include './include/estoque.php'; $title = "Controle de Estoque"; include './template/header.php'; ?> <?php salvar(); ?> <a href="listagem.php">Ver Lista</a> <center> <form method="post"> <div class="center"> Nome:<br/> <input type="text" name="nome"><br/><br/> Valor:<br/> <input type="text" name="valor"/><br/><br/> Quantidade:<br/> <input type="text" name="quantidade"/><br/><br/> Validade:<br/> <input type="text" name="validade"/><br/><br/> <input type="submit" value="Cadastrar"/> </div> </form> </center> <?php include './template/footer.php'; ?>
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; } }