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


PHP validate::type方法代码示例

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


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

示例1: ibd

<?php

include './includes/std.php';
validate::KOD($_POST['kod'], FALSE);
$ibd = new ibd();
switch (validate::type($_POST['isn'])) {
    case 'ISBN':
        $szukaj1 = ksiazki::szukaj_ISBN($_POST['isn']);
        $szukaj2 = $ibd->szukaj_ISBN($_POST['isn']);
        break;
    case 'ISSN':
        $szukaj1 = ksiazki::szukaj_ISSN($_POST['isn']);
        $szukaj2 = $ibd->szukaj_ISSN($_POST['isn']);
        break;
}
$i = 0;
$title = 'Dodawanie książki';
include './design/top.php';
?>

<h3> Krok 2 - wybierz żądaną książkę </h3>

<?php 
gotowe::dodaj_lista($_POST['kod'], $szukaj1, $szukaj2);
include './design/bottom.php';
开发者ID:Alambos,项目名称:books,代码行数:25,代码来源:add_isbn.php

示例2: szukaj_info

 static function szukaj_info($dane, $order = NULL, $start = NULL, $limit = 30)
 {
     $allow = array('id', 'tytul', 'autor', 'wydawnictwo', 'miejsce', 'rok', 'wydanie', 'wycofana');
     $replace = array('tytul' => 'tytul~~', 'autor' => 'autor~~', 'wydawnictwo' => 'wydawnictwo~~');
     $where = array();
     foreach ($dane as $key => $value) {
         if (!in_array($key, $allow) or $value === '') {
             continue;
         }
         if ($replace[$key]) {
             $key = $replace[$key];
         }
         $where[$key] = $value;
     }
     if ($where['id']) {
         validate::$kod = TRUE;
         switch (validate::type($where['id'])) {
             case 'ISBN':
                 $where['ISBN'] = $where['id'];
                 unset($where['id']);
                 break;
             case 'ISSN':
                 $where['ISSN'] = $where['id'];
                 unset($where['id']);
                 break;
             case 'MSC':
                 $where['regal'] = $where['id'];
                 if ($dane['polka']) {
                     $where['polka'] = $dane['polka'];
                 }
                 if ($dane['rzad']) {
                     $where['rzad'] = $dane['rzad'];
                 }
                 unset($where['id']);
                 break;
         }
         validate::$kod = FALSE;
     }
     if (!$where['regal']) {
         unset($where['polka']);
         unset($where['rzad']);
     }
     if ($where['id']) {
         $ret[] = self::szukaj_KOD($where['id']);
         $num = count($ret);
     } else {
         if ($dane['do']) {
             $num = db2::num('pozycz', 'id');
             if ($num == 0) {
                 $ret = array();
             } else {
                 $ret = db2::get(array('pozycz', array('J', 'ksiazki', 'USING', 'id')), '*', NULL, $order, $start, $limit);
             }
         } else {
             $num = db2::num('ksiazki', 'id', $where);
             if ($num == 0) {
                 $ret = array();
             } else {
                 $where = db2::__combine_where($where, TRUE);
                 $ret = db2::escape_data(sql::fetch(sql::query('SELECT `ksiazki`.*, `pozycz`.`od`, `pozycz`.`kto`' . (db2::revelance() ? ', ' . db2::$revelance : '') . ' FROM `ksiazki` LEFT OUTER JOIN `pozycz` ON `pozycz`.`id`=`ksiazki`.`id` ' . $where . db2::__combine_order($order, TRUE) . db2::__combine_limit($start, $limit))));
             }
         }
         self::cache_addarray($ret);
     }
     return array($num, $ret, db2::revelance());
 }
开发者ID:Alambos,项目名称:books,代码行数:66,代码来源:ksiazki.php


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