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


PHP db_loadColumn函数代码示例

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


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

示例1: selPermWhere

function selPermWhere($table, $idfld)
{
    global $AppUI;
    // get any companies denied from viewing
    $sql = "SELECT {$idfld}" . "\nFROM {$table}, permissions" . "\nWHERE permission_user = {$AppUI->user_id}" . "\n\tAND permission_grant_on = '{$table}'" . "\n\tAND permission_item = {$idfld}" . "\n\tAND permission_value = 0";
    $deny = db_loadColumn($sql);
    echo db_error();
    return "permission_user = {$AppUI->user_id}" . "\nAND permission_value <> 0" . "\nAND (" . "\n\t(permission_grant_on = 'all')" . "\n\tOR (permission_grant_on = '{$table}' and permission_item = -1)" . "\n\tOR (permission_grant_on = '{$table}' and permission_item = {$idfld})" . "\n\t)" . (count($deny) > 0 ? "\nAND {$idfld} NOT IN (" . implode(',', $deny) . ')' : '');
}
开发者ID:srinivasulurao,项目名称:jonel,代码行数:9,代码来源:selector.php

示例2: getReadableModule

function getReadableModule()
{
    global $AppUI;
    $perms =& $AppUI->acl();
    $sql = 'SELECT mod_directory FROM modules WHERE mod_active > 0 ORDER BY mod_ui_order';
    $modules = db_loadColumn($sql);
    foreach ($modules as $mod) {
        if ($perms->checkModule($mod, 'access')) {
            return $mod;
        }
    }
    return null;
}
开发者ID:klr2003,项目名称:sourceread,代码行数:13,代码来源:permissions.php

示例3: updateSubTasksProject

 /**
  * This function recursively updates all tasks project
  * to the one passed as parameter
  */
 function updateSubTasksProject($new_project, $task_id = null)
 {
     $q = new DBQuery();
     if (is_null($task_id)) {
         $task_id = $this->task_id;
     }
     $q->addTable('tasks');
     $q->addQuery('task_id');
     $q->addWhere("task_parent = '" . $task_id . "'");
     $sql = $q->prepare();
     $q->clear();
     $tasks_id = db_loadColumn($sql);
     if (count($tasks_id) == 0) {
         return true;
     }
     // update project of children
     $q->addTable('tasks');
     $q->addUpdate('task_project', $new_project);
     $q->addWhere("task_parent = '" . $task_id . "'");
     $q->exec();
     $q->clear();
     foreach ($tasks_id as $id) {
         if ($id != $task_id) {
             $this->updateSubTasksProject($new_project, $id);
         }
     }
 }
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:31,代码来源:tasks.class.php

示例4: getDeniedRecords

 /**
  *	Overload of the dpObject::getDeniedRecords
  *	to ensure that the projects owned by denied companies are denied.
  *
  *	@author	handco <handco@sourceforge.net>
  *	@see	dpObject::getAllowedRecords
  */
 function getDeniedRecords($uid)
 {
     $aBuf1 = parent::getDeniedRecords($uid);
     $oCpy = new CCompany();
     // Retrieve which projects are allowed due to the company rules
     $aCpiesAllowed = $oCpy->getAllowedRecords($uid, 'company_id,company_name');
     $q = new DBQuery();
     $q->addTable('projects');
     $q->addQuery('project_id');
     if (count($aCpiesAllowed)) {
         $q->addWhere('NOT (project_company IN (' . implode(',', array_keys($aCpiesAllowed)) . '))');
     }
     $sql = $q->prepare();
     $q->clear();
     $aBuf2 = db_loadColumn($sql);
     return array_merge($aBuf1, $aBuf2);
 }
开发者ID:srinivasulurao,项目名称:jonel,代码行数:24,代码来源:projects.class.php

