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


PHP db::next_record方法代码示例

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


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

示例1: create_defaults

 /**
  * insert a copy of the default preferences for use by real account_id
  *
  * @param $account_id numerical id of account for which to create the prefs
  */
 public function create_defaults($account_id)
 {
     return;
     // not longer needed, as the defaults are merged in on runtime
     $this->db->query("select * from phpgw_preferences where preference_owner='-2'", __LINE__, __FILE__);
     $this->db->next_record();
     if ($this->db->f('preference_value')) {
         $this->db->query("insert into phpgw_preferences values ('{$account_id}','" . $this->db->f('preference_value') . "')", __LINE__, __FILE__);
     }
     if ($GLOBALS['phpgw_info']['server']['cache_phpgw_info'] && $account_id == $GLOBALS['phpgw_info']['user']['account_id']) {
         $GLOBALS['phpgw']->session->read_repositories(False);
     }
 }
开发者ID:HaakonME,项目名称:porticoestate,代码行数:18,代码来源:class.preferences.inc.php

示例2: db

 function get_fullname($uid)
 {
     global $name, $prefix, $hlpdsk_prefix;
     $tts = new db();
     $query = "select first_name,middle_name,last_name from users where id='{$uid}'";
     if ($tts->query($query)) {
         $tts->next_record();
         $fullname = $tts->f('last_name') . ' ';
         if ($tts->f('middle_name') != '') {
             $fullname .= $tts->f('middle_name') . ' ';
         }
         $fullname .= $tts->f('first_name');
         return $fullname;
     }
     return '';
 }
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:16,代码来源:opentts.php

示例3: isset

