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


PHP Validation::show方法代码示例

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


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

示例1: post

 function post()
 {
     require CLASS_PATH . "validation.class.php";
     $validate = new Validation();
     if (isset($_POST['save_service'])) {
         pb_submit_check('service');
         $vals = array();
         $vals['status'] = 0;
         $vals['member_id'] = 0;
         $vals['content'] = $_POST['service']['content'];
         if (isset($_POST['service']['nick_name'])) {
             $vals['nick_name'] = $_POST['service']['nick_name'];
         }
         $vals['email'] = $_POST['service']['email'];
         $vals['type_id'] = $_POST['service']['type_id'];
         $vals['created'] = $time_stamp;
         $vals['user_ip'] = pb_get_client_ip();
         $vals['title'] = $_POST['service']['title'];
         $this->service->doValidation($vals);
         if (!empty($this->service->validationErrors)) {
             setvar("item", $vals);
             setvar("Errors", $validate->show($service));
             render("service/index");
         } else {
             if (empty($vals['title'])) {
                 $vals['title'] = L("comments_and_suggestions", "tpl");
             }
             if ($this->service->save($vals)) {
                 flash('thanks_for_advise', URL);
             } else {
                 flash();
             }
         }
     } else {
         flash("pls_enter_your_advise", "index.php");
     }
 }
开发者ID:reboxhost,项目名称:phpb2b,代码行数:37,代码来源:service_controller.php

示例2: add

 function add()
 {
     global $G;
     require CLASS_PATH . "validation.class.php";
     $validate = new Validation();
     uses("trade", "member", "tradefield", "tag");
     $tag = new Tags();
     $offer = $tradefield = new Tradefields();
     $member = new Members();
     $trade = new Trades();
     if (isset($_POST['visit_post'])) {
         capt_check("capt_post_free");
         pb_submit_check('visit_post');
         $_POST['data']['trade']['title'] = pb_lang_merge($_POST['data']['multi']);
         $trade->setParams();
         $tradefield->setParams();
         $if_title_exists = $trade->findByTitle($trade->params['data']['trade']['title']);
         if (!empty($if_title_exists)) {
             $trade->validationErrors[] = L("semilar_offer_post");
         }
         if (!$validate->notEmpty($trade->params['data']['trade']['title'])) {
             $trade->validationErrors[] = L("title_cant_be_empty");
         }
         $trade->params['expire_days'] = $_POST['expire_days'];
         $if_check = $G['setting']['vis_post_check'];
         $msg = null;
         $words = $trade->dbstuff->GetArray("SELECT * FROM {$trade->table_prefix}words");
         if (!empty($words)) {
             foreach ($words as $word_val) {
                 if (!empty($word_val['title'])) {
                     str_replace($word_val['title'], "***", $trade->params['data']['trade']['title']);
                     str_replace($word_val['title'], "***", $trade->params['data']['trade']['content']);
                 }
             }
             $item['forbid_word'] = implode("\r\n", $tmp_str);
         }
         if ($if_check) {
             $trade->params['data']['trade']['status'] = 0;
             $msg = 'pls_wait_for_check';
         } else {
             $trade->params['data']['trade']['status'] = 1;
             $msg = 'success';
         }
         if (!empty($trade->validationErrors)) {
             setvar("item", am($trade->params['data']['trade'], $tradefield->params['data']['tradefield']));
             setvar("Errors", $validate->show($trade));
             render("offer/post");
         } else {
             $trade->params['data']['trade']['industry_id'] = implode(",", $_POST['industry']['id']);
             $trade->params['data']['trade']['area_id'] = implode(",", $_POST['area']['id']);
             $result = $trade->Add();
             if ($result) {
                 flash($msg);
             } else {
                 flash();
             }
         }
     }
 }
开发者ID:reboxhost,项目名称:phpb2b,代码行数:59,代码来源:offer_controller.php

