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


PHP client::get_id方法代码示例

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


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

示例1: client

    // Restrict non-admin users records
    if (!$current_user->have_role("admin")) {
        $_FORM["personID"] = $current_user->get_id();
    }
    $rows = invoice::get_list($_FORM);
    echo invoice::get_list_html($rows, $_FORM);
}
$client = new client();
$clientID = $_POST["clientID"] or $clientID = $_GET["clientID"];
if ($_POST["save"]) {
    if (!$_POST["clientName"]) {
        alloc_error("Please enter a Client Name.");
    }
    $client->read_globals();
    $client->set_value("clientModifiedTime", date("Y-m-d"));
    $clientID = $client->get_id();
    $client->set_values("client_");
    if (!$client->get_id()) {
        // New client.
        $client->set_value("clientCreatedTime", date("Y-m-d"));
        $new_client = true;
    }
    if (!$TPL["message"]) {
        $client->save();
        $clientID = $client->get_id();
        $client->set_values("client_");
    }
} else {
    if ($_POST["save_attachment"]) {
        move_attachment("client", $clientID);
        alloc_redirect($TPL["url_alloc_client"] . "clientID=" . $clientID . "&sbs_link=attachments");
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:client.php

示例2: array

     $TPL["parentTypeOptions"] = page::select_options($parent_types);
     include_template("templates/reminderSelectParentTypeM.tpl");
     break;
 case 2:
     // Which project,task,client. (skip for general)
     // get personID
     $personID = $current_user->get_id();
     $parent_names = array();
     $db = new db_alloc();
     if ($parentType == "client") {
         $query = "SELECT * FROM client WHERE clientStatus!='Archived' ORDER BY clientName";
         $db->query($query);
         while ($db->next_record()) {
             $client = new client();
             $client->read_db_record($db);
             $parent_names[$client->get_id()] = $client->get_value('clientName');
         }
     } else {
         if ($parentType == "project") {
             if ($current_user->have_role("admin")) {
                 $query = "SELECT * FROM project WHERE projectStatus != 'Archived' ORDER BY projectName";
             } else {
                 $query = prepare("SELECT * \n                          FROM project \n                     LEFT JOIN projectPerson ON project.projectID=projectPerson.projectID \n                         WHERE personID='%d' \n                           AND projectStatus != 'Archived'\n                      ORDER BY projectName", $personID);
             }
             $db->query($query);
             while ($db->next_record()) {
                 $project = new project();
                 $project->read_db_record($db);
                 $parent_names[$project->get_id()] = $project->get_value('projectName');
             }
         } else {
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:reminder.php

示例3: project

 function get_client_and_project_dropdowns_and_links($clientID = false, $projectID = false, $onlymine = false)
 {
     // This function returns dropdown lists and links for both client and
     // project. The two dropdown lists are linked, in that if you change the
     // client, then the project dropdown dynamically updates
     global $TPL;
     $project = new project();
     $project->set_id($projectID);
     $project->select();
     if (!$clientID) {
         $clientID = $project->get_value("clientID");
     }
     $client = new client();
     $client->set_id($clientID);
     $client->select();
     $options["clientStatus"] = "Current";
     $ops = client::get_list($options);
     $ops = array_kv($ops, "clientID", "clientName");
     $client->get_id() and $ops[$client->get_id()] = $client->get_value("clientName");
     $client_select = "<select id=\"clientID\" name=\"clientID\" onChange=\"makeAjaxRequest('" . $TPL["url_alloc_updateProjectListByClient"] . "clientID='+\$('#clientID').attr('value')+'&onlymine=" . sprintf("%d", $onlymine) . "','projectDropdown')\"><option></option>";
     $client_select .= page::select_options($ops, $clientID, 100) . "</select>";
     $client_link = $client->get_link();
     $project_select = '<div id="projectDropdown" style="display:inline">' . $project->get_dropdown_by_client($clientID, $onlymine) . '</div>';
     $project_link = $project->get_link();
     return array($client_select, $client_link, $project_select, $project_link);
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:26,代码来源:client.inc.php

示例4: singleton

 function populate_string($str, $entity, $entityID = false)
 {
     // Actually do the text substitution
     $current_user =& singleton("current_user");
     is_object($current_user) and $swap["cu"] = person::get_fullname($current_user->get_id());
     if ($entity == "timeSheet" && $entityID) {
         $timeSheet = new timeSheet();
         $timeSheet->set_id($entityID);
         $timeSheet->select();
         $timeSheet->load_pay_info();
         foreach ($timeSheet->pay_info as $k => $v) {
             $swap[$k] = $v;
         }
         if ($timeSheet->get_value("approvedByManagerPersonID")) {
             $swap["tm"] = person::get_fullname($timeSheet->get_value("approvedByManagerPersonID"));
         } else {
             $project = $timeSheet->get_foreign_object("project");
             $projectManagers = $project->get_timeSheetRecipients();
             if (is_array($projectManagers) && count($projectManagers)) {
                 $people =& get_cached_table("person");
                 foreach ($projectManagers as $pID) {
                     $swap["tm"] .= $commar . $people[$pID]["name"];
                     $commar = ", ";
                 }
             }
         }
         if ($timeSheet->get_value("approvedByAdminPersonID")) {
             $swap["tc"] = person::get_fullname($timeSheet->get_value("approvedByAdminPersonID"));
         } else {
             $people =& get_cached_table("person");
             $timeSheetAdministrators = config::get_config_item('defaultTimeSheetAdminList');
             if (count($timeSheetAdministrators)) {
                 $swap["tc"] = "";
                 $comma = "";
                 foreach ($timeSheetAdministrators as $adminID) {
                     $swap["tc"] .= $comma . $people[$adminID]["name"];
                     $comma = ", ";
                 }
             } else {
                 $swap["tc"] = 'no-one';
             }
         }
         $swap["ti"] = $timeSheet->get_id();
         $swap["to"] = person::get_fullname($timeSheet->get_value("personID"));
         $swap["ta"] = person::get_fullname($timeSheet->get_value("personID"));
         $swap["tf"] = $timeSheet->get_value("dateFrom");
         $swap["tt"] = $timeSheet->get_value("dateTo");
         $swap["ts"] = $timeSheet->get_timeSheet_status();
         $swap["tu"] = config::get_config_item("allocURL") . "time/timeSheet.php?timeSheetID=" . $timeSheet->get_id();
         $projectID = $timeSheet->get_value("projectID");
     }
     if ($entity == "task" && $entityID) {
         $task = new task();
         $task->set_id($entityID);
         $task->select();
         $swap["ti"] = $task->get_id();
         $swap["to"] = person::get_fullname($task->get_value("creatorID"));
         $swap["ta"] = person::get_fullname($task->get_value("personID"));
         $swap["tm"] = person::get_fullname($task->get_value("managerID"));
         $swap["tc"] = person::get_fullname($task->get_value("closerID"));
         $swap["tn"] = $task->get_value("taskName");
         $swap["td"] = $task->get_value("taskDescription");
         $swap["tu"] = config::get_config_item("allocURL") . "task/task.php?taskID=" . $task->get_id();
         $swap["tp"] = $task->get_priority_label();
         $swap["ts"] = $task->get_task_status("label");
         $swap["teb"] = $task->get_value("timeBest");
         $swap["tem"] = $task->get_value("timeExpected");
         $swap["tew"] = $task->get_value("timeWorst");
         $swap["tep"] = person::get_fullname($task->get_value("estimatorID"));
         //time estimate person, when it's implemented
         $projectID = $task->get_value("projectID");
     }
     if ($entity == "project" && $entityID || $projectID) {
         $project = new project();
         if ($projectID) {
             $project->set_id($projectID);
         } else {
             $project->set_id($entityID);
         }
         $project->select();
         $swap["pn"] = $project->get_value("projectName");
         $swap["pi"] = $project->get_id();
         $clientID = $project->get_value("clientID");
     }
     if ($entity == "client" && $entityID || $clientID) {
         $client = new client();
         if ($clientID) {
             $client->set_id($clientID);
         } else {
             $client->set_id($entityID);
         }
         $client->select();
         $swap["li"] = $client->get_id();
         $swap["cc"] = $client->get_value("clientName");
     }
     $swap["cd"] = config::get_config_item("companyContactAddress");
     $swap["cd"] .= " " . config::get_config_item("companyContactAddress2");
     $swap["cd"] .= " " . config::get_config_item("companyContactAddress3");
     $swap["cd"] .= "\nP: " . config::get_config_item("companyContactPhone");
     $swap["cd"] .= "\nF: " . config::get_config_item("companyContactFax");
//.........这里部分代码省略.........
开发者ID:cjbayliss,项目名称:alloc,代码行数:101,代码来源:commentTemplate.inc.php

示例5: unset

 }
 unset($comment_id, $cc_id);
 $client = new client();
 $client->set_value("clientName", $data[0]);
 $client->set_value("clientPhoneOne", $data[1]);
 $client->set_value("clientFaxOne", $data[2]);
 $client->set_value("clientStreetAddressOne", $data[3]);
 $client->set_value("clientSuburbOne", $data[4]);
 $client->set_value("clientStateOne", $data[5]);
 $client->set_value("clientPostcodeOne", $data[6]);
 $client->set_value("clientStreetAddressTwo", $data[7]);
 $client->set_value("clientSuburbTwo", $data[8]);
 $client->set_value("clientStatus", "current");
 $client->set_value("clientModifiedUser", $current_user->get_id());
 $client->save();
 if ($client->get_id()) {
     if (rtrim($data[9])) {
         $comment = new comment();
         $comment->set_value("commentMaster", "client");
         $comment->set_value("commentMasterID", $client->get_id());
         $comment->set_value("commentType", "client");
         $comment->set_value("commentLinkID", $client->get_id());
         $comment->set_value("comment", $data[9]);
         $comment->save();
         $comment_id = $comment->get_id();
     }
     if ($data[10] || $data[11]) {
         $cc = new clientContact();
         $cc->set_value("clientID", $client->get_id());
         $cc->set_value("primaryContact", 1);
         $cc->set_value("clientContactName", $data[10]);
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:csv_clients.php


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