本文整理汇总了PHP中fetch_object函数的典型用法代码示例。如果您正苦于以下问题:PHP fetch_object函数的具体用法?PHP fetch_object怎么用?PHP fetch_object使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fetch_object函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: find
function find($search)
{
global $conn, $agent;
$search = $search;
$sql = "Select agentname,agents_ac_no,contact_person,telephone,fax,email,billing_address,town,postal_code,road_street,building From agents where agents_ac_no='{$search}'";
$results = mkr_query($sql, $conn);
$agent = fetch_object($results);
}
开发者ID:ankita1234,项目名称:hotel-management,代码行数:8,代码来源:agents.php
示例2: find
function find($search)
{
global $conn, $users;
$search = $search;
$sql = "select userid,fname,sname,loginname,pass,phone,mobile,fax,email,countrycode,admin,\n\t\tguest,reservation,booking,agents,rooms,billing,rates,lookup,reports\n\t\tFrom users where userid='{$search}'";
$results = mkr_query($sql, $conn);
$users = fetch_object($results);
}
开发者ID:ankita1234,项目名称:hotel-management,代码行数:8,代码来源:admin.php
示例3: find
function find($search)
{
global $conn, $guests;
$search = $search;
$strOffSet = !empty($_POST["strOffSet"]) ? $_POST["strOffSet"] : 0;
//check on wether search is being done on idno/ppno/guestid/guestname
$sql = "Select guests.guestid,concat_ws(' ',guests.firstname,guests.middlename,guests.lastname) as guest,guests.pp_no,\n\t\tguests.idno,guests.countrycode,guests.pobox,guests.town,guests.postal_code,guests.phone,\n\t\tguests.email,guests.mobilephone,countries.country\n\t\tFrom guests\n\t\tInner Join countries ON guests.countrycode = countries.countrycode where guests.guestid='{$search}'\n\t\tLIMIT {$strOffSet},1";
$results = mkr_query($sql, $conn);
$guests = fetch_object($results);
}
开发者ID:ankita1234,项目名称:hotel-management,代码行数:10,代码来源:guests.php
示例4: db_connect
<td>
<h2>Reservation List </h2>
</td>
</tr>
<tr>
<td><div id="Requests">
<?php
$sql = "Select reservation.reservation_id,guests.guestid,concat_ws(' ',guests.firstname,guests.middlename,guests.lastname) as guest,reservation.reserve_checkindate,reservation.reserve_checkoutdate,DATEDIFF(reservation.reserve_checkoutdate,reservation.reserve_checkindate) nights,\n\t\t\treservation.meal_plan,reservation.no_adults,reservation.no_child0_5,reservation.roomid,reservation.reservation_by,rooms.roomno\n\t\t\tFrom reservation\n\t\t\tInner Join guests ON reservation.guestid = guests.guestid\n\t\t\tInner Join rooms ON reservation.roomid = rooms.roomid";
$conn = db_connect(HOST, USER, PASS, DB, PORT);
$results = mkr_query($sql, $conn);
echo "<table align=\"center\">";
//get field names to create the column header
echo "<tr bgcolor=\"#009999\">\n\t\t\t\t<th colspan=\"4\">Action</th>\n\t\t\t\t<th>Room No.</th>\n\t\t\t\t<th>Guest</th>\n\t\t\t\t<th>Meal Plan</th>\n\t\t\t\t<th>Check-In Date</th>\n\t\t\t\t<th>Check-Out Date</th>\n\t\t\t\t<th>Nights</th>\n\t\t\t\t<th>Adults</th>\n\t\t\t\t<th>Children</th>\n\t\t\t\t</tr>";
//end of field header
//get data from selected table on the selected fields
while ($reservation = fetch_object($results)) {
//alternate row colour
$j++;
if ($j % 2 == 1) {
echo "<tr id=\"row{$j}\" onmouseover=\"javascript:setColor('{$j}')\" onmouseout=\"javascript:origColor('{$j}')\" bgcolor=\"#CCCCCC\">";
} else {
echo "<tr id=\"row{$j}\" onmouseover=\"javascript:setColor('{$j}')\" onmouseout=\"javascript:origColor('{$j}')\" bgcolor=\"#EEEEF8\">";
}
echo "<td><a href=\"reservations.php?search={$reservation->guestid}\"><img src=\"images/button_view.png\" width=\"16\" height=\"16\" border=\"0\" title=\"view/edit reservation\"/></a></td>";
echo "<td><a href=\"bookings.php?search={$reservation->guestid}\"><img src=\"images/bed.jpg\" width=\"16\" height=\"16\" border=\"0\" title=\"book guest\"/></a></td>";
echo "<td><a href=\"billings.php?search={$reservation->guestid}\"><img src=\"images/button_signout.png\" width=\"16\" height=\"16\" border=\"0\" title=\"bill guest\"/></a></td>";
echo "<td><a href=\"reservation_list.php?search={$reservation->reservation_id}&action=remove\"><img src=\"images/button_remove.png\" width=\"16\" height=\"16\" border=\"0\" title=\"delete reservation\"/></a></td>";
echo "<td>" . $reservation->roomno . "</td>";
echo "<td>" . trim($reservation->guest) . "</td>";
echo "<td>" . $reservation->meal_plan . "</td>";
echo "<td>" . $reservation->reserve_checkindate . "</td>";
开发者ID:ivan-kovalenko,项目名称:hotelmis,代码行数:31,代码来源:reservation_list.php
示例5: find
function find($search)
{
global $conn, $bookings;
$search = $search;
$strOffSet = !empty($_POST["strOffSet"]) ? $_POST["strOffSet"] : 0;
//offset value peacked on all pages with pagination - logical error
//check on wether search is being done on idno/ppno/guestid/guestname
$sql = "Select guests.guestid,concat_ws(' ',guests.firstname,guests.middlename,guests.lastname) as guest,guests.pp_no,\n\t\tguests.idno,guests.countrycode,guests.pobox,guests.town,guests.postal_code,guests.phone,guests.email,guests.mobilephone,\n\t\tcountries.country,booking.book_id,booking.guestid,booking.booking_type,booking.meal_plan,booking.no_adults,booking.no_child,\n\t\tbooking.checkin_date,booking.checkout_date,booking.residence_id,booking.payment_mode,booking.agents_ac_no,booking.roomid,\n\t\tbooking.checkedin_by,booking.invoice_no,booking.billed,booking.checkoutby,booking.codatetime,DATEDIFF(booking.checkout_date,booking.checkin_date) as no_nights\n\t\tFrom guests\n\t\tInner Join countries ON guests.countrycode = countries.countrycode\n\t\tInner Join booking ON guests.guestid = booking.guestid\n\t\twhere booking.book_id='{$search}'";
$results = mkr_query($sql, $conn);
$bookings = fetch_object($results);
}
开发者ID:ankita1234,项目名称:hotel-management,代码行数:11,代码来源:bookings.php
示例6: getdata
/**
*This function is getting data from database<br>
*@note global variables <i>sql</i>,<i>con</i> to set the result.<br>
*display result to web page.<br>
*Generate HTML output directly for use in web page.<br>
*/
function getdata()
{
global $sql, $conn;
$results = mkr_query($sql, $conn);
/*$totRows = mysql_query("SELECT FOUND_ROWS()"); //get total number of records in the select query irrespective of the LIMIT clause
$totRows = mysql_result($totRows , 0);
$_SESSION["nRecords"]=$totRows;
$_SESSION["totPages"]=ceil($totRows/$strRows);
$_SESSION["RowsDisplayed"]=$strRows;*/
echo "<table align=\"center\">";
//get field names to create the column header
echo "<tr bgcolor=\"#009999\">\n\t\t<th>Action</th>";
while ($i < mysql_num_fields($results)) {
$meta = mysql_fetch_field($results, $i);
$field = $meta->name;
echo "<th>" . $field . "</th>";
$i++;
}
"</tr>";
//end of field header
if ((int) $results !== 0) {
//get data from selected table on the selected fields
while ($row = fetch_object($results)) {
//alternate row colour
$j++;
if ($j % 2 == 1) {
echo "<tr id=\"row{$j}\" onmouseover=\"javascript:setColor('{$j}')\" onmouseout=\"javascript:origColor('{$j}')\" bgcolor=\"#CCCCCC\">";
} else {
echo "<tr id=\"row{$j}\" onmouseover=\"javascript:setColor('{$j}')\" onmouseout=\"javascript:origColor('{$j}')\" bgcolor=\"#EEEEF8\">";
}
echo "<td><a href=\"reportqueries.php?search={$row->ID}\"><img src=\"images/button_view.png\" width=\"16\" height=\"16\" border=\"0\" title=\"view\"/></a></td>";
$i = 0;
while ($i < mysql_num_fields($results)) {
$meta = mysql_fetch_field($results, $i);
$field = $meta->name;
echo "<td>" . $row->{$field} . "</td>";
$i++;
}
//
echo "</tr>";
//end of - data rows
}
//end of while row
echo "</table>";
}
free_result($results);
}
开发者ID:bogiesoft,项目名称:hotelmis-ota,代码行数:53,代码来源:reportqueries.php
示例7: db_connect
<label><input type="radio" name="roomstatus" value="R" />
Agents</label>
<label><input type="radio" name="roomstatus" value="B" />
Guests</label></td></tr>
<tr>
<td colspan="2"><div id="Requests">
<?php
$conn = db_connect(HOST, USER, PASS, DB, PORT);
$sql = "Select users.userid,concat_ws(' ',users.fname,users.sname) as user,users.loginname,users.phone,users.mobile,\n\t\t\t\tusers.fax,users.email,users.dateregistered,users.admin,users.guest,users.reservation,\n\t\t\t\tusers.booking,users.agents,users.rooms,users.billing,users.rates,users.lookup,users.reports,countries.country\n\t\t\t\tFrom users\n\t\t\t\tleft Join countries ON users.countrycode = countries.countrycode";
$results = mkr_query($sql, $conn);
echo "<table align=\"center\">";
//get field names to create the column header
echo "<tr bgcolor=\"#009999\">\n\t\t\t\t<th colspan=\"2\">Action</th>\n\t\t\t\t<th>User Id</th>\n\t\t\t\t<th>User</th>\n\t\t\t\t<th>Admin.</th>\n\t\t\t\t<th>Guest</th>\n\t\t\t\t<th>Reservation</th>\n\t\t\t\t<th>Booking</th>\n\t\t\t\t<th>Agents</th>\n\t\t\t\t<th>Rooms</th>\n\t\t\t\t<th>Bills</th>\n\t\t\t\t<th>Rates</th>\n\t\t\t\t<th>Lookup</th>\n\t\t\t\t<th>Reports</th>\n\t\t\t\t</tr>";
//end of field header
//get data from selected table on the selected fields
while ($user = fetch_object($results)) {
//alternate row colour
$j++;
if ($j % 2 == 1) {
echo "<tr id=\"row{$j}\" onmouseover=\"javascript:setColor('{$j}')\" onmouseout=\"javascript:origColor('{$j}')\" bgcolor=\"#CCCCCC\">";
} else {
echo "<tr id=\"row{$j}\" onmouseover=\"javascript:setColor('{$j}')\" onmouseout=\"javascript:origColor('{$j}')\" bgcolor=\"#EEEEF8\">";
}
echo "<td><a href=\"admin.php?search={$user->userid}\"><img src=\"images/button_view.png\" width=\"16\" height=\"16\" border=\"0\" title=\"view/edit user details\"/></a></td>";
echo "<td><a href=\"users_list.php?search={$user->userid}&action=remove\"><img src=\"images/button_remove.png\" width=\"16\" height=\"16\" border=\"0\" title=\"remove user\"/></a></td>";
echo "<td>" . $user->userid . "</td>";
echo "<td>" . $user->user . "</td>";
echo "<td>" . $user->admin . "</td>";
echo "<td>" . $user->guest . "</td>";
echo "<td>" . $user->reservation . "</td>";
echo "<td>" . $user->booking . "</td>";
开发者ID:ankita1234,项目名称:hotel-management,代码行数:31,代码来源:users_list.php
示例8: bootstrap
function bootstrap()
{
$this->long_name = editor_generic::long_name();
unset($this->key_by_id);
unset($this->key_by_name);
unset($this->col_by_id);
unset($this->col_by_name);
unset($this->fetchq);
unset($this->captions);
unset($this->resizers);
$this->editors = array();
$this->tr->td->nodes = array();
$this->wr->nodes = array();
$this->use_single = false;
fetch_object($this);
//print htmlspecialchars(serialize($this));
//editor_generic::addeditor('m_text',new m_text);
//$this->td->append_child($this->editors['m_text']);
$this->fetchq = new query_gen_ext('SELECT');
$this->fetchq->from->exprs[] = new sql_column(NULL, $this->sql_table);
$keys_found = 0;
foreach ($this->key_by_id as $c) {
if (isset($this->keys[$c['id']])) {
$wh = new sql_expression('=', array(new sql_column(NULL, NULL, $c['name']), new sql_immed($this->keys[$c['id']])));
$this->fetchq->where->exprs[] = $wh;
$keys_found++;
}
$wh = new sql_column(NULL, NULL, $c['name'], 'c' . $c['id']);
$this->fetchq->what->exprs[] = $wh;
//add to key list
if (!isset($this->keys[$c['id']])) {
$this->keys[$c['id']] = '';
}
}
foreach ($this->col_by_id as $c) {
if ($keys_found == count($this->key_by_id)) {
$tr = new dom_tr();
unset($tr->id);
$this->single->append_child($tr);
$th = new dom_td();
unset($th->id);
$tr->append_child($th);
$txt = new dom_statictext($c['hr_name']);
$th->append_child($txt);
$th->attributes['title'] = $e['name'];
$td = new dom_td();
$tr->append_child($td);
if ($c['editor'] != '') {
$ed = $c['editor'];
} else {
$ed = 'm_text';
}
editor_generic::addeditor('c' . $c['id'], new $ed($c));
$this->editors_by_id[$c['id']] = $this->editors['c' . $c['id']];
$this->editors_by_id[$c['id']]->css_class = 'c' . $c['id'];
$this->editors_by_id[$c['id']]->oid = $c['id'];
$td->append_child($this->editors['c' . $c['id']]);
$this->use_single = true;
} else {
if ($c['editor'] != '') {
$ed = $c['editor'];
} else {
// $ed='m_text';
$ed = 'v_text_keysel';
}
editor_generic::addeditor('c' . $c['id'], new $ed($c));
$this->editors_by_id[$c['id']] = $this->editors['c' . $c['id']];
$this->editors_by_id[$c['id']]->css_class = 'c' . $c['id'];
$this->editors_by_id[$c['id']]->oid = $c['id'];
$this->tr->append_child($this->editors['c' . $c['id']]);
//caption
$wd = new dom_td();
$this->resizers[$c['id']] = new dom_div();
$this->resizers[$c['id']]->css_class = 'c' . $c['id'];
$this->resizers[$c['id']]->before_id = 'r';
$this->resizers[$c['id']]->after_id = 'resize_stylex';
$this->captions[$c['id']] = new dom_statictext();
$this->wr->append_child($wd);
$wd->append_child($this->resizers[$c['id']]);
$this->resizers[$c['id']]->append_child($this->captions[$c['id']]);
}
//add to fetch query
$wh = new sql_column(NULL, NULL, $c['name'], 'c' . $c['id']);
$this->fetchq->what->exprs[] = $wh;
//add style
$this->style->exstyle['.c' . $c['id']]['width'] = '50px';
#$this->style->exstyle['.c'.$c['id']]['overflow']='hidden';
#$this->style->exstyle['.c'.$c['id']]['padding-right']='1px';
$this->style->exstyle['.c' . $c['id']]['margin'] = '0px';
$this->style->exstyle['.c' . $c['id']]['padding'] = '0px';
// $this->style->exstyle['.c'.$c['id']]['margin']='2px';
$this->style->exstyle['.c' . $c['id'] . " input"]['width'] = '100%';
$this->style->exstyle['.c' . $c['id'] . " input"]['margin'] = '0px';
$this->style->exstyle['.c' . $c['id'] . " input"]['padding'] = '0px';
$this->style->exstyle['.c' . $c['id'] . " input"]['border'] = '0px';
$this->context[$this->long_name . '.c' . $c['id']]['var'] = 'c' . $c['id'];
}
if (!is_array($this->args)) {
$this->args = array();
}
//.........这里部分代码省略.........
开发者ID:vladisslav2011,项目名称:nb,代码行数:101,代码来源:dev_controls.php
示例9: error_reporting
check for license.txt at the root folder
/*****************************************************************************
For any details please feel free to contact me at [email protected]
Or for snail mail. P. O. Box 938, Kilifi-80108, East Africa-Kenya.
/*****************************************************************************/
error_reporting(E_ALL & ~E_NOTICE);
include_once "queryfunctions.php";
include_once "functions.php";
$loginname = $_SESSION["loginname"];
$sql = "select userid,admin,guest,reservation,booking,agents,rooms,billing,rates,lookup,reports from users where loginname='{$loginname}'";
$conn = db_connect(HOST, USER, PASS, DB, PORT);
$results = mkr_query($sql, $conn);
$msg[0] = "";
$msg[1] = "";
AddSuccess($results, $conn, $msg);
$access = fetch_object($results);
//will be used to set access on pages
/*if !isset($_SESSION["access"]){
$_SESSION["access"]
}*/
if ($access->admin == 1) {
echo "<tr><td><a href=\"admin.php\">Admin</a></td></tr>";
}
if ($access->guest == 1) {
echo "<tr><td><a href=\"guests.php\">Guests</a></td></tr>";
}
if ($access->reservation == 1) {
echo "<tr><td><a href=\"reservations.php\">Reservations</a></td></tr>";
}
if ($access->booking == 1) {
echo "<tr><td><a href=\"bookings.php\">Bookings</a></td></tr>";
开发者ID:ivan-kovalenko,项目名称:hotelmis,代码行数:31,代码来源:menu_header.php
示例10: year
/*$sql="Select rooms.roomno,concat_ws(' ',guests.firstname,guests.middlename,guests.lastname) as guest,
booking.checkin_date,booking.checkout_date,DATEDIFF(booking.checkout_date,booking.checkin_date) as nights,
booking.meal_plan,booking.no_adults,booking.no_child
From rooms
left Join booking ON rooms.roomid = booking.roomid
left Join guests ON booking.guestid = guests.guestid
Where year(booking.checkin_date ) = '2006' AND month(booking.checkin_date ) = '7'
Order By booking.checkin_date Asc";*/
$sql = "Select rooms.roomno,guests.guestid,concat_ws(' ',guests.firstname,guests.middlename,guests.lastname) AS guest,\n\t\t\t\tbooking.checkin_date,booking.checkout_date,DATEDIFF(booking.checkout_date,booking.checkin_date) AS nights,\n\t\t\t\tbooking.meal_plan,booking.no_adults,booking.no_child,rooms.`status`\n\t\t\t\tFrom rooms\n\t\t\t\tleft Join booking ON rooms.roomid = booking.roomid\n\t\t\t\tleft Join guests ON booking.guestid = guests.guestid\n\t\t\t\tOrder By rooms.roomno Asc";
$results = mkr_query($sql, $conn);
echo "<table align=\"center\">";
//get field names to create the column header
echo "<tr bgcolor=\"#009999\">\n\t\t\t\t<th></th>\n\t\t\t\t<th>Room No.</th>\n\t\t\t\t<th>Guest Name</th>\n\t\t\t\t<th>In</th>\n\t\t\t\t<th>Out</th>\n\t\t\t\t<th>Nts</th>\n\t\t\t\t<th>Plan</th>\n\t\t\t\t<th>Adults</th>\n\t\t\t\t<th>Children</th>\n\t\t\t\t<th>Room Status</th>\n\t\t\t\t</tr>";
//end of field header
//get data from selected table on the selected fields
while ($booked = fetch_object($results)) {
//alternate row colour
$j++;
if ($j % 2 == 1) {
echo "<tr bgcolor=\"#CCCCCC\">";
} else {
echo "<tr bgcolor=\"#EEEEF8\">";
}
echo "<td><a href=\"bookings.php?search={$booked->guestid}\"><img src=\"images/button_view.png\" width=\"16\" height=\"16\" border=\"0\" title=\"view booking details\"/></a></td>";
echo "<td>" . $booked->roomno . "</td>";
echo "<td>" . $booked->guest . "</td>";
echo "<td>" . $booked->checkin_date . "</td>";
echo "<td>" . $booked->checkout_date . "</td>";
echo "<td>" . $booked->nights . "</td>";
echo "<td>" . $booked->meal_plan . "</td>";
echo "<td>" . $booked->no_adults . "</td>";
开发者ID:ankita1234,项目名称:hotel-management,代码行数:31,代码来源:rooms_list.php
示例11: db_connect
<td>
<h2>Agents List </h2>
</td>
</tr>
<tr>
<td><div id="Requests">
<?php
$conn = db_connect(HOST, USER, PASS, DB, PORT);
$sql = "Select agentname,agents_ac_no,contact_person,telephone,fax,email,billing_address,town,postal_code,road_street,building From agents";
$results = mkr_query($sql, $conn);
echo "<table align=\"center\">";
//get field names to create the column header
echo "<tr bgcolor=\"#009999\">\n\t\t\t\t<th></th>\n\t\t\t\t<th>A/C No.</th>\n\t\t\t\t<th>Agent</th>\n\t\t\t\t<th>Contact</th>\n\t\t\t\t<th>Fax</th>\n\t\t\t\t<th>Phone</th>\n\t\t\t\t<th>Email</th>\n\t\t\t\t<th>P. O. Box</th>\n\t\t\t\t<th>Town-Postal code</th>\n\t\t\t\t</tr>";
//end of field header
//get data from selected table on the selected fields
while ($agent = fetch_object($results)) {
//alternate row colour
$j++;
if ($j % 2 == 1) {
echo "<tr id=\"row{$j}\" onmouseover=\"javascript:setColor('{$j}')\" onmouseout=\"javascript:origColor('{$j}')\" bgcolor=\"#CCCCCC\">";
} else {
echo "<tr id=\"row{$j}\" onmouseover=\"javascript:setColor('{$j}')\" onmouseout=\"javascript:origColor('{$j}')\" bgcolor=\"#EEEEF8\">";
}
echo "<td><a href=\"agents.php?search={$agent->agents_ac_no}\"><img src=\"images/button_view.png\" width=\"16\" height=\"16\" border=\"0\" title=\"View\"/></a></td>";
echo "<td>" . $agent->agents_ac_no . "</td>";
echo "<td>" . $agent->agentname . "</td>";
echo "<td>" . $agent->contact_person . "</td>";
echo "<td>" . $agent->fax . "</td>";
echo "<td>" . $agent->telephone . "</td>";
echo "<td>" . $agent->email . "</td>";
echo "<td>" . $agent->billing_address . "</td>";
开发者ID:ivan-kovalenko,项目名称:hotelmis,代码行数:31,代码来源:agents_list.php
示例12: db_connect
include_once "login_check.inc.php";
include_once "queryfunctions.php";
include_once "functions.php";
if (isset($_POST['Submit'])) {
$conn = db_connect(HOST, USER, PASS, DB, PORT);
$action = $_POST['Submit'];
switch ($action) {
case 'List':
return;
break;
case 'Find':
//check if user is searching using name, payrollno, national id number or other fields
$search = $_POST["search"];
$sql = "Select guests.guestid,guests.lastname,guests.firstname,guests.middlename,guests.pp_no,\n\t\t\tguests.idno,guests.countrycode,guests.pobox,guests.town,guests.postal_code,guests.phone,\n\t\t\tguests.email,guests.mobilephone,countries.country\n\t\t\tFrom guests\n\t\t\tInner Join countries ON guests.countrycode = countries.countrycode where pp_no='{$search}'";
$results = mkr_query($sql, $conn);
$agent = fetch_object($results);
break;
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/new.css" rel="stylesheet" type="text/css">
<title>Hotel Management Information System</title>
<script type="text/javascript">
<!--
var request;
开发者ID:ivan-kovalenko,项目名称:hotelmis,代码行数:31,代码来源:guests_list.php
示例13: fetch_object
$selectRow = fetch_object($selectResult);
echo "<TABLE BORDER=0>\n";
echo "<TD><I>Interface</I>:</TD><TD>{$selectRow->name} ({$iid['0']})</TD><TR>\n";
if ($sclass == "network") {
printf("<TD><I>Speed</I>:</TD><TD>%2.3f Mbps</TD><TR>\n", $selectRow->speed / 1000000);
}
echo "<TD><I>Description</I>:</TD><TD>{$selectRow->description}</TD><TR>\n";
echo "</TABLE>\n";
}
foreach ($stat_list as $stat) {
$table_list = array();
$selectQuery = "SELECT tablename from mapping_table where graphname=\"{$stat}\"";
$selectResult = query($dbc, $selectQuery);
$x = 0;
$args = "";
while ($selectRow = fetch_object($selectResult)) {
$f_table = $selectRow->tablename;
if (isset($has_tables[$f_table])) {
$selectQuery = "SELECT id from " . $f_table . "_{$rid} where id={$t_iid} AND {$time_range} LIMIT 1";
$selectResult2 = query($dbc, $selectQuery);
$selectRow2 = fetch_array($selectResult2);
if (isset($selectRow2[0])) {
$x++;
$table_list["t{$x}"] = $f_table;
echo "<!-- yay! we found {$f_table} for {$stat} -->\n";
$args = $args . "t{$x}=" . $f_table . "_{$rid}&";
} else {
echo "<!-- {$f_table} isn't valid for this interface! -->\n";
}
}
}
开发者ID:cabloo,项目名称:RTG2,代码行数:31,代码来源:targetmaker.php
示例14: strtotime
echo "</TABLE>\n";
echo "<P>";
echo '<INPUT TYPE="SUBMIT" VALUE="Ok">';
echo "</FORM>";
}
if (($bt || $smonth) && $iid) {
/* Format into GNU date syntax */
if ($bt == "") {
$bt = strtotime("{$syear}-{$smonth}-{$sday} {$shour}:{$smin}:00");
$et = strtotime("{$eyear}-{$emonth}-{$eday} {$ehour}:{$emin}:59");
}
$range = "dtime>FROM_UNIXTIME({$bt}) AND dtime<=FROM_UNIXTIME({$et})";
$range = "{$range} AND id={$iid['0']}";
$selectQuery = "SELECT description, name, speed FROM interface WHERE rid={$rid} AND id={$iid['0']}";
$selectResult = query($dbc, $selectQuery);
$selectRow = fetch_object($selectResult);
echo "<TABLE BORDER=0>\n";
echo "<TD><I>Device</I>:</TD><TD>{$router} ({$rid})</TD><TR>\n";
echo "<TD><I>Interface</I>:</TD><TD>{$selectRow->name} ({$iid['0']})</TD><TR>\n";
printf("<TD><I>Speed</I>:</TD><TD>%2.3f Mbps</TD><TR>\n", $selectRow->speed / 1000000);
echo "<TD><I>Description</I>:</TD><TD>{$selectRow->description}</TD><TR>\n";
print strftime("<TD><I>Period</I>:</TD><TD>%m/%d/%Y %H:%M - ", $bt);
print strftime("%m/%d/%Y %H:%M</TD>\n", $et);
echo "</TABLE>\n";
echo "<P>\n";
# XXX - REB - Why did this get nuked?
#$selectQuery="SELECT DISTINCT id FROM ifInOctets_$rid WHERE $range";
#$selectResult=mysql_query($selectQuery, $dbc);
#if (mysql_num_rows($selectResult) <= 0) {
# print "<BR>No Data Found on Interface for Given Range.<BR>\n";
#}
开发者ID:cabloo,项目名称:RTG2,代码行数:31,代码来源:rtg.php
示例15: db_connect
<td>
<h2>Booking List </h2>
</td>
</tr>
<tr>
<td><div id="Requests">
<?php
$sql = "Select guests.guestid,concat_ws(' ',guests.firstname,guests.middlename,guests.lastname) as guest,booking.checkin_date,\n\t\t\tbooking.checkout_date,DATEDIFF(booking.checkout_date,booking.checkin_date) nights,\n\t\t\tbooking.meal_plan,booking.no_adults,booking.no_child,booking.roomid,booking.checkedin_by,rooms.roomno,booking.book_id\n\t\t\tFrom booking\n\t\t\tInner Join guests ON booking.guestid = guests.guestid\n\t\t\tInner Join rooms ON booking.roomid = rooms.roomid";
$conn = db_connect(HOST, USER, PASS, DB, PORT);
$results = mkr_query($sql, $conn);
echo "<table align=\"center\">";
//get field names to create the column header
echo "<tr bgcolor=\"#009999\">\n\t\t\t\t<th colspan=\"2\">Action</th>\n\t\t\t\t<th>Room No.</th>\n\t\t\t\t<th>Guest</th>\n\t\t\t\t<th>Meal Plan</th>\n\t\t\t\t<th>Check-In Date</th>\n\t\t\t\t<th>Check-Out Date</th>\n\t\t\t\t<th>Nights</th>\n\t\t\t\t<th>Adults</th>\n\t\t\t\t<th>Children</th>\n\t\t\t\t</tr>";
//end of field header
//get data from selected table on the selected fields
while ($booking = fetch_object($results)) {
//alternate row colour
$j++;
if ($j % 2 == 1) {
echo "<tr id=\"row{$j}\" onmouseover=\"javascript:setColor('{$j}')\" onmouseout=\"javascript:origColor('{$j}')\" bgcolor=\"#CCCCCC\">";
} else {
echo "<tr id=\"row{$j}\" onmouseover=\"javascript:setColor('{$j}')\" onmouseout=\"javascript:origColor('{$j}')\" bgcolor=\"#EEEEF8\">";
}
echo "<td><a href=\"bookings.php?search={$booking->book_id}\"><img src=\"images/button_view.png\" width=\"16\" height=\"16\" border=\"0\" title=\"view booking details\"/></a></td>";
echo "<td><a href=\"billings.php?search={$booking->guestid}\"><img src=\"images/button_signout.png\" width=\"16\" height=\"16\" border=\"0\" title=\"bill guest\"/></a></td>";
echo "<td>" . $booking->roomno . "</td>";
echo "<td>" . trim($booking->guest) . "</td>";
echo "<td>" . $booking->meal_plan . "</td>";
echo "<td>" . $booking->checkin_date . "</td>";
echo "<td>" . $booking->checkout_date . "</td>";
echo "<td>" . $booking->nights . "</td>";
开发者ID:ankita1234,项目名称:hotel-management,代码行数:31,代码来源:bookings_list.php
示例16: find
function find($search)
{
global $conn, $bill;
$search = $search;
//search on booking
//check on wether search is being done on idno/ppno/guestid/guestname
$sql = "Select bills.bill_id,bills.book_id,bills.date_billed,bills.billno,bills.`status`,bills.date_checked,\n\t\tconcat_ws(' ',guests.firstname,guests.middlename,guests.lastname) as guest,guests.pobox,guests.town,guests.postal_code,\n\t\tbooking.checkin_date,booking.checkout_date,booking.roomid,rooms.roomno\n\t\tFrom bills\n\t\tInner Join booking ON bills.book_id = booking.book_id\n\t\tInner Join guests ON booking.guestid = guests.guestid\n\t\tInner Join rooms ON booking.roomid = rooms.roomid where bills.bill_id='{$search}'";
//need a search on reservation - todo not (tested)
/*$sql="Select bills.bill_id,bills.book_id,bills.date_billed,bills.billno,bills.`status`,bills.date_checked,
concat_ws(' ',guests.firstname,guests.middlename,guests.lastname) as guest,guests.pobox,guests.town,guests.postal_code,
reservation.reserve_checkindate,reservation.reserve_checkoutdate,reservation.roomid,rooms.roomno
From bills
Inner Join reservation ON bills.book_id = reservation.reservation_id
Inner Join guests ON reservation.guestid = guests.guestid
Inner Join rooms ON reservation.roomid = rooms.roomid where bills.bill_id='$search'";*/
$results = mkr_query($sql, $conn);
$bill = fetch_object($results);
}
开发者ID:ivan-kovalenko,项目名称:hotelmis,代码行数:18,代码来源:billings.php
示例17: rooms
$reserverd = !empty($_POST["status"]) ? "'" . $_POST["status"] . "'" : 'NULL';
$photo = !empty($_POST["photo"]) ? "'" . $photo . "'" : 'NULL';
$filetype = !empty($_POST["filetype"]) ? "'" . $filetype . "'" : 'NULL';
$sql = "INSERT INTO rooms (roomno,roomtypeid,roomname,noofrooms,occupancy,tv,aircondition,fun,safe,fridge,status,photo,filetype)\n\t\t\t\t VALUES({$roomno},{$roomtypeid},{$roomname},{$noofrooms},{$occupancy},{$tv},{$aircondition},{$fun},{$safe},{$fridge},{$status},{$photo},{$filetype})";
$results = mkr_query($sql, $conn);
AddSuccess($results, $conn);
}
break;
case 'List':
break;
case 'Find':
//check if user is searching using name, payrollno, national id number or other fields
$search = $_POST["search"];
$sql = "Select rooms.roomid,rooms.roomno,rooms.roomtypeid,roomtype.roomtype,rooms.roomname,\n\t\t\trooms.noofrooms,rooms.occupancy,rooms.tv,rooms.aircondition,rooms.fun,rooms.safe,rooms.fridge,rooms.status,rooms.photo\n\t\t\tFrom rooms Inner Join roomtype ON rooms.roomtypeid = roomtype.roomtypeid where roomno='{$search}'";
$results = mkr_query($sql, $conn);
$rooms = fetch_object($results);
break;
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/new.css" rel="stylesheet" type="text/css">
<title>Hotel Management Information System</title>
<script type="text/javascript">
<!--
var request;
开发者ID:ivan-kovalenko,项目名称:hotelmis,代码行数:31,代码来源:rooms.php
示例18: findguest
function findguest($search)
{
global $conn, $guests;
$search = $search;
//check on wether search is being done on idno/ppno/guestid/guestname
$sql = "Select guests.guestid,guests.lastname,guests.firstname,guests.middlename,guests.pp_no,\n\t\tguests.idno,guests.countrycode,guests.pobox,guests.town,guests.postal_code,guests.phone,\n\t\tguests.email,guests.mobilephone,countries.country\n\t\tFrom guests\n\t\tInner Join countries ON guests.countrycode = countries.countrycode where guests.guestid='{$search}'";
$results = mkr_query($sql, $conn);
$guests = fetch_object($results);
}
开发者ID:ankita1234,项目名称:hotel-management,代码行数:9,代码来源:functions.php
示例19: updatebill
function updatebill()
{
$billno = !empty($_POST['search']) ? $_POST['search'] : 0;
//$billno=!empty($_POST['billid']) ? $_POST['billid'] : 1;
$sql = "Select transactions.doc_date,details.item,transactions.dr,transactions.cr,transactions.doc_no,transactions.doc_type,details.itemid\n\t\tFrom transactions\n\t\tInner Join details ON transactions.details = details.itemid\n\t\tWhere transactions.billno = '{$search}'";
$results = mkr_query($sql, $conn);
echo "<table width=\"100%\" border=\"0\" cellpadding=\"1\">\n\t <tr bgcolor=\"#FF9900\">\n\t\t<th></th>\n\t\t<th>Date</th>\n\t\t<th>Details</th>\n\t\t<th>DR</th>\n\t\t<th>CR</th>\n\t\t<th>Balance</th>\n\t\t<th>Doc. No. </th>\n\t\t<th>Doc. Type</th>\n\t </tr>";
//get data from selected table on the selected fields
while ($trans = fetch_object($results)) {
$balance = $balance - $trans->cr + $trans->dr;
//alternate row colour
$j++;
if ($j % 2 == 1) {
echo "<tr id=\"row{$j}\" onmouseover=\"javascript:setColor('{$j}')\" onmouseout=\"javascript:origColor('{$j}')\" bgcolor=\"#CCCCCC\">";
} else {
echo "<tr id=\"row{$j}\" onmouseover=\"javascript:setColor('{$j}')\" onmouseout=\"javascript:origColor('{$j}')\" bgcolor=\"#EEEEF8\">";
}
echo "<td><a href=\"billings.php?search={$guest->guestid}&action=search\"><img src=\"images/button_signout.png\" width=\"16\" height=\"16\" border=\"0\" title=\"bill guest\"/></a></td>";
echo "<td>" . $trans->doc_date . "</td>";
|
请发表评论