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


PHP getArrayVal函数代码示例

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


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

示例1: setStartCode

 public function setStartCode()
 {
     $query = 'SELECT TOP 1 MemberCardNo FROM POS_Member WHERE MemberCardNo LIKE \'T%\' ORDER BY Code DESC';
     $res = Processor::execErp($query);
     $member = odbc_fetch_array($res);
     $this->code = getArrayVal($member, 'MemberCardNo');
     return $this;
 }
开发者ID:jocoonopa,项目名称:lubri,代码行数:8,代码来源:MemberCode.php

示例2: genQueryNestReplace

 public static function genQueryNestReplace(array $targetArr, array $replaceArr, $columnName)
 {
     $string = '';
     foreach ($targetArr as $key => $target) {
         $target = '\'' === $target ? $target . '\'' : $target;
         $columnName = 0 === $key ? $columnName : $string;
         $string = 'REPLACE(' . $columnName . ', \'' . $target . '\', \'' . getArrayVal($replaceArr, $key) . '\')';
     }
     return $string;
 }
开发者ID:jocoonopa,项目名称:lubri,代码行数:10,代码来源:Grammer.php

示例3: appendRow

 protected function appendRow(array $data, array $css)
 {
     $this->targetSheet->row($this->getIndex(), $data);
     $this->targetSheet->cells($this->getCellsRange(), function ($cells) use($css) {
         $cells->setBackground(getArrayVal($css, 'backgrounColor'))->setFontColor(getArrayVal($css, 'fontColor'));
     });
     return $this;
 }
开发者ID:jocoonopa,项目名称:lubri,代码行数:8,代码来源:ExportHandler.php

示例4: detectSSL

/**
* Detect if Collabtive runs on HTTP or HTTPS
*/
function detectSSL()
{
    if (getArrayVal($_SERVER, "https") == "on") {
        return true;
    } elseif (getArrayVal($_SERVER, "https") == 1) {
        return true;
    } elseif (getArrayVal($_SERVER, "HTTPS") == 'on') {
        return true;
    } elseif (getArrayVal($_SERVER, "HTTPS") == 1) {
        return true;
    } elseif (getArrayVal($_SERVER, "SERVER_PORT") == 443) {
        return true;
    } else {
        return false;
    }
}
开发者ID:raum01,项目名称:Collabtive,代码行数:19,代码来源:initfunctions.php