示例3: ua_referer

                    break;
                default:
                    $goto_page = URL . "index.php";
                    break;
            }
            pheader('location: ' . $goto_page);
        } elseif ($checked == -2) {
            $member->validationErrors[] = L('member_not_exists');
        } elseif ($checked == -3) {
            $member->validationErrors[] = L('login_pwd_false');
        } elseif ($checked == -4) {
            $member->validationErrors[] = L('member_checking');
        } else {
            $member->validationErrors[] = L('login_faild');
        }
        setvar("LoginError", $validate->show($member));
    }
}
function ua_referer($default = '')
{
    global $referer;
    $indexname = URL . "index.php";
    $default = empty($default) ? $indexname : '';
    $referer = pb_htmlspecialchar($referer);
    if (!preg_match("/(\\.php|[a-z]+(\\-\\d+)+\\.html)/", $referer) || strpos($referer, 'logging.php')) {
        $referer = $default;
    }
    return $referer;
}
if (isset($_GET['action']) && $_GET['action'] == "logout") {
    $referer = null;
开发者ID:vuong93st,项目名称:w-game,代码行数:31,代码来源:logging.php

示例4: array

    pb_submit_check('service');
    $vals = array();
    $vals['status'] = 0;
    $vals['member_id'] = 0;
    $vals['content'] = $_POST['service']['content'];
    if (isset($_POST['service']['nick_name'])) {
        $vals['nick_name'] = $_POST['service']['nick_name'];
    }
    $vals['email'] = $_POST['service']['email'];
    $vals['type_id'] = $_POST['service']['type_id'];
    $vals['created'] = $time_stamp;
    $vals['user_ip'] = pb_get_client_ip();
    $vals['title'] = $_POST['service']['title'];
    $service->doValidation($vals);
    if (!empty($service->validationErrors)) {
        setvar("item", $vals);
        setvar("Errors", $validate->show($service));
        render("service/index");
    } else {
        if (empty($vals['title'])) {
            $vals['title'] = L("comments_and_suggestions", "tpl");
        }
        if ($service->save($vals)) {
            flash('thanks_for_advise', URL);
        } else {
            flash();
        }
    }
} else {
    flash("pls_enter_your_advise", "index.php");
}
开发者ID:renduples,项目名称:alibtob,代码行数:31,代码来源:post.php

示例5: Validation

$validate = new Validation();
check_permission("company");
uses("industry", "area", "attachment", "companyfield", "typeoption");
$attachment = new Attachment('pic');
$area = new Areas();
$industry = new Industries();
$companyfield = new Companyfields();
$typeoption = new Typeoption();
$tpl_file = "company";
if (isset($_POST['do']) && !empty($_POST['data']['company'])) {
    pb_submit_check('data');
    $vals = $_POST['data']['company'];
    $company->doValidation($vals);
    if (!empty($company->validationErrors)) {
        setvar("item", $vals);
        setvar("Errors", $validate->show($company));
        template($tpl_file, true);
    }
    if (isset($companyinfo)) {
        if (empty($companyinfo['name'])) {
            $i18n = new L10n();
            $space_name = $i18n->translateSpaceName($_POST['data']['company']['name']);
            $space_name = str_replace(' ', '', $space_name);
            $vals['cache_spacename'] = $space_name;
            $vals['first_letter'] = substr($space_name, 0, 1);
            $member->updateSpaceName(array("id" => $the_memberid), $space_name);
            if (isset($companyinfo['status']) && $companyinfo['status'] == 0) {
                $vals['name'] = strip_tags($_POST['data']['company']['name']);
                $vals['english_name'] = strip_tags($vals['english_name']);
            }
        }
开发者ID:renduples,项目名称:alibtob,代码行数:31,代码来源:company.php

示例6: implode

                str_replace($word_val['title'], "***", $trade->params['data']['trade']['title']);
                str_replace($word_val['title'], "***", $trade->params['data']['trade']['content']);
            }
        }
        $item['forbid_word'] = implode("\r\n", $tmp_str);
    }
    if ($if_check) {
        $trade->params['data']['trade']['status'] = 0;
        $msg = 'pls_wait_for_check';
    } else {
        $trade->params['data']['trade']['status'] = 1;
        $msg = 'success';
    }
    if (!empty($trade->validationErrors)) {
        setvar("item", am($trade->params['data']['trade'], $tradefield->params['data']['tradefield']));
        setvar("Errors", $validate->show($trade));
    } else {
        $trade->params['data']['trade']['industry_id'] = PbController::getMultiId($_POST['industry']['id']);
        $trade->params['data']['trade']['area_id'] = PbController::getMultiId($_POST['area']['id']);
        $result = $trade->Add();
        if ($result) {
            $smarty->flash($msg, URL . "offer/detail.php?id=" . $trade->{$trade->table_name . "_id"});
        } else {
            $smarty->flash();
        }
    }
}
$trade_types = $trade->GetArray("SELECT * FROM " . $tb_prefix . "tradetypes");
foreach ($trade_types as $key => $val) {
    if ($val['parent_id'] == 0) {
        $set_types[$val['id']] = $val;
开发者ID:renduples,项目名称:alibtob,代码行数:31,代码来源:post.php


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