• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP DataAccess类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: GetSeqNextValue

 public static function GetSeqNextValue(DataAccess $dataaccess, $table_name, $col_name, $count = 1)
 {
     if ($count == 1) {
         $ds = $dataaccess->GetData("seq", "call p_seq_nextvalue(?, ?, 0, @nextvalue)", array((string) $table_name, (string) $col_name));
         return $ds["seq"]["rows"][0]["nextvalue"];
     } else {
         $ds = $dataaccess->GetData("seq", "call p_seq_batchvalue(?, ?, ?, 0, @nextvalue)", array((string) $table_name, (string) $col_name, (int) $count));
         return $ds["seq"]["rows"][0]["nextvalue"];
     }
 }
开发者ID:3116246,项目名称:haolinju,代码行数:10,代码来源:SysSeq.php


示例2: userExist

 public static function userExist($user)
 {
     $dataAccess = new DataAccess();
     $data = $dataAccess->getUser($user);
     if (count($data) == 0) {
         return false;
     } else {
         return $data[0];
     }
 }
开发者ID:atsbjc,项目名称:micce,代码行数:10,代码来源:CheckUser.class.php


示例3: GetCategories

 public function GetCategories()
 {
     if (!$this->Categories) {
         $this->Categories = DataAccess::GetCategoriesByUserID($this->ID);
     }
     return $this->Categories;
 }
开发者ID:andopor,项目名称:doma-project,代码行数:7,代码来源:user_class.php


示例4: Execute

 public function Execute()
 {
     $viewData = array();
     $errors = array();
     if (Helper::IsLoggedInAdmin() && isset($_GET["loginAsUser"])) {
         // login as a certain user and redirect to his page
         if (Helper::LoginUserByUsername($_GET["loginAsUser"])) {
             Helper::Redirect("index.php?" . Helper::CreateQuerystring(getCurrentUser()));
         }
     }
     $viewData["Users"] = DataAccess::GetAllUsers(!Helper::IsLoggedInAdmin());
     $viewData["LastMapForEachUser"] = DataAccess::GetLastMapsForUsers("date");
     // last x maps
     $numberOfMaps = isset($_GET["lastMaps"]) && is_numeric($_GET["lastMaps"]) ? (int) $_GET["lastMaps"] : (isset($_GET["lastMaps"]) && $_GET["lastMaps"] == "all" ? 999999 : 10);
     $viewData["LastMaps"] = DataAccess::GetMaps(0, 0, 0, 0, null, $numberOfMaps, "createdTime", Helper::GetLoggedInUserID());
     // last x comments
     $numberOfComments = isset($_GET["lastComments"]) && is_numeric($_GET["lastComments"]) ? (int) $_GET["lastComments"] : (isset($_GET["lastComments"]) && $_GET["lastComments"] == "all" ? 999999 : 10);
     $viewData["LastComments"] = DataAccess::GetLastComments($numberOfComments, Helper::GetLoggedInUserID());
     $viewData["OverviewMapData"] = null;
     $categories = DataAccess::GetCategoriesByUserID();
     foreach ($viewData["LastMaps"] as $map) {
         $data = Helper::GetOverviewMapData($map, false, true, true, $categories);
         if ($data != null) {
             $viewData["OverviewMapData"][] = $data;
         }
     }
     if (isset($_GET["error"]) && $_GET["error"] == "email") {
         $errors[] = sprintf(__("ADMIN_EMAIL_ERROR"), ADMIN_EMAIL);
     }
     $viewData["Errors"] = $errors;
     return $viewData;
 }
开发者ID:andopor,项目名称:doma-project,代码行数:32,代码来源:users.controller.php


示例5: GetUser

 public function GetUser()
 {
     if (!$this->User) {
         $this->User = DataAccess::GetUserByID($this->UserID);
     }
     return $this->User;
 }
开发者ID:andopor,项目名称:doma-project,代码行数:7,代码来源:category_class.php


示例6: GetCategory

 public function GetCategory()
 {
     if (!$this->Category) {
         $this->Category = DataAccess::GetCategoryByID($this->CategoryID);
     }
     return $this->Category;
 }
