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


PHP set_error函数代码示例

本文整理汇总了PHP中set_error函数的典型用法代码示例。如果您正苦于以下问题:PHP set_error函数的具体用法?PHP set_error怎么用?PHP set_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: index

 public function index()
 {
     if (!empty($this->usuario)) {
         redirect(base_url('inicio'), 'redirect');
     }
     //Si esta logueado redirigimos al dashboard
     $this->load->helper('form');
     $this->load->library('form_validation');
     $this->form_validation->set_rules('username', 'Usuario', 'trim|required|max_length[20]');
     $this->form_validation->set_rules('password', 'Clave', 'required|max_length[20]');
     if ($this->form_validation->run() == FALSE) {
         $val_err = validation_errors();
         set_error($val_err, 'login', true);
     } else {
         $username = set_value('username');
         $password = set_value('password');
         $result = $this->usuarios_model->get(null, $username);
         if ($result != false && strtolower($result->UsuarioNick) == strtolower($username) && $this->usuarios_model->ComprobarClave($result->UsuarioClave, $password)) {
             if ($result->UsuarioEstado == 0) {
                 //Usuario inactivo
                 set_error('001', 'login');
             } elseif ($result->UsuarioEstado == 2) {
                 set_error('003', 'login');
             } else {
                 $this->usuarios_model->setUltimaConex($result->UsuarioId, $result->UsuarioFecha, $result->UsuarioIp);
                 $this->session->set_userdata(array('UsuarioId' => $result->UsuarioId));
                 redirect(base_url('inicio'));
             }
         } else {
             //Usuario o clave incorrectos
             set_error('002', 'login');
         }
     }
     $this->vista('login/inicio', null, 'Iniciar Sesión');
 }
开发者ID:alfa5,项目名称:SKServer,代码行数:35,代码来源:login.php

示例2: query

function query($sql, $debug_message = '')
{
    if (class_exists('module_db', false) && is_callable('module_db::query')) {
        return module_db::query($sql, $debug_message);
    }
    //echo ''.$sql.'<br>';
    if (_DEBUG_MODE && defined('_DEBUG_SQL') && _DEBUG_SQL) {
        static $past_queries = array();
        if (!isset($past_queries[$sql])) {
            $past_queries[$sql] = 0;
        } else {
            $past_queries[$sql]++;
        }
        $sql_debug = $sql;
        if (strlen($sql_debug) > 60) {
            $sql_debug = htmlspecialchars(substr($sql_debug, 0, 60)) . '<a href="#" onclick="$(this).hide(); $(\'span\',$(this).parent()).show(); return false;">....</a><span style="display:none">' . htmlspecialchars(substr($sql, 60)) . '</span>';
        } else {
            $sql_debug = htmlspecialchars($sql);
        }
        if (class_exists('module_debug', false)) {
            module_debug::log(array('title' => 'SQL Query', 'file' => 'includes/database.php', 'data' => '(' . ($past_queries[$sql] > 0 ? '<span style="color:#FF0000; font-weight:bold;">' . $past_queries[$sql] . '</span>' : $past_queries[$sql]) . ') ' . $debug_message . $sql_debug, 'important' => $past_queries[$sql] > 0));
        }
    }
    $res = mysql_query($sql);
    //or die(mysql_error() . $sql);
    if (mysql_errno()) {
        set_error(_l('SQL Error: %s', mysql_error() . ' ' . $sql));
        set_error(_l('Try clicking the "Run Manual Upgrades" button to resolve SQL Errors.'));
        return false;
    }
    return $res;
}
开发者ID:sgh1986915,项目名称:php-crm,代码行数:32,代码来源:database.php

示例3: setRolGrupo

 public function setRolGrupo($Nick)
 {
     $data['grupo'] = $this->roles_model->getGrupoInfo(null, $Nick);
     if (!$data['grupo']) {
         //Si el grupo no existe o es superior al tuyo
         redirect(base_url('errores/404/'));
     } elseif (!$this->compareRangos($data['grupo'])) {
         set_error("014", 'grupos');
     }
     $roles = $this->roles_model->getRoles();
     if (!empty($roles)) {
         $i = 0;
         $c = 0;
         $ci = 0;
         $Roles = array();
         $DRoles = array();
         foreach ($roles as $rol) {
             $i++;
             if (in_array($rol->RolId, $data['grupo']->URoles)) {
                 //Permisos de grupo
                 $Roles[$rol->CategoriaNombre][] = $rol;
             } else {
                 //Permisos sin establecer
                 $DRoles["Otros"][$rol->CategoriaNombre][] = $rol;
             }
         }
     } else {
         set_error("018", 'inicio');
     }
     $data['roles'] = $Roles;
     $data['droles'] = $DRoles;
     $bread = array(array("bread" => $Nick, "link" => "grupo/" . $Nick), array("bread" => "Permisos de Grupo"));
     $this->vista('roles/grupos', $bread, 'Permisos de ' . $Nick, $data, "roles");
 }