示例5: header

    if (!$userpermissions["admin"]["add"]) {
        $errtxt = $langfile["nopermission"];
        $noperm = $langfile["accessdenied"];
        $template->assign("errortext", "{$errtxt}<br>{$noperm}");
        $template->assign("mode", "error");
        $template->display("error.tpl");
        die;
    }
    if ($user->del($id)) {
        $loc = $url . "admin.php?action=users&mode=deleted";
        header("Location: {$loc}");
    }
} elseif ($action == "profile") {
    $thetag = new tags();
    $start = getArrayVal($_GET, "start");
    $end = getArrayVal($_GET, "end");
    $proj = (object) new project();
    if ($userpermissions["admin"]["add"]) {
        $projects = $proj->getMyProjects($id);
        $i = 0;
        if (!empty($projects)) {
            foreach ($projects as $opro) {
                $membs = $proj->getProjectMembers($opro["ID"], 1000);
                $projects[$i]['members'] = $membs;
                $i = $i + 1;
            }
            $template->assign("opros", $projects);
        }
    }
    $tracker = (object) new timetracker();
    $track = array();
开发者ID:Setrino,项目名称:collabtive,代码行数:31,代码来源:manageuser.php

示例6: elseif

    // Get milestone info
    $milestone = $milestone->getMilestone($mid);
    $template->assign("projectname", $projectname);
    $template->assign("milestone", $milestone);
    $template->display("editmilestone.tpl");
} elseif ($action == "edit") {
    if (!$userpermissions["milestones"]["edit"]) {
        $errtxt = $langfile["nopermission"];
        $noperm = $langfile["accessdenied"];
        $template->assign("errortext", "<h2>{$errtxt}</h2><br>{$noperm}");
        $template->display("error.tpl");
        die;
    }
    // Get milestone ID and start date from form
    $mid = $_POST['mid'];
    $start = getArrayVal($_POST, "start");
    // Edit the milestone
    if ($milestone->edit($mid, $name, $desc, $start, $end)) {
        $loc = $url . "managemilestone.php?action=showproject&id={$id}&mode=edited";
        header("Location: {$loc}");
    } else {
        $template->assign("editmilestone", 0);
    }
} elseif ($action == "del") {
    if (!$userpermissions["milestones"]["del"]) {
        $errtxt = $langfile["nopermission"];
        $noperm = $langfile["accessdenied"];
        $template->assign("errortext", "<h2>{$errtxt}</h2><br>{$noperm}");
        $template->display("error.tpl");
        die;
    }
开发者ID:veganaize,项目名称:Collabtive,代码行数:31,代码来源:managemilestone.php

示例7: __construct

 function __construct()
 {
     $this->userid = getArrayVal($_SESSION, "userid");
     $this->uname = getArrayVal($_SESSION, "username");
 }
开发者ID:janvalentik,项目名称:Collabtive,代码行数:5,代码来源:class.mylog.php

示例8: header

        $loc = $url . "admin.php?action=users&mode=roleadded";
        header("Location: $loc");
    }
}
// delete a role
elseif ($action == "delrole")
{
    if ($roleobj->del($id))
    {
        echo "ok";
    }
}
// edit a role
elseif ($action == "editrole")
{
    $rolename = getArrayVal($_POST, "rolename");
    $projectperms = $roleobj->sanitizeArray($projectperms);
    $mileperms = $roleobj->sanitizeArray($mileperms);
    $taskperms = $roleobj->sanitizeArray($taskperms);
    $messageperms = $roleobj->sanitizeArray($messageperms);
    $fileperms = $roleobj->sanitizeArray($fileperms);
    $trackerperms = $roleobj->sanitizeArray($trackerperms);
    $chatperms = $roleobj->sanitizeArray($chatperms);
    $adminperms = $roleobj->sanitizeArray($adminperms);

    if ($roleobj->edit($id, $rolename, $projectperms, $taskperms, $mileperms, $messageperms, $fileperms, $trackerperms, $chatperms, $adminperms))
    {
        $loc = $url . "admin.php?action=users&mode=roleedited";
        header("Location: $loc");
    }
}
开发者ID:janvalentik,项目名称:Collabtive,代码行数:31,代码来源:manageroles.php

示例9: openIdLogin

 /**
  * Log a user in
  *
  * @param string $user User name
  * @param string $pass Password
  * @return bool
  */
 function openIdLogin($url)
 {
     /* here the openid auth should take place */
     try {
         $openid = new LightOpenID($_SERVER['HTTP_HOST']);
         if (!$openid->mode) {
             $openid->identity = $url;
             header('Location: ' . $openid->authUrl());
         } elseif ($openid->mode == 'cancel') {
             return false;
         } else {
             $identity = $openid->data['openid_identity'];
             $sel1 = $conn->query("SELECT ID from openids WHERE identity='{$identity}'");
             if ($row = $sel1->fetch()) {
                 $id = $row['ID'];
             } else {
                 return false;
             }
             // die("SELECT ID,name,locale,lastlogin,gender FROM user WHERE ID=$id");
             $sel1 = $conn->query("SELECT ID,name,locale,lastlogin,gender FROM user WHERE ID={$id}");
             $chk = $sel1->fetch();
             if ($chk["ID"] != "") {
                 $rolesobj = new roles();
                 $now = time();
                 $_SESSION['userid'] = $chk['ID'];
                 $_SESSION['username'] = stripslashes($chk['name']);
                 $_SESSION['lastlogin'] = $now;
                 $_SESSION['userlocale'] = $chk['locale'];
                 $_SESSION['usergender'] = $chk['gender'];
                 $_SESSION["userpermissions"] = $rolesobj->getUserRole($chk["ID"]);
                 $userid = $_SESSION['userid'];
                 $seid = session_id();
                 $staylogged = getArrayVal($_POST, 'staylogged');
                 if ($staylogged == 1) {
                     setcookie("PHPSESSID", "{$seid}", time() + 14 * 24 * 3600);
                 }
                 $upd1 = $conn->prepare("UPDATE user SET lastlogin = ? WHERE ID = ?");
                 $upd1Stmt = $upd1->execute(array($now, $userid));
                 return true;
             } else {
                 return false;
             }
         }
     } catch (ErrorException $e) {
         return false;
     }
 }
