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


PHP db::next方法代码示例

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


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

示例1: authenticate

    function authenticate($U, $P, $recordar = 0, $by = 'usuario')
    {
        $RESULT = false;
        if (trim($U) != '' && trim($P) != '') {
            $db = new db();
            $db->connect();
            $sql = ' SELECT * FROM usuarios
						 WHERE ( ' . $by . ' = "' . mysql_real_escape_string($U) . '" )
						 AND   ( password = "' . md5($P) . '" )
						 ';
            $db->query($sql);
            // no existe
            $RESULT = false;
            while ($record = $db->next()) {
                // LOGEAR
                $this->creaSession($record);
                $RESULT = true;
                if ($recordar) {
                    $two_months = time() + 30 * 24 * 3600;
                    setcookie('id_usuario', $U, $two_months);
                    setcookie('contrasena', $P, $two_months);
                }
            }
            $db->close();
        }
        return $RESULT;
    }
开发者ID:mtaisigue,项目名称:albaranes,代码行数:27,代码来源:Login.php

示例2: VerDetallePais

 public function VerDetallePais()
 {
     $db = new db();
     $db->connect();
     $query = 'SELECT * FROM albaranes WHERE id_albaranes = ' . $this->id_albaranes;
     $db->query($query);
     $r = $db->next();
     $db->close();
     return $r;
 }
开发者ID:mtaisigue,项目名称:albaranes,代码行数:10,代码来源:Pais.php

示例3: verCiudadPais

 function verCiudadPais()
 {
     $db = new db();
     $db->connect();
     $query = 'SELECT * FROM lista_estados WHERE id_pais = ' . $this->id_pais;
     $db->query($query);
     $Arr = array();
     while ($r = $db->next()) {
         $Arr[] = $r;
     }
     return $Arr;
     $db->close();
 }
开发者ID:mtaisigue,项目名称:albaranes,代码行数:13,代码来源:Ciudad.php

示例4: verEstadosPais

 public static function verEstadosPais()
 {
     $db = new db();
     $db->connect();
     $query = 'SELECT * FROM lista_estados WHERE id_pais = ' . self::$id_pais;
     $db->query($query);
     $Arr = array();
     while ($r = $db->next()) {
         $Arr[] = $r;
     }
     $db->close();
     return $Arr;
 }
开发者ID:mtaisigue,项目名称:albaranes,代码行数:13,代码来源:Pais.php

示例5: verFuncionalidades

 public function verFuncionalidades()
 {
     $db = new db();
     $db->connect();
     $query = 'SELECT * FROM fk_privileges';
     $db->query($query);
     $Arr = array();
     while ($r = $db->next()) {
         $r['privilege_desc'] = utf8_encode($r['privilege_desc']);
         $Arr[] = $r;
     }
     $db->close();
     return $Arr;
 }
开发者ID:mtaisigue,项目名称:albaranes,代码行数:14,代码来源:Funcionalidades.php

示例6: fk_select_text

function fk_select_text($table, $fields, $id_selected)
{
    $db = new db();
    $OPTION[0] = '';
    $OPTION[1] = '';
    $table_ar = trim($table);
    $table_ar = explode(' ', $table_ar);
    $table_ar = $table_ar[0];
    $rec = new ActiveRecord($table_ar);
    $WHERE = ' WHERE ' . $rec->id_field_name . ' = "' . $id_selected . '" ';
    $SQL = 'SELECT ' . $fields . ' FROM ' . $table . ' ' . $WHERE;
    $db->query($SQL);
    if ($opt = $db->next()) {
        $OPTION[0] = htmlentities($opt[0]);
        $OPTION[1] = htmlentities($opt[1]);
    }
    return $OPTION;
}
开发者ID:mmendoza000,项目名称:freekore,代码行数:18,代码来源:fk.php