开发者ID:alfa5,项目名称:SKServer,代码行数:34,代码来源:roles.php

示例4: show_errors

/**
 * Displays the errors in a user friendly box
 */
function show_errors()
{
    $errors = set_error();
    if (!empty($errors)) {
        $errors = implode('<br/>', $errors);
        show_view('five-notification-error', array('notification' => $errors));
    }
}
开发者ID:Jonathonbyrd,项目名称:5TwentyCMS,代码行数:11,代码来源:templates.php

示例5: insere

 function insere($con, $vol_id)
 {
     $sql = "INSERT INTO lacres VALUES (NULL";
     $sql .= ", " . $con->quote($vol_id);
     $sql .= ", " . $con->quote($this->nLacre);
     $sql .= ")";
     $qry = $con->query($sql);
     if (MDB2::isError($qry)) {
         set_error('Erro lacres: ' . $qry->getMessage());
         return false;
     } else {
         $lacres_id = $con->lastInsertID("lacres", "lacres_id");
     }
 }
开发者ID:vagnerbarros,项目名称:testephpsvn2,代码行数:14,代码来源:lacres.class.php

示例6: insere

 function insere($con, $det_id)
 {
     $sql = "INSERT INTO infAdProd VALUES (NULL";
     $sql .= ", " . $con->quote($det_id);
     $sql .= ", " . $con->quote($this->infAdProd);
     $sql .= ")";
     $qry = $con->query($sql);
     if (MDB2::isError($qry)) {
         set_error('Erro infAdProd: ' . $qry->getMessage());
         return false;
     } else {
         $infAdProd_id = $con->lastInsertID("infAdProd", "infAdProd_id");
     }
 }
开发者ID:vagnerbarros,项目名称:testephpsvn2,代码行数:14,代码来源:infAdProd.class.php

示例7: insere

 function insere($con, $infAdic_id)
 {
     $sql = "INSERT INTO procRef VALUES (NULL";
     $sql .= ", " . $con->quote($infAdic_id);
     $sql .= ", " . $con->quote($this->nProc);
     $sql .= ", " . $con->quote($this->indProc);
     $sql .= ")";
     $qry = $con->query($sql);
     if (MDB2::isError($qry)) {
         set_error('Erro procRef: ' . $qry->getMessage());
         return false;
     } else {
         $procRef_id = $con->lastInsertID("procRef", "procRef_id");
     }
 }
开发者ID:vagnerbarros,项目名称:testephpsvn2,代码行数:15,代码来源:procRef.class.php

示例8: insere

 function insere($con, $infNFe_id)
 {
     $sql = "INSERT INTO exporta VALUES (NULL";
     $sql .= ", " . $con->quote($infNFe_id);
     $sql .= ", " . $con->quote($this->UFEmbarq);
     $sql .= ", " . $con->quote($this->xLocEmbarq);
     $sql .= ")";
     $qry = $con->query($sql);
     if (MDB2::isError($qry)) {
         set_error('Erro exporta: ' . $qry->getMessage());
         return false;
     } else {
         $exporta_id = $con->lastInsertID("exporta", "exporta_id");
     }
 }
开发者ID:vagnerbarros,项目名称:testephpsvn2,代码行数:15,代码来源:exporta.class.php

示例9: insere

 function insere($con, $infAdic_id)
 {
     $sql = "INSERT INTO obsCont VALUES (NULL";
     $sql .= ", " . $con->quote($infAdic_id);
     $sql .= ", " . $con->quote($this->xCampo);
     $sql .= ", " . $con->quote($this->xTexto);
     $sql .= ")";
     $qry = $con->query($sql);
     if (MDB2::isError($qry)) {
         set_error('Erro obsCont: ' . $qry->getMessage());
         return false;
     } else {
         $obsCont_id = $con->lastInsertID("obsCont", "obsCont_id");
     }
 }
开发者ID:vagnerbarros,项目名称:testephpsvn2,代码行数:15,代码来源:obsCont.class.php

