本文整理汇总了PHP中get_db_value函数的典型用法代码示例。如果您正苦于以下问题:PHP get_db_value函数的具体用法?PHP get_db_value怎么用?PHP get_db_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_db_value函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkPermission
public function checkPermission ($id_user, $acl = 'PR', $operation = '', $id_workunit = -1) {
$system = System::getInstance();
$permission = false;
if (dame_admin($id_user)) {
$permission = true;
} else {
// Section access
if ($system->checkACL($acl)) {
// If the workunit exists, should belong to the user
if ($operation == "delete_workunit") {
if ($id_workunit > 0) {
$user_workunit = get_db_value("id_user", "tworkunit", "id", $id_workunit);
if (strcasecmp($id_user, $user_workunit) == 0) {
$permission = true;
}
}
} else {
$permission = true;
}
}
}
return $permission;
}
示例2: process_values
function process_values(&$values, $id_inventory)
{
/* Check empty values */
$values['id_manufacturer'] = $values['id_manufacturer'] ? $values['id_manufacturer'] : NULL;
$values['id_building'] = $values['id_building'] ? $values['id_building'] : NULL;
$values['id_sla'] = $values['id_sla'] ? $values['id_sla'] : NULL;
$values['id_product'] = $values['id_product'] ? $values['id_product'] : NULL;
$values['id_contract'] = $values['id_contract'] ? $values['id_contract'] : NULL;
foreach ($values as $field => $value) {
if ($id_inventory) {
$values[$field] = isset($values[$field][0]) && $values[$field][0] == '`' ? get_db_value($values[$field], 'tinventory', 'id', $id_inventory) : $values[$field];
} else {
$values[$field] = isset($values[$field][0]) && $values[$field][0] == '`' ? '' : $values[$field];
}
}
}
示例3: checkPermission
public function checkPermission($id_user, $acl = 'IR', $operation = '', $id_incident = -1)
{
$system = System::getInstance();
$permission = false;
if (dame_admin($id_user)) {
$permission = true;
} else {
if ($system->checkACL($this->acl)) {
if ($id_incident > 0 && $operation == "delete") {
$incident_creator = get_db_value("id_creator", "tincidencia", "id_incidencia", $id_incident);
if ($system->checkACL("IM") && strcasecmp($id_user, $incident_creator) == 0) {
$permission = true;
}
} else {
$permission = true;
}
}
}
return $permission;
}
示例4: get_parameter
require "general/noaccess.php";
exit;
}
$id_nota = get_parameter("id", 0);
$id_incident = get_parameter("id_inc", 0);
// ********************************************************************
// Note detail of $id_note
// ********************************************************************
$sql4 = 'SELECT * FROM tnota WHERE id_nota = ' . $id_nota;
$res4 = mysql_query($sql4);
if ($row3 = mysql_fetch_array($res4)) {
echo "<div class='notetitle'>";
// titulo
$timestamp = $row3["timestamp"];
$nota = $row3["nota"];
$id_usuario_nota = $row3["id_usuario"];
$avatar = get_db_value("avatar", "tusuario", "id_usuario", $id_usuario_nota);
// Show data
echo "<img src='images/avatars/" . $avatar . ".png' class='avatar_small'> ";
echo " <a href='index.php?sec=users&sec2=operation/users/user_edit&id={$id_usuario_nota}'>";
echo $id_usuario_nota;
echo "</a>";
echo " " . __("said on {$timestamp}");
echo "</div>";
// Body
echo "<div class='notebody'>";
echo clean_output_breaks($nota);
echo "</div>";
} else {
echo __('No data available');
}
示例5: get_db_value
//$tracking_group = "<table class='details_table alternate'>";
foreach ($stats[INCIDENT_METRIC_GROUP] as $key => $value) {
$name = get_db_value ('nombre', 'tgrupo', 'id_grupo', $key);
$tracking_group = "<tr>";
$tracking_group .= "<td><strong>".$name."</strong>:</td>";
$tracking_group .= "<td style='text-align:right;'>".give_human_time($value,true,true,true)."</td>";
$tracking_group .= "</tr>";
}
//$tracking_group .= "</table>";
echo print_container('incident_tracking_group', __('Statistics by group'), $tracking_group, 'open', true, '20px', '', '', 1, 'less_widht');
echo "</td>";
echo "<td style='vertical-align:top;width: 33%;'>";
//$tracking_user = "<table class='details_table alternate'>";
foreach ($stats[INCIDENT_METRIC_USER] as $key => $value) {
$name = get_db_value ('nombre_real', 'tusuario', 'id_usuario', $key);
$tracking_user = "<tr>";
$tracking_user .= "<td><strong>".$name."</strong>:</td>";
$tracking_user .= "<td style='text-align:right;'>".give_human_time($value,true,true,true)."</td>";
$tracking_user .= "</tr>";
}
//$tracking_user .= "</table>";
echo print_container('incident_tracking_user', __('Statistics by owner'), $tracking_user, 'open', true, '20px', '', '', 1, 'less_widht');
echo "</td>";
echo "</tr>";
echo "</table>";
}
$trackings = get_db_all_rows_field_filter ('tincident_track', 'id_incident', $id, 'timestamp DESC, id_it DESC');
示例6: DMR_DM_PRESTAMO_show
//.........这里部分代码省略.........
// Load lists of values
//-------------------------------
$aPRES_REQUERIMIENTO = split(";", "1;Documento;2;Anexo");
//-------------------------------
//-------------------------------
// Load all fields into variables from recordset or input parameters
//-------------------------------
$contador = 0;
while ($bPK && ($rs && !$rs->EOF)) {
$contador++;
$fldDEPE_CODI = $rs->fields["DEPE_CODI"];
$fldPRES_FECH_PEDI = $rs->fields["PRES_FECH_PEDI"];
$fldPRES_FECH_VENC = $rs->fields["PRES_FECH_VENC"];
$fldPRES_ID = $rs->fields["PRES_ID"];
$fldPRES_REQUERIMIENTO = $rs->fields["PRES_REQUERIMIENTO"];
$fldRADI_NUME_RADI = $rs->fields["RADI_NUME_RADI"];
$fldUSUA_LOGIN_ACTU = $rs->fields["USUA_LOGIN_ACTU"];
//-------------------------------
// Load data from recordset when form displayed first time
//-------------------------------
if ($sPRESTAMOErr == "") {
$fldUSUA_LOGIN_PRES = $rs->fields["USUA_LOGIN_PRES"];
$fldPRES_FECH_PRES = $rs->fields["PRES_FECH_PRES"];
$fldPRES_DESC = $rs->fields["PRES_DESC"];
$fldPRES_ESTADO = $rs->fields["PRES_ESTADO"];
} else {
$fldPRES_DESC = strip(get_param("PRES_DESC_" . $contador));
$fldPRES_ESTADO = strip(get_param("PRES_ESTADO_" . $contador));
$fldPRES_ID = strip(get_param("PRES_ID_" . $contador));
}
//-------------------------------
// Set lookup fields
//-------------------------------
$fldDEPE_CODI = get_db_value("SELECT DEPE_NOMB FROM DEPENDENCIA WHERE DEPE_CODI=" . tosql($fldDEPE_CODI, "Number"));
//-------------------------------
// Show form field
//-------------------------------
?>
<tr><td colspan="2"><HR></td></tr>
<tr>
<td class="FieldCaptionTD">
<font class="FieldCaptionFONT">Radicado</font>
</td>
<td class="DataTD">
<font class="DataFONT">
<?php
echo tohtml($fldRADI_NUME_RADI);
?>
</font>
</td>
</tr>
<tr>
<td class="FieldCaptionTD">
<font class="FieldCaptionFONT">Fecha de Vencimiento</font>
</td>
<td class="DataTD">
<font class="DataFONT"><?php
echo $fldPRES_FECH_VENC;
?>
</font>
</td>
</tr>
<tr>
<td class="FieldCaptionTD">
<font class="FieldCaptionFONT">Requerimiento</font>
示例7: get_parameter
include_once 'include/functions_user.php';
$get_group_details = (bool) get_parameter('get_group_details');
$id = (int) get_parameter('id');
$delete_user = get_parameter('delete_user', 0);
if ($delete_user) {
$id_user_delete = get_parameter('id_user_delete');
user_delete_user($id_user_delete);
}
if ($get_group_details) {
if (!give_acl($config["id_user"], $id, "IR")) {
return;
}
$default_user = get_db_value('id_user_default', 'tgrupo', 'id_grupo', $id);
$real_name = get_db_value('nombre_real', 'tusuario', 'id_usuario', $default_user);
$group = array();
$group['forced_email'] = get_db_value('forced_email', 'tgrupo', 'id_grupo', $id);
$group['user_real_name'] = $real_name;
$group['id_user_default'] = $default_user;
echo json_encode($group);
if (defined('AJAX')) {
return;
}
}
if (!give_acl($config["id_user"], 0, "UM")) {
audit_db($config["id_user"], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access group management");
require "general/noaccess.php";
exit;
}
echo '<h1>' . __('Group management') . '</h1>';
$create_group = (bool) get_parameter('create_group');
$update_group = (bool) get_parameter('update_group');
示例8: check_login
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program 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 General Public License for more details.
global $config;
check_login ();
require_once ('include/functions_inventories.php');
require_once ('include/functions_user.php');
$id = (int) get_parameter ('id');
$inventory_name = get_db_value('name', 'tinventory', 'id', $id);
$is_enterprise = false;
if (file_exists ("enterprise/include/functions_inventory.php")) {
require_once ("enterprise/include/functions_inventory.php");
$is_enterprise = true;
}
$write_permission = true;
if ($is_enterprise) {
$read_permission = inventory_check_acl($config['id_user'], $id);
$write_permission = inventory_check_acl($config['id_user'], $id, true);
示例9: calendar_get_users_holidays_date_range
function calendar_get_users_holidays_date_range($start, $end, $id_user)
{
$mysql_start = date('Y-m-d', $start);
$mysql_end = date('Y-m-d', $end);
$user_clause = "";
if (is_array($id_user)) {
$aux_ids = array();
foreach ($id_user as $iu) {
array_push($aux_ids, "'" . $iu . "'");
}
$user_clause = "id_user IN (" . join(",", $aux_ids) . ")";
} else {
$user_clause = "id_user = '{$id_user}'";
}
$sql = sprintf("SELECT tworkunit.timestamp AS date, tworkunit.id_user as user FROM tworkunit, tworkunit_task WHERE \n\t\t\t\t\t{$user_clause} AND tworkunit_task.id_workunit = tworkunit.id AND tworkunit_task.id_task =-1 AND \n\t\t\t\t\ttimestamp >= '{$mysql_start}' AND timestamp <= '{$mysql_end}' ORDER BY date ASC");
$res = process_sql($sql);
if (!$res) {
$res = array();
}
$holidays = array();
$holidays_counters = array();
$holidays_last_day = array();
foreach ($res as $r) {
if (!isset($holidays[$r["user"]])) {
$holidays[$r["user"]] = array();
$holidays_counters[$r["user"]] = -1;
$holidays_last_day[$r["user"]] = 0;
}
//Calculate start and end for the holiday value
if (isset($holidays_last_day[$r["user"]])) {
//Last day minus current day is 1 we increase dates for stored holidays
$last_time = strtotime($holidays_last_day[$r["user"]]);
$current_time = strtotime($r["date"]);
$day_in_seconds = 24 * 3600;
if ($current_time - $last_time <= $day_in_seconds) {
$pos = $holidays_counters[$r["user"]];
$holidays[$r["user"]][$pos]["end"] = strtotime($r["date"]);
$holidays_last_day[$r["user"]] = strtotime($r["date"]);
} else {
array_push($holidays[$r["user"]], array("start" => strtotime($r["date"]), "end" => strtotime($r["date"])));
$holidays_last_day[$r["user"]] = $r["date"];
$holidays_counters[$r["user"]]++;
}
}
//Update last day
$holidays_last_day[$r["user"]] = $r["date"];
}
$full_holidays = array();
$colors = array("#aa3333", "#33aa33", "#3a3a3a", "#3333aa", "#045FB4", "#DF7401", "#01DF3A", "#BE81F7", "#8181F7", "#81BEF7", "#F781F3", "#F7D358", "#F78181", "#FA8258", "#BCF5A9", "#A9A9F5", "#D0A9F5", "#E2A9F3", "#A9F5D0", "#A9F5E1", "#BDBDBD", "#E6E6E6", "#F6CECE", "#6AA4B2", "#6AB277", "#B28E6A", "#B26A97", "#776AB2", "#A58EB4", "#8EB490", "#8E96B4", "#B48E98");
$i = 0;
$colors_size = count($colors);
foreach ($holidays as $key => $values) {
$i = $i % $colors_size;
$name = get_db_value("nombre_real", "tusuario", "id_usuario", $key);
$url = "index.php?sec=users&sec2=operation/user_report/holidays_calendar&custom_dates=1&id_user=" . $key;
array_push($full_holidays, array("name" => safe_output($name), "dates" => $values, "bgColor" => $colors[$i], "link" => $url));
$i++;
}
return $full_holidays;
}
示例10: dlookup
function dlookup($table_name, $field_name, $where_condition)
{
$sql = "SELECT " . $field_name . " FROM " . $table_name . " WHERE " . $where_condition;
return get_db_value($sql);
}
示例11: __
$table_advanced->data[3][1] .= "<img src='images/task.png'></a>";
} else {
$table_advanced->data[3][1] .= " <a id='task_link' title='" . __('Open this task') . "' target='_blank' href='javascript:;'></a>";
}
$table_advanced->data[1][1] = print_input_text('email_copy', $email_copy, "", 70, 500, true, __("Additional email addresses"), $blocked_incident);
if (!$blocked_incident) {
$table_advanced->data[1][1] .= " <a href='javascript: incident_show_contact_search();'>" . print_image('images/add.png', true, array('title' => __('Add'))) . "</a>";
}
if ($create_incident) {
$id_inventory = (int) get_parameter('id_inventory');
$inventories = array();
if ($id_inventory) {
if (!give_acl($config['id_user'], $id_inventory, "VR")) {
audit_db($config['id_user'], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access inventory #" . $id);
} else {
$inventories[$id_inventory] = get_db_value('name', 'tinventory', 'id', $id_inventory);
}
}
$table_advanced->data[3][2] = print_select($inventories, 'incident_inventories', NULL, '', '', '', true, false, false, __('Objects affected'));
$table_advanced->data[3][2] .= " <a href='javascript: incident_show_inventory_search(\"\",\"\",\"\",\"\",\"\",\"\");'>" . print_image('images/add.png', true, array('title' => __('Add'))) . "</a>";
$table_advanced->data[3][2] .= " <a href='javascript: removeInventory();'>" . print_image('images/cross.png', true, array('title' => __('Remove'))) . "</a>";
} else {
$inventories = get_inventories_in_incident($id);
$table_advanced->data[3][2] = print_select($inventories, 'incident_inventories', NULL, '', '', '', true, false, false, __('Objects affected'), $blocked_incident);
if (!$blocked_incident) {
$table_advanced->data[3][2] .= " <a href='javascript: incident_show_inventory_search(\"\",\"\",\"\",\"\",\"\",\"\");'>" . print_image('images/add.png', true, array('title' => __('Add'))) . "</a>";
$table_advanced->data[3][2] .= " <a href='javascript: removeInventory();'>" . print_image('images/cross.png', true, array('title' => __('Remove'))) . "</a>";
}
}
foreach ($inventories as $inventory_id => $inventory_name) {
$table_advanced->data[3][2] .= print_input_hidden("inventories[]", $inventory_id, true, 'selected-inventories');
示例12: get_db_value
$old_name = get_db_value("name", "tinventory", "id", $inventory_id);
}
// Checks if the name is in the db
$query_result = get_db_value("name", "tinventory", "name", $name);
if ($query_result) {
if ($name != $old_name) {
// Exists. Validation error
echo json_encode(false);
return;
}
}
// Does not exist
echo json_encode(true);
return;
}
if ($search_duplicate_name) {
if (!isset($config['duplicate_inventory_name']) || $config['duplicate_inventory_name']) {
echo json_encode(true);
return;
} else {
$inventory_name = get_parameter('inventory_name');
$exists = get_db_value('id', 'tinventory', 'name', $inventory_name);
if ($exists) {
echo json_encode(false);
return;
} else {
echo json_encode(true);
return;
}
}
}
示例13: combo_roles_people_task
function combo_roles_people_task($id_task, $id_user, $label = '', $return = false)
{
$roles = get_db_all_rows_filter('trole_people_task', array('id_task' => $id_task, 'id_user' => $id_user), 'id_role');
$user_roles = array();
$output = '';
if ($roles !== false) {
foreach ($roles as $key => $rol) {
$rol_name = get_db_value('name', 'trole', 'id', $rol['id_role']);
$user_roles[$rol['id_role']] = $rol_name;
}
}
return print_select($user_roles, 'id_profile', '', '', 0, 0, true, 0, false, $label);
}
示例14: print_image
$incident_adv_details .= "</tr>";
$incident_adv_details .= "<tr>";
$incident_adv_details .= "<td class='advanced_details_icons'>" . print_image('images/sla.png', true) . "</td>";
$incident_adv_details .= "<td><table><tr><td>" . __("SLA disabled") . ":</td><td align='right'><b>" . $sla . "</b></td></tr></table></td>";
$incident_adv_details .= "</tr>";
$incident_adv_details .= "<tr>";
$incident_adv_details .= $obj_table;
$incident_adv_details .= "<tr>";
$incident_adv_details .= "<td class='advanced_details_icons'>" . print_image('images/email.png', true) . "</td>";
$incident_adv_details .= "<td><table><tr><td>" . __("Notify changes by email") . ":</td><td align='right'><b>" . $email_notify_text . "</b></td></tr></table></td>";
$incident_adv_details .= "</tr>";
$incident_adv_details .= $email_table;
$incident_adv_details .= "</table>";
$left_side .= print_container('incident_adv_details', __('Advanced details'), $incident_adv_details);
if ($incident["id_incident_type"]) {
$type_name = get_db_value("name", "tincident_type", "id", $incident["id_incident_type"]);
$incident_custom_fields = "<table class='advanced_details_table alternate'>";
$incident_custom_fields .= "<tr>";
$incident_custom_fields .= "<td><table><tr><td><b>" . $type_name . "</b></td></tr></table></td>";
$incident_custom_fields .= "</tr>";
$fields = incidents_get_all_type_field($incident["id_incident_type"], $id);
foreach ($fields as $f) {
if ($f["type"] != "textarea") {
$incident_custom_fields .= "<tr>";
$incident_custom_fields .= "<td>";
$incident_custom_fields .= "<table>";
$incident_custom_fields .= "<tr>";
$incident_custom_fields .= "<td>" . $f["label"] . ":</td><td align='right'><b>" . $f["data"] . "</b></td>";
$incident_custom_fields .= "</tr>";
$incident_custom_fields .= "</table>";
$incident_custom_fields .= "</td>";
示例15: ui_print_success_message
process_sql ($sql);
echo ui_print_success_message (__('Successfully reactivated'), '', true, 'h3', true);
audit_db ($config['id_user'], $REMOTE_ADDR, "Project activated", "User ".$config['id_user']." activated project #".$id_project);
project_tracking ($id_project, PROJECT_ACTIVATED);
}
// Delete
if ($delete_project) {
if (!$project_permission['manage']) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Forbidden", "User ".$config['id_user']." try to delete project #$id_project");
require ("general/noaccess.php");
exit;
}
$id_owner = get_db_value ('id_owner', 'tproject', 'id', $id_project);
delete_project ($id_project);
echo ui_print_success_message (__('Successfully deleted'), '', true, 'h3', true);
}
if ($view_disabled) {
echo '<h2>'.__('Projects').'</h2>';
echo '<h4>'.__('Archived projects');
echo integria_help ("archieved_projects", true);
echo '</h4>';
}
$table = new stdClass;
$table->class = 'search-table';
$table->style = array ();
$table->data = array ();