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


PHP Timer::print_comment方法代码示例

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


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

示例1: Timer

 /**
  * Modify current reservation time
  * If this reservation is part of a recurring group, all reservations in the
  *  group will be modified that havent already passed
  * @param Object $res reservation that we are modifying
  * @param array $users_to_invite hashtable of users to invite to this reservation
  * @param array $users_to_remove hashtable of users to remove from this reservation
  * @param array $resources_to_add array of resourceids to add to this reservation
  * @param array $resources_to_remove array of resourceids to remove from this reservation	
  * @param string $accept_code acceptance code to be used for reservation accept/decline
  */
 function mod_res($res, $users_to_invite, $users_to_remove, $resources_to_add, $resources_to_remove, $accept_code)
 {
     $t = new Timer("mod_res()");
     $t->start();
     $id = $res->get_id();
     // Update the main reservation data
     $values = array($res->get_start_date(), $res->get_end_date(), $res->get_start(), $res->get_end(), mktime(), $res->get_summary(), $res->get_pending(), $res->get_allow_participation(), $res->get_allow_anon_participation(), $id);
     $query = 'UPDATE ' . $this->get_table(TBL_RESERVATIONS) . ' SET ' . ' start_date=?,' . ' end_date=?,' . ' starttime=?,' . ' endtime=?,' . ' modified=?,' . ' summary=?,' . ' is_pending=?,' . ' allow_participation=?,' . ' allow_anon_participation=?' . ' WHERE resid=?';
     $q = $this->db->prepare($query);
     $result = $this->db->execute($q, $values);
     $this->check_for_error($result);
     // Update the owner of the reservation
     $query = 'UPDATE ' . $this->get_table(TBL_RESERVATION_USERS) . ' SET memberid=? WHERE resid=? AND owner = 1';
     $q = $this->db->prepare($query);
     $result = $this->db->execute($q, array($res->get_memberid(), $res->get_id()));
     $this->check_for_error($result);
     //die('updated owner');
     // Insert all new invitees
     if (count($users_to_invite) > 0) {
         $values = array();
         // Reset values
         foreach ($users_to_invite as $memberid => $email) {
             $values[] = array($id, $memberid, 0, 1, 0, 0, $accept_code, $id, $memberid);
         }
         // Equivalent to 'INSERT INTO ' . $this->get_table(TBL_RESERVATION_USERS) . ' VALUES(?,?,?,?,?,?,?) WHERE NOT EXISTS (SELECT 1 FROM ' . $this->get_table(TBL_RESERVATION_USERS) . ' WHERE resid=? AND memberid=?)';
         // This is needed in case a user is being added to a group of recurring reservations and already exsits on another one
         $query = 'INSERT INTO ' . $this->get_table(TBL_RESERVATION_USERS) . ' SELECT ?,?,?,?,?,?,? FROM ' . $this->get_table(TBL_MUTEX) . ' mutex' . ' LEFT OUTER JOIN ' . $this->get_table(TBL_RESERVATION_USERS) . ' ru ON ru.resid=? AND ru.memberid=?' . ' WHERE mutex.i = 1 AND ru.resid IS NULL AND ru.memberid IS NULL';
         $q = $this->db->prepare($query);
         $result = $this->db->executeMultiple($q, $values);
         $this->check_for_error($result);
     }
     // Delete all removed/uninvited users
     if (count($users_to_remove) > 0) {
         $userids = array();
         // Reset values
         $userids = array_keys($users_to_remove);
         $query = 'DELETE FROM ' . $this->get_table(TBL_RESERVATION_USERS) . ' WHERE resid=? AND memberid IN (' . $this->make_del_list($userids) . ')';
         $q = $this->db->prepare($query);
         $result = $this->db->execute($q, array($id));
         $this->check_for_error($result);
     }
     // Insert all new additional resource records
     if (count($resources_to_add) > 0) {
         $values = null;
         for ($i = 0; $i < count($resources_to_add); $i++) {
             $values[] = array($id, $resources_to_add[$i], 0, $id, $resources_to_add[$i]);
         }
         // Equivalent to 'INSERT INTO ' . $this->get_table(TBL_RESERVATION_RESOURCES) . ' VALUES(?,?,?) WHERE NOT EXISTS (SELECT 1 FROM ' . $this->get_table(TBL_RESERVATION_RESOURCES) . ' WHERE resid=? AND resourceid=?)';
         // This is needed in case a resource is being added to a group of recurring reservations and already exsits on another one
         $query = 'INSERT INTO ' . $this->get_table(TBL_RESERVATION_RESOURCES) . ' SELECT ?,?,? FROM ' . $this->get_table(TBL_MUTEX) . ' mutex' . ' LEFT OUTER JOIN ' . $this->get_table(TBL_RESERVATION_RESOURCES) . ' ar ON ar.resid=? AND ar.resourceid=?' . ' WHERE mutex.i = 1 AND ar.resid IS NULL AND ar.resourceid IS NULL';
         $q = $this->db->prepare($query);
         $result = $this->db->executeMultiple($q, $values);
         $this->check_for_error($result);
     }
     // Delete all removed additional resources
     if (count($resources_to_remove) > 0) {
         $query = 'DELETE FROM ' . $this->get_table(TBL_RESERVATION_RESOURCES) . ' WHERE resid=? AND resourceid IN (' . $this->make_del_list($resources_to_remove) . ')';
         $q = $this->db->prepare($query);
         $result = $this->db->execute($q, array($id));
         $this->check_for_error($result);
     }
     $t->stop();
     $t->print_comment();
     unset($values, $query);
 }
开发者ID:razagilani,项目名称:srrs,代码行数:76,代码来源:ResDB.class.php

示例2: search

// Connect to database
$link = CmnFns::getNewLink();
// Get Link object
// Perform function based on if search button has been pressed
if (isset($_POST['search']) || isset($_GET['text'])) {
    search($_POST['outputtype'], $_POST['searchtype']);
} else {
    showForm($db->get_min_max(), $db->get_table_data('login', array('memberid', 'fname', 'lname'), array('lname', 'fname')), $db->get_table_data('resources', array('machid', 'name'), array('name')), $db->get_table_data('schedules', array('scheduleid', 'scheduletitle'), array('scheduletitle')));
}
$t->endMain();
// End main table
$t->printHTMLFooter();
// Print HTML footer
/****** END MAIN CODE ******/
$timer->stop();
$timer->print_comment();
/**
* Perform search and print out results
* This function will perform the search for given
* criteria and print out formatted results.
* @param string $type output type
* @global $_POST['memberid'] array array of memberid's
* @global $_POST['piid'] array array of piID's
* @global $_POST['machid'] array array of machID's
* @global $_POST['startYear'] int starting year
* @global $_POST['startMonth'] int starting month
* @global $_POST['startDay'] int starting day
* @global $_POST['endYear'] int ending year
* @global $_POST['endMonth'] int ending month
* @global $_POST['endDay'] int ending day
* @global $_POST['starttime'] double starting time
开发者ID:razagilani,项目名称:srrs,代码行数:31,代码来源:usage.php


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