开发者ID:andopor,项目名称:doma-project,代码行数:7,代码来源:map_class.php


示例7: executeDatabaseScripts

function executeDatabaseScripts()
{
    $allScripts = getScripts();
    $errors = array();
    foreach ($allScripts as $s) {
        // check whether scripts should be run
        if (isset($s["conditionFunction"])) {
            $f = $s["conditionFunction"];
            $runScripts = $f($s["conditionData"]);
        } else {
            $runScripts = true;
        }
        if ($runScripts) {
            foreach ($s["scripts"] as $script) {
                mysql_query($script);
                Helper::WriteToLog($script);
                $error = getMySQLErrorIfAny();
                if ($error) {
                    Helper::WriteToLog($error);
                    $errors[] = $error;
                }
            }
        }
    }
    if (count($errors) == 0) {
        DataAccess::SetSetting("DATABASE_VERSION", DOMA_VERSION);
    }
    return array("errors" => $errors);
}
开发者ID:andopor,项目名称:doma-project,代码行数:29,代码来源:db_scripts.php


示例8: getMapCornerPositionsAndRouteCoordinates

function getMapCornerPositionsAndRouteCoordinates($id)
{
    $map = new Map();
    $map->Load($id);
    $user = DataAccess::GetUserByID($map->UserID);
    $categories = DataAccess::GetCategoriesByUserID($user->ID);
    return Helper::GetOverviewMapData($map, true, false, false, $categories);
}
开发者ID:andopor,项目名称:doma-project,代码行数:8,代码来源:ajax_server.php


示例9: Execute

 public function Execute()
 {
     $viewData = array();
     // no user specified - redirect to user list page
     if (!getCurrentUser()) {
         Helper::Redirect("users.php");
     }
     // user is hidden - redirect to user list page
     if (!getCurrentUser()->Visible) {
         Helper::Redirect("users.php");
     }
     // the requested map
     $map = new Map();
     $map->Load($_GET["map"]);
     if (!$map->ID) {
         die("The map has been removed.");
     }
     DataAccess::UnprotectMapIfNeeded($map);
     if (Helper::MapIsProtected($map)) {
         die("The map is protected until " . date("Y-m-d H:i:s", Helper::StringToTime($map->ProtectedUntil, true)) . ".");
     }
     if ($map->UserID != getCurrentUser()->ID) {
         die;
     }
     $viewData["Comments"] = DataAccess::GetCommentsByMapId($map->ID);
     $viewData["Name"] = $map->Name . ' (' . date(__("DATE_FORMAT"), Helper::StringToTime($map->Date, true)) . ')';
     // previous map in archive
     $previous = DataAccess::GetPreviousMap(getCurrentUser()->ID, $map->ID, Helper::GetLoggedInUserID());
     $viewData["PreviousName"] = $previous == null ? null : $previous->Name . ' (' . date(__("DATE_FORMAT"), Helper::StringToTime($previous->Date, true)) . ')';
     // next map in archive
     $next = DataAccess::GetNextMap(getCurrentUser()->ID, $map->ID, Helper::GetLoggedInUserID());
     $viewData["NextName"] = $next == null ? null : $next->Name . ' (' . date(__("DATE_FORMAT"), Helper::StringToTime($next->Date, true)) . ')';
     $size = $map->GetMapImageSize();
     $viewData["ImageWidth"] = $size["Width"];
     $viewData["ImageHeight"] = $size["Height"];
     DataAccess::IncreaseMapViews($map);
     $viewData["Map"] = $map;
     $viewData["BackUrl"] = isset($_SERVER["HTTP_REFERER"]) && basename($_SERVER["HTTP_REFERER"]) == "users.php" ? "users.php" : "index.php?" . Helper::CreateQuerystring(getCurrentUser());
     $viewData["Previous"] = $previous;
     $viewData["Next"] = $next;
     $viewData["ShowComments"] = isset($_GET["showComments"]) && ($_GET["showComments"] = true) || !__("COLLAPSE_VISITOR_COMMENTS");
     $viewData["FirstMapImageName"] = Helper::GetMapImage($map);
     if ($map->BlankMapImage) {
         $viewData["SecondMapImageName"] = Helper::GetBlankMapImage($map);
     }
     $viewData["QuickRouteJpegExtensionData"] = $map->GetQuickRouteJpegExtensionData();
     if (isset($viewData["QuickRouteJpegExtensionData"]) && $viewData["QuickRouteJpegExtensionData"]->IsValid) {
         $categories = DataAccess::GetCategoriesByUserID(getCurrentUser()->ID);
         $viewData["OverviewMapData"][] = Helper::GetOverviewMapData($map, true, false, false, $categories);
         $viewData["GoogleMapsUrl"] = "http://maps.google.com/maps" . "?q=" . urlencode(Helper::GlobalPath("export_kml.php?id=" . $map->ID . "&format=kml")) . "&language=" . Session::GetLanguageCode();
     }
     if (USE_3DRERUN == '1' && DataAccess::GetSetting("LAST_WORLDOFO_CHECK_DOMA_TIME", "0") + RERUN_FREQUENCY * 3600 < time()) {
         $viewData["RerunMaps"] = Helper::GetMapsForRerunRequest();
         $viewData["TotalRerunMaps"] = count(explode(",", $viewData["RerunMaps"]));
         $viewData["ProcessRerun"] = true;
     }
     return $viewData;
 }