示例5: foreach

 $sum_total_hours_allocated = $sum_total_hours_worked = 0;
 $sum_hours_allocated_complete = $sum_hours_worked_complete = 0;
 //TODO: Split times for which more than one users were working...
 foreach ($user_list as $user_id => $user) {
     $sql = "SELECT task_id\n\t\t\t        FROM user_tasks\n\t\t\t        where user_id = {$user_id}";
     $tasks_id = db_loadColumn($sql);
     $total_hours_allocated = $total_hours_worked = 0;
     $hours_allocated_complete = $hours_worked_complete = 0;
     foreach ($tasks_id as $task_id) {
         if (isset($task_list[$task_id])) {
             // Now let's figure out how many time did the user spent in this task
             $sql = "SELECT sum(task_log_hours)\n\t\t        \t\t\tFROM task_log\n\t\t        \t\t\tWHERE task_log_task        = {$task_id}\n\t\t\t\t\t              AND task_log_creator = {$user_id}";
             $hours_worked = round(db_loadResult($sql), 2);
             $sql = "SELECT task_percent_complete\n                                                FROM tasks\n                                                WHERE task_id = {$task_id}";
             //                 echo $sql;
             $percent = db_loadColumn($sql);
             $complete = $percent[0] == 100;
             if ($complete) {
                 $hours_allocated_complete += $task_list[$task_id]["hours_allocated"];
                 $hours_worked_complete += $hours_worked;
             }
             $total_hours_allocated += $task_list[$task_id]["hours_allocated"];
             $total_hours_worked += $hours_worked;
         }
     }
     $sum_total_hours_allocated += $total_hours_allocated;
     $sum_total_hours_worked += $total_hours_worked;
     $sum_hours_allocated_complete += $hours_allocated_complete;
     $sum_hours_worked_complete += $hours_worked_complete;
     if ($total_hours_allocated > 0 || $total_hours_worked > 0) {
         $percentage = 0;
开发者ID:TheIdeaMan,项目名称:dotproject,代码行数:31,代码来源:userperformance.php

示例6: db_loadColumn

}
if ($do_report) {
    $total = 0;
    if ($fullaccess) {
        $sql = "SELECT company_id FROM companies";
    } else {
        $sql = "SELECT company_id FROM companies WHERE company_owner='" . $AppUI->user_id . "'";
    }
    $companies = db_loadColumn($sql);
    if (!empty($companies)) {
        foreach ($companies as $company) {
            $total += showcompany($company);
        }
    } else {
        $sql = "SELECT company_id FROM companies";
        foreach (db_loadColumn($sql) as $company) {
            $total += showcompany($company, true);
        }
    }
    echo '<h2>' . $AppUI->_('Total Hours') . ":";
    printf("%.2f", $total);
    echo '</h2>';
    if ($log_pdf) {
        // make the PDF file
        $font_dir = dPgetConfig('root_dir') . "/lib/ezpdf/fonts";
        $temp_dir = dPgetConfig('root_dir') . "/files/temp";
        $base_url = dPgetConfig('base_url');
        require $AppUI->getLibraryClass('ezpdf/class.ezpdf');
        $pdf =& new Cezpdf();
        $pdf->ezSetCmMargins(1, 2, 1.5, 1.5);
        $pdf->selectFont("{$font_dir}/Helvetica.afm");
开发者ID:n2i,项目名称:xvnkb,代码行数:31,代码来源:overall.php

示例7: array

    //Prevent users from editing other ppls timecards.
    $can_edit_task_logs = $HELPDESK_CONFIG['minimum_edit_level'] >= $AppUI->user_type;
    if (!$can_edit_task_logs) {
        if ($log->task_log_creator != $AppUI->user_id) {
            $AppUI->redirect("m=public&a=access_denied");
        }
    }
} else {
    $log->task_log_help_desk_id = $item_id;
    $log->task_log_name = $hditem['item_title'];
}
// Lets check which cost codes have been used before
$sql = "select distinct task_log_costcode\n        from task_log\n        where task_log_costcode != ''\n        order by task_log_costcode";
$task_log_costcodes = array("");
// Let's add a blank default option
$task_log_costcodes = array_merge($task_log_costcodes, db_loadColumn($sql));
//if ($canEdit) {
// Task Update Form
$df = $AppUI->getPref('SHDATEFORMAT');
$log_date = new CDate($log->task_log_date);
if ($task_log_id) {
    echo $AppUI->_("Edit Log");
} else {
    echo $AppUI->_("Add Log");
}
?>

<!-- TIMER RELATED SCRIPTS -->
<script language="JavaScript">
	// please keep these lines on when you copy the source
	// made by: Nicolas - http://www.javascript-page.com
开发者ID:srinivasulurao,项目名称:jonel,代码行数:31,代码来源:vw_log_update.php

示例8: updateSubTasksProject

 /**
  * This function recursively updates all tasks project
  * to the one passed as parameter
  */
 function updateSubTasksProject($new_project, $task_id = null)
 {
     if (is_null($task_id)) {
         $task_id = $this->task_id;
     }
     $sql = "select task_id\n\t\t        from tasks\n\t\t        where task_parent = '{$task_id}'";
     $tasks_id = db_loadColumn($sql);
     if (count($tasks_id) == 0) {
         return true;
     }
     $sql = "update tasks set task_project = '{$new_project}' where task_parent = '{$task_id}'";
     db_exec($sql);
     foreach ($tasks_id as $id) {
         if ($id != $task_id) {
             $this->updateSubTasksProject($new_project, $id);
         }
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:22,代码来源:tasks.class.php

示例9: updateSubTasksProject

 /**
  * This function recursively updates all tasks project
  * to the one passed as parameter
  */
 function updateSubTasksProject($new_project, $task_id = null)
 {
     if (is_null($task_id)) {
         $task_id = $this->task_id;
     }
     $sql = "SELECT task_id FROM tasks WHERE task_parent = '{$task_id}'";
     $tasks_id = db_loadColumn($sql);
     if (count($tasks_id) == 0) {
         return true;
     }
     $sql = "UPDATE tasks SET task_project = '{$new_project}' WHERE task_parent = '{$task_id}'";
     db_exec($sql);
     foreach ($tasks_id as $id) {
         if ($id != $task_id) {
             $this->updateSubTasksProject($new_project, $id);
         }
     }
 }
开发者ID:n2i,项目名称:xvnkb,代码行数:22,代码来源:tasks.class.php


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