當前位置: 首頁>>代碼示例>>PHP>>正文


PHP model類代碼示例

本文整理匯總了PHP中model的典型用法代碼示例。如果您正苦於以下問題:PHP model類的具體用法?PHP model怎麽用?PHP model使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了model類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getPostulantesEvaluacionByVacante

 public function getPostulantesEvaluacionByVacante($vacante)
 {
     $sql = "select u.id as usuario_id, v.id as vacante_id , et.id as etapa_id, u.nombres, u.apellidos, u.numero_identificacion, v.titulo, et.nombre as etapa, e.valor, e.observacion\n\t\t\t\tfrom vacante as v \n\t\t\t\tinner join postulacion as p on p.vacante_id =  v.id\n\t\t\t\tinner join usuario as u on p.postulante_id =  u.id \n\t\t\t\tinner join evaluacion as e on e.postulacion_id = p.id\n\t\t\t\tinner join etapa as et on et.id = e.etapa_id\n\t\t\twhere v.id = {$vacante} or 999 = {$vacante}\n\t\torder by u.id, v.id, et.id";
     $model = new model();
     $result = $model->runSql($sql);
     return $model->getRows($result);
 }
開發者ID:efaby,項目名稱:postulacion,代碼行數:7,代碼來源:ReporteModel.php

示例2: deleteCategoria

 public function deleteCategoria()
 {
     $categoria = $_GET['id'];
     $sql = "delete from categoria where id = " . $categoria;
     $model = new model();
     $result = $model->runSql($sql);
 }
開發者ID:efaby,項目名稱:postulacion,代碼行數:7,代碼來源:CategoriaModel.php

示例3: validaLogin

 function validaLogin()
 {
     $email = $_POST['email'];
     $senha = $_POST['senha'];
     echo '1';
     if (!isset($email) || !isset($senha)) {
         sessao_limpa();
     }
     echo '2';
     if (strlen(trim($email)) == 0 || strlen(trim($senha) == 0)) {
         header("Location: /login/error/msg/u_s");
     }
     echo '3';
     $model = new model();
     $query = "SELECT * FROM usuario WHERE email_usuario = '{$email}' AND senha_usuario = '{$senha}'";
     $result = $model->readSQL($query);
     $session = new session();
     if ($result) {
         $session->sessao_grava($result[0]['email_usuario'], $result[0]['id_usuario_tipo']);
         header("Location: /index");
     } else {
         $session->sessao_limpa();
         header("Location: /login/error/msg/u_s");
     }
 }
開發者ID:ErickMaeda,項目名稱:controle-eventos-php-cow_tipping_dwarfs,代碼行數:25,代碼來源:loginController.php

示例4: action_comments_list

 function action_comments_list()
 {
     global $data;
     $comm = new model("comments");
     $data["articles"] = $comm->page("service_id,object_id,id,ip,create_time,author,service_name");
     v();
 }
開發者ID:xurenlu,項目名稱:tik,代碼行數:7,代碼來源:m.php

示例5: mostraGrid

 public function mostraGrid()
 {
     $total_reg = "10";
     // número de registros por página
     $pagina = $_SESSION['pagina'];
     if (!$pagina) {
         $pc = "1";
     } else {
         $pc = $pagina;
     }
     $inicio = $pc - 1;
     $inicio = $inicio * $total_reg;
     //list all records
     $estado_model = new estadoModel();
     $model = new model();
     $qry_limitada = $estado_model->getEstado('stat<>0', $inicio . ',' . $total_reg);
     //Full table Scan :( or :)
     //send the records to template sytem
     $this->smarty->assign('listestado', $qry_limitada);
     // Total de Registros na tabela
     $qry_total = $model->readSQL("SELECT count(*)as total FROM estado WHERE stat<>0");
     $total_registros = $qry_total[0]['total'];
     //pega o valor
     $html = $this->paginador($pc, $total_registros, 'estado');
     return $html;
 }
開發者ID:ErickMaeda,項目名稱:controle-eventos-php-cow_tipping_dwarfs,代碼行數:26,代碼來源:estadoController.php

示例6: getCategoriaList

 /**
  * Obtiene Categorias
  */
 public function getCategoriaList()
 {
     $model = new model();
     $sql = "select * from categoria ";
     $result = $model->runSql($sql);
     return $model->getRows($result);
 }
開發者ID:efaby,項目名稱:postulacion,代碼行數:10,代碼來源:PreguntaModel.php

示例7: calculate

 public function calculate($address_id)
 {
     $total = 0;
     $model = new model("fare");
     $fare = $model->where("is_default=1")->find();
     if ($fare) {
         $addr = $model->table('address')->where("id={$address_id}")->find();
         if ($addr) {
             $city = $addr['city'];
             $first_price = $fare['first_price'];
             $second_price = $fare['second_price'];
             $first_weight = $fare['first_weight'];
             $second_weight = $fare['second_weight'];
             $zoning = unserialize($fare['zoning']);
             foreach ($zoning as $zon) {
                 if (preg_match(',' . $city . ',', ',' . $zon['area'] . ',') > 0) {
                     $first_price = $zon['f_price'];
                     $second_price = $zon['s_price'];
                     $first_weight = $zon['f_weight'];
                     $second_weight = $zon['s_weight'];
                     break;
                 }
             }
             if ($this->weight <= $first_weight) {
                 $total = $first_price;
             } else {
                 $weight = $this->weight - $first_weight;
                 $total = $first_price + ceil($weight / $second_weight) * $second_price;
             }
         }
     }
     return sprintf("%01.2f", $total);
 }