开发者ID:andopor,项目名称:doma-project,代码行数:58,代码来源:show_map.controller.php


示例10: getRoles

 private function getRoles()
 {
     $rolesUsuario = new Rol();
     $roles = DataAccess::selectWhere($rolesUsuario, $usuario->idUsuario);
     $count = count($roles);
     for ($i = 0; $i < $count; $i++) {
         $rolname = NameRoles::getName($roles['id_rol_roles']);
         $rolUsuario = new Rol($roles);
         $rolesSession[$rolname] = $rolUsuario;
         $menuSession[$rolname] = $rolname;
     }
 }
开发者ID:digoc93,项目名称:inventarios,代码行数:12,代码来源:SystemControl.php


示例11: canuse

function canuse($pid)
{
    $p = new DataAccess();
    $sql = "select pid from problem where pid = {$pid} and submitable = 1";
    $cnt = $p->dosql($sql);
    if ($cnt == 0) {
        return false;
    }
    if ($_SESSION['ID']) {
        $sql = "SELECT * FROM submit WHERE pid = {$pid} AND uid ={$_SESSION['ID']} order by accepted desc limit 1";
        $ac = $p->dosql($sql);
        if ($ac) {
            $e = $p->rtnrlt(0);
            if ($e['accepted']) {
                return false;
            } else {
                true;
            }
        }
    }
    return true;
}
开发者ID:Zhi2014,项目名称:cogs,代码行数:22,代码来源:random.php


示例12: getDependencias

 protected final function getDependencias($allData = false)
 {
     $dependencia = new Dependencia();
     $dependencias = DataAccess::selectWhere($dependencia);
     if ($allData) {
         return $dependencias;
     }
     $count = count($dependencias);
     for ($index = 0; $index < $count; $index++) {
         //array asociativo idempresa-nombre
         $id_Dependencia[$dependencias[$index]['iddependencia']] = $dependencias[$index]['nombre'];
     }
     return $id_Dependencia;
 }
开发者ID:digoc93,项目名称:inventarios,代码行数:14,代码来源:ControlSeccion.php


示例13: getLineas

 protected final function getLineas($allData = false)
 {
     $linea = new Linea();
     $lineas = DataAccess::selectWhere($linea);
     if ($allData) {
         return $lineas;
     }
     $count = count($lineas);
     for ($index = 0; $index < $count; $index++) {
         //array asociativo idempresa-nombre
         $id_Linea[$lineas[$index]['idlinea']] = $lineas[$index]['nombre'];
     }
     return $id_Linea;
 }
开发者ID:digoc93,项目名称:inventarios,代码行数:14,代码来源:ControlSublinea.php


