本文整理汇总了PHP中project::set_id方法的典型用法代码示例。如果您正苦于以下问题:PHP project::set_id方法的具体用法?PHP project::set_id怎么用?PHP project::set_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类project
的用法示例。
在下文中一共展示了project::set_id方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: project
function is_owner($person = "")
{
$project = new project();
$project->set_id($this->get_value("projectID"));
$project->select();
return $project->is_owner($person);
}
示例2: get_list
public static function get_list($_FORM)
{
/*
*
* Get a list of task history items with sophisticated filtering and somewhat sophisticated output
*
* (n.b., the output from this generally needs to be post-processed to handle the semantic meaning of changes in various fields)
*
*/
$filter = audit::get_list_filter($_FORM);
if (is_array($filter) && count($filter)) {
$where_clause = " WHERE " . implode(" AND ", $filter);
}
if ($_FORM["projectID"]) {
$entity = new project();
$entity->set_id($_FORM["projectID"]);
$entity->select();
} else {
if ($_FORM["taskID"]) {
$entity = new task();
$entity->set_id($_FORM["taskID"]);
$entity->select();
}
}
$q = "SELECT *\n FROM audit\n {$where_clause}\n ORDER BY dateChanged";
$db = new db_alloc();
$db->query($q);
$items = array();
while ($row = $db->next_record()) {
$audit = new audit();
$audit->read_db_record($db);
$rows[] = $row;
}
return $rows;
}
示例3: project
function is_owner($person = "")
{
if (!$this->get_id()) {
return true;
} else {
$project = new project();
$project->set_id($this->get_value("projectID"));
$project->select();
return $project->is_owner($person);
}
}
示例4: show_all_exp
function show_all_exp($template)
{
global $TPL;
global $expenseForm;
global $db;
global $transaction_to_edit;
if ($expenseForm->get_id()) {
if ($_POST["transactionID"] && ($_POST["edit"] || is_object($transaction_to_edit) && $transaction_to_edit->get_id())) {
// if edit is clicked OR if we've rejected changes made to something so are still editing it
$query = prepare("SELECT * FROM transaction WHERE expenseFormID=%d AND transactionID<>%d ORDER BY transactionID DESC", $expenseForm->get_id(), $_POST["transactionID"]);
} else {
$query = prepare("SELECT * FROM transaction WHERE expenseFormID=%d ORDER BY transactionID DESC", $expenseForm->get_id());
}
$db->query($query);
while ($db->next_record()) {
$transaction = new transaction();
$transaction->read_db_record($db);
$transaction->set_values();
$transaction->get_value("quantity") and $TPL["amount"] = $transaction->get_value("amount") / $transaction->get_value("quantity");
$TPL["lineTotal"] = $TPL["amount"] * $transaction->get_value("quantity");
$tf = new tf();
$tf->set_id($transaction->get_value("fromTfID"));
$tf->select();
$TPL["fromTfIDLink"] = $tf->get_link();
$tf = new tf();
$tf->set_id($transaction->get_value("tfID"));
$tf->select();
$TPL["tfIDLink"] = $tf->get_link();
$projectID = $transaction->get_value("projectID");
if ($projectID) {
$project = new project();
$project->set_id($transaction->get_value("projectID"));
$project->select();
$TPL["projectName"] = $project->get_value("projectName");
}
if ($transaction->get_value("fromTfID") == config::get_config_item("expenseFormTfID")) {
$TPL['expense_class'] = "loud";
} else {
$TPL['expense_class'] = "";
}
include_template($template);
}
}
}
示例5: show_projects
function show_projects($template_name)
{
global $TPL;
global $default;
$_FORM = task::load_form_data($defaults);
$arr = task::load_task_filter($_FORM);
is_array($arr) and $TPL = array_merge($TPL, $arr);
if (is_array($_FORM["projectID"])) {
$projectIDs = $_FORM["projectID"];
foreach ($projectIDs as $projectID) {
$project = new project();
$project->set_id($projectID);
$project->select();
$_FORM["projectID"] = array($projectID);
$TPL["graphTitle"] = urlencode($project->get_value("projectName"));
$arr = task::load_task_filter($_FORM);
is_array($arr) and $TPL = array_merge($TPL, $arr);
include_template($template_name);
}
}
}
示例6: project
function translate_meta_tfID($tfID = "")
{
// The special -1 and -2 tfID's represent META TF, i.e. calculated at runtime
// -1 == META: Project TF
if ($tfID == -1) {
if ($this->get_value("projectID")) {
$project = new project();
$project->set_id($this->get_value("projectID"));
$project->select();
$tfID = $project->get_value("cost_centre_tfID");
}
if (!$tfID) {
alloc_error("Unable to use META: Project TF. Please ensure the project has a TF set, or adjust the transactions.");
}
// -2 == META: Salesperson TF
} else {
if ($tfID == -2) {
if ($this->get_value("personID")) {
$person = new person();
$person->set_id($this->get_value("personID"));
$person->select();
$tfID = $person->get_value("preferred_tfID");
if (!$tfID) {
alloc_error("Unable to use META: Salesperson TF. Please ensure the Saleperson has a Preferred Payment TF.");
}
} else {
alloc_error("Unable to use META: Salesperson TF. No product salesperson set.");
}
} else {
if ($tfID == -3) {
$tfID = $this->get_value("tfID");
$tfID or alloc_error("Unable to use META: Sale TF not set.");
}
}
}
return $tfID;
}
示例7: export_csv
function export_csv($projectID)
{
$project = new project();
$project->set_id($projectID);
$project->select();
$retstr = '"Task Name","Estimated Time","Assignee"';
// Export all tasks in the project
$taskOptions["projectIDs"] = array($project->get_id());
$taskOptions["return"] = "array";
$taskOptions["taskView"] = "byProject";
$tasks = task::get_list($taskOptions);
// Sort by taskID--we assume taskIDs were assigned linearly on import/creation--so as to produce an identical file
foreach ($tasks as $task) {
$taskIDs[] = $task['taskID'];
}
array_multisort($taskIDs, $tasks);
foreach ($tasks as $task) {
$assignee = new person();
$assignee->set_id($task['personID']);
$assignee->select();
$estimatedHours = $task['timeExpected'];
is_numeric($estimatedHours) or $estimatedHours = 0;
$retstr .= "\n" . export_escape_csv($task['taskName']) . ',' . export_escape_csv($estimatedHours) . ',' . export_escape_csv($assignee->get_name(array("format" => "nick")));
}
return $retstr;
}
示例8: project
function update_search_index_doc(&$index)
{
$p =& get_cached_table("person");
$creatorID = $this->get_value("creatorID");
$creator_field = $creatorID . " " . $p[$creatorID]["username"] . " " . $p[$creatorID]["name"];
$closerID = $this->get_value("closerID");
$closer_field = $closerID . " " . $p[$closerID]["username"] . " " . $p[$closerID]["name"];
$personID = $this->get_value("personID");
$person_field = $personID . " " . $p[$personID]["username"] . " " . $p[$personID]["name"];
$managerID = $this->get_value("managerID");
$manager_field = $managerID . " " . $p[$managerID]["username"] . " " . $p[$managerID]["name"];
$taskModifiedUser = $this->get_value("taskModifiedUser");
$taskModifiedUser_field = $taskModifiedUser . " " . $p[$taskModifiedUser]["username"] . " " . $p[$taskModifiedUser]["name"];
$status = $this->get_value("taskStatus");
if ($this->get_value("projectID")) {
$project = new project();
$project->set_id($this->get_value("projectID"));
$project->select();
$projectName = $project->get_name();
$projectShortName = $project->get_name(array("showShortProjectLink" => true));
$projectShortName && $projectShortName != $projectName and $projectName .= " " . $projectShortName;
}
$doc = new Zend_Search_Lucene_Document();
$doc->addField(Zend_Search_Lucene_Field::Keyword('id', $this->get_id()));
$doc->addField(Zend_Search_Lucene_Field::Text('name', $this->get_value("taskName"), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('project', $projectName, "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('pid', $this->get_value("projectID"), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('creator', $creator_field, "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('closer', $closer_field, "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('assignee', $person_field, "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('manager', $manager_field, "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('modifier', $taskModifiedUser_field, "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('desc', $this->get_value("taskDescription"), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('priority', $this->get_value("priority"), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('limit', $this->get_value("timeLimit"), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('best', $this->get_value("timeBest"), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('worst', $this->get_value("timeWorst"), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('expected', $this->get_value("timeExpected"), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('type', $this->get_value("taskTypeID"), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('status', $status, "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('dateCreated', str_replace("-", "", $this->get_value("dateCreated")), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('dateAssigned', str_replace("-", "", $this->get_value("dateAssigned")), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('dateClosed', str_replace("-", "", $this->get_value("dateClosed")), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('dateTargetStart', str_replace("-", "", $this->get_value("dateTargetStart")), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('dateTargetCompletion', str_replace("-", "", $this->get_value("dateTargetCompletion")), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('dateStart', str_replace("-", "", $this->get_value("dateActualStart")), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('dateCompletion', str_replace("-", "", $this->get_value("dateActualCompletion")), "utf-8"));
$index->addDocument($doc);
}
示例9: array
$el = array("date" => $row['dateChanged']);
//overwrite the new data (taskStatus, personID) with the correct (historical) data
if ($trace[$row['taskID']]) {
$row = array_merge($row, $trace[$row['taskID']]);
}
if (!$row['personID']) {
$name = "Unassigned";
} else {
$name = $people[$row['personID']]['username'];
}
if ($row['field'] != "taskStatus" || array_search($row['taskStatus'], $status_types) !== FALSE) {
$taskName = escape_xml($row['taskName']);
$project = null;
if ($show_project) {
$project = new project();
$project->set_id($row['projectID']);
$project->select();
}
if ($summary) {
if ($show_project) {
$projectName = $project->get_value('projectShortName');
}
$el['desc'] = sprintf('%s: %d %s "%s" %s', $name, $row['taskID'], $projectName, $taskName, $row['taskStatus']);
} else {
if ($show_project) {
$projectName = "(" . $project->get_value("projectName") . ")";
}
if ($row['field'] == "taskStatus") {
$el['desc'] = sprintf('Task #%d "%s" %s status changed to %s', $row['taskID'], $taskName, $projectName, $row['taskStatus']);
} else {
if ($row['field'] == "personID") {
示例10: project
function update_search_index_doc(&$index)
{
$p =& get_cached_table("person");
$personID = $this->get_value("personID");
$person_field = $personID . " " . $p[$personID]["username"] . " " . $p[$personID]["name"];
$managerID = $this->get_value("approvedByManagerPersonID");
$manager_field = $managerID . " " . $p[$managerID]["username"] . " " . $p[$managerID]["name"];
$adminID = $this->get_value("approvedByAdminPersonID");
$admin_field = $adminID . " " . $p[$adminID]["username"] . " " . $p[$adminID]["name"];
$tf_field = $this->get_value("recipient_tfID") . " " . tf::get_name($this->get_value("recipient_tfID"));
if ($this->get_value("projectID")) {
$project = new project();
$project->set_id($this->get_value("projectID"));
$project->select();
$projectName = $project->get_name();
$projectShortName = $project->get_name(array("showShortProjectLink" => true));
$projectShortName && $projectShortName != $projectName and $projectName .= " " . $projectShortName;
}
$q = prepare("SELECT dateTimeSheetItem, taskID, description, comment, commentPrivate \n FROM timeSheetItem \n WHERE timeSheetID = %d \n ORDER BY dateTimeSheetItem ASC", $this->get_id());
$db = new db_alloc();
$db->query($q);
while ($r = $db->row()) {
$desc .= $br . $r["dateTimeSheetItem"] . " " . $r["taskID"] . " " . $r["description"] . "\n";
$r["comment"] && $r["commentPrivate"] or $desc .= $r["comment"] . "\n";
$br = "\n";
}
$doc = new Zend_Search_Lucene_Document();
$doc->addField(Zend_Search_Lucene_Field::Keyword('id', $this->get_id()));
$doc->addField(Zend_Search_Lucene_Field::Text('project', $projectName, "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('pid', $this->get_value("projectID"), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('creator', $person_field, "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('desc', $desc, "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('status', $this->get_value("status"), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('tf', $tf_field, "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('manager', $manager_field, "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('admin', $admin_field, "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('dateManager', str_replace("-", "", $this->get_value("dateSubmittedToManager")), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('dateAdmin', str_replace("-", "", $this->get_value("dateSubmittedToAdmin")), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('dateFrom', str_replace("-", "", $this->get_value("dateFrom")), "utf-8"));
$doc->addField(Zend_Search_Lucene_Field::Text('dateTo', str_replace("-", "", $this->get_value("dateTo")), "utf-8"));
$index->addDocument($doc);
}
示例11: 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");
//.........这里部分代码省略.........
示例12: project
alloc_redirect($TPL["url_alloc_project"] . "projectID=" . $project->get_id());
}
} else {
if ($_POST["delete"]) {
$project->read_globals();
$project->delete();
alloc_redirect($TPL["url_alloc_projectList"]);
// If they are creating a new project that is based on an existing one
} else {
if ($_POST["copy_project_save"] && $_POST["copy_projectID"] && $_POST["copy_project_name"]) {
$p = new project();
$p->set_id($_POST["copy_projectID"]);
if ($p->select()) {
$p2 = new project();
$p2->read_row_record($p->row());
$p2->set_id("");
$p2->set_value("projectName", $_POST["copy_project_name"]);
$p2->set_value("projectShortName", "");
$p2->save();
$TPL["message_good"][] = "Project details copied successfully.";
// Copy project people
$q = prepare("SELECT * FROM projectPerson WHERE projectID = %d", $p->get_id());
$db = new db_alloc();
$db->query($q);
while ($row = $db->row()) {
$projectPerson = new projectPerson();
$projectPerson->currency = $p->get_value("currencyTypeID");
$projectPerson->read_row_record($row);
$projectPerson->set_id("");
$projectPerson->set_value("projectID", $p2->get_id());
$projectPerson->save();
示例13: project
function is_alive()
{
$type = $this->get_value('reminderType');
if ($type == "project") {
$project = new project();
$project->set_id($this->get_value('reminderLinkID'));
if ($project->select() == false || $project->get_value('projectStatus') == "Archived") {
return false;
}
} else {
if ($type == "task") {
$task = new task();
$task->set_id($this->get_value('reminderLinkID'));
if ($task->select() == false || substr($task->get_value("taskStatus"), 0, 6) == 'closed') {
return false;
}
} else {
if ($type == "client") {
$client = new client();
$client->set_id($this->get_value('reminderLinkID'));
if ($client->select() == false || $client->get_value('clientStatus') == "Archived") {
return false;
}
}
}
}
return true;
}
示例14: usleep
/*
* Copyright (C) 2006-2011 Alex Lance, Clancy Malcolm, Cyber IT Solutions
* Pty. Ltd.
*
* This file is part of the allocPSA application <info@cyber.com.au>.
*
* allocPSA is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* allocPSA is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with allocPSA. If not, see <http://www.gnu.org/licenses/>.
*/
define("NO_REDIRECT", 1);
require_once "../alloc.php";
if ($_GET["projectID"]) {
usleep(300000);
$project = new project();
$project->set_id($_GET["projectID"]);
$project->select();
$tf_sel = $project->get_value("cost_centre_tfID") or $tf_sel = config::get_config_item("mainTfID");
$tf = new tf();
$options = page::select_options($tf->get_assoc_array("tfID", "tfName"), $tf_sel);
echo "<select id=\"tfID\" name=\"tfID\">" . $options . "</select>";
}
示例15: timeSheet
function get_printable_timeSheet_file($timeSheetID, $timeSheetPrintMode, $printDesc, $format)
{
global $TPL;
$TPL["timeSheetID"] = $timeSheetID;
$TPL["timeSheetPrintMode"] = $timeSheetPrintMode;
$TPL["printDesc"] = $printDesc;
$TPL["format"] = $format;
$db = new db_alloc();
if ($timeSheetID) {
$timeSheet = new timeSheet();
$timeSheet->set_id($timeSheetID);
$timeSheet->select();
$timeSheet->set_tpl_values();
$person = $timeSheet->get_foreign_object("person");
$TPL["timeSheet_personName"] = $person->get_name();
$timeSheet->set_tpl_values("timeSheet_");
// Display the project name.
$project = new project();
$project->set_id($timeSheet->get_value("projectID"));
$project->select();
$TPL["timeSheet_projectName"] = $project->get_value("projectName", DST_HTML_DISPLAY);
// Get client name
$client = $project->get_foreign_object("client");
$client->set_tpl_values();
$TPL["clientName"] = $client->get_value("clientName", DST_HTML_DISPLAY);
$TPL["companyName"] = config::get_config_item("companyName");
$TPL["companyNos1"] = config::get_config_item("companyACN");
$TPL["companyNos2"] = config::get_config_item("companyABN");
unset($br);
$phone = config::get_config_item("companyContactPhone");
$fax = config::get_config_item("companyContactFax");
$phone and $TPL["phone"] = "Ph: " . $phone;
$fax and $TPL["fax"] = "Fax: " . $fax;
$timeSheet->load_pay_info();
$db->query(prepare("SELECT max(dateTimeSheetItem) AS maxDate\n ,min(dateTimeSheetItem) AS minDate\n ,count(timeSheetItemID) as count\n FROM timeSheetItem \n WHERE timeSheetID=%d ", $timeSheetID));
$db->next_record();
$timeSheet->set_id($timeSheetID);
$timeSheet->select() || alloc_error("Unable to select time sheet, trying to use id: " . $timeSheetID);
$TPL["period"] = format_date(DATE_FORMAT, $db->f("minDate")) . " to " . format_date(DATE_FORMAT, $db->f("maxDate"));
$TPL["img"] = config::get_config_item("companyImage");
$TPL["companyContactAddress"] = config::get_config_item("companyContactAddress");
$TPL["companyContactAddress2"] = config::get_config_item("companyContactAddress2");
$TPL["companyContactAddress3"] = config::get_config_item("companyContactAddress3");
$email = config::get_config_item("companyContactEmail");
$email and $TPL["companyContactEmail"] = "Email: " . $email;
$web = config::get_config_item("companyContactHomePage");
$web and $TPL["companyContactHomePage"] = "Web: " . $web;
$TPL["footer"] = config::get_config_item("timeSheetPrintFooter");
$TPL["taxName"] = config::get_config_item("taxName");
$default_header = "Time Sheet";
$default_id_label = "Time Sheet ID";
$default_contractor_label = "Contractor";
$default_total_label = "TOTAL AMOUNT PAYABLE";
if ($timeSheetPrintMode == "money") {
$default_header = "Tax Invoice";
$default_id_label = "Invoice Number";
}
if ($timeSheetPrintMode == "estimate") {
$default_header = "Estimate";
$default_id_label = "Estimate Number";
$default_contractor_label = "Issued By";
$default_total_label = "TOTAL AMOUNT ESTIMATED";
}
if ($format != "html") {
// Build PDF document
$font1 = ALLOC_MOD_DIR . "util/fonts/Helvetica.afm";
$font2 = ALLOC_MOD_DIR . "util/fonts/Helvetica-Oblique.afm";
$pdf_table_options = array("showLines" => 0, "shaded" => 0, "showHeadings" => 0, "xPos" => "left", "xOrientation" => "right", "fontSize" => 10, "rowGap" => 0, "fontSize" => 10);
$cols = array("one" => "", "two" => "", "three" => "", "four" => "");
$cols3 = array("one" => "", "two" => "");
$cols_settings["one"] = array("justification" => "right");
$cols_settings["three"] = array("justification" => "right");
$pdf_table_options2 = array("showLines" => 0, "shaded" => 0, "showHeadings" => 0, "width" => 400, "fontSize" => 10, "xPos" => "center", "xOrientation" => "center", "cols" => $cols_settings);
$cols_settings2["gst"] = array("justification" => "right");
$cols_settings2["money"] = array("justification" => "right");
$pdf_table_options3 = array("showLines" => 2, "shaded" => 0, "width" => 400, "xPos" => "center", "fontSize" => 10, "cols" => $cols_settings2, "lineCol" => array(0.8, 0.8, 0.8), "splitRows" => 1, "protectRows" => 0);
$cols_settings["two"] = array("justification" => "right", "width" => 80);
$pdf_table_options4 = array("showLines" => 2, "shaded" => 0, "width" => 400, "showHeadings" => 0, "fontSize" => 10, "xPos" => "center", "cols" => $cols_settings, "lineCol" => array(0.8, 0.8, 0.8));
$pdf = new Cezpdf();
$pdf->ezSetMargins(90, 90, 90, 90);
$pdf->selectFont($font1);
$pdf->ezStartPageNumbers(436, 80, 10, 'right', 'Page {PAGENUM} of {TOTALPAGENUM}');
$pdf->ezStartPageNumbers(200, 80, 10, 'left', '<b>' . $default_id_label . ': </b>' . $TPL["timeSheetID"]);
$pdf->ezSetY(775);
$TPL["companyName"] and $contact_info[] = array($TPL["companyName"]);
$TPL["companyContactAddress"] and $contact_info[] = array($TPL["companyContactAddress"]);
$TPL["companyContactAddress2"] and $contact_info[] = array($TPL["companyContactAddress2"]);
$TPL["companyContactAddress3"] and $contact_info[] = array($TPL["companyContactAddress3"]);
$TPL["companyContactEmail"] and $contact_info[] = array($TPL["companyContactEmail"]);
$TPL["companyContactHomePage"] and $contact_info[] = array($TPL["companyContactHomePage"]);
$TPL["phone"] and $contact_info[] = array($TPL["phone"]);
$TPL["fax"] and $contact_info[] = array($TPL["fax"]);
$pdf->selectFont($font2);
$y = $pdf->ezTable($contact_info, false, "", $pdf_table_options);
$pdf->selectFont($font1);
$line_y = $y - 10;
$pdf->setLineStyle(1, "round");
$pdf->line(90, $line_y, 510, $line_y);
$pdf->ezSetY(782);
$image_jpg = ALLOC_LOGO;
//.........这里部分代码省略.........