本文整理汇总了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';
示例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());
}