当前位置: 首页>>代码示例>>PHP>>正文


PHP Crud::setTabela方法代码示例

本文整理汇总了PHP中Crud::setTabela方法的典型用法代码示例。如果您正苦于以下问题:PHP Crud::setTabela方法的具体用法?PHP Crud::setTabela怎么用?PHP Crud::setTabela使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Crud的用法示例。


在下文中一共展示了Crud::setTabela方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: primeiroLogin

 public function primeiroLogin()
 {
     $pL = new Crud();
     $pL->setTabela("users");
     $result = $pL->consultar(array("id", "nome", "email"), "id = {$this->idInserido}");
     $_SESSION['dehbora']['user'] = $result->fetch(PDO::FETCH_ASSOC);
 }
开发者ID:romulo1984,项目名称:dehbora,代码行数:7,代码来源:Usuario.php

示例2: Crud

                                        <div class="input-prepend">
                                            <span class="add-on"><i class="icon-filter"></i></span>
                                            <input type="text" value="" name="searchrss" id="searchrss" placeholder="Filtrar feeds"/>
                                            <span class="input-loader-feeds" style="margin-left: 10px; width: 24px; display: none;">
                                                <img style="margin-bottom: 5px;" src="<?php 
echo URL_BASE;
?>
/public/img/loader-mini.gif"/>
                                            </span>
                                        </div>
                                    </form>
                                <div style="overflow-y:auto; height: 200px;" class="box-scroll">
                                <ul class="nav nav-list" id="alvosearchrss" >
                                    <?php 
$lista_feeds = new Crud();
$lista_feeds->setTabela('feeds');
$l_f = $lista_feeds->consultar(array('id', 'nome', 'url', 'publico', 'id_categoria'), 'id_user =' . $user['id'], 'created DESC')->fetchAll(PDO::FETCH_ASSOC);
foreach ($l_f as $l) {
    echo '<li class="li-rss ';
    if (isset($id_feed_atual) && $id_feed_atual == $l['id']) {
        echo "active";
    }
    echo '"><a href="' . URL_BASE . '/feeds/' . $l['id'] . '">' . $l['nome'] . '</a></li>';
}
$nome_feed_inicial = $l_f[0]['nome'];
?>
                                </ul>
                                </div>
                                <ul class="nav nav-list">
                                    <li class="divider"></li>
                                    <li><a href="#addFeed" style="color: green !important;" data-toggle="modal" data-step="2" data-intro="Clicando neste botão você adiciona novos feeds." data-position="right"><i class="icon-plus"></i> Adicionar Feed</a></li>
开发者ID:romulo1984,项目名称:dehbora,代码行数:31,代码来源:sidebar.php

示例3: Crud

} else {
    $permalink = base64_decode($_GET['permalink']);
}
if (isset($_POST['userid'])) {
    $iduser = $_POST['userid'];
} else {
    $iduser = $_GET['iduser'];
}
$result_noticia = $noticia->consultar(array("id"), "permalink = '" . $permalink . "'");
$n = $result_noticia->fetch(PDO::FETCH_ASSOC);
if ($n == "") {
    $avaliado = 0;
} else {
    $avaliado = 1;
    $nota = new Crud();
    $nota->setTabela("notas");
    $result_nota = $nota->consultar(array("nota"), "id_user = " . $iduser . " AND id_noticia = " . $n['id']);
    $no = $result_nota->fetch(PDO::FETCH_ASSOC);
}
if (isset($no)) {
    if ($no['nota'] == 1) {
        $nota_dada = '<img src="' . URL_BASE . '/public/img/1-stars.png"/>';
    } elseif ($no['nota'] == 2) {
        $nota_dada = '<img src="' . URL_BASE . '/public/img/2-stars.png"/>';
    } elseif ($no['nota'] == 3) {
        $nota_dada = '<img src="' . URL_BASE . '/public/img/3-stars.png"/>';
    } elseif ($no['nota'] == 4) {
        $nota_dada = '<img src="' . URL_BASE . '/public/img/4-stars.png"/>';
    } elseif ($no['nota'] == 5) {
        $nota_dada = '<img src="' . URL_BASE . '/public/img/5-stars.png"/>';
    }
开发者ID:romulo1984,项目名称:dehbora,代码行数:31,代码来源:avaliacao.php

示例4: add_feed

function add_feed()
{
    $app = Slim::getInstance();
    $count_erro = 0;
    $erro_url = 0;
    if (!$_POST['nome']) {
        $count_erro += 1;
    } elseif (!$_POST['url']) {
        $count_erro += 1;
    } elseif (!preg_match('|^http(s)?://[a-z0-9-]+(\\.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $_POST['url'])) {
        $erro_url = 1;
    }
    if ($count_erro > 0) {
        $app->flash('errors', 'Os campos <strong>NOME</strong> e <strong>URL</strong> são obrigatórios!');
        $app->redirect(URL_BASE . '/');
        exit;
    } elseif ($erro_url == 1) {
        $app->flash('errors', 'O campo <strong>URL</strong> deve ser um URL válido. (o prefixo http:// é obrigatório)!');
        $app->redirect(URL_BASE . '/');
        exit;
    }
    $nome = $_POST['nome'];
    $url = $_POST['url'];
    $user = $app->view()->getData('user');
    if (isset($_POST['publico'])) {
        $publico = 1;
    } else {
        $publico = 0;
    }
    $add_feed = new Crud();
    $add_feed->setTabela('feeds');
    $a_f = $add_feed->inserir(array("nome" => $nome, "url" => $url, "publico" => $publico, "id_user" => $user['id']));
    if ($a_f) {
        $app->flash('sucesso', 'Feed Adicionado com Sucesso');
        $app->redirect(URL_BASE . '/');
    } else {
        $app->flash('errors', 'O Feed não pode ser adicionado');
        $app->redirect(URL_BASE . '/');
    }
}
开发者ID:romulo1984,项目名称:dehbora,代码行数:40,代码来源:routes.php


注:本文中的Crud::setTabela方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。