示例7: get_id_record

 /**
  *@package AppForm
  *@method get_id_record($id_record)
  *@desc returns id record related to $record_num
  *@since v0.1
  **/
 private function get_id_record($record_num = 1)
 {
     $db = new db();
     $id_record = 0;
     // Get
     $record_num = $record_num - 1 > 0 ? $record_num - 1 : 0;
     // SELECT {id} FROM TABLE WHERE 1=1 {AND} limit {record_num},1
     $db->set_select($this->DbRecord->id_field_name);
     $db->set_table($this->model);
     $db->set_where(' 1 = 1 ');
     if ($this->DbRecord->SqlAnd != '') {
         $db->add_and($this->DbRecord->SqlAnd);
     }
     $db->set_limit(1, $record_num);
     $db->query();
     if ($row = $db->next()) {
         $id_record = $row[0];
     } else {
         // Find first
         $this->record_number = 1;
         if ($this->total_records == 0) {
             $this->record_number = 0;
         }
         //select ID_USUARIO from USUARIOS WHERE TRUE  LIMIT 0,1
         $db->set_select($this->DbRecord->id_field_name);
         $db->set_table($this->model);
         $db->set_where(' 1=1 ');
         if ($this->DbRecord->SqlAnd != '') {
             $db->add_and($this->DbRecord->SqlAnd);
         }
         $db->set_limit(1, 0);
         $db->query();
         if ($row = $db->next()) {
             $id_record = $row[0];
         }
     }
     return $id_record;
 }
开发者ID:mmendoza000,项目名称:freekore,代码行数:44,代码来源:appform.php

示例8: fk_select_text

function fk_select_text($table, $fields, $id_selected)
{
    $db = new db();
    $OPTION[0] = '';
    $OPTION[1] = '';
    $rec = new ActiveRecord($table);
    $WHERE = ' WHERE ' . $rec->id_field_name . ' = "' . $id_selected . '" ';
    $SQL = 'SELECT ' . $fields . ' FROM ' . $table . ' ' . $WHERE;
    $db->query($SQL);
    if ($opt = $db->next()) {
        $OPTION[0] = $opt[0];
        $OPTION[1] = $opt[1];
    }
    return $OPTION;
}
开发者ID:mtaisigue,项目名称:albaranes,代码行数:15,代码来源:fk.php

示例9: db

    function priv_paquete($codigo_paquete)
    {
        $db = new db();
        $sql = 'SELECT count(id_paquete_usuario)
		        FROM paquetes_usuario pu 
		          INNER JOIN paquetes p ON pu.id_paquete = p.id_paquete
		        WHERE pu.id_usuario = "' . $_SESSION['id_usuario'] . '" 
		        AND pu.fecha_fin >= CURDATE()
		        AND p.codigo ="' . $codigo_paquete . '" ';
        $db->query($sql);
        $found = $db->next();
        $tot = $found[0];
        if ($tot >= 1) {
            return TRUE;
        } else {
            return FALSE;
        }
    }
开发者ID:mtaisigue,项目名称:albaranes,代码行数:18,代码来源:utils.php