示例10: insere

 function insere($con, $infNFe_id)
 {
     $sql = "INSERT INTO compra VALUES (NULL";
     $sql .= ", " . $con->quote($infNFe_id);
     $sql .= ", " . $con->quote($this->xNEmp);
     $sql .= ", " . $con->quote($this->xPed);
     $sql .= ", " . $con->quote($this->xCont);
     $sql .= ")";
     $qry = $con->query($sql);
     if (MDB2::isError($qry)) {
         set_error('Erro compra: ' . $qry->getMessage());
         return false;
     } else {
         $compra_id = $con->lastInsertID("compra", "compra_id");
     }
 }
开发者ID:vagnerbarros,项目名称:testephpsvn2,代码行数:16,代码来源:compra.class.php

示例11: insere

 function insere($con, $transp_id)
 {
     $sql = "INSERT INTO veicTransp VALUES (NULL";
     $sql .= ", " . $con->quote($transp_id);
     $sql .= ", " . $con->quote($this->placa);
     $sql .= ", " . $con->quote($this->UF);
     $sql .= ", " . $con->quote($this->RNTC);
     $sql .= ")";
     $qry = $con->query($sql);
     if (MDB2::isError($qry)) {
         set_error('Erro veicTransp: ' . $qry->getMessage());
         return false;
     } else {
         $veicTransp_id = $con->lastInsertID("veicTransp", "veicTransp_id");
     }
 }
开发者ID:vagnerbarros,项目名称:testephpsvn2,代码行数:16,代码来源:veicTransp.class.php

示例12: insere

 function insere($con, $infNFe_id)
 {
     $sql = "INSERT INTO total VALUES (NULL";
     $sql .= ", " . $con->quote($infNFe_id);
     $sql .= ")";
     $qry = $con->query($sql);
     if (MDB2::isError($qry)) {
         set_error('Erro total: ' . $qry->getMessage());
         return false;
     } else {
         $total_id = $con->lastInsertID("total", "total_id");
         $this->ICMSTot->insere($con, $total_id);
         is_object($this->ISSQNtot) ? $this->ISSQNtot->insere($con, $total_id) : null;
         is_object($this->retTrib) ? $this->retTrib->insere($con, $total_id) : null;
     }
 }
开发者ID:vagnerbarros,项目名称:testephpsvn2,代码行数:16,代码来源:total.class.php

示例13: insere

 function insere($con, $cobr_id)
 {
     $sql = "INSERT INTO dup VALUES (NULL";
     $sql .= ", " . $con->quote($cobr_id);
     $sql .= ", " . $con->quote($this->nDup);
     $sql .= ", " . $con->quote($this->dVenc);
     $sql .= ", " . $con->quote($this->vDup);
     $sql .= ")";
     $qry = $con->query($sql);
     if (MDB2::isError($qry)) {
         set_error('Erro dup: ' . $qry->getMessage());
         return false;
     } else {
         $dup_id = $con->lastInsertID("dup", "dup_id");
     }
 }
开发者ID:vagnerbarros,项目名称:testephpsvn2,代码行数:16,代码来源:dup.class.php

示例14: insere

 function insere($con, $DI_id)
 {
     $sql = "INSERT INTO adi VALUES (NULL";
     $sql .= ", " . $con->quote($DI_id);
     $sql .= ", " . $con->quote($this->nAdicao);
     $sql .= ", " . $con->quote($this->nSeqAdic);
     $sql .= ", " . $con->quote($this->cFabricante);
     $sql .= ", " . $con->quote($this->vDescDI);
     $sql .= ")";
     $qry = $con->query($sql);
     if (MDB2::isError($qry)) {
         set_error('Erro adi: ' . $qry->getMessage());
         return false;
     } else {
         $adi_id = $con->lastInsertID("adi", "adi_id");
     }
 }
开发者ID:vagnerbarros,项目名称:testephpsvn2,代码行数:17,代码来源:adi.class.php

示例15: insere

 function insere($con, $infNFe_id)
 {
     $sql = "INSERT INTO cobr VALUES (NULL";
     $sql .= ", " . $con->quote($infNFe_id);
     $sql .= ")";
     $qry = $con->query($sql);
     if (MDB2::isError($qry)) {
         set_error('Erro cobr: ' . $qry->getMessage());
         return false;
     } else {
         $cobr_id = $con->lastInsertID("cobr", "cobr_id");
         is_object($this->fat) ? $this->fat->insere($con, $cobr_id) : null;
         for ($i = 0; $i < count($this->dup); $i++) {
             $this->dup[$i]->insere($con, $cobr_id);
         }
     }
 }
开发者ID:vagnerbarros,项目名称:testephpsvn2,代码行数:17,代码来源:cobr.class.php


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