开发者ID:Setrino,项目名称:collabtive,代码行数:54,代码来源:class.user.php

示例10: cleanArray

function cleanArray(array $theArray)
{
    $outArray = array();
    foreach ($theArray as $anArrayKey => $anArrayVal) {
        $outArray[$anArrayKey] = getArrayVal($theArray, $anArrayKey);
    }
    return $outArray;
}
开发者ID:veganaize,项目名称:Collabtive,代码行数:8,代码来源:initfunctions.php

示例11: elseif

    $template->assign("templates", $templates);
    $template->display("editsettings.tpl");
} elseif ($action == "editsets") {
    $theme = getArrayVal($_POST, "theme");
    if ($theset->editSettings($name, $subtitle, $locale, $timezone, $dateformat, $templ, $theme, $rssuser, $rsspass)) {
        $handle = opendir($template->compile_dir);
        while (false !== ($file = readdir($handle))) {
            if ($file != "." and $file != "..") {
                unlink(CL_ROOT . "/" . $template->compile_dir . "/" . $file);
            }
        }
        $_SESSION["userlocale"] = $locale;
        $users = $user->getAllUsers(100000);
        foreach ($users as $theuser) {
            // set the new locale for all the users
            $user->edit($theuser["ID"], $theuser["name"], $theuser["realname"], $theuser["email"], $theuser["tel1"], $theuser["tel2"], $theuser["company"], $theuser["zip"], $theuser["gender"], $theuser["url"], $theuser["adress"], $theuser["adress2"], $theuser["state"], $theuser["country"], $theuser["tags"], $locale, "", $theuser["rate"]);
        }
        header("Location: admin.php?action=system&mode=edited");
    }
} elseif ($action == "editmailsets") {
    $status = getArrayVal($_POST, "mailstatus");
    $mailfrom = getArrayVal($_POST, "mailfrommail");
    $mailfromname = getArrayVal($_POST, "mailfromname");
    $method = getArrayVal($_POST, "mailmethod");
    $server = getArrayVal($_POST, "server");
    $mailuser = getArrayVal($_POST, "mailuser");
    $mailpass = getArrayVal($_POST, "mailpass");
    if ($theset->editMailsettings($status, $mailfrom, $mailfromname, $method, $server, $mailuser, $mailpass)) {
        header("Location: admin.php?action=system&mode=edited");
    }
}
开发者ID:veganaize,项目名称:Collabtive,代码行数:31,代码来源:admin.php

示例12: preg_replace

            $content = '(.+</' . $tag . '(>|\\s[^>]*>)|)';
        }
        $str = preg_replace('#</?' . $tag . '(>|\\s[^>]*>)' . $content . '#is', '', $str);
    }
    return $str;
}
function getArrayVal(array $array, $name)
{
    if (array_key_exists($name, $array)) {
        return strip_only_tags($array[$name], "script");
    }
}
error_reporting(0);
$pic = getArrayVal($_GET, "pic");
$height = getArrayVal($_GET, "height");
$width = getArrayVal($_GET, "width");
include CL_ROOT . "/include/class.hft_image.php";
$imagehw = GetImageSize($pic);
$imagewidth = $imagehw[0];
$imageheight = $imagehw[1];
$myThumb = new hft_image(CL_ROOT . "/" . $pic);
$myThumb->jpeg_quality = 80;
if (!isset($height)) {
    $ratio = $imageheight / $imagewidth;
    $height = $width * $ratio;
    $height = round($height);
}
if (!isset($width)) {
    $ratio = $imagewidth / $imageheight;
    $width = $height * $ratio;
}
开发者ID:Setrino,项目名称:collabtive,代码行数:31,代码来源:thumb.php

