本文整理汇总了PHP中findchilddept函数的典型用法代码示例。如果您正苦于以下问题:PHP findchilddept函数的具体用法?PHP findchilddept怎么用?PHP findchilddept使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了findchilddept函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: findchilddept
function findchilddept(&$tarr, $parent, $level = 0)
{
$level = $level + 1;
$n = count($tarr);
for ($x = 0; $x < $n; $x++) {
if ($tarr[$x]["dept_parent"] == $parent && $tarr[$x]["dept_parent"] != $tarr[$x]["dept_id"]) {
showchilddept($tarr[$x], $level);
findchilddept($tarr, $tarr[$x]["dept_id"], $level);
}
}
}
开发者ID:Esleelkartea,项目名称:gestion-de-primeras-muestras,代码行数:11,代码来源:vw_depts.php
示例2: projects_list_data
//.........这里部分代码省略.........
$q->addWhere('p.project_status = ' . $project_status);
}
if (isset($department)) {
$q->addJoin('project_departments', 'pd', 'pd.project_id = p.project_id');
if (!$addPwOiD) {
$q->addWhere('pd.department_id in (' . implode(',', $dept_ids) . ')');
} else {
// Show Projects where the Project Owner is in the given department
$q->addWhere('p.project_owner IN (' . (!empty($owner_ids) ? implode(',', $owner_ids) : 0) . ')');
}
} else {
if ($company_id && !$addPwOiD) {
$q->addWhere('p.project_company = ' . $company_id);
}
}
if ($projectTypeId > -1) {
$q->addWhere('p.project_type = ' . $projectTypeId);
}
if ($user_id && $addProjectsWithAssignedTasks) {
$q->addWhere('(tu.user_id = ' . $user_id . ' OR p.project_owner = ' . $user_id . ')');
} else {
if ($user_id) {
$q->addWhere('p.project_owner = ' . $user_id);
}
}
if ($owner > 0) {
$q->addWhere('p.project_owner = ' . $owner);
}
$q->addGroup('p.project_id');
$q->addOrder($orderby . ' ' . $orderdir);
$obj_project->setAllowedSQL($AppUI->user_id, $q, null, 'p');
$projects = $q->loadList();
// retrieve list of records
// modified for speed
// by Pablo Roca ([email protected])
// 16 August 2003
// get the list of permitted companies
$obj_company = new CCompany();
$companies = $obj_company->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name');
if (count($companies) == 0) {
$companies = array(0);
}
// get the list of permitted companies
$companies = arrayMerge(array('0' => $AppUI->_('All')), $companies);
//get list of all departments, filtered by the list of permitted companies.
$q->clear();
$q->addTable('companies', 'c');
$q->addQuery('c.company_id, c.company_name, dep.*');
$q->addJoin('departments', 'dep', 'c.company_id = dep.dept_company');
$q->addJoin('projects', 'p', 'p.project_company = c.company_id');
$q->addWhere('p.project_status NOT IN (1, 4, 5, 6, 7)');
$q->addOrder('c.company_name, dep.dept_parent, dep.dept_name');
$obj_company->setAllowedSQL($AppUI->user_id, $q);
$active_companies = $q->loadList();
$q->clear();
$q->addTable('companies', 'c');
$q->addQuery('c.company_id, c.company_name, dep.*');
$q->addJoin('departments', 'dep', 'c.company_id = dep.dept_company');
$q->addJoin('projects', 'p', 'p.project_company = c.company_id');
$q->addOrder('c.company_name, dep.dept_parent, dep.dept_name');
$obj_company->setAllowedSQL($AppUI->user_id, $q);
$all_companies = $q->loadList();
//display the select list
$cBuffer = '<select name="department" onchange="javascript:document.pickCompany.submit()" class="text">';
$cBuffer .= '<option value="company_0" style="font-weight:bold;">' . $AppUI->_('All') . '</option>' . "\n";
$company = '';
$active_company_ids = array();
// Active companies first
$cBuffer .= '<optgroup label="Active">';
foreach ($active_companies as $row) {
if ($row['dept_parent'] == 0) {
if ($company != $row['company_id']) {
$cBuffer .= '<option value="' . $AppUI->___($company_prefix . $row['company_id']) . '" style="font-weight:bold;"' . ($company_id == $row['company_id'] ? 'selected="selected"' : '') . '>' . $AppUI->___($row['company_name']) . '</option>' . "\n";
$company = $row['company_id'];
$active_company_ids[] = $company;
}
if ($row['dept_parent'] != null) {
showchilddept($row);
findchilddept($rows, $row['dept_id']);
}
}
}
$cBuffer .= '</optgroup>';
// Inactive companies
$cBuffer .= '<optgroup label="Inactive">';
foreach ($all_companies as $row) {
if ($row['dept_parent'] == 0 and !in_array($row['company_id'], $active_company_ids)) {
if ($company != $row['company_id']) {
$cBuffer .= '<option value="' . $AppUI->___($company_prefix . $row['company_id']) . '" style="font-weight:bold;"' . ($company_id == $row['company_id'] ? 'selected="selected"' : '') . '>' . $AppUI->___($row['company_name']) . '</option>' . "\n";
$company = $row['company_id'];
}
if ($row['dept_parent'] != null) {
showchilddept($row);
findchilddept($rows, $row['dept_id']);
}
}
}
$cBuffer .= '</optgroup>';
$cBuffer .= '</select>';
}
开发者ID:srinivasulurao,项目名称:jonel,代码行数:101,代码来源:projects.class.php
示例3: foreach
$q->addJoin('departments', 'dep', 'c.company_id = dep.dept_company');
$q->addOrder('c.company_name, dep.dept_parent, dep.dept_name');
$rows = $q->loadList();
//display the select list
$cBuffer = '<select name="department" onChange="document.companyFilter.submit()" class="text">';
$cBuffer .= '<option value="' . $company_prefix . '0" style="font-weight:bold;">' . $AppUI->_('All') . '</option>' . "\n";
$company = '';
foreach ($rows as $row) {
if ($row['dept_parent'] == 0) {
if ($company != $row['company_id']) {
$cBuffer .= '<option value="' . $AppUI->___($company_prefix . $row['company_id']) . '" style="font-weight:bold;"' . ($company_id == $row['company_id'] ? 'selected="selected"' : '') . '>' . $AppUI->___($row['company_name']) . '</option>' . "\n";
$company = $row['company_id'];
}
if ($row['dept_parent'] != null) {
showchilddept($row);
findchilddept($rows, $row['dept_id']);
}
}
}
$cBuffer .= '</select>';
$titleBlock->addCell('<form action="?m=tasks" method="post" name="companyFilter">' . "\n" . $cBuffer . "\n" . '</form>' . "\n");
$titleBlock->addCell();
if ($canEdit && $project_id) {
$titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new task') . '">', '', '<form action="?m=tasks&a=addedit&task_project=' . $project_id . '" method="post">', '</form>');
}
$titleBlock->show();
if (dPgetParam($_GET, 'inactive', '') == 'toggle') {
$AppUI->setState('inactive', $AppUI->getState('inactive') == -1 ? 0 : -1);
}
$in = $AppUI->getState('inactive') == -1 ? '' : 'in';
// use a new title block (a new row) to prevent from oversized sites
开发者ID:hightechcompany,项目名称:dotproject,代码行数:31,代码来源:index.php
示例4: projects_list_data
//.........这里部分代码省略.........
$q->addTable('departments');
$q->addQuery('dept_id, dept_parent');
$q->addOrder('dept_parent,dept_name');
$rows = $q->loadList();
addDeptId($rows, $department);
$dept_ids[] = isset($department->dept_id) ? $department->dept_id : 0;
$dept_ids[] = $department > 0 ? $department : 0;
}
$q->clear();
// retrieve list of records
// modified for speed
// by Pablo Roca ([email protected])
// 16 August 2003
// get the list of permitted companies
$obj = new CCompany();
$companies = $obj->getAllowedRecords($AppUI->user_id, 'companies.company_id,companies.company_name', 'companies.company_name');
if (count($companies) == 0) {
$companies = array();
}
$q->addTable('projects', 'pr');
$q->addQuery('pr.project_id, project_status, project_color_identifier,
project_type, project_name, project_description, project_scheduled_hours as project_duration,
project_parent, project_original_parent, project_percent_complete,
project_color_identifier, project_company,
company_name, project_status, project_last_task as critical_task,
tp.task_log_problem, user_username, project_active');
$fields = w2p_Core_Module::getSettings('projects', 'index_list');
unset($fields['department_list']);
// added as an alias below
foreach ($fields as $field => $text) {
$q->addQuery($field);
}
$q->addQuery('CONCAT(ct.contact_first_name, \' \', ct.contact_last_name) AS owner_name');
$q->addJoin('users', 'u', 'pr.project_owner = u.user_id');
$q->addJoin('contacts', 'ct', 'ct.contact_id = u.user_contact');
$q->addJoin('tasks_problems', 'tp', 'pr.project_id = tp.task_project');
if ($addProjectsWithAssignedTasks) {
$q->addJoin('tasks_users', 'tu', 'pr.project_id = tu.task_project');
}
if (!isset($department) && $company_id && !$addPwOiD) {
$q->addWhere('pr.project_company = ' . (int) $company_id);
}
if ($project_type > -1) {
$q->addWhere('pr.project_type = ' . (int) $project_type);
}
if (isset($department) && !$addPwOiD) {
$q->addWhere('project_departments.department_id in ( ' . implode(',', $dept_ids) . ' )');
}
if ($user_id && $addProjectsWithAssignedTasks) {
$q->addWhere('(tu.user_id = ' . (int) $user_id . ' OR pr.project_owner = ' . (int) $user_id . ' )');
} elseif ($user_id) {
$q->addWhere('pr.project_owner = ' . (int) $user_id);
}
if ($owner > 0) {
$q->addWhere('pr.project_owner = ' . (int) $owner);
}
if (mb_trim($search_text)) {
$q->addWhere('pr.project_name LIKE \'%' . $search_text . '%\' OR pr.project_description LIKE \'%' . $search_text . '%\'');
}
// Show Projects where the Project Owner is in the given department
if ($addPwOiD && !empty($owner_ids)) {
$q->addWhere('pr.project_owner IN (' . implode(',', $owner_ids) . ')');
}
$orderby = 'project_company' == $orderby ? 'company_name' : $orderby;
$q->addGroup('pr.project_id');
$q->addOrder($orderby . ' ' . $orderdir);
$prj = new CProject();
$prj->setAllowedSQL($AppUI->user_id, $q, null, 'pr');
$dpt = new CDepartment();
$projects = $q->loadList();
// get the list of permitted companies
$companies = arrayMerge(array('0' => $AppUI->_('All')), $companies);
$company_array = $companies;
//get list of all departments, filtered by the list of permitted companies.
$q->clear();
$q->addTable('companies');
$q->addQuery('company_id, company_name, dep.*');
$q->addJoin('departments', 'dep', 'companies.company_id = dep.dept_company');
$q->addOrder('company_name,dept_parent,dept_name');
$obj->setAllowedSQL($AppUI->user_id, $q);
$dpt->setAllowedSQL($AppUI->user_id, $q);
$rows = $q->loadList();
//display the select list
$buffer = '<select name="department" id="department" onChange="document.pickCompany.submit()" class="text" style="width: 200px;">';
$company = '';
foreach ($company_array as $key => $c_name) {
$buffer .= '<option value="' . $company_prefix . $key . '" style="font-weight:bold;"' . ($company_id == $key ? 'selected="selected"' : '') . '>' . $c_name . '</option>' . "\n";
foreach ($rows as $row) {
if ($row['dept_parent'] == 0) {
if ($key == $row['company_id']) {
if ($row['dept_parent'] != null) {
findchilddept($rows, $row['dept_id']);
}
}
}
}
}
$buffer .= '</select>';
return $projects;
}
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:101,代码来源:cleanup_functions.php
示例5: projects_list_data
//.........这里部分代码省略.........
if ($addPwOiD && isset($department)) {
$owner_ids = array();
$q->addTable('users');
$q->addQuery('user_id');
$q->addJoin('contacts', 'c', 'c.contact_id = user_contact');
$q->addWhere('c.contact_department = ' . $department);
$owner_ids = $q->loadColumn();
$q->clear();
}
if (isset($department)) {
//If a department is specified, we want to display projects from the department, and all departments under that, so we need to build that list of departments
$dept_ids = array();
$q->addTable('departments');
$q->addQuery('dept_id, dept_parent');
$q->addOrder('dept_parent,dept_name');
$rows = $q->loadList();
addDeptId($rows, $department);
$dept_ids[] = $department;
}
$q->clear();
// retrieve list of records
// modified for speed
// by Pablo Roca ([email protected])
// 16 August 2003
// get the list of permitted companies
$obj = new CCompany();
$companies = $obj->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name');
if (count($companies) == 0) {
$companies = array(0);
}
$q->addTable('projects');
$q->addQuery('projects.project_id, project_status, project_color_identifier, project_name, project_description, project_duration,
project_start_date, project_end_date, project_color_identifier, project_company, company_name, company_description, project_status,
project_priority, tc.critical_task, tc.project_actual_end_date, tp.task_log_problem, tt.total_tasks, tsy.my_tasks,
ts.project_percent_complete, user_username');
$q->addJoin('companies', 'com', 'projects.project_company = company_id');
$q->addJoin('users', 'u', 'projects.project_owner = u.user_id');
$q->addJoin('tasks_critical', 'tc', 'projects.project_id = tc.task_project');
$q->addJoin('tasks_problems', 'tp', 'projects.project_id = tp.task_project');
$q->addJoin('tasks_sum', 'ts', 'projects.project_id = ts.task_project');
$q->addJoin('tasks_total', 'tt', 'projects.project_id = tt.task_project');
$q->addJoin('tasks_summy', 'tsy', 'projects.project_id = tsy.task_project');
if ($addProjectsWithAssignedTasks) {
$q->addJoin('tasks_users', 'tu', 'projects.project_id = tu.task_project');
}
// DO we have to include the above DENY WHERE restriction, too?
//$q->addJoin('', '', '');
if (isset($department)) {
$q->addJoin('project_departments', 'pd', 'pd.project_id = projects.project_id');
}
if (!isset($department) && $company_id && !$addPwOiD) {
$q->addWhere("projects.project_company = '{$company_id}'");
}
if (isset($department) && !$addPwOiD) {
$q->addWhere("pd.department_id in ( " . implode(',', $dept_ids) . " )");
}
if ($user_id && $addProjectsWithAssignedTasks) {
$q->addWhere('(tu.user_id = ' . $user_id . ' OR projects.project_owner = ' . $user_id . ' )');
} elseif ($user_id) {
$q->addWhere('projects.project_owner = ' . $user_id);
}
if ($owner > 0) {
$q->addWhere('projects.project_owner = ' . $owner);
}
// Show Projects where the Project Owner is in the given department
if ($addPwOiD && !empty($owner_ids)) {
$q->addWhere('projects.project_owner IN (' . implode(',', $owner_ids) . ')');
}
$q->addGroup('projects.project_id');
$q->addOrder("{$orderby} {$orderdir}");
$obj->setAllowedSQL($AppUI->user_id, $q);
$projects = $q->loadList();
// get the list of permitted companies
$companies = arrayMerge(array('0' => $AppUI->_('All')), $companies);
//get list of all departments, filtered by the list of permitted companies.
$q->clear();
$q->addTable('companies');
$q->addQuery('company_id, company_name, dep.*');
$q->addJoin('departments', 'dep', 'companies.company_id = dep.dept_company');
$q->addOrder('company_name,dept_parent,dept_name');
$obj->setAllowedSQL($AppUI->user_id, $q);
$rows = $q->loadList();
//display the select list
$buffer = '<select name="department" onChange="document.pickCompany.submit()" class="text">';
$buffer .= '<option value="company_0" style="font-weight:bold;">' . $AppUI->_('All') . '</option>' . "\n";
$company = '';
foreach ($rows as $row) {
if ($row["dept_parent"] == 0) {
if ($company != $row['company_id']) {
$buffer .= '<option value="' . $company_prefix . $row['company_id'] . '" style="font-weight:bold;"' . ($company_id == $row['company_id'] ? 'selected="selected"' : '') . '>' . $row['company_name'] . '</option>' . "\n";
$company = $row['company_id'];
}
if ($row["dept_parent"] != null) {
showchilddept($row);
findchilddept($rows, $row["dept_id"]);
}
}
}
$buffer .= '</select>';
}
开发者ID:seatecnologia,项目名称:dotproject_timesheet,代码行数:101,代码来源:projects.class.php
示例6: array
?>
<th nowrap="nowrap">
<a href="?m=departments&orderby=<?php
echo $fieldList[$index];
?>
" class="hdr">
<?php
echo $AppUI->_($fieldNames[$index]);
?>
</a>
</th><?php
}
?>
</tr>
<?php
if (count($deptList) > 0) {
$displayList = array();
foreach ($deptList as $dept) {
if ($dept['dept_parent'] == 0) {
findchilddept($deptList, $dept['dept_id']);
}
echo '<tr><td>' . (mb_trim($dept['dept_desc']) ? w2PtoolTip($dept['dept_name'], $dept['dept_desc']) : '') . '<a href="./index.php?m=departments&a=view&dept_id=' . $dept['dept_id'] . '" >' . $dept['dept_name'] . '</a>' . (mb_trim($dept['dept_desc']) ? w2PendTip() : '') . '</td>';
echo '<td width="125" align="right" nowrap="nowrap">' . $dept['countp'] . '</td>';
echo '<td width="125" align="right" nowrap="nowrap">' . $dept['inactive'] . '</td>';
echo '<td align="left" nowrap="nowrap">' . $AppUI->_($types[$dept['dept_type']]) . '</td></tr>';
}
} else {
echo '<tr><td colspan="4">' . $AppUI->_('No data available') . '</td></tr>';
}
?>
</table>
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:vw_depts.php
示例7: projects_list_data
//.........这里部分代码省略.........
$owner_ids = $q->loadColumn();
$q->clear();
}
if (isset($department)) {
//If a department is specified, we want to display projects from the department, and all departments under that, so we need to build that list of departments
$dept_ids = array();
$q->addTable('departments');
$q->addQuery('dept_id, dept_parent');
$q->addOrder('dept_parent,dept_name');
$rows = $q->loadList();
addDeptId($rows, $department);
$dept_ids[] = isset($department->dept_id) ? $department->dept_id : 0;
$dept_ids[] = $department > 0 ? $department : 0;
}
$q->clear();
// retrieve list of records
// modified for speed
// by Pablo Roca ([email protected])
// 16 August 2003
// get the list of permitted companies
$obj = new CCompany();
$companies = $obj->getAllowedRecords($AppUI->user_id, 'companies.company_id,companies.company_name', 'companies.company_name');
if (count($companies) == 0) {
$companies = array();
}
$q->addTable('projects', 'pr');
$q->addQuery('pr.project_id, project_status, project_color_identifier, project_type, project_name, project_description, project_duration, project_parent, project_original_parent,
project_start_date, project_end_date, project_color_identifier, project_company, company_name, company_description, project_status,
project_priority, tc.critical_task, tc.project_actual_end_date, tp.task_log_problem, pr.project_task_count, tsy.my_tasks,
pr.project_percent_complete, user_username, project_active');
$q->addQuery('CONCAT(ct.contact_first_name, \' \', ct.contact_last_name) AS owner_name');
$q->addJoin('users', 'u', 'pr.project_owner = u.user_id');
$q->addJoin('contacts', 'ct', 'ct.contact_id = u.user_contact');
$q->addJoin('tasks_critical', 'tc', 'pr.project_id = tc.task_project');
$q->addJoin('tasks_problems', 'tp', 'pr.project_id = tp.task_project');
$q->addJoin('tasks_sum', 'ts', 'pr.project_id = ts.task_project');
$q->addJoin('tasks_summy', 'tsy', 'pr.project_id = tsy.task_project');
if ($addProjectsWithAssignedTasks) {
$q->addJoin('tasks_users', 'tu', 'pr.project_id = tu.task_project');
}
if (!isset($department) && $company_id && !$addPwOiD) {
$q->addWhere('pr.project_company = ' . (int) $company_id);
}
if ($project_type > -1) {
$q->addWhere('pr.project_type = ' . (int) $project_type);
}
if (isset($department) && !$addPwOiD) {
$q->addWhere('project_departments.department_id in ( ' . implode(',', $dept_ids) . ' )');
}
if ($user_id && $addProjectsWithAssignedTasks) {
$q->addWhere('(tu.user_id = ' . (int) $user_id . ' OR pr.project_owner = ' . (int) $user_id . ' )');
} elseif ($user_id) {
$q->addWhere('pr.project_owner = ' . (int) $user_id);
}
if ($owner > 0) {
$q->addWhere('pr.project_owner = ' . (int) $owner);
}
if (mb_trim($search_text)) {
$q->addWhere('pr.project_name LIKE \'%' . $search_text . '%\' OR pr.project_description LIKE \'%' . $search_text . '%\'');
}
// Show Projects where the Project Owner is in the given department
if ($addPwOiD && !empty($owner_ids)) {
$q->addWhere('pr.project_owner IN (' . implode(',', $owner_ids) . ')');
}
$q->addGroup('pr.project_id');
$q->addOrder($orderby . ' ' . $orderdir);
$prj = new CProject();
$prj->setAllowedSQL($AppUI->user_id, $q, null, 'pr');
$dpt = new CDepartment();
$projects = $q->loadList();
// get the list of permitted companies
$companies = arrayMerge(array('0' => $AppUI->_('All')), $companies);
$company_array = $companies;
//get list of all departments, filtered by the list of permitted companies.
$q->clear();
$q->addTable('companies');
$q->addQuery('company_id, company_name, dep.*');
$q->addJoin('departments', 'dep', 'companies.company_id = dep.dept_company');
$q->addOrder('company_name,dept_parent,dept_name');
$obj->setAllowedSQL($AppUI->user_id, $q);
$dpt->setAllowedSQL($AppUI->user_id, $q);
$rows = $q->loadList();
//display the select list
$buffer = '<select name="department" id="department" onChange="document.pickCompany.submit()" class="text" style="width: 200px;">';
$company = '';
foreach ($company_array as $key => $c_name) {
$buffer .= '<option value="' . $company_prefix . $key . '" style="font-weight:bold;"' . ($company_id == $key ? 'selected="selected"' : '') . '>' . $c_name . '</option>' . "\n";
foreach ($rows as $row) {
if ($row['dept_parent'] == 0) {
if ($key == $row['company_id']) {
if ($row['dept_parent'] != null) {
showchilddept($row);
findchilddept($rows, $row['dept_id']);
}
}
}
}
}
$buffer .= '</select>';
}
开发者ID:joly,项目名称:web2project,代码行数:101,代码来源:projects.class.php
注:本文中的findchilddept函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论