示例10: leaveACommentDisabled

    private function leaveACommentDisabled()
    {
        ?>
<li class="leave-comment">

<div class="c1_6 col-md-1 hidden-xs">
<?php 
        if (Security::is_logged()) {
            $imagen = '';
            $db = new db();
            $db->query_assoc('select * from usuarios usr
	left join uploads upl on upl.id_upload = usr.imagen 
	where usr.id_usuario = "' . $_SESSION['id_usuario'] . '" 
	');
            if ($rec = $db->next()) {
                $imagen = $rec['archivo'];
            }
        } else {
            $imagen = '';
        }
        if ($imagen != '') {
            ?>
<div class="user-img"><img src="<?php 
            echo http_uploads() . '/' . $imagen;
            ?>
"></div><?php 
        } else {
            ?>
<div class="user-img no-pho"></div><?php 
        }
        ?>
</div>
<div class="c5_6 col-md-11 ">
<?php 
        if ($this->show_detail) {
            ?>
<table class="user-data">
	<tr>
		<td colspan="2">
		<div id="message-err-<?php 
            echo $this->id_obj;
            ?>
" class="fk-error-message"
			style="display: none"></div>
		</td>
	</tr>
	<tr>
		<td>Nombre(Requerido):</td>
		<td><input type="text" id="name-user-<?php 
            echo $this->id_obj;
            ?>
"
			name="name-user-<?php 
            echo $this->id_obj;
            ?>
" value="" /></td>
	</tr>
	<tr>
		<td>Email(Requerido):</td>
		<td><input type="text" id="email-user-<?php 
            echo $this->id_obj;
            ?>
"
			name="email-user<?php 
            echo $this->id_obj;
            ?>
" value="" /></td>
	</tr>
	<tr>
		<td>Sitio web:</td>
		<td><input type="text" id="web-user-<?php 
            echo $this->id_obj;
            ?>
"
			name="web-user<?php 
            echo $this->id_obj;
            ?>
" value="" /></td>
	</tr>
</table><?php 
        }
        ?>
<table class="txt-data">
	<tr>
		<td><textarea id="leave-comment-<?php 
        echo $this->id_obj;
        ?>
-disabled" class="form-control disabled" disabled="disabled"> </textarea></td>
	</tr>
</table>
<button type="button" class="btn btn-danger btn-xs" id="leave-comment-btn-<?php 
        echo $this->id_obj;
        ?>
-disabled"> Comentar <i class="fa fa-comment"></i></button>


</div>
<div class="clear"></div>


//.........这里部分代码省略.........
开发者ID:mmendoza000,项目名称:freekore,代码行数:101,代码来源:FkComments.class.php

示例11: hasPriv_Field

    public static function hasPriv_Field($id_user, $table, $field)
    {
        $db = new db();
        $db->connect();
        $id_controller = 0;
        $id_accion = 0;
        $id_priv = 0;
        $id_perfil = 0;
        $id_mode_priv = 2;
        // Privilegios sobre: 1 Pantalla, 2 campo, 3 Pantalla y campo
        // si no hay nada que evite ver este campo default: tiene priv
        $has_priv['access'] = 1;
        $has_priv['read_only'] = 0;
        // Encontrar el privilegio
        $sql = 'SELECT p.id_priv
				FROM fk_privileges p
				WHERE p.id_mode_priv ="' . $id_mode_priv . '"
				AND p.table_name = "' . $table . '" 
		        AND p.field_name = "' . $field . '" LIMIT 1
				';
        $db->query($sql);
        if ($rec = $db->next()) {
            $id_priv = $rec['id_priv'];
        }
        if ($id_priv != 0) {
            // Si existe el privilegio, por default el acceso es false
            $has_priv['access'] = 0;
            $has_priv['read_only'] = 0;
            // Encontrar perfil del usuario
            $sql = 'SELECT id_perfil from ' . self::$db_tbl_usuarios . '
			        where ' . self::$db_fld_id_usuario . ' = "' . $id_user . '" ';
            $db->query($sql);
            if ($rec = $db->next()) {
                $id_perfil = $rec[0];
            }
            // 1) encontrar priv de excepcion
            $sql = 'SELECT p_usr.permitir_acceso as access,solo_lectura as read_only
		            FROM fk_privileges_usuarios p_usr 
		            WHERE p_usr.id_usuario = "' . $id_user . '"
		            AND p_usr.id_priv = "' . $id_priv . '"
		            LIMIT 1';
            $db->query($sql);
            if ($rec = $db->next()) {
                $acceso = $rec['access'];
                $read_only = $rec['read_only'];
            } else {
                //2) Si no hay registros de excepcion, buscar los del perfil
                // encontrar priv de perfil...
                $sql = 'SELECT p_pf.access,p_pf.read_only
		            FROM fk_perfiles_privs p_pf 
		            WHERE p_pf.id_perfil = "' . $id_perfil . '"
		            AND p_pf.id_priv = "' . $id_priv . '"
		            LIMIT 1
		            ';
                $db->query($sql);
                if ($rec = $db->next()) {
                    $acceso = $rec['access'];
                    $read_only = $rec['read_only'];
                }
            }
            if (isset($acceso) && isset($read_only)) {
                $has_priv['access'] = $acceso;
                $has_priv['read_only'] = $read_only;
            }
        }
        return $has_priv;
    }
开发者ID:mtaisigue,项目名称:albaranes,代码行数:67,代码来源:Security.class.php

示例12: TakePermisosUsuario

 public function TakePermisosUsuario()
 {
     $db = new db();
     $db->connect();
     $query = 'SELECT * FROM fk_perfiles_privs WHERE id_usuario = ' . $this->id_usuario;
     $db->query($query);
     $Arr = array();
     while ($r = $db->next()) {
         $Arr[] = $r;
     }
     return $Arr;
 }
开发者ID:mtaisigue,项目名称:albaranes,代码行数:12,代码来源:Usuario.php

示例13: runQueryProcess

 protected function runQueryProcess()
 {
     $this->db_queryapplist = new db();
     $db_queryapplist_2 = new db();
     // SELECT FOUND_ROWS()
     $this->ProcessSqlFormat();
     $this->db_queryapplist->query_assoc($this->sql_exec);
     // Obtener total de registros para paginador
     $db_queryapplist_2->query_assoc('SELECT FOUND_ROWS() as total');
     $rec_tot = $db_queryapplist_2->next();
     $this->tot_regs = $rec_tot['total'];
     $this->creaVariablesPaginador();
     if ($this->page > $this->tot_pages) {
         // Si el usuario mete valores mayores a la pagina, regresa a pagina 1
         $this->formaLimit(1);
         $this->ProcessSqlFormat();
         $this->db_queryapplist->query_assoc($this->sql_exec);
         $this->creaVariablesPaginador();
     }
 }
开发者ID:mmendoza000,项目名称:freekore,代码行数:20,代码来源:applist.php

示例14: get_id_record

 /**
  *@package AppForm
  *@method get_id_record($id_record)
  *@desc returns id record related to $record_num
  *@since v0.1
  **/
 private function get_id_record($record_num = 1)
 {
     $db = new db();
     $id_record = 0;
     // Get
     $record_num = $record_num - 1 > 0 ? $record_num - 1 : 0;
     $sql = 'select ' . $this->DbRecord->id_field_name . ' from ' . $this->model . ' WHERE TRUE ' . $this->DbRecord->SqlAnd . ' LIMIT ' . $record_num . ',1';
     $db->query($sql);
     if ($row = $db->next()) {
         $id_record = $row[0];
     } else {
         // Find first
         $this->record_number = 1;
         if ($this->total_records == 0) {
             $this->record_number = 0;
         }
         $sql = 'select ' . $this->DbRecord->id_field_name . ' from ' . $this->model . ' WHERE TRUE ' . $this->DbRecord->SqlAnd . ' LIMIT 0,1';
         $db->query($sql);
         if ($row = $db->next()) {
             $id_record = $row[0];
         }
     }
     return $id_record;
 }
开发者ID:mtaisigue,项目名称:albaranes,代码行数:30,代码来源:AppForm.class.php

示例15: verPerfilPriv

 public function verPerfilPriv()
 {
     $db = new db();
     $db->connect();
     $query = 'SELECT * FROM fk_perfiles_privs WHERE id_usuario = ' . $this->id_perfil . ' AND id_priv = ' . $this->id_priv;
     $db->query($query);
     $r = $db->next();
     return $r;
 }
开发者ID:mtaisigue,项目名称:albaranes,代码行数:9,代码来源:Perfil.php


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