示例13: require

<?php
require("init.php");

$action = getArrayVal($_GET, "action");

$mainclasses = array("desktop" => "desktop",
    "profil" => "profil",
    "admin" => "admin_active"
    );
$template->assign("mainclasses", $mainclasses);

//check if the user is admin
if (!$userpermissions["admin"]["add"])
{
    $errtxt = $langfile["nopermission"];
    $noperm = $langfile["accessdenied"];
    $template->assign("errortext", "$errtxt<br>$noperm");
    $template->display("error.tpl");
}

//basecamp import
if ($action == "basecamp")
{
    // create new file object
    $myfile = new datei();
    // create new importer object
    $importer = new importer();
    // upload the file
    $up = $myfile->upload("importfile", "files/" . CL_CONFIG . "/ics", 0);
    if ($up)
    {
开发者ID:janvalentik,项目名称:Collabtive,代码行数:31,代码来源:manageimport.php

示例14: login

 /**
  * Log a user in
  *
  * @param string $user User name
  * @param string $pass Password
  * @return bool
  */
 function login($user, $pass)
 {
     global $conn;
     if (!$user) {
         return false;
     }
     $user = $conn->quote($user);
     $pass = sha1($pass);
     $sel1 = $conn->query("SELECT ID,name,locale,lastlogin,gender FROM user WHERE (name = {$user} OR email = {$user}) AND pass = '{$pass}'");
     $chk = $sel1->fetch();
     if ($chk["ID"] != "") {
         $rolesobj = new roles();
         $now = time();
         $_SESSION['userid'] = $chk['ID'];
         $_SESSION['username'] = stripslashes($chk['name']);
         $_SESSION['lastlogin'] = $now;
         $_SESSION['userlocale'] = $chk['locale'];
         $_SESSION['usergender'] = $chk['gender'];
         $_SESSION["userpermissions"] = $rolesobj->getUserRole($chk["ID"]);
         $userid = $_SESSION['userid'];
         $seid = session_id();
         $staylogged = getArrayVal($_POST, 'staylogged');
         if ($staylogged == 1) {
             setcookie("PHPSESSID", "{$seid}", time() + 14 * 24 * 3600);
         }
         $upd1 = $conn->query("UPDATE user SET lastlogin = '{$now}' WHERE ID = {$userid}");
         return true;
     } else {
         return false;
     }
 }
开发者ID:raum01,项目名称:Collabtive,代码行数:38,代码来源:class.user.php

示例15: die

    $template->assign("loginerror", 0);
    $template->display("login.tpl");
    die();
}
$liste = (object) new tasklist();
$objmilestone = (object) new milestone();

$action = getArrayVal($_GET, "action");
$id = getArrayVal($_GET, "id");
$tlid = getArrayVal($_GET, "tlid");
$mode = getArrayVal($_GET, "mode");

$name = getArrayVal($_POST, "name");
$desc = getArrayVal($_POST, "desc");
$access = getArrayVal($_POST, "email");
$milestone = getArrayVal($_POST, "milestone");

$project = array();
$project['ID'] = $id;
$classes = array("overview" => "overview",
    "msgs" => "msgs",
    "tasks" => "tasks_active",
    "miles" => "miles",
    "files" => "files",
    "users" => "users",
    "tracker" => "tracking"
    );
$template->assign("classes", $classes);
if (!chkproject($userid, $id))
{
    $errtxt = $langfile["notyourproject"];
开发者ID:janvalentik,项目名称:Collabtive,代码行数:31,代码来源:managetasklist.php


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