開發者ID:sammychan1981,項目名稱:quanpin,代碼行數:33,代碼來源:Fare.php

示例8: index

 function index()
 {
     $dsn = array();
     $this->sv("rooturl", preg_replace('/&t=.*/', '', $_SERVER['REQUEST_URI']));
     if (f('submit')) {
         $dsn['dbHost'] = either(f("host"), "db4free.net");
         $dsn['port'] = either(f("port"), 3306);
         $dsn['dbHost'] .= ":" . $dsn['port'];
         $dsn['dbName'] = either(f("db"), "greedisok");
         $dsn['dbUser'] = either(f("user"), "greedisok");
         $dsn['dbPswd'] = either(f("pass"), 'greedisok');
         $dsn["charset"] = "";
         include_once ROOT . "lib/vip/DBUtil.php";
         $db = new DB($dsn);
         include_once ROOT . "app/main/model.php";
         $modelobj = new model($db);
         $this->sv("dsn", $dsn);
         try {
             $this->sv("table_list", $modelobj->table_names());
             $table = f('t');
             if ($table) {
                 $modelobj->change_table($table);
                 $table_detail = $modelobj->detail();
                 $this->sv("table_detail", $table_detail);
             }
         } catch (Exception $e) {
             $this->sv("info", $e->getMessage());
         }
     }
 }
開發者ID:tranngocthang89,項目名稱:basephpmvc,代碼行數:30,代碼來源:code_controller.php

示例9: M

/**
 * 實例化模型類
 */
function M($table)
{
    static $modelArray = array();
    if (isset($modelArray[$table])) {
        return $modelArray[$table];
    } else {
        if (file_exists(APP_PATH . 'model' . DIRECTORY_SEPARATOR . $table . 'Model.php')) {
            $model = $table . 'Model';
            $model = new $model();
            $modelArray[$table] = $model;
        } else {
            $model = new model();
            //設置表名
            $model->table = $table;
            //獲取屬性綁定
            $attribute = array();
            $colums = $model->findAllBySql("select COLUMN_NAME from information_schema.columns where table_name='{$model->pre}{$model->table}'");
            foreach ($colums as $val) {
                $attribute[$val['COLUMN_NAME']] = $val['COLUMN_NAME'];
            }
            $model->attributes = $attribute;
            $modelArray[$table] = $model;
        }
        return $model;
    }
}
開發者ID:jeremywong1992,項目名稱:companyBook,代碼行數:29,代碼來源:function.inc.php

示例10: deleteArea

 public function deleteArea()
 {
     $area = $_GET['id'];
     $sql = "update area set eliminado = 1 where id = " . $area;
     $model = new model();
     $result = $model->runSql($sql);
 }
開發者ID:efaby,項目名稱:postulacion,代碼行數:7,代碼來源:AreaModel.php

示例11: getUsuarioByCedula

 public function getUsuarioByCedula($cedula)
 {
     $model = new model();
     $sql = "select * from usuario where numero_identificacion = " . $cedula;
     $result = $model->runSql($sql);
     $resultArray = $model->getRows($result);
     return $resultArray[0];
 }
開發者ID:efaby,項目名稱:postulacion,代碼行數:8,代碼來源:UsuarioModel.php

示例12: obtenerUsuario

 public function obtenerUsuario($usuario)
 {
     $model = new model();
     $sql = "Select * from usuario where numero_identificacion = " . $usuario;
     $result = $model->runSql($sql);
     $resultArray = $model->getRows($result);
     return $resultArray[0];
 }
開發者ID:efaby,項目名稱:postulacion,代碼行數:8,代碼來源:RegistroModel.php

示例13: run

 public function run()
 {
     $m = new AuditTrail();
     $m->unsetAttributes();
     $m->model = get_class($this->model);
     $m->model_id = $this->model->getPrimaryKey();
     $this->renderpartial('history', array('model' => $m, 'id' => $this->id));
 }
開發者ID:dbrisinajumi,項目名稱:audittrail,代碼行數:8,代碼來源:AudittrailHistory.php

示例14: complement_user_profile

function complement_user_profile($user)
{
    include_once "model.php";
    include_once "view.php";
    $model = new model();
    $view = new view();
    $result = $model->get_agencies();
    $view->profile_fields($user, $result);
}
開發者ID:rdelr011,項目名稱:BOLO-Flier-Creator,代碼行數:9,代碼來源:extra-user-data.php

示例15: db

 public function db()
 {
     jiashu::loadLib('model');
     $user = new model('user', 'testdb');
     //$r = $user->executeSql('select * from test_user');//you can use executeSql() to query a SQL statment directly.用executeSql()函數可以直接執行SQL語句
     $r = $user->field('username,email')->limit('1')->query();
     JSFW()->setTplData('r', $r);
     JSFW()->render('index');
 }
開發者ID:gusen,項目名稱:jiashu,代碼行數:9,代碼來源:index.php


注:本文中的model類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。