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


PHP People::GetPerson方法代码示例

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


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

示例1: function

});
//
//	URL:	/api/v1/people
//	Method: POST
//	Params:
//		Required: peopleid, newpeopleid
//	Returns: true / false on the updates being successful
//
$app->post('/people/:peopleid/transferdevicesto/:newpeopleid', function ($peopleid, $newpeopleid) use($app, $person) {
    $response['error'] = false;
    $response['errorcode'] = 200;
    // Verify the userids are real
    foreach (array('peopleid', 'newpeopleid') as $var) {
        $p = new People();
        $p->UserID = ${$var};
        if (!$p->GetPerson() && ($var != 'newpeopleid' && ${$var} == 0)) {
            $response['error'] = true;
            $response['message'] = "{$var} is not valid";
            continue;
        }
    }
    // If we error above don't attempt to make changes
    if (!$response['error']) {
        $dev = new Device();
        $dev->PrimaryContact = $peopleid;
        foreach ($dev->Search() as $d) {
            $d->PrimaryContact = $newpeopleid;
            if (!$d->UpdateDevice()) {
                // If we encounter an error stop immediately
                $response['error'] = true;
                $response['message'] = __("Device update has failed");
开发者ID:mnibbelink,项目名称:openDCIM,代码行数:31,代码来源:index.php

示例2: PowerPanel

     $tooltip .= __($row["Label"]) . ": {$pan->PanelLabel}<br>\n";
     break;
 case "PanelVoltage":
     $pan = new PowerPanel();
     $pan->PanelID = $pdu->PanelID;
     $pan->GetPanel();
     $tooltip .= __($row["Label"]) . ": " . $pan->PanelVoltage . " / " . intval($pan->PanelVoltage / 1.73) . "<br>\n";
     break;
 case "PanelPole":
     $tooltip .= __($row["Label"]) . ": " . $pdu->GetAllBreakerPoles() . "<br>\n";
     break;
 case "PrimaryContact":
     $pc = new People();
     $pc->PersonID = $dev->PrimaryContact;
     if ($pc->PersonID > 0) {
         $pc->GetPerson();
         $tooltip .= __($row["Label"]) . ": " . $pc->LastName . ", " . $pc->FirstName . "<br>\n";
     } else {
         $tooltip .= __($row["Label"]) . ": " . __("Unassigned") . "<br>\n";
     }
     break;
 case "Weight":
     $dev->{$row}["Field"] = $dev->GetDeviceTotalWeight();
     goto end;
     // cringe now
 // cringe now
 case "NominalWatts":
     $dev->{$row}["Field"] = $dev->GetDeviceTotalPower();
     goto end;
     // fuck you, yeah I really did that
 // fuck you, yeah I really did that
开发者ID:ghasedak,项目名称:openDCIM,代码行数:31,代码来源:ajax_tooltip.php

示例3: elseif

             $outageStatus = __("Degraded");
         } elseif ($fsDiverse) {
             $outageStatus = __("Degraded/Fail-Safe");
         } else {
             $outageStatus = __("Normal");
         }
     }
 }
 if (!$skipNormal || $skipNormal && ($outageStatus == __("Down") || $outageStatus == __("Undocumented"))) {
     echo "<tr>\n";
     printf("<td>%s</td>\n", $cabRow->Location);
     printf("<td>%s</td>\n", $devRow->Label);
     printf("<td>%s</td>\n", $outageStatus);
     printf("<td>%s</td>\n", $devRow->Position);
     $tmpPerson->PersonID = $devRow->PrimaryContact;
     $tmpPerson->GetPerson();
     printf("<td>%s</td>\n", $tmpPerson->Email);
     $dept->DeptID = $devRow->Owner;
     $dept->GetDeptByID();
     printf("<td>%s</td>\n", $dept->Name);
     echo "</tr>\n";
 }
 if ($devRow->ChassisSlots > 0 || $devRow->RearChassisSlots > 0) {
     $kidList = $devRow->GetDeviceChildren();
     foreach ($kidList as $k) {
         $tmpPerson->PersonID = $devRow->PrimaryContact;
         $tmpPerson->GetPerson();
         echo "<tr>\n";
         printf("<td>%s</td>\n", $cabRow->Location);
         printf("<td>%s</td>\n", $k->Label);
         printf("<td>%s</td>\n", $outageStatus);
开发者ID:paragm,项目名称:openDCIM,代码行数:31,代码来源:report_outage_simulator.php

示例4: buildESXtable

function buildESXtable($DeviceID)
{
    $ESX = new ESX();
    $ESX->DeviceID = $DeviceID;
    $vmList = $ESX->GetDeviceInventory();
    print "\n<div class=\"table border\"><div><div>" . __("VM Name") . "</div><div>" . __("Status") . "</div><div>" . __("Owner") . "</div><div>" . __("Primary Contact") . "</div><div>" . __("Last Updated") . "</div></div>\n";
    foreach ($vmList as $vmRow) {
        $onOff = preg_match('/off/i', $vmRow->vmState) ? 'off' : 'on';
        $Dept = new Department();
        $Dept->DeptID = $vmRow->Owner;
        if ($Dept->DeptID > 0) {
            $Dept->GetDeptByID();
        } else {
            $Dept->Name = __("Unknown");
        }
        if ($vmRow->PrimaryContact > 0) {
            $con = new People();
            $con->PersonID = $vmRow->PrimaryContact;
            $con->GetPerson();
            $PCName = $con->LastName . ", " . $con->FirstName;
        } else {
            $PCName = __("Unknown");
        }
        print "<div><div>{$vmRow->vmName}</div><div class=\"{$onOff}\">{$vmRow->vmState}</div><div><a href=\"updatevmowner.php?vmindex={$vmRow->VMIndex}\">{$Dept->Name}</a></div><div><a href=\"updatevmowner.php?vmindex={$vmRow->VMIndex}\">{$PCName}</a></div><div>{$vmRow->LastUpdated}</div></div>\n";
    }
    echo '</div> <!-- END div.table -->';
}
开发者ID:ghasedak,项目名称:openDCIM,代码行数:27,代码来源:devices.php

示例5: Device

$dev = new Device();
$req = new RackRequest();
$contact = new People();
$tmpContact = new People();
$formfix = $error = '';
$contactList = $person->GetUserList();
//We only need to worry about sending email in the event this is a new submission and no other time.
if (isset($_POST["action"])) {
    if (isset($_REQUEST['requestid']) && $_REQUEST['requestid'] > 0) {
        $req->RequestID = $_REQUEST['requestid'];
        $req->GetRequest();
        $contact->PersonID = $req->RequestorID;
        $contact->GetPerson();
    }
    $tmpContact->PersonID = $_POST["requestorid"];
    $tmpContact->GetPerson();
    // If any port other than 25 is specified, assume encryption and authentication
    if ($config->ParameterArray['SMTPPort'] != 25) {
        $transport = Swift_SmtpTransport::newInstance()->setHost($config->ParameterArray['SMTPServer'])->setPort($config->ParameterArray['SMTPPort'])->setEncryption('ssl')->setUsername($config->ParameterArray['SMTPUser'])->setPassword($config->ParameterArray['SMTPPassword']);
    } else {
        $transport = Swift_SmtpTransport::newInstance()->setHost($config->ParameterArray['SMTPServer'])->setPort($config->ParameterArray['SMTPPort']);
    }
    $mailer = Swift_Mailer::newInstance($transport);
    $message = Swift_Message::NewInstance()->setSubject($config->ParameterArray['MailSubject']);
    // Set from address
    try {
        $message->setFrom($config->ParameterArray['MailFromAddr']);
    } catch (Swift_RfcComplianceException $e) {
        $error .= __("MailFrom") . ": <span class=\"errmsg\">" . $e->getMessage() . "</span><br>\n";
    }
    // Add rack requestor to the list of recipients
开发者ID:ghasedak,项目名称:openDCIM,代码行数:31,代码来源:rackrequest.php

示例6: array

 $pdf->SetFont($config->ParameterArray['PDFfont'], 'B', 16);
 $pdf->Cell(0, 15, __("Devices between {$start_year} and {$year} years old"), '', 1, 'C', 0);
 $pdf->SetFont($config->ParameterArray['PDFfont'], '', 10);
 $headerTags = array(__("Label"), __("Age"), __("Owner"), __("Primary Contact"));
 $cellWidths = array(45, 30, 50, 45);
 $maxval = count($headerTags);
 for ($col = 0; $col < $maxval; $col++) {
     $pdf->Cell($cellWidths[$col], 7, $headerTags[$col], 1, 0, 'C', 0);
 }
 $pdf->Ln();
 $fill = 1;
 foreach ($age_list[$year] as $devRow) {
     $dept->DeptID = $devRow->Owner;
     $dept->GetDeptByID();
     $con->PersonID = $devRow->PrimaryContact;
     $con->GetPerson();
     if ($devRow->MfgDate > "1970-01-01") {
         $date1 = new DateTime($devRow->MfgDate);
     } else {
         $date1 = new DateTime($devRow->InstallDate);
     }
     $date2 = new DateTime('now');
     $interval = $date1->diff($date2);
     $years = $interval->format('%y y %m m %d d');
     $cellHeight = 6;
     $pdf->Cell($cellWidths[0], $cellHeight, $devRow->Label, 1, 0, 'L', $fill);
     $pdf->Cell($cellWidths[1], $cellHeight, $years, 1, 0, 'L', $fill);
     $pdf->Cell($cellWidths[2], $cellHeight, $dept->Name, 1, 0, 'L', $fill);
     $pdf->Cell($cellWidths[3], $cellHeight, $con->FirstName . ' ' . $con->LastName, 1, 1, 'L', $fill);
     $fill = !$fill;
 }
开发者ID:sengkoil,项目名称:openDCIM,代码行数:31,代码来源:report_aging.php

示例7: header

<?php

require_once 'db.inc.php';
require_once 'facilities.inc.php';
$subversion = __("Data Center Contact Detail");
if (!$person->SiteAdmin) {
    header('Location: ' . redirect());
    exit;
}
$userRights = new People();
$status = "";
if (isset($_REQUEST['PersonID']) && strlen($_REQUEST['PersonID']) > 0) {
    $userRights->PersonID = $_REQUEST['PersonID'];
    $userRights->GetPerson();
}
if (isset($_POST['action']) && isset($_POST['UserID'])) {
    if (($_POST['action'] == 'Create' || $_POST['action'] == 'Update') && (isset($_POST['LastName']) && $_POST['LastName'] != null && $_POST['LastName'] != '')) {
        $userRights->UserID = $_POST['UserID'];
        $userRights->LastName = $_POST['LastName'];
        $userRights->FirstName = $_POST['FirstName'];
        $userRights->Phone1 = $_POST['Phone1'];
        $userRights->Phone2 = $_POST['Phone2'];
        $userRights->Phone3 = $_POST['Phone3'];
        $userRights->Email = $_POST['Email'];
        $userRights->AdminOwnDevices = isset($_POST['AdminOwnDevices']) ? 1 : 0;
        $userRights->ReadAccess = isset($_POST['ReadAccess']) ? 1 : 0;
        $userRights->WriteAccess = isset($_POST['WriteAccess']) ? 1 : 0;
        $userRights->DeleteAccess = isset($_POST['DeleteAccess']) ? 1 : 0;
        $userRights->ContactAdmin = isset($_POST['ContactAdmin']) ? 1 : 0;
        $userRights->RackRequest = isset($_POST['RackRequest']) ? 1 : 0;
        $userRights->RackAdmin = isset($_POST['RackAdmin']) ? 1 : 0;
开发者ID:ghasedak,项目名称:openDCIM,代码行数:31,代码来源:usermgr.php

示例8: array_obj_diff

require_once "db.inc.php";
require_once "facilities.inc.php";
if (!$person->ContactAdmin) {
    // No soup for you.
    header('Location: ' . redirect());
    exit;
}
// This page has no function without a valid dept id
if (!isset($_REQUEST['personid'])) {
    echo "How'd you get here without a referral?";
    exit;
}
$dept = new Department();
$person = new People();
$person->PersonID = isset($_POST['personid']) ? $_POST['personid'] : $_GET['personid'];
$person->GetPerson();
// Update if form was submitted and action is set
if (isset($_POST['action']) && $_POST['action'] == "Submit") {
    $grpMembers = $_POST['chosen'];
    $person->AssignDepartments($grpMembers);
}
$deptList = $person->GetDeptsByPerson();
$departmentList = $dept->GetDepartmentList();
$possibleList = array_obj_diff($departmentList, $deptList);
function array_obj_diff($array1, $array2)
{
    foreach ($array1 as $key => $value) {
        $array1[$key] = serialize($value);
    }
    foreach ($array2 as $key => $value) {
        $array2[$key] = serialize($value);
开发者ID:ghasedak,项目名称:openDCIM,代码行数:31,代码来源:people_depts.php


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