示例14: getEmpresas

 protected final function getEmpresas($allData = false)
 {
     $empresa = new Empresa();
     $empresas = DataAccess::selectWhere($empresa);
     if ($allData) {
         return $empresas;
     }
     $count = count($empresas);
     for ($index = 0; $index < $count; $index++) {
         //array asociativo idempresa-nombre
         $id_Empresa[$empresas[$index]['idempresa']] = $empresas[$index]['nombre'];
     }
     return $id_Empresa;
 }
开发者ID:digoc93,项目名称:inventarios,代码行数:14,代码来源:ControlDependencia.php


示例15: Execute

 public function Execute()
 {
     $viewData = array();
     // load session
     session_start();
     Helper::SetUser(null);
     $errors = array();
     // load strings
     Session::SetLanguageStrings(Helper::GetLanguageStrings());
     // check php version
     if (version_compare(phpversion(), "5.0.0") < 0) {
         $errors[] = sprintf(__("TOO_OLD_PHP_VERSION"), phpversion());
     }
     if (count($errors) == 0) {
         if (Helper::DatabaseVersionIsValid()) {
             $errors[] = __("SITE_ALREADY_CREATED");
         }
         if (count($errors) == 0) {
             $previousDatabaseVersion = DataAccess::GetSetting("DATABASE_VERSION", "0.0");
             // create or update database
             $result = executeDatabaseScripts();
             $errors = $result["errors"];
             // chmod only has effect on linux/unix systems
             @mkdir(Helper::LocalPath(MAP_IMAGE_PATH));
             @chmod(Helper::LocalPath(MAP_IMAGE_PATH), 0777);
             @mkdir(Helper::LocalPath(TEMP_FILE_PATH));
             @chmod(Helper::LocalPath(TEMP_FILE_PATH), 0777);
             if (count($errors) == 0) {
                 if ($previousDatabaseVersion == "0.0") {
                     // created databse
                     Helper::LogUsage("createSite", "version=" . DOMA_VERSION);
                     Helper::LoginAdmin(ADMIN_USERNAME, ADMIN_PASSWORD);
                 } else {
                     // updated database
                     Helper::LogUsage("updateSite", "oldVersion={$previousDatabaseVersion}&newVersion=" . DOMA_VERSION);
                     // redirect to originally requested page
                     $redirectUrl = $_GET["redirectUrl"];
                     if (!isset($redirectUrl)) {
                         $redirectUrl = "users.php";
                     }
                     Helper::Redirect($redirectUrl);
                 }
             }
         }
     }
     $viewData["Errors"] = $errors;
     return $viewData;
 }
开发者ID:andopor,项目名称:doma-project,代码行数:48,代码来源:create.controller.php


示例16: Execute

 public function Execute()
 {
     $viewData = array();
     $errors = array();
     $comment = new Comment();
     // no user specified - redirect to user list page
     if (isset($_POST["comment_text"])) {
         $comment->Comment = stripslashes(strip_tags(urldecode($_POST["comment_text"])));
     } else {
         die("No comment text");
     }
     if (isset($_POST["user_name"])) {
         $comment->Name = stripslashes(strip_tags(urldecode($_POST["user_name"])));
     } else {
         die("No user name");
     }
     if (isset($_POST["map_id"]) && is_numeric($_POST["map_id"])) {
         $comment->MapID = $_POST["map_id"];
     } else {
         die("No valid map ID");
     }
     if (isset($_POST["user_email"])) {
         $comment->Email = stripslashes(strip_tags($_POST["user_email"]));
     }
     $comment->UserIP = $_SERVER['REMOTE_ADDR'];
     $comment->DateCreated = date("Y-m-d H:i:s");
     $comment->Save();
     $map = new Map();
     $map->Load($comment->MapID);
     if (__("EMAIL_VISITOR_COMMENTS") && $map->UserID != Helper::GetLoggedInUser()->ID) {
         $user = DataAccess::GetUserByID($map->UserID);
         $fromName = __("DOMA_ADMIN_EMAIL_NAME");
         $subject = __("NEW_COMMENT_EMAIL_SUBJECT");
         $mapAddress = Helper::GlobalPath("show_map.php?user=" . $user->Username . "&map=" . $map->ID . "&showComments=true");
         $body = sprintf(__("NEW_COMMENT_EMAIL_BODY"), $map->Name, $mapAddress, $comment->Name, $comment->Email, $comment->Comment);
         $emailSentSuccessfully = Helper::SendEmail($fromName, $user->Email, $subject, $body);
         if (!$emailSentSuccessfully) {
             $errors[] = __("EMAIL_ERROR");
         }
     }
     $viewData["Errors"] = $errors;
     $viewData["Comment"] = $comment;
     $viewData["Map"] = $map;
     return $viewData;
 }