$GO_SECURITY->authenticate();
$GO_MODULES->authenticate('messages');
#require($GO_LANGUAGE->get_language_file('messages'));
$post_action = isset($_REQUEST['post_action']) ? $_REQUEST['post_action'] : '';
$task = isset($_REQUEST['task']) ? $_REQUEST['task'] : '';
$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : 'messages';
$receipient_id = isset($_REQUEST['receipient']) ? $_REQUEST['receipient'] : '';
$link_back = isset($_REQUEST['link_back']) && $_REQUEST['link_back'] != '' ? $_REQUEST['link_back'] : $_SERVER['REQUEST_URI'];
$db = new db();
switch ($task) {
    case 'send':
        if ($_REQUEST['message'] == '') {
            $feedback .= 'Message is empty';
        } else {
            if ($receipient_id > 0) {
                if ($db->query("SELECT * FROM messages_users WHERE user_id='{$receipient_id}'") && $db->next_record()) {
                    $has_permission = $GO_SECURITY->has_permission($GO_SECURITY->user_id, $db->f('acl_write'));
                } else {
                    $has_permission = true;
                }
                if ($has_permission) {
                    $msg_id = $db->nextid("messages_messages");
                    $db->query("INSERT INTO messages_messages (id,user_id,sender_id,ctime, text) VALUES ('{$msg_id}','{$receipient_id}','{$GO_SECURITY->user_id}','" . get_gmt_time() . "','" . smart_addslashes($_REQUEST['message']) . "')");
                    $db->query("INSERT INTO messages_new (id) VALUES ('{$msg_id}')");
                } else {
                    $feedback .= "You are not allowed to send message to the receipient";
                }
            } else {
                $feedback .= 'You did not specify receipient';
            }
        }
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:31,代码来源:index.php

示例4: header

$GO_MODULES->authenticate('projects');
if (!$GO_MODULES->write_permissions) {
    header('Location: ' . $GO_CONFIG->host . 'error_docs/403.php');
    exit;
}
require $GO_LANGUAGE->get_language_file('projects');
require $GO_THEME->theme_path . "header.inc";
$template_id = $_REQUEST['template_id'];
$task_id = $_REQUEST['task_id'];
if (isset($template_id) && isset($task_id)) {
    $db = new db();
    $db->query('SELECT * FROM task_template_' . $template_id . ' ORDER BY task_order');
    if ($db->num_rows() > 0) {
        $tasks = array();
        $tasks[0] = array(0, $pm_status_begin, '');
        while ($db->next_record()) {
            $tasks[$db->f('task_id')] = array($db->f('task_order'), $db->f('task_name'), $db->f('task_predecessors'));
        }
        if ($task_id <= 0) {
            $predecessors = $_REQUEST['predecessors'];
            if (!isset($predecessors) || $predecessors == '') {
                $task_pre_list = '';
                $predecessors = array();
            } else {
                $task_pre_list = "'" . $predecessors . "'";
                $predecessors = explode(",", $predecessors);
            }
            display_tasklist($tasks, '', $predecessors);
        } else {
            $plist = array();
            $task_pre_list = $tasks[$task_id][2];
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:31,代码来源:predecessors.php

示例5: sprintf

 $db_child->query("SELECT * FROM ab_categories WHERE parent_id = '{$id}' ORDER BY category");
 $count_child = $db_child->num_rows();
 //------------------------
 echo '<tr class="HiLi">';
 echo '<td align="center"><b>' . $value . '</b></td>';
 echo "<td colspan=\"97\" nowrap><a href='javascript:set_edit({$id}, \"{$name}\", {$parent}, {$count_child})'><b>{$name}</b></a></td>";
 if ($count == 1) {
     echo '<td width="36" align="center">&nbsp;</a></td>';
 }
 $delitem = sprintf($count_child > 0 ? $ab_ConfirmDeleteStatus2 : $ab_ConfirmDeleteStatus, $name);
 echo "<td><a href='javascript:delete_status(\"" . div_confirm_id($delitem) . "\"," . $id . ")'>{$trash}</a></td>";
 echo '</tr>';
 //    echo $spliter;
 if ($count_child > 0) {
     $val_child = 0;
     while ($db_child->next_record()) {
         $val_child++;
         $name = $db_child->f('category');
         $id = $db_child->f('category_id');
         $parent = $db_child->f('parent_id');
         $delitem = sprintf($ab_ConfirmDeleteStatus, $name);
         $delitem_hint = "{$strDeleteItem} '{$name}'";
         echo '<tr>';
         echo '<td align="center"></td>';
         echo "<td colspan=\"97\" nowrap><a href='javascript:set_edit({$id}, \"{$name}\", {$value}, 0)'>" . $val_child . "&nbsp;&nbsp;&nbsp;{$name}</a></td>";
         if ($count == 1) {
             echo '<td width="36" align="center">&nbsp;</a></td>';
         }
         echo "<td><a href='javascript:delete_status(\"" . div_confirm_id($delitem) . "\",{$id})'>{$trash}</a></td>";
         echo '</tr>';
         //    		echo $spliter;
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:31,代码来源:categories.php

示例6: print_config_content

function print_config_content($order, $ab, $page)
{
    global $strSexes, $GO_USERS;
    $db = new db();
    for ($i = 0; $i < count($order); $i++) {
        switch ($order[$i]) {
            case 'email':
                if ($page == 0) {
                    echo "<td nowrap>" . mail_to(empty_to_stripe($ab->f("email")), empty_to_stripe($ab->f("email")), 'normal', true, $ab->f("id")) . "&nbsp;</td>\n";
                }
                if ($page == 1) {
                    echo '<td>' . mail_to($ab->f('email'), $ab->f('email')) . '</td>';
                }
                if ($page == 2) {
                    echo "<td>" . mail_to(empty_to_stripe($GO_USERS->f("email"))) . "&nbsp;</td>\n";
                }
                break;
            case 'sex':
                echo '<td nowrap> ' . $strSexes[$ab->f('sex')] . ' </td>';
                break;
            case 'birthday':
            case 'relation_date':
                $day = $ab->f($order[$i]) > 0 ? db_date_to_date($ab->f($order[$i])) : '';
                echo '<td nowrap> ' . empty_to_stripe($day) . ' </td>';
                break;
            case 'company_id':
            case 'parent':
                $db->query("SELECT name FROM ab_companies WHERE id = '" . (int) $ab->f($order[$i]) . "'");
                echo '<td nowrap> ' . htmlspecialchars(empty_to_stripe($db->next_record() ? $db->f('name') : '')) . ' </td>';
                break;
            case '':
                break;
            default:
                echo "<td nowrap> " . htmlspecialchars(empty_to_stripe($ab->f($order[$i]))) . "&nbsp; </td>\n";
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:37,代码来源:tkdlib.php

示例7: or

Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
*/
require "../../Group-Office.php";
require $GO_MODULES->path . "classes/calendar.class.inc";
$cal = new calendar();
require $GO_LANGUAGE->get_language_file('calendar');
require $GO_THEME->theme_path . 'header.inc';
echo '<table border="0" cellpadding="10" cellspacing="0"><tr><td><h1>' . $sc_decline_title . '</h1>';
if ($_REQUEST['task'] == 'submit') {
    if ($_REQUEST['event_id'] > 0 && $_REQUEST['email'] != '') {
        if ($cal->set_event_status($_REQUEST['event_id'], '2', $_REQUEST['email'])) {
            $db = new db();
            $email = $_REQUEST['email'];
            $db->query("SELECT first_name, middle_name, last_name FROM users WHERE email='" . $email . "'");
            if ($db->next_record()) {
                $name = $db->f('last_name') . ' ' . $db->f('middle_name') . ' ' . $db->f('first_name');
            }
            //		$db->query("SELECT u.email, c.name FROM cal_events c INNER JOIN users u ON c.user_id = u.id WHERE c.id = '".$_REQUEST['event_id']."'");
            $db->query("SELECT u.email, u.date_format, u.time_format, u.DST, c.* FROM cal_events c INNER JOIN users u ON c.user_id = u.id WHERE c.id = '" . $_REQUEST['event_id'] . "'");
            if ($db->next_record()) {
                $mail_to = $db->f('email');
                $title = $db->f('name');
                require 'decline_mail.php';
                require_once $GO_CONFIG->root_path . 'lib/tkdlib.php';
                echo send_mail($mail_to, $mail_body, $sc_declined_mail_title, $name, $email);
                echo $sc_decline_confirm;
            }
        }
    } else {
        echo $sc_bad_event;
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:31,代码来源:decline.php

示例8: notify_relevant_members

function notify_relevant_members($project_id, $task_id, $person_id, $assigned = true)
{
    global $GO_CONFIG, $php_mailer_lang;
    $db = new db();
    $sql = "SELECT users.* FROM" . " users LEFT JOIN users_groups ON (users.id = users_groups.user_id)" . " WHERE users_groups.group_id='" . $GO_CONFIG->group_root . "'";
    if ($db->query($sql) && $db->num_rows() && $db->next_record()) {
        require_once $GO_CONFIG->class_path . "phpmailer/class.phpmailer.php";
        require_once $GO_CONFIG->class_path . "phpmailer/class.smtp.php";
        $mail = new PHPMailer();
        $mail->PluginDir = $GO_CONFIG->class_path . 'phpmailer/';
        $mail->SetLanguage($php_mailer_lang, $GO_CONFIG->class_path . 'phpmailer/language/');
        switch ($GO_CONFIG->mailer) {
            case 'smtp':
                $mail->Host = $GO_CONFIG->smtp_server;
                $mail->Port = $GO_CONFIG->smtp_port;
                $mail->IsSMTP();
                break;
            case 'qmail':
                $mail->IsQmail();
                break;
            case 'sendmail':
                $mail->IsSendmail();
                break;
            case 'mail':
                $mail->IsMail();
                break;
        }
        $mail->Sender = $db->f('email');
        $mail->From = $db->f('email');
        $mail->FromName = $GO_CONFIG->title;
        $mail->AddReplyTo($db->f('email'), $GO_CONFIG->title);
        $mail->WordWrap = 50;
        $mail->IsHTML(true);
        $db->query("SELECT * FROM task WHERE task_id=" . $task_id . " AND task_project_id=" . $project_id);
        $db->next_record();
        $task_name = $db->f('task_name');
        $task_person_id = $db->f('task_person_id');
        $task_duration = $db->f('task_time');
        $db->query('SELECT * ' . 'FROM pmProjects ' . 'WHERE id="' . $project_id . '" ');
        $db->next_record();
        $task_url = $GO_CONFIG->full_url . 'modules/projects/project.php?task=show_task_status&project_id=' . $project_id . '&task_id=' . $task_id . '&task_status=' . (isset($status) ? $status : '');
        $project_url = $GO_CONFIG->full_url . 'modules/projects/project.php?project_id=' . $project_id;
        global $pm_task_status_values;
        $new_status = $pm_task_status_values[$status];
        $project_name = $db->f('name');
        $project_description = $db->f('description');
        global $subjectTaskAssigneeChanged, $mailTaskAssigneeLeft, $mailTaskAssigneeJoined;
        $mail->Subject = sprintf($subjectTaskAssigneeChanged, $task_name, $project_name);
        if ($assigned) {
            $mail_body = sprintf($mailTaskAssigneeJoined, $project_name, $project_description, $task_name, $task_duration, $task_url);
        } else {
            $mail_body = sprintf($mailTaskAssigneeLeft, $project_name, $project_description, $task_name);
        }
        $mail->Body = $mail_body;
        $mail->ClearAllRecipients();
        if (isset($status) && $status == TASK_DONE) {
            $db->query('SELECT users.* ' . 'FROM users,pmProjects ' . 'WHERE users.id=pmProjects.user_id ' . 'AND pmProjects.id="' . $project_id . '"');
        } else {
            $db->query('SELECT * ' . 'FROM users ' . 'WHERE id="' . $task_person_id . '"');
        }
        $db->next_record();
        $mail->AddAddress($db->f('email'));
        // HACK: For some reasons, admin@hptvietnam.com.vn is not accepted by mail.hptvietnam.com.vn :(
        $mail->From = $db->f('email');
        $mail->Sender = $db->f('email');
        //if (!$mail->Send()) echo "Failed: ".$mail->ErrorInfo;
        $mail->Send();
        //$mail->Send();
    }
}
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:70,代码来源:project.php

示例9: isset

$Ticket_Number = isset($_GET['Ticket_Number']) ? Security::htmlsecure($_GET['Ticket_Number']) : 0;
$Ticket_Number = isset($_POST['Ticket_Number']) ? Security::htmlsecure($_POST['Ticket_Number']) : $Ticket_Number;
echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="ticket_form">';
echo '<input type="hidden" name="Ticket_Number" value="' . $Ticket_Number . '" />';
global $name;
$textmenu = menu("Show_Tickets", '');
eval($textmenu);
//
// take ownership
if (isset($_GET['take_ownership'])) {
    $query = "select * from acl_items  where id='" . Security::sqlsecure($_GET['acl_write']) . "' and description='ticket write'";
    $mydb = new db($query);
    if ($mydb->next_record()) {
        $query = "select * from acl where acl_id='" . Security::sqlsecure($_GET['acl_write']) . "' and user_id='" . whoami() . "'";
        $mydb = new db($query);
        if (!$mydb->next_record()) {
            $query = "insert into acl (acl_id,user_id) values ('" . Security::sqlsecure($_GET['acl_write']) . "','" . whoami() . "')";
            $mydb = new db($query);
        }
    }
}
//
$return_to = isset($_REQUEST['return_to']) ? $_REQUEST['return_to'] : $_SERVER['HTTP_REFERER'];
$link_back = isset($_REQUEST['link_back']) ? $_REQUEST['link_back'] : $_SERVER['REQUEST_URI'];
$ticket['acl_read'] = get_cross_value("{$prefix}{$hlpdsk_prefix}_tickets", "acl_read", " where Ticket_Number='" . Security::sqlsecure($Ticket_Number) . "'");
$ticket['acl_write'] = get_cross_value("{$prefix}{$hlpdsk_prefix}_tickets", "acl_write", " where Ticket_Number='" . Security::sqlsecure($Ticket_Number) . "'");
$acl_read = $ticket['acl_read'];
$acl_write = $ticket['acl_write'];
$tabtable = new tabtable('ticket_tabtable', $tts_lang_tickets_details, '100%', '400', '120', '', true);
if ($acl_read > 0 and $acl_write > 0) {
    $tabtable->add_tab('properties', $strProperties);
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:31,代码来源:showline.php

示例10: update_enable

function update_enable($pkgs)
{
    $db = new db();
    $db->query("SELECT id FROM modules");
    $disabled_modules = array();
    while ($db->next_record()) {
        if (!in_array($db->f('id'), $pkgs)) {
            $disabled_modules[] = $db->f('id');
        }
    }
    if (!empty($pkgs)) {
        $db->query("UPDATE modules SET enable=1 WHERE id in ('" . implode("','", $pkgs) . "')");
    }
    if (!empty($disabled_modules)) {
        $db->query("UPDATE modules SET enable=0 WHERE id in ('" . implode("','", $disabled_modules) . "')");
    }
}
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:17,代码来源:index.php

示例11: fill_config_content

function fill_config_content($order, $ab, $page, &$row, &$irow, &$firstrun)
{
    global $strSexes, $GO_USERS;
    $db = new db();
    for ($i = 0; $i < count($order); $i++) {
        switch ($order[$i]) {
            case 'email':
                if ($page == 0) {
                    if ($firstrun) {
                        $row[$irow++] = array('html' => mail_to(empty_to_stripe($ab->f("email")), empty_to_stripe($ab->f("email")), 'normal', true, $ab->f("id")));
                    } else {
                        $row[$irow++]['html'] = mail_to(empty_to_stripe($ab->f("email")), empty_to_stripe($ab->f("email")), 'normal', true, $ab->f("id"));
                    }
                }
                if ($page == 1) {
                    if ($firstrun) {
                        $row[$irow++] = array('html' => mail_to($ab->f('email'), $ab->f('email')));
                    } else {
                        $row[$irow++]['html'] = mail_to($ab->f('email'), $ab->f('email'));
                    }
                }
                if ($page == 2) {
                    if ($firstrun) {
                        $row[$irow++] = array('html' => mail_to(empty_to_stripe($GO_USERS->f("email"))));
                    } else {
                        $row[$irow++]['html'] = mail_to(empty_to_stripe($GO_USERS->f("email")));
                    }
                }
                break;
            case 'sex':
                $row[$irow++] = $strSexes[$ab->f('sex')];
                break;
            case 'birthday':
            case 'relation_date':
                $day = $ab->f($order[$i]) > 0 ? db_date_to_date($ab->f($order[$i])) : '';
                $row[$irow++] = empty_to_stripe($day);
                break;
            case 'company_id':
            case 'parent':
                $db->query("SELECT name FROM ab_companies WHERE id = '" . (int) $ab->f($order[$i]) . "'");
                $row[$irow++] = empty_to_stripe($db->next_record() ? $db->f('name') : '');
                break;
            case '':
                break;
            default:
                $row[$irow++] = empty_to_stripe($ab->f($order[$i]));
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:49,代码来源:tkdlib.php


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