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


PHP AdminForm::load_by_filter方法代码示例

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


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

示例1: header

} else {
    header('Location: index.php');
}
include "models/admin_model.php";
$admins = new AdminForm();
$to_edit = new AdminForm();
if (isset($_POST['add_admin'])) {
    $to_edit->load_from_post();
    $valid = $to_edit->validate();
    if ($_POST['password2'] != $to_edit->fields['password']->value) {
        $valid = false;
    } else {
        $to_edit->fields['password']->hash_pass();
    }
    if ($valid) {
        $to_edit->save();
    }
} elseif (isset($_POST['admin_id'])) {
    $to_edit->load_by_pk($_POST['admin_id']);
    $to_edit->load_from_post();
    $valid = $to_edit->validate();
    if ($valid) {
        $to_edit->save();
        $to_edit = new AdminForm();
    }
}
$admins->load_by_filter("");
$page_title = "Manage Administrators";
$panel_heading = "Manage Administrators";
$page_body = "manage_admins_template.php";
include "templates/template.php";
开发者ID:SirTekno,项目名称:cfa_dev,代码行数:31,代码来源:manage_admins.php

示例2: LandownerForm

         }
     }
 }
 if ($login_fields['user_type'] == "Landowner") {
     $form = new LandownerForm();
     $checkQuery = $form->load_by_filter(array("email" => $_POST['email']));
     if ($checkQuery) {
         if ($form->fields['password']->authenticate($_POST['password'])) {
             $redirect = "Location: landowner_view.php";
             $valid_password = true;
         }
     }
 }
 if ($login_fields['user_type'] == "Administrator") {
     $form = new AdminForm();
     $checkQuery = $form->load_by_filter(array("email" => $_POST['email']));
     if ($checkQuery) {
         if ($form->fields['password']->authenticate($_POST['password'])) {
             $redirect = "Location: admin.php";
             $valid_password = true;
         }
     }
 }
 if ($valid_password == true) {
     $_SESSION['type'] = $login_fields['user_type'];
     $_SESSION['first_name'] = $form->fields['first_name']->get_value();
     $_SESSION['last_name'] = $form->fields['last_name']->get_value();
     $_SESSION['usr_id'] = $form->id_instance;
     $_SESSION['email'] = $form->fields['email']->get_value();
     header($redirect);
     die;
开发者ID:SirTekno,项目名称:cfa_dev,代码行数:31,代码来源:login.php


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