开发者ID:andopor,项目名称:doma-project,代码行数:45,代码来源:add_comment.controller.php


示例17: consultarMarcas

 protected final function consultarMarcas()
 {
     return DataAccess::selectWhere($this->marca, " ");
 }
开发者ID:digoc93,项目名称:inventarios,代码行数:4,代码来源:ControlMarca.php


示例18: error_reporting

<?php

error_reporting(E_ALL & ~E_NOTICE);
include_once dirname(__FILE__) . "/../config.php";
include_once dirname(__FILE__) . "/definitions.php";
// set character encoding
header('Content-Type: text/html; charset=utf-8');
// load session
session_start();
// create database if it does not exist
if (!Helper::DatabaseVersionIsValid()) {
    Helper::Redirect("create.php?redirectUrl=" . urlencode($_SERVER["REQUEST_URI"]));
}
// extract current user from querystring
if (isset($_GET["user"])) {
    $currentUser = getCurrentUser();
    if (!$currentUser || $currentUser->Username != $_GET["user"] || !Session::GetLanguageStrings() || isset($_GET["lang"]) && Session::GetLanguageCode() != $_GET["lang"]) {
        Helper::SetUser(DataAccess::GetUserByUsername($_GET["user"]));
    }
} else {
    Helper::SetUser(null);
}
开发者ID:andopor,项目名称:doma-project,代码行数:22,代码来源:main.php


示例19: DataAccess

<?php

require_once "../include/header.php";
$uid = (int) $_SESSION['ID'];
$pid = (int) $_GET['pid'];
$p = new DataAccess();
$sql = "select problem.*,groups.* from problem,groups where pid=" . (int) $_GET[pid] . " and groups.gid=problem.group limit 1";
$cnt = $p->dosql($sql);
$d = $p->rtnrlt(0);
$title = $d['probname'];
gethead(1, "", $pid . ". " . $title);
$LIB->hlighter();
$LIB->mathjax();
$q = new DataAccess();
$r = new DataAccess();
if ($cnt) {
    if ($d[readforce] > $_SESSION[readforce]) {
        异常("没有阅读权限!", 取路径("problem/index.php"));
    }
    if (!$d[submitable] && !有此权限('查看题目') && $d['addid'] != $uid) {
        异常("该题目不可提交!", 取路径("problem/index.php"));
    }
    $subgroup = $LIB->getsubgroup($q, $d['gid']);
    $subgroup[0] = $d['gid'];
    $promise = false;
    if ($uid == $d['addid']) {
        $promise = true;
    }
    foreach ($subgroup as $value) {
        if ($value == (int) $_SESSION['group']) {
            $promise = true;
开发者ID:Zhi2014,项目名称:cogs,代码行数:31,代码来源:problem.php


示例20: header

<?php

header('Content-Type:text/html;charset=utf-8');
/*
 * 抽象工厂模式【多类型数据库】
 * Author: Kaysen
 */
$dirList = 'User' . DIRECTORY_SEPARATOR . '; ';
$dirList .= 'Department' . DIRECTORY_SEPARATOR;
define('__AUTOLOAD_DIR__', $dirList);
define('ROOT_PATH', dirname(__FILE__));
require_once ROOT_PATH . '/../../Loader.php';
$user = new User();
$dept = new Department();
$IUser = DataAccess::createUser();
$IUser->insert($user);
$IUser->getUser(1);
$IDepar = DataAccess::createDepartment();
$IDepar->insert($dept);
$IDepar->getDepartment(2);
开发者ID:kaysen820,项目名称:design_patten,代码行数:20,代码来源:test.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP DataAccessObject类代码示例发布时间:2022-05-23
下一篇:
PHP Data类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap