本文整理汇总了PHP中pg_fetch_result函数的典型用法代码示例。如果您正苦于以下问题:PHP pg_fetch_result函数的具体用法?PHP pg_fetch_result怎么用?PHP pg_fetch_result使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pg_fetch_result函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: fetchResult
/**
* Returns a specific field of the current row.
*
* @param string $field
* @return mixed
*/
public function fetchResult($field)
{
if ($this->currentRowNumber >= $this->numRows()) {
return false;
}
return pg_fetch_result($this->result, $this->currentRowNumber, $field);
}
开发者ID:enyo,项目名称:rincewind,代码行数:13,代码来源:PostgresqlResult.php
示例2: getWeekNumber
function getWeekNumber($mday, $month, $year)
{
$sql = "SELECT EXTRACT(week FROM DATE '{$year}-{$month}-{$mday}')";
$rslt = db_exec($sql);
return pg_fetch_result($rslt, 0, 0);
//return round(date("z", mktime(0,0,0,$month,$mday,$year) ) / 7);
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:7,代码来源:diary-functions.php
示例3: display
function display()
{
extract($_REQUEST);
$sql = "SELECT * FROM cubit.documents WHERE id='{$id}'";
$doc_rslt = db_exec($sql) or errDie("Unable to retrieve documents.");
$doc_data = pg_fetch_array($doc_rslt);
extract($doc_data);
if (!empty($doc_type)) {
$sql = "SELECT type_name FROM cubit.document_types WHERE id='{$doc_type}'";
$type_rslt = db_exec($sql) or errDie("Unable to retrieve document type.");
$type_name = pg_fetch_result($type_rslt, 0);
} else {
$type_name = "";
}
if (!empty($team_id)) {
$sql = "SELECT team_name FROM cubit.teams WHERE id='{$team_id}'";
$team_rslt = db_exec($sql) or errDie("Unable to retrieve team.");
$team_name = pg_fetch_result($team_rslt, 0);
} else {
$team_name = "";
}
$OUTPUT = "<table " . TMPL_tblDflts . ">\n\t<tr><td valign='top'>\n\t<table " . TMPL_tblDflts . ">\n\t\t<tr>\n\t\t\t<th colspan='2'>Details</th>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>Title</td>\n\t\t\t<td>{$title}</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>Project</td>\n\t\t\t<td>{$project}</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>Area</td>\n\t\t\t<td>{$area}</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>Discipline</td>\n\t\t\t<td>{$discipline}</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>Document Type</td>\n\t\t\t<td>{$type_name}</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>Revision</td>\n\t\t\t<td>{$revision}</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>Drawing Number</td>\n\t\t\t<td>{$drawing_num}</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>Sheet Number</td>\n\t\t\t<td>{$sheet_num}</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>File Location</td>\n\t\t\t<td>{$location}</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>Contract</td>\n\t\t\t<td>{$contract}</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>Contractor</td>\n\t\t\t<td>{$contractor}</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>Code</td>\n\t\t\t<td>{$code}</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>Issue For</td>\n\t\t\t<td>{$issue_for}</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>Comments</td>\n\t\t\t<td>{$comments}</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>QS</td>\n\t\t\t<td>{$qs}</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>Team Permissions</td>\n\t\t\t<td>{$team_name}</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>Status</td>\n\t\t\t<td>{$status}</td>\n\t\t</tr>\n\t</table>\n\t</td><td valign='top'>";
$sql = "SELECT * FROM document_files WHERE doc_id='{$id}'";
$df_rslt = db_exec($sql) or errDie("Unable to retrieve files.");
$file_out = "";
while ($df_data = pg_fetch_array($df_rslt)) {
$file_out .= "<tr class='" . bg_class() . "'>\n\t\t\t<td><a href='getfile.php?key=doc&id={$df_data['id']}'>{$df_data['filename']}</a></td>\n\t\t\t<td>" . getFilesize($df_data["size"]) . "</td>\n\t\t</tr>";
}
if (empty($file_out)) {
$file_out = "<tr class='" . bg_class() . "'>\n\t\t\t<td colspan='2'>No files found.</td>\n\t\t</tr>";
}
$OUTPUT .= "<table " . TMPL_tblDflts . ">\n\t\t<tr>\n\t\t\t<th colspan='2'>Files</th>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th>File</th>\n\t\t\t<th>Size</th>\n\t\t</tr>\n\t\t{$file_out}\n\t</table>\n\t</td></tr>\n\t</table>";
return $OUTPUT;
}
开发者ID:kumarsivarajan,项目名称:accounting-123,代码行数:34,代码来源:document_det.php
示例4: display
function display()
{
$sql = "SELECT * FROM cubit.stock ORDER BY stkcod ASC";
$stock_rslt = db_exec($sql) or errDie("Unable to retrieve stock.");
$stock_out = "";
while ($stock_data = pg_fetch_array($stock_rslt)) {
// Retrieve units on order
$sql = "SELECT sum(qty) FROM cubit.sorders_items WHERE stkid='{$stock_data['stkid']}'";
$order_rslt = db_exec($sql) or errDie("Unable to retrieve orders.");
$order_qty = pg_fetch_result($order_rslt, 0);
if (empty($stock_data["minlvl"])) {
continue;
}
if (empty($order_qty)) {
$order_qty = 0;
}
$units = $stock_data["units"] - $order_qty;
$required = abs($units - $stock_data["minlvl"]);
// We're not required to purchase this item
if ($units > $stock_data["minlvl"]) {
continue;
}
$stock_out .= "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>{$stock_data['stkcod']}</td>\n\t\t\t\t<td>{$stock_data['stkdes']}</td>\n\t\t\t\t<td align='center'>" . sprint3($stock_data['units']) . "</td>\n\t\t\t\t<td align='center'>" . sprint3($order_qty) . "</td>\n\t\t\t\t<td align='center'>" . sprint3($stock_data['minlvl']) . "</td>\n\t\t\t\t<td align='center'><b>" . sprint3($required) . "</b></td>\n\t\t\t\t<td><a href='purchase-new.php'>Purchase</a></td>\n\t\t\t</tr>";
}
if (empty($stock_out)) {
$stock_out = "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='7'>No items required for purchase.</td>\n\t\t\t</tr>";
}
$OUTPUT = "\n\t\t<center>\n\t\t<h3>Required Purchases</h3>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th>Stock Code</th>\n\t\t\t\t<th>Stock Description</th>\n\t\t\t\t<th>Current Units</th>\n\t\t\t\t<th>Units on Order</th>\n\t\t\t\t<th>Minimum Level</th>\n\t\t\t\t<th>Minimum Required</th>\n\t\t\t\t<th>Options</th>\n\t\t\t</tr>\n\t\t\t{$stock_out}\n\t\t</table>\n\t\t</center>";
return $OUTPUT;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:30,代码来源:required_purchases.php
示例5: get_db_variables
function get_db_variables()
{
$sql_str = "SELECT " . "var_name, " . "var_value " . "FROM " . "portal_config_variables ";
$this->dbconn->connect();
$result = pg_query($this->dbconn->conn, $sql_str);
if (!$result) {
echo "An error occurred while executing the query - " . $sql_str . " - " . pg_last_error($this->dbconn->conn);
$this->dbconn->disconnect();
return false;
}
$n_rows = pg_num_rows($result);
$vars = array();
for ($i = 0; $i < $n_rows; $i++) {
$vars[pg_fetch_result($result, $i, 'var_name')] = pg_fetch_result($result, $i, 'var_value');
}
$this->dbconn->disconnect();
// set member variables from name/value pairs
$this->upload_path = $vars["upload_path"];
$this->mapfile_path = $vars["mapfile_path"];
$this->layer_config_path = $vars["layer_config_path"];
$this->mapservice_config_path = $vars["mapservice_config_path"];
$this->mapservice_name = $vars["mapservice_name"];
$this->map_agent = $vars["map_agent"];
$this->map_agent_launch_url = $vars["map_agent_launch_url"];
$this->output_dir = $vars["output_dir"];
$this->ogr2ogr_path = $vars["ogr2ogr_path"];
$this->confirmation_email_template = $vars["confirmation_email_template"];
return true;
}
开发者ID:neskie,项目名称:Stewardship-Portal,代码行数:29,代码来源:class_app_config.php
示例6: stock_is_blocked
function stock_is_blocked($stkid)
{
$sql = "SELECT blocked FROM cubit.stock WHERE stkid='{$stkid}'";
$stock_rslt = db_exec($sql) or errDie("Unable to check if stock is blocked.");
$blocked = pg_fetch_result($stock_rslt, 0);
return $blocked;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:7,代码来源:stock.lib.php
示例7: budgetTotalFromYear
function budgetTotalFromYear($accid, $budfor)
{
db_conn("cubit");
$sql = "SELECT SUM(bi.amt) FROM cubit.buditems bi, cubit.budgets bd\n\t\t\tWHERE bi.budid=bd.budid AND bi.id='{$accid}' AND bd.budfor='{$budfor}'\n\t\t\t\tAND bd.prdtyp='yr' AND bi.prd='" . BUDGET_YEARS_INDEX . "'";
$rslt = db_exec($sql) or errDie("Error reading monthly budget total.");
return pg_fetch_result($rslt, 0, 0);
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:7,代码来源:budget.lib.php
示例8: getNumOfComm
function getNumOfComm($postId)
{
$sql = pg_prepare(getDatabaseConnection(), "getNumOfComm", "SELECT count(*) FROM comments_posts WHERE post_id=\$1");
$result = pg_execute(getDatabaseConnection(), "getNumOfComm", [$postId]) or die('Query failed: ' . pg_last_error());
$numComm = pg_fetch_result($result, 0, 0);
return $numComm;
}
开发者ID:nicklasdean,项目名称:scwes2,代码行数:7,代码来源:functions.php
示例9: getObjIds
private function getObjIds()
{
$this->conn = $this->openConnectionTrans();
if ($this->conn) {
$sql = <<<SQL
\t\t\t\tSELECT
\t\t\t\t\tSTRING_AGG((OBJ_ID)::TEXT, ',') AS OBJ_IDS
\t\t\t\tFROM GARAGE.CONTAINERS AS A
\t\t\t\tINNER JOIN HAULAGE_LIST H on (A.haulage_list_id=H.id)
\t\t\t\tINNER JOIN HAULAGE_NOTICE_CONTAINERS HNC ON (HNC.ID = A.HAULAGE_NOTICE_CONTAINERS_ID)
\t\t\t\tLEFT JOIN ATP.HAULAGE_LIST HL ON (HL.CONTAINERS_NEW_ID = HNC.CONTAINERS_NEW_ID)
\t\t\t\tLEFT JOIN DRIVERS_CARS DC ON (DC.ID = HL.DRIVERS_CARS_ID)
\t\t\t\tWHERE A.DRIVERS_ID IS NOT NULL
\t\t\t\tAND (A.LOCATION_ID IS NOT NULL AND NOT (A.LOCATION_ID = 400 AND A.CONTAINERS_STATUS_ID = 13 ))
\t\t\t\tAND (A.containers_status_id is distinct from 13) AND OUR_CARS IS TRUE AND H.ROUTE IS NOT NULL
\t\t\t\tAND CHANGED_ROUTE IS NOT TRUE --не обновлять статусы для машин которые сменили маршрут
SQL;
if ($cur = pg_query($this->conn, $sql)) {
return pg_fetch_result($cur, 0, 'obj_ids');
} else {
return false;
}
} else {
return false;
}
}
开发者ID:mmiihaisyrbu,项目名称:gps_data,代码行数:26,代码来源:SattransData.php
示例10: orderDate
function orderDate($stkid, $from_date, $to_date)
{
$sql = "SELECT minlvl FROM cubit.stock WHERE stkid='{$stkid}'";
$min_rslt = db_exec($sql) or errDie("Unable to retrieve stock minimum stock level.");
$min = pg_fetch_result($min_rslt, 0);
if (empty($min)) {
$min = 0;
}
$from_time = strtotime($from_date);
$to_time = strtotime(date("Y-m-t", $from_time));
$sales = averageSalesQty($stkid, date("Y-m-d", $from_time), date("Y-m-d", $to_time), "DAILY");
if ($sales <= $min) {
return date("Y-m-d");
} else {
$tmp_sales = $sales;
$ret = 0;
while ($tmp_sales > $min) {
$to_time = $from_time * (1 * (60 * 60 * 24));
$tmp_sales = averageSalesQty($stkid, date("Y-m-d", $from_time), date("Y-m-d", $to_time), "MONTHLY");
$ret = 1;
}
if ($ret) {
return date("Y-m-d", $to_time);
}
}
return;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:27,代码来源:purchase_dateqty_report.php
示例11: _send_cake_info
function _send_cake_info($res, $from, $to_session)
{
global $connection;
global $logger;
$result = pg_query($connection, 'SELECT *, users.nick as author_nick
FROM pies
JOIN users ON users.id = pies.author
WHERE pies.id = ' . $from->pieid);
if (!$result) {
throw new Exception("Failed to load pie information");
}
$row = pg_fetch_assoc($result);
$settings = json_decode($row['settings'], true);
$info = array();
$info['name'] = $row['name'];
$info['description'] = $row['description'];
$info['created_at'] = $row['start'];
$info['author'] = $row['author_nick'];
$info['visible'] = $row['visible'] == 't';
$info['links'] = $settings['links'] ?: array();
$info['statuses'] = $settings['statuses'] ?: array('', '', '', '', '', '', '', '', '', 'all done');
$result = pg_query($connection, 'SELECT count(pieces.id) as pieces_count FROM pieces WHERE pie = ' . $from->pieid);
$info['pieces_count'] = pg_fetch_result($result, 0, "pieces_count");
$msg = array('cake_info', $info);
if ($to_session) {
$res->to_session($from, $msg);
} else {
$res->to_pie($from, $msg);
}
}
开发者ID:nicevoice,项目名称:MapCraft,代码行数:30,代码来源:cake.php
示例12: amtOnOrder
function amtOnOrder($stkid)
{
$sql = "\n\tSELECT sum(qty) FROM cubit.purchases\n\t\tLEFT JOIN cubit.pur_items ON purchases.purid=pur_items.purid\n\tWHERE stkid='{$stkid}' AND received='n'";
$pur_rslt = db_exec($sql) or errDie("Unable to retrieve purchases.");
$on_order = pg_fetch_result($pur_rslt, 0);
return $on_order;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:7,代码来源:sales_purchase_forecast.php
示例13: getMisc
public function getMisc()
{
$query_result = $this->get('id', null, null);
$array = $query_result->result_array();
$infos = null;
foreach ($array as $invite) {
$id = $invite['id'];
// Calcul du nombre de vols total
$this->db->where('invite', $id);
$this->db->from('vol');
$infos[$id]['locations'] = $this->db->count_all_results();
// Calcul du nombre moyen de vols par mois
$res = pg_query_params("SELECT * FROM GSI.F_INVITE_GETMOIS(\$1)", array($id));
$nb_mois = pg_fetch_result($res, 0, 0);
if ($nb_mois == 0) {
$infos[$id]['locations_par_mois'] = $infos[$id]['locations'];
} else {
$infos[$id]['locations_par_mois'] = round($infos[$id]['locations'] / $nb_mois, 2);
}
// Calcul du chiffre d'affaire
$this->db->select_sum('prix', 'total');
$this->db->where('invite', $id);
$query = $this->db->get('vol');
$row = $query->row_array();
if ($row['total'] == null) {
$row['total'] = 0;
}
$infos[$id]['chiffre_d\'affaire (€)'] = $row['total'];
}
return $infos;
}
开发者ID:vincbon,项目名称:GestionParapente,代码行数:31,代码来源:Invite_model.php
示例14: setActiveGroup
function setActiveGroup($verbose)
{
global $dbManager;
$stmt = __METHOD__;
$sql = "SELECT user_pk,group_pk FROM users LEFT JOIN groups ON group_name=user_name WHERE group_fk IS NULL";
$dbManager->prepare($stmt, $sql);
$res = $dbManager->execute($stmt);
if (pg_num_rows($res) == 0) {
pg_free_result($res);
return 0;
}
$userGroupMap = pg_fetch_all($res);
pg_free_result($res);
$selectStmt = __METHOD__ . '.select';
$sql = "SELECT user_fk,min(group_fk) group_fk FROM group_user_member WHERE user_fk=\$1";
$updateStmt = __METHOD__ . '.update';
$dbManager->prepare($updateStmt, "UPDATE users SET group_fk=\$2 WHERE user_pk=\$1");
foreach ($userGroupMap as $row) {
if (!empty($row['group_pk'])) {
pg_free_result($dbManager->execute($updateStmt, $row));
continue;
}
$rowrow = $dbManager->getSingleRow($sql, array($row['user_pk']), $selectStmt);
pg_fetch_result($dbManager->execute($updateStmt, $rowrow));
}
}
开发者ID:DanielDobre,项目名称:fossology,代码行数:26,代码来源:dbmigrate_2.5-2.6.php
示例15: view
function view()
{
global $_GET;
extract($_GET);
if (!isset($target)) {
$OUTPUT = "<li class=err>Invalid use of module</li>";
require "template.php";
}
$vars = "";
foreach ($_GET as $key => $value) {
if ($key != "target") {
$vars .= "&{$key}={$value}";
}
}
// compute the auth url
db_conn("cubit");
$sql = "SELECT * FROM cubitnet_sitesettings WHERE div='" . USER_DIV . "'";
$rslt = db_exec($sql) or errDie("Error reading username and password for Cubit.co.za");
if (pg_num_rows($rslt) < 1) {
$OUTPUT = "<li class=err>Cubit.co.za Settings not set up yet.\r\n\t\t\tPlease <a href='cubitnet_settings.php'>enter</a> the settings first</li>";
require "template.php";
}
extract(pg_fetch_array($rslt));
db_conn("cubit");
$sql = "SELECT setting_value FROM cubitnet_settings WHERE setting_name='cubitnet_hash'";
$rslt = db_exec($sql) or errDie("Error reading hash value for Cubit.co.za.");
if (pg_num_rows($rslt) < 1) {
$OUTPUT = "<li class=err>Cubit.co.za Settings not set up yet.\r\n\t\t\tPlease <a href='cubitnet_settings.php'>enter</a> the settings first</li>";
require "template.php";
}
$cubitnet_hash = pg_fetch_result($rslt, 0, 0);
print "\r\n\t<frameset rows=0,* border=0>\r\n\t\t<frame name=https_auth src='" . IDENTIFY_URL . "?hash={$cubitnet_hash}&username={$cn_username}&password={$cn_password}'>\r\n\t\t<frame name=data_frame src='{$target}?{$vars}'>\r\n\t</frameset>";
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:33,代码来源:https_face.php
示例16: show_image
function show_image($_POST)
{
extract($_POST);
if (!isset($picid)) {
return "";
}
db_connect();
$get_img = "SELECT type,ident_id FROM display_images WHERE id = '{$picid}' LIMIT 1";
$run_img = db_exec($get_img) or errDie("Unable to get image information.");
if (pg_numrows($run_img) < 1) {
#image not found ??
$previous = "";
$next = "";
} else {
$arr = pg_fetch_array($run_img);
$previous = "";
$next = "";
#check for any additional images for this member
#get prev button
$get_other = "SELECT id FROM display_images WHERE type = '{$arr['type']}' AND ident_id = '{$arr['ident_id']}' AND id < '{$picid}' ORDER BY id desc LIMIT 1";
$run_other = db_exec($get_other) or errDie("Unable to get images information.");
if (pg_numrows($run_other) > 0) {
$previous = "<input type='button' onCLick=\"document.location='view_image.php?picid=" . pg_fetch_result($run_other, 0, 0) . "'\" value='Previous'>";
}
$get_other = "SELECT id FROM display_images WHERE type = '{$arr['type']}' AND ident_id = '{$arr['ident_id']}' AND id > '{$picid}' LIMIT 1";
$run_other = db_exec($get_other) or errDie("Unable to get images information.");
if (pg_numrows($run_other) > 0) {
$next = "<input type='button' onCLick=\"document.location='view_image.php?picid=" . pg_fetch_result($run_other, 0, 0) . "'\" value='Next'>";
}
}
$buttons = "<tr height='20%' valign='bottom'><td width='40%' align='right'>{$previous}</td><td>{$next}</td></tr>";
$display = "\n\t\t\t\t\t<table " . TMPL_tblDflts . " height='95%' width='100%'>\n\t\t\t\t\t\t<tr height='80%'>\n\t\t\t\t\t\t\t<td colspan='2'><img src='show_dimg.php?picid={$picid}' width='160' height='185' border='1'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t{$buttons}\n\t\t\t\t\t</table>\n\t\t\t\t";
return $display;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:34,代码来源:view_image.php
示例17: posttake_display
function posttake_display()
{
extract($_REQUEST);
$fields = array();
$fields["page"] = 1;
extract($fields, EXTR_SKIP);
$sql = "\n\t\tSELECT stock.stkid, stock.whid, stkcod, stkdes, bar, adjusted, qty \n\t\tFROM cubit.stock_take \n\t\t\tLEFT JOIN cubit.stock ON stock_take.stkid=stock.stkid \n\t\tWHERE page='{$page}' AND (adjusted='0' OR adjusted IS NULL) \n\t\tORDER BY stkcod ASC, whid";
$stock_rslt = db_exec($sql) or errDie("Unable to retrieve stock.");
$stock_out = "";
while ($stock_data = pg_fetch_array($stock_rslt)) {
db_conn("exten");
$get_wh = "SELECT whname FROM warehouses WHERE whid = '{$stock_data['whid']}' LIMIT 1";
$run_wh = db_exec($get_wh) or errDie("Unable to get warehouse information.");
if (pg_numrows($run_wh) < 1) {
$whname = "Default";
} else {
$whname = trim(pg_fetch_result($run_wh, 0, 0));
}
$stock_out .= "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>{$stock_data['bar']}</td>\n\t\t\t\t<td>{$whname}</td>\n\t\t\t\t<td>{$stock_data['stkcod']}</td>\n\t\t\t\t<td>{$stock_data['stkdes']}</td>\n\t\t\t\t<td align='center'><input type='text' name='qty[{$stock_data['stkid']}]' value='{$stock_data['qty']}' size='3' style='text-align: center' /></td>\n\t\t\t\t<td><input type='submit' name='update[{$stock_data['stkid']}]' value='OK' /></td>\n\t\t\t</tr>";
}
if (empty($stock_out)) {
$stock_out = "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='5'>No results found.</td>\n\t\t\t</tr>";
}
$OUTPUT = "\n\t\t<center>\n\t\t<h3>Stock Take</h3>\n\t\t<form method='POST' action='" . SELF . "'>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th colspan='2'>Page</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td><input type='text' name='page' value='{$page}' size='3' style='font-weight: bold; text-align: center' /></td>\n\t\t\t\t<td><input type='submit' value='OK' /></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</form>\n\t\t<form method='POST' action='" . SELF . "'>\n\t\t\t<input type='hidden' name='key' value='take_update' />\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th>Barcode</th>\n\t\t\t\t<th>Store</th>\n\t\t\t\t<th>Stock Code</th>\n\t\t\t\t<th>Stock Description</th>\n\t\t\t\t<th>Quantity</th>\n\t\t\t\t<th> </th>\n\t\t\t</tr>\n\t\t\t{$stock_out}\n\t\t</table>\n\t\t<input type='submit' name='button[adjustments]' value='Adjustments' />\n\t\t</form>\n\t\t</center>";
return $OUTPUT;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:26,代码来源:stock_take_post.php
示例18: adjust_display
function adjust_display()
{
extract($_REQUEST);
$fields = array();
$fields["page"] = 1;
extract($fields, EXTR_SKIP);
$sql = "SELECT stock.stkid, bar, stkcod, stkdes, catname, csprice,\n\t\t\t\t(qty-units) AS adjust_qty\n\t\t\tFROM cubit.stock_take\n\t\t\t\tLEFT JOIN cubit.stock ON stock.stkid=stock_take.stkid\n\t\t\tWHERE adjusted='0' AND page='{$page}'\n\t\t\tORDER BY stkcod ASC";
$adjust_rslt = db_exec($sql) or errDie("Unable to retrieve adjustments.");
$adjust_out = "";
while ($adjust_data = pg_fetch_array($adjust_rslt)) {
if ($adjust_data["adjust_qty"] == 0) {
continue;
}
$value = $adjust_data["csprice"] * $adjust_data["adjust_qty"];
$adjust_out .= "\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>{$adjust_data['bar']}</td>\n\t\t\t<td>{$adjust_data['catname']}</td>\n\t\t\t<td>{$adjust_data['stkcod']}</td>\n\t\t\t<td>{$adjust_data['stkdes']}</td>\n\t\t\t<td align='center'>" . sprint3($adjust_data['adjust_qty']) . "</td>\n\t\t\t<td align='right'>" . sprint($value) . "</th>\n\t\t\t<td>\n\t\t\t\t<input type='hidden' name='adjust_qty[{$adjust_data['stkid']}]'\n\t\t\t\tvalue='{$adjust_data['adjust_qty']}' />\n\t\t\t\t<input type='submit' name='update[{$adjust_data['stkid']}]'\n\t\t\t\tvalue='Adjust' />\n\t\t\t</td>\n\t\t</tr>";
}
if (empty($adjust_out)) {
$adjust_out = "\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td colspan='7'>\n\t\t\t\t<li>No results found for this page.</li>\n\t\t\t</td>\n\t\t</tr>";
}
$sql = "SELECT max(page) FROM cubit.stock_take";
$mp_rslt = db_exec($sql) or errDie("Unable to retrieve total pages.");
$max_page = pg_fetch_result($mp_rslt, 0);
if ($page < $max_page) {
$adjust_btn = "\n\t\t\t<a href='" . SELF . "?key=adjust_display&page=" . ($page + 1) . "'>\n\t\t\t\tNext »\n\t\t\t</a>";
} else {
$adjust_btn = "";
}
$OUTPUT = "\n\t<center>\n\t<h3>Stock Take - Adjustments</h3>\n\t<form method='post' action='" . SELF . "'>\n\t<table " . TMPL_tblDflts . ">\n\t\t<tr>\n\t\t\t<th colspan='2'>Page</th>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>\n\t\t\t\t<input type='text' name='page' value='{$page}' size='3'\n\t\t\t\tstyle='font-weight: bold; text-align: center' />\n\t\t\t</td>\n\t\t\t<td><input type='submit' value='OK' /></td>\n\t\t</tr>\n\t</table>\n\t</form>\n\t<form method='post' action='" . SELF . "'>\n\t<input type='hidden' name='key' value='adjust_update' />\n\t<input type='hidden' name='page' value='{$page}' />\n\t<table " . TMPL_tblDflts . ">\n\t\t<tr>\n\t\t\t<th>Barcode</th>\n\t\t\t<th>Category</th>\n\t\t\t<th>Stock Code</th>\n\t\t\t<th>Stock Description</th>\n\t\t\t<th>Adjustment</th>\n\t\t\t<th>Value</th>\n\t\t\t<th> </th>\n\t\t</tr>\n\t\t{$adjust_out}\n\t</table>\n\t<input type='submit' name='button[page_complete]' value='Adjust Page' />\n\t<br />\n\t{$adjust_btn}\n\t</center>";
return $OUTPUT;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:30,代码来源:stock_take_adjust.php
示例19: enter
function enter($errors = "")
{
// Retrieve the settings from Cubit
db_conn("cubit");
$sql = "SELECT filename FROM template_settings WHERE template='invoices' AND div='" . USER_DIV . "'";
$invRslt = db_exec($sql) or errDie("Unable to retrieve the invoices template setting from Cubit.");
$invoices_db = pg_fetch_result($invRslt, 0);
$sql = "SELECT filename FROM template_settings WHERE template='statements' AND div='" . USER_DIV . "'";
$stmntRslt = db_exec($sql) or errDie("Unable to retrieve the statement template setting from Cubit.");
$statements_db = pg_fetch_result($stmntRslt, 0);
$sql = "SELECT filename FROM template_settings WHERE template='reprints' AND div='" . USER_DIV . "'";
$rprntRslt = db_exec($sql) or errDie("Unable to retrieve pdf reprint template setting from Cubit.");
$reprints_db = pg_fetch_result($rprntRslt, 0);
// $invoices_ar = array (
// "PDF Tax Invoice"=>"pdf/pdf-tax-invoice.php",
// "HTML Tax Invoice"=>"invoice-print.php",
// );
//
// $statements_ar = array (
// "PDF Statement"=>"pdf/pdf-statement.php",
// "Default PDF"=>"pdf/cust-pdf-stmnt.php"
// );
//
// $reprints_ar = array (
// "PDF Tax Invoice"=>"new",
// "Default PDF"=>"default"
// );
$invoices_ar = array("PDF Tax Invoice" => "pdf/pdf-tax-invoice.php", "HTML Tax Invoice" => "invoice-print.php");
$statements_ar = array("New Format PDF Statement" => "pdf/pdf-statement.php", "Old Format PDF" => "pdf/cust-pdf-stmnt.php");
$reprints_ar = array("New Format PDF Tax Invoice" => "new", "Old Format PDF Tax Invoice" => "default");
$invoices = "";
foreach ($invoices_ar as $key => $val) {
if ($invoices_db == $val) {
$selected = "checked";
} else {
$selected = "";
}
$invoices .= "<input type=radio name='invoices' value='{$key}::{$val}' {$selected}>{$key}<br>";
}
$statements = "";
foreach ($statements_ar as $key => $val) {
if ($statements_db == $val) {
$selected = "checked";
} else {
$selected = "";
}
$statements .= "<input type=radio name='statements' value='{$key}::{$val}' {$selected}>{$key}<br>";
}
$reprints = "";
foreach ($reprints_ar as $key => $val) {
if ($reprints_db == $val) {
$selected = "checked";
} else {
$selected = "";
}
$reprints .= "<input type=radio name='reprints' value='{$key}::{$val}' {$selected}>{$key}<br>";
}
$OUTPUT = "\n\t\t<h3>Template Settings</h3>\n\t\t{$errors}\n\t\t<form method='POST' action='" . SELF . "'>\n\t\t\t<input type='hidden' name='key' value='confirm'>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th>Option</th>\n\t\t\t\t<th>Layout</th>\n\t\t\t\t<th>Preview</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>Invoices / Credit Notes</td>\n\t\t\t\t<td valign='top'>{$invoices}</td>\n\t\t\t\t<td valign='middle'>\n\t\t\t\t\t<a href='pdf-tax-invoice-prev.png' target='blank'>Preview PDF Tax Invoice</a><br>\n\t\t\t\t\t<a href='html-tax-invoice-prev.png' target='blank'>Preview HTML Tax Invoice</a>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>Statements</th>\n\t\t\t\t<td valign='top'>{$statements}</td>\n\t\t\t\t<td valign='middle'>\n\t\t\t\t\t<a href='pdf-statement-prev.png' target='blank'>Preview PDF Statement</a><br>\n\t\t\t\t\t<a href='default-statement-prev.png' target='blank'>Preview Default PDF Statement</a>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>Invoice PDF Reprints</td>\n\t\t\t\t<td valign='top'>{$reprints}</td>\n\t\t\t\t<td> </td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td colspan='3' align='right'><input type='submit' value='Confirm »'\\></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</form>" . mkQuickLinks(ql("../cust-credit-stockinv.php", "New Invoice"), ql("../purchase-new.php", "New Purchase"));
return $OUTPUT;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:60,代码来源:template-settings.php
示例20: get_attributes
function get_attributes()
{
$sql_str = "SELECT " . "name, " . "style_desc, " . "symbol_name, " . "symbol_size, " . "angle, " . "width, " . "color_r, " . "color_g, " . "color_b, " . "outlinecolor_r, " . "outlinecolor_b, " . "outlinecolor_g, " . "bgcolor_r, " . "bgcolor_g, " . "bgcolor_b " . "FROM " . "tng_mapserver_style " . "WHERE " . "id = " . $this->id;
$this->dbconn->connect();
$result = pg_query($this->dbconn->conn, $sql_str);
if (!$result) {
echo "An error occurred while executing the query - " . $sql_str . " - " . pg_last_error($this->dbconn->conn);
//$this->dbconn->disconnect();
return false;
}
// successfuly ran the query
// store attributes
$this->name = pg_fetch_result($result, 0, 'name');
$this->style_desc = pg_fetch_result($result, 0, 'style_desc');
$this->symbol_name = pg_fetch_result($result, 0, 'symbol_name');
$this->symbol_size = pg_fetch_result($result, 0, 'symbol_size');
$this->angle = pg_fetch_result($result, 0, 'angle');
$this->width = pg_fetch_result($result, 0, 'width');
$this->color_r = pg_fetch_result($result, 0, 'color_r');
$this->color_g = pg_fetch_result($result, 0, 'color_g');
$this->color_b = pg_fetch_result($result, 0, 'color_b');
$this->outlinecolor_r = pg_fetch_result($result, 0, 'outlinecolor_r');
$this->outlinecolor_g = pg_fetch_result($result, 0, 'outlinecolor_g');
$this->outlinecolor_b = pg_fetch_result($result, 0, 'outlinecolor_b');
$this->bgcolor_r = pg_fetch_result($result, 0, 'bgcolor_r');
$this->bgcolor_g = pg_fetch_result($result, 0, 'bgcolor_g');
$this->bgcolor_b = pg_fetch_result($result, 0, 'bgcolor_b');
$this->dbconn->disconnect();
return true;
}
开发者ID:neskie,项目名称:Stewardship-Portal,代码行数:30,代码来源:class_ms_style.php
注:本文中的pg_fetch_result函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论