本文整理汇总了PHP中extlib_rstr函数的典型用法代码示例。如果您正苦于以下问题:PHP extlib_rstr函数的具体用法?PHP extlib_rstr怎么用?PHP extlib_rstr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了extlib_rstr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: edit
function edit($listid)
{
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($listid, "num", 1, 50, "Invalid Price List id.");
# display errors, if any
if ($v->isError()) {
$confirm = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirm .= "<li class='err'>-" . $e["msg"] . "</li>";
}
return $confirm;
}
# Select Stock
db_conn("exten");
$sql = "SELECT * FROM pricelist WHERE listid = '{$listid}' AND div = '" . USER_DIV . "'";
$listRslt = db_exec($sql) or errDie("Unable to access databse.", SELF);
if (pg_numrows($listRslt) < 1) {
return "<li> Invalid Price List ID.";
} else {
$list = pg_fetch_array($listRslt);
}
$vattype = getSetting("SELAMT_VAT") == 'inc' ? "Including Vat" : "Excluding Vat";
$enter = "\r\n\t\t<h3>Price List</h3>\r\n\t\t<table " . TMPL_tblDflts . ">\r\n\t\t\t<tr>\r\n\t\t\t\t<th>Field</th>\r\n\t\t\t\t<th>Value</th>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td>Price list</td>\r\n\t\t\t\t<td align='center'>{$list['listname']}</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr><td><br></td></tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan='2'><h3>Prices</h3><td>\r\n\t\t\t<tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<th>Item</th>\r\n\t\t\t\t<th>Price Amount</th>\r\n\t\t\t</tr>";
# Query server
$i = 0;
db_conn('exten');
$sql = "SELECT * FROM plist_prices WHERE listid = '{$listid}' AND div = '" . USER_DIV . "' AND show='Yes' ORDER BY stkid ASC";
$stkpRslt = db_exec($sql) or errDie("Unable to retrieve stock items from database.");
if (pg_numrows($stkpRslt) < 1) {
return "<li class='err'> There are no stock item on the selected pricelist.</li>";
}
while ($stkp = pg_fetch_array($stkpRslt)) {
db_connect();
# get stock details
$sql = "SELECT stkid, stkcod, stkdes FROM stock WHERE stkid = '{$stkp['stkid']}' AND div = '" . USER_DIV . "'";
$stkRslt = db_exec($sql) or errDie("Unable to retrieve stocks from database.");
$stk = pg_fetch_array($stkRslt);
$enter .= "\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td>{$stk['stkcod']} - " . extlib_rstr($stk['stkdes'], 30) . "</td>\r\n\t\t\t\t\t<td align='right'>" . CUR . " " . sprint($stkp['price']) . " {$vattype}</td>\r\n\t\t\t\t</tr>";
}
$enter .= "\r\n\t\t\t</table>";
$OUTPUT = $enter;
require "temp.xls.php";
Stream("Pricelist", $OUTPUT);
return $OUTPUT;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:48,代码来源:pricelist-xls.php
示例2: edit
function edit($listid)
{
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($listid, "num", 1, 50, "Invalid Price List id.");
# display errors, if any
if ($v->isError()) {
$confirm = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirm .= "<li class=err>-" . $e["msg"] . "<br>";
}
return $confirm;
}
# Select Stock
db_conn("exten");
$sql = "SELECT * FROM spricelist WHERE listid = '{$listid}' AND div = '" . USER_DIV . "'";
$listRslt = db_exec($sql) or errDie("Unable to access databse.", SELF);
if (pg_numrows($listRslt) < 1) {
return "<li> Invalid Price List ID.";
} else {
$list = pg_fetch_array($listRslt);
}
$vattype = getSetting("SELAMT_VAT") == 'inc' ? "Including Vat" : "Excluding Vat";
$enter = "<h3>Supplier Price List</h3>\r\n\t\t<form action='" . SELF . "' method=post>\r\n\t\t<table cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n\t\t<tr><th>Field</th><th>Value</th></tr>\r\n\t\t<tr class='bg-odd'><td>Price list</td><td align=center>{$list['listname']}</td></tr>\r\n\t\t<tr><td><br></td></tr>\r\n\t\t<tr><td colspan=2><h3>Prices</h3><td><tr>\r\n\t\t<tr><th>Item</th><th>Price Amount</th></tr>";
# Query server
$i = 0;
db_conn('exten');
$sql = "SELECT * FROM splist_prices WHERE listid = '{$listid}' AND div = '" . USER_DIV . "' ORDER BY stkid ASC";
$stkpRslt = db_exec($sql) or errDie("Unable to retrieve stock items from database.");
if (pg_numrows($stkpRslt) < 1) {
return "<li class=err> There are no stock item on the selected pricelist.";
}
while ($stkp = pg_fetch_array($stkpRslt)) {
db_connect();
# get stock details
$sql = "SELECT stkid, stkcod, stkdes FROM stock WHERE stkid = '{$stkp['stkid']}' AND div = '" . USER_DIV . "'";
$stkRslt = db_exec($sql) or errDie("Unable to retrieve stocks from database.");
$stk = pg_fetch_array($stkRslt);
$enter .= "<tr class='" . bg_class() . "'><td>{$stk['stkcod']} - " . extlib_rstr($stk['stkdes'], 30) . "</td><td align=right>" . CUR . " {$stkp['price']} {$vattype}</td></tr>";
}
$enter .= "\r\n\t\t</table></form>\r\n\t\t<p>\r\n\t\t<table border=0 cellpadding='2' cellspacing='1'>\r\n\t\t<tr><th>Quick Links</th></tr>\r\n\t\t<tr class='bg-odd'><td><a href='sup-pricelist-view.php'>View Supplier Price Lists</a></td></tr>\r\n\t\t<tr class='bg-odd'><td><a href='../main.php'>Main Menu</a></td></tr>\r\n\t\t</table>";
return $enter;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:45,代码来源:sup-pricelist-det.php
示例3: printStk
function printStk($_POST)
{
# get vars
foreach ($_POST as $key => $value) {
${$key} = $value;
}
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($whid, "num", 1, 50, "Invalid Warehouse.");
$v->isOk($fday, "num", 1, 2, "Invalid from Date day.");
$v->isOk($fmon, "num", 1, 2, "Invalid from Date month.");
$v->isOk($fyear, "num", 1, 4, "Invalid from Date Year.");
$v->isOk($today, "num", 1, 2, "Invalid to Date day.");
$v->isOk($tomon, "num", 1, 2, "Invalid to Date month.");
$v->isOk($toyear, "num", 1, 4, "Invalid to Date Year.");
# mix dates
$fromdate = $fyear . "-" . $fmon . "-" . $fday;
$todate = $toyear . "-" . $tomon . "-" . $today;
if (!checkdate($fmon, $fday, $fyear)) {
$v->isOk($fromdate, "num", 1, 1, "Invalid from date.");
}
if (!checkdate($tomon, $today, $toyear)) {
$v->isOk($todate, "num", 1, 1, "Invalid to date.");
}
# display errors, if any
if ($v->isError()) {
$confirm = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirm .= "<li class=err>-" . $e["msg"] . "<br>";
}
return $confirm;
}
# Get Stock
db_connect();
$searchs = "SELECT * FROM stock WHERE whid = '{$whid}' AND div = '" . USER_DIV . "'";
$stkRslt = db_exec($searchs) or errDie("Unable to retrieve stocks from database.");
if (pg_numrows($stkRslt) < 1) {
return "<li class=err> There are no stock items found.</li>\r\n\t\t<p>\r\n\t\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width=15%>\r\n\t\t\t<tr><td><br></td></tr>\r\n\t\t\t<tr><th>Quick Links</th></tr>\r\n\t\t\t<tr class='bg-odd'><td><a href='sales-reports.php'>Sales Reports</a></td></tr>\r\n\t\t\t<script>document.write(getQuicklinkSpecial());</script>\r\n\t\t\t<tr class='bg-even'><td><a href='main.php'>Main Menu</a></td></tr>\r\n\t\t</table>";
}
db_conn("exten");
# Get warehouse
$sql = "SELECT whname FROM warehouses WHERE whid = '{$whid}' AND div = '" . USER_DIV . "'";
$whRslt = db_exec($sql);
$wh = pg_fetch_array($whRslt);
$totprof = 0;
$totqty = 0;
$totpqty = 0;
$totcsprice = 0;
$items = array();
while ($stk = pg_fetch_array($stkRslt)) {
# Get all relevant records
db_connect();
$sql = "SELECT sum(qty) as qty, sum(csprice) as csprice, sum(csamt) as csamt FROM stockrec WHERE edate >= '{$fromdate}' AND edate <= '{$todate}' AND stkid = '{$stk['stkid']}' AND trantype = 'invoice' AND div = '" . USER_DIV . "'";
$recRslt = db_exec($sql) or errDie("Unable to access databse.", SELF);
$rec = pg_fetch_array($recRslt);
# Get all relevant records
db_connect();
$sql = "SELECT sum(qty) as qty, sum(csprice) as csprice, sum(csamt) as csamt FROM stockrec WHERE edate >= '{$fromdate}' AND edate <= '{$todate}' AND stkid = '{$stk['stkid']}' AND trantype = 'note' AND div = '" . USER_DIV . "'";
$recRslt = db_exec($sql) or errDie("Unable to access databse.", SELF);
$nrec = pg_fetch_array($recRslt);
# Get all relevant records
db_connect();
$sql = "SELECT sum(qty) as qty, sum(csprice) as csprice, sum(csamt) as csamt FROM stockrec WHERE edate >= '{$fromdate}' AND edate <= '{$todate}' AND stkid = '{$stk['stkid']}' AND trantype = 'purchase' AND div = '" . USER_DIV . "'";
$precRslt = db_exec($sql) or errDie("Unable to access databse.", SELF);
$prec = pg_fetch_array($precRslt);
# less credit notes
$rec['qty'] -= $nrec['qty'];
$rec['csprice'] -= $nrec['csprice'];
$rec['csamt'] -= $nrec['csamt'];
# zeros
$rec['qty'] += 0;
$rec['csprice'] += 0;
$rec['csamt'] += 0;
# zeros
$prec['qty'] += 0;
$prec['csprice'] += 0;
$prec['csamt'] += 0;
# Calculate profit
$prof = $rec['csprice'] - $rec['csamt'];
$totprof += $prof;
$totcsprice += $rec['csprice'];
$totqty += $rec['qty'];
$totpqty += $prec['qty'];
# Limit to 30 chars
$stk['stkdes'] = extlib_rstr($stk['stkdes'], 30);
$item['stkcod'] = $stk['stkcod'];
$item['stkdes'] = $stk['stkdes'];
$item['pqty'] = $prec['qty'];
$item['qty'] = $rec['qty'];
$item['csprice'] = sprint($rec['csprice']);
$item['profit'] = sprint($prof);
$items[] = $item;
}
# bubble sorting
$sortarr =& $items;
// where $out = array name to sort
for ($j = 0; $j < count($sortarr); $j++) {
for ($i = 0; $i < count($sortarr) - 1; $i++) {
//.........这里部分代码省略.........
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:101,代码来源:stock-move-rep-b.php
示例4: confirm
function confirm($_POST)
{
# get vars
foreach ($_POST as $key => $value) {
${$key} = $value;
}
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($listname, "string", 1, 255, "Invalid Price list name.");
$v->isOk($listid, "num", 1, 50, "Invalid Price List id.");
if (isset($stkids)) {
foreach ($stkids as $key => $value) {
$v->isOk($stkids[$key], "num", 1, 20, "Invalid Stock Item number.");
$v->isOk($prices[$key], "float", 1, 20, "Invalid Stock Item price.");
}
} else {
return "<li class=err> there is not stock for the price list.";
}
$vattype = getSetting("SELAMT_VAT") == 'inc' ? "Including Vat" : "Excluding Vat";
# display errors, if any
if ($v->isError()) {
$confirm = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirm .= "<li class=err>" . $e["msg"];
}
$confirm .= "<p><input type=button onClick='JavaScript:history.back();' value='« Correct submission'>";
return $confirm;
}
# Select Stock
db_conn("exten");
$sql = "SELECT * FROM spricelist WHERE listid = '{$listid}' AND div = '" . USER_DIV . "'";
$listRslt = db_exec($sql) or errDie("Unable to access databse.", SELF);
if (pg_numrows($listRslt) < 1) {
return "<li> Invalid Price List ID.";
} else {
$list = pg_fetch_array($listRslt);
}
$confirm = "<h3>Confirm Copy Supplier Price list</h3>\r\n\t<form action='" . SELF . "' method=post>\r\n\t<table cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n\t<input type=hidden name=key value=write>\r\n\t<input type=hidden name=listname value='{$listname}'>\r\n\t<input type=hidden name=listid value='{$listid}'>\r\n\t<tr><th>Field</th><th>Value</th></tr>\r\n\t<tr class='bg-odd'><td>From Price list</td><td align=center>{$list['listname']}</td></tr>\r\n\t<tr class='bg-even'><td>To Price list</td><td align=center>{$listname}</td></tr>\r\n\t<tr><td colspan=2><br><td><tr>\r\n\t<tr><td align=right><input type=button value='Back' onclick='javascript:history.back();'></td><td valign=left><input type=submit value='Write »'></td></tr>\r\n\t<tr><td colspan=2><h3>Prices</h3><td><tr>\r\n\t<tr><th>Item</th><th>Price Amount</th></tr>";
# Query server
foreach ($stkids as $key => $value) {
db_connect();
$sql = "SELECT stkid, stkcod, stkdes FROM stock WHERE stkid = '{$stkids[$key]}' AND div = '" . USER_DIV . "'";
$stkRslt = db_exec($sql) or errDie("Unable to retrieve stocks from database.");
$stk = pg_fetch_array($stkRslt);
$confirm .= "<tr class='" . bg_class() . "'><td><input type=hidden name=stkids[] value='{$stk['stkid']}'>{$stk['stkcod']} - " . extlib_rstr($stk['stkdes'], 30) . "</td><td>" . CUR . " <input type=hidden name=prices[] size=8 value='{$prices[$key]}'>{$prices[$key]} {$vattype}</td></tr>";
}
$confirm .= "\r\n\t<tr><td><br></td></tr>\r\n\t<tr><td align=right><input type=button value='Back' onclick='javascript:history.back();'></td><td valign=left><input type=submit value='Write »'></td></tr>\r\n\t</table></form>\r\n\t<p>\r\n\t<table border=0 cellpadding='2' cellspacing='1'>\r\n\t<tr><th>Quick Links</th></tr>\r\n\t<tr class='bg-odd'><td><a href='sup-pricelist-view.php'>View Supplier Price Lists</a></td></tr>\r\n\t<tr class='bg-odd'><td><a href='../main.php'>Main Menu</a></td></tr>\r\n\t</table>";
return $confirm;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:51,代码来源:sup-pricelist-copy.php
示例5: details
//.........这里部分代码省略.........
# Put in product
$products .= "\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td colspan='2'>{$Accounts}<input type='hidden' name='whids[]' value='{$stkd['whid']}'></td>\n\t\t\t\t\t<td><input type='hidden' name='stkids[]' value='{$stkd['stkid']}'>{$Vatcodes}</td>\n\t\t\t\t\t<td><input type='text' size='20' name='descriptions[]' value='{$stkd['description']}'> {$sernos}</td>\n\t\t\t\t\t<td>{$qtyin}</td>\n\t\t\t\t\t<td>{$viewcost}</td>\n\t\t\t\t\t<td><input type='hidden' name='disc[]' value='{$stkd['disc']}'><input type='hidden' name='discp[]' value='{$stkd['discp']}'></td>\n\t\t\t\t\t<td nowrap><input type='hidden' name='amt[]' value='{$stkd['amt']}'> " . CUR . " {$stkd['amt']}</td>\n\t\t\t\t\t<td><input type='checkbox' name='remprod[]' value='{$key}'><input type='hidden' name='SCROLL' value='yes'></td>\n\t\t\t\t</tr>";
$key++;
} else {
# keep track of selected stock amounts
$amts[$i] = $stkd['amt'];
$i++;
# get selected stock in this warehouse
db_connect();
$sql = "SELECT * FROM stock WHERE stkid = '{$stkd['stkid']}' AND div = '" . USER_DIV . "'";
$stkRslt = db_exec($sql);
$stk = pg_fetch_array($stkRslt);
# get warehouse name
db_conn("exten");
$sql = "SELECT whname FROM warehouses WHERE whid = '{$stk['whid']}' AND div = '" . USER_DIV . "'";
$whRslt = db_exec($sql);
$wh = pg_fetch_array($whRslt);
db_conn('cubit');
$Sl = "SELECT * FROM vatcodes ORDER BY code";
$Ri = db_exec($Sl) or errDie("Unable to get vat codes");
$Vatcodes = "\n\t\t\t\t<select name='vatcodes[]'>\n\t\t\t\t\t<option value='0'>Select</option>";
while ($vd = pg_fetch_array($Ri)) {
if ($stkd['vatcode'] == $vd['id']) {
$sel = "selected";
} else {
$sel = "";
}
$Vatcodes .= "<option value='{$vd['id']}' {$sel}>{$vd['code']}</option>";
}
$Vatcodes .= "</select>";
$stkd['unitcost'] = sprint($stkd['unitcost']);
$stkd['amt'] = sprint($stkd['amt']);
# put in product
$products .= "\n\t\t\t\t<input type='hidden' name='accounts[]' value='0'>\n\t\t\t\t<input type='hidden' name='descriptions[]' value=''>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td><input type='hidden' name='whids[]' value='{$stkd['whid']}'>{$wh['whname']}</td>\n\t\t\t\t\t<td><input type='hidden' name='stkids[]' value='{$stkd['stkid']}'><a href='#' onclick='openwindow(\"stock-amt-det.php?stkid={$stk['stkid']}\")'>{$stk['stkcod']}</a></td>\n\t\t\t\t\t<td>{$Vatcodes}</td>\n\t\t\t\t\t<td>" . extlib_rstr($stk['stkdes'], 30) . "</td>\n\t\t\t\t\t<td><input type='text' size='3' name='qtys[]' value='{$stkd['qty']}'></td>\n\t\t\t\t\t<td><input type='text' size='8' name='unitcost[]' value='{$stkd['unitcost']}'></td>\n\t\t\t\t\t<td><input type='text' size='4' name='disc[]' value='{$stkd['disc']}'> OR <input type='text' size='4' name='discp[]' value='{$stkd['discp']}' maxlength=5>%</td>\n\t\t\t\t\t<td nowrap><input type='hidden' name='amt[]' value='{$stkd['amt']}'> " . CUR . " {$stkd['amt']}</td>\n\t\t\t\t\t<td><input type='checkbox' name='remprod[]' value='{$key}'><input type='hidden' name='SCROLL' value='yes'></td>\n\t\t\t\t</tr>";
$key++;
}
}
# Look above(remprod keys)
$keyy = $key;
# look above(if i = 0 then there are no products)
if ($i == 0) {
$done = "";
}
# check if stock warehouse was selected
if (isset($whidss)) {
foreach ($whidss as $key => $whid) {
if (isset($stkidss[$key]) && $stkidss[$key] != "-S" && isset($cust['pricelist'])) {
# skip if not selected
if ($whid == "-S") {
continue;
}
# get selected stock in this warehouse
db_connect();
$sql = "SELECT * FROM stock WHERE stkid = '{$stkidss[$key]}' AND div = '" . USER_DIV . "' ORDER BY stkcod ASC";
$stkRslt = db_exec($sql);
$stk = pg_fetch_array($stkRslt);
# get selected warehouse name
db_conn("exten");
$sql = "SELECT whname FROM warehouses WHERE whid = '{$stk['whid']}' AND div = '" . USER_DIV . "'";
$whRslt = db_exec($sql);
$wh = pg_fetch_array($whRslt);
# get price from price list if it is set
if (isset($cust['pricelist'])) {
# get selected stock in this warehouse
db_conn("exten");
$sql = "SELECT price FROM plist_prices WHERE listid = '{$cust['pricelist']}' AND stkid = '{$stk['stkid']}' AND div = '" . USER_DIV . "'";
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:67,代码来源:quote-new.php
示例6: confirm
function confirm($_POST)
{
# get vars
foreach ($_POST as $key => $value) {
${$key} = $value;
}
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($listid, "num", 1, 50, "Invalid Price List id.");
if (isset($stkids)) {
foreach ($stkids as $key => $value) {
$v->isOk($stkids[$key], "num", 1, 20, "Invalid Stock Item number.");
$v->isOk($prices[$key], "float", 1, 20, "Invalid Stock Item price.");
}
} else {
return "<li class=err> there is not stock for the price list.";
}
# Display errors, if any
if ($v->isError()) {
$confirm = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirm .= "<li class=err>" . $e["msg"];
}
$confirm .= "<p><input type=button onClick='JavaScript:history.back();' value='« Correct submission'>";
return $confirm;
}
# Select Stock
db_conn("exten");
$sql = "SELECT * FROM pricelist WHERE listid = '{$listid}'";
$listRslt = db_exec($sql) or errDie("Unable to access databse.", SELF);
if (pg_numrows($listRslt) < 1) {
return "<li> Invalid Price List ID.";
} else {
$list = pg_fetch_array($listRslt);
}
$confirm = "<h3>Confirm Stock Selling Prices Increase</h3>\n\t<form action='" . SELF . "' method=post>\n\t<table cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\n\t<input type=hidden name=key value=write>\n\t<input type=hidden name=listid value='{$listid}'>\n\t<tr><th>Field</th><th>Value</th></tr>\n\t<tr class='bg-odd'><td>Price list</td><td align=center>{$list['listname']}</td></tr>\n\t<tr><td colspan=2><br><td><tr>\n\t<tr><td align=right><input type=button value='Back' onclick='javascript:history.back();'></td><td valign=left><input type=submit value='Write »'></td></tr>\n\t<tr><td colspan=2><h3>Prices</h3><td><tr>\n\t<tr><th>Item</th><th>Old Price</th><th>New Price</th></tr>";
# Query server
foreach ($stkids as $key => $value) {
# format price
$prices[$key] = sprint($prices[$key]);
db_connect();
$sql = "SELECT stkid, stkcod, stkdes FROM stock WHERE stkid = '{$stkids[$key]}'";
$stkRslt = db_exec($sql) or errDie("Unable to retrieve stocks from database.");
$stk = pg_fetch_array($stkRslt);
db_conn("exten");
$sql = "SELECT price FROM plist_prices WHERE stkid = '{$stkids[$key]}' AND listid = '{$listid}'";
$rslt = db_exec($sql) or errDie("Unable to fetch price list items from Cubit.", SELF);
$stkp = pg_fetch_array($rslt);
$confirm .= "<tr class='" . bg_class() . "'><td><input type=hidden name=stkids[] value='{$stk['stkid']}'>{$stk['stkcod']} - " . extlib_rstr($stk['stkdes'], 30) . "</td><td>" . CUR . " {$stkp['price']}</td><td>" . CUR . " <input type=hidden name=prices[] size=8 value='{$prices[$key]}'>{$prices[$key]}</td></tr>";
}
$confirm .= "\n\t<tr><td><br></td></tr>\n\t<tr><td align=right><input type=button value='Back' onclick='javascript:history.back();'></td><td valign=left><input type=submit value='Write »'></td></tr>\n\t</table></form>\n\t<p>\n\t<table border=0 cellpadding='2' cellspacing='1'>\n\t<tr><th>Quick Links</th></tr>\n\t<tr class='bg-odd'><td><a href='toms/pricelist-view.php'>View Price Lists</a></td></tr>\n\t<script>document.write(getQuicklinkSpecial());</script>\n\t</table>";
return $confirm;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:55,代码来源:stock-inc.php
示例7: details
//.........这里部分代码省略.........
$amts[$i] = $stkd['amt'];
$i++;
# Get warehouse name
db_conn("exten");
$sql = "SELECT whname FROM warehouses WHERE whid = '{$stkd['whid']}' AND div = '" . USER_DIV . "'";
$whRslt = db_exec($sql);
$wh = pg_fetch_array($whRslt);
# Get selected stock in this warehouse
db_connect();
$sql = "SELECT * FROM stock WHERE stkid = '{$stkd['stkid']}' AND div = '" . USER_DIV . "'";
$stkRslt = db_exec($sql);
$stk = pg_fetch_array($stkRslt);
$sernos = "<input type='hidden' name='sernos[]' value='{$stkd['serno']}'>{$stkd['serno']}";
# check permissions
if (perm("invoice-unitcost-edit.php")) {
$viewcost = "<input type='text' size='8' name='unitcost[]' value='{$stkd['unitcost']}'>";
} else {
$viewcost = "<input type='hidden' size='8' name='unitcost[]' value='{$stkd['unitcost']}'>{$stkd['unitcost']}";
}
db_conn('cubit');
$Sl = "SELECT * FROM vatcodes ORDER BY code";
$Ri = db_exec($Sl) or errDie("Unable to get vat codes");
$Vatcodes = "\n\t\t\t\t<select name='vatcodes[]'>\n\t\t\t\t\t<option value='0'>Select</option>";
while ($vd = pg_fetch_array($Ri)) {
if ($stkd['vatcode'] == $vd['id']) {
$sel = "selected";
} else {
$sel = "";
}
$Vatcodes .= "<option value='{$vd['id']}' {$sel}>{$vd['code']}</option>";
}
$Vatcodes .= "</select>";
# Put in product
$products .= "\n\t\t\t\t<input type='hidden' name='accounts[]' value='0'>\n\t\t\t\t<input type='hidden' name='descriptions[]' value=''>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td><input type='hidden' name='whids[]' value='{$stkd['whid']}'>{$wh['whname']}</td>\n\t\t\t\t\t<td><input type='hidden' name='stkids[]' value='{$stkd['stkid']}'><a href='#bottom' onclick='openwindow(\"stock-amt-det.php?stkid={$stk['stkid']}\")'>{$stk['stkcod']}</a></td>\n\t\t\t\t\t{$sernos}\n\t\t\t\t\t<td>{$Vatcodes}</td>\n\t\t\t\t\t<td>" . extlib_rstr($stk['stkdes'], 30) . "</td>\n\t\t\t\t\t<td><input type='text' size='3' name='qtys[]' value='{$stkd['qty']}'></td>\n\t\t\t\t\t<td>{$viewcost}</td>\n\t\t\t\t\t<td><input type='text' size='4' name='disc[]' value='{$stkd['disc']}'> OR <input type='text' size='4' name='discp[]' value='{$stkd['discp']}' maxlength='5'>%</td>\n\t\t\t\t\t<td nowrap><input type='hidden' name='amt[]' value='{$stkd['amt']}'> " . CUR . " " . sprint($stkd['amt']) . "</td>\n\t\t\t\t\t<td><input type='checkbox' name='remprod[]' value='{$key}'><input type='hidden' name='SCROLL' value='yes'></td>\n\t\t\t\t</tr>";
$key++;
}
}
# Look above(remprod keys)
$keyy = $key;
# Look above(if i = 0 then there are no products)
if ($i == 0) {
$done = "";
} else {
$SCROLL = "yes";
}
# check if stock warehouse was selected
if (isset($whidss)) {
foreach ($whidss as $key => $whid) {
if (isset($stkidss[$key]) && $stkidss[$key] != "-S" && isset($cust['pricelist'])) {
# skip if not selected
if ($whid == "-S") {
continue;
}
# Get selected warehouse name
db_conn("exten");
$sql = "SELECT whname FROM warehouses WHERE whid = '{$whid}' AND div = '" . USER_DIV . "'";
$whRslt = db_exec($sql);
$wh = pg_fetch_array($whRslt);
# Get selected stock in this warehouse
db_connect();
$sql = "SELECT * FROM stock WHERE stkid = '{$stkidss[$key]}' AND div = '" . USER_DIV . "' ORDER BY stkcod ASC";
$stkRslt = db_exec($sql);
$stk = pg_fetch_array($stkRslt);
$sernos = "<input type='hidden' name='sernos[]' value=''>";
# Get price from price list if it is set
if (isset($cust['pricelist'])) {
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:67,代码来源:rec-invoice-new.php
示例8: details
//.........这里部分代码省略.........
$sernos .= "<option value='{$ser['serno']}'>{$ser['serno']}</option>";
}
$sernos .= "</select>";
} else {
$sernos = "<input type='hidden' name='sernos[]' value='{$stkd['serno']}'>{$stkd['serno']}";
}
# Input qty if not serialised
$qtyin = "<input type='text' size='3' name='qtys[]' value='{$stkd['qty']}'>";
if ($stk['serd'] == 'yes') {
$qtyin = "<input type='hidden' size='3' name='qtys[]' value='{$stkd['qty']}'>{$stkd['qty']}";
}
# check permissions
if (perm("invoice-unitcost-edit.php")) {
$viewcost = "<input type='text' size='8' name='unitcost[]' value='{$stkd['funitcost']}'>";
$cunitcost = "<input type='text' size='8' name='cunitcost[]' value='{$stkd['unitcost']}'>";
} else {
$viewcost = "<input type='hidden' size='8' name='unitcost[]' value='{$stkd['funitcost']}'>{$stkd['funitcost']}";
$cunitcost = "<input type='hidden' size='8' name='cunitcost[]' value='{$stkd['unitcost']}'>{$stkd['unitcost']}";
}
db_conn('cubit');
$Sl = "SELECT * FROM vatcodes ORDER BY code";
$Ri = db_exec($Sl) or errDie("Unable to get vat codes");
$Vatcodes = "\n\t\t\t<select name='vatcodes[]'>\n\t\t\t\t<option value='0'>Select</option>";
while ($vd = pg_fetch_array($Ri)) {
if ($stkd['vatcode'] == $vd['id']) {
$sel = "selected";
} else {
$sel = "";
}
$Vatcodes .= "<option value='{$vd['id']}' {$sel}>{$vd['code']}</option>";
}
$Vatcodes .= "</select>";
# Put in product
$products .= "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td><input type='hidden' name='whids[]' value='{$stkd['whid']}'>{$wh['whname']}</td>\n\t\t\t\t<td><input type='hidden' name='stkids[]' value='{$stkd['stkid']}'><a href='#bottom' onclick='openwindow(\"stock-amt-det.php?stkid={$stk['stkid']}\")'>{$stk['stkcod']}</a></td>\n\t\t\t\t<td>{$Vatcodes}</td>\n\t\t\t\t<td>{$sernos}</td>\n\t\t\t\t<td>" . extlib_rstr($stk['stkdes'], 30) . "</td>\n\t\t\t\t<td>{$qtyin}</td>\n\t\t\t\t<td>" . CUR . " {$viewcost}</td>\n\t\t\t\t<td>{$inv['currency']} {$cunitcost}</td>\n\t\t\t\t<td>{$inv['currency']}<input type='text' size='4' name='disc[]' value='{$stkd['disc']}'> OR <input type='text' size='4' name='discp[]' value='{$stkd['discp']}' maxlength='5'>%</td>\n\t\t\t\t<td><input type='hidden' name='amt[]' value='{$stkd['amt']}'> {$inv['currency']} {$stkd['amt']}</td>\n\t\t\t\t<td><input type='checkbox' name='remprod[]' value='{$key}'><input type='hidden' name='SCROLL' value='yes'></td>\n\t\t\t</tr>";
$key++;
}
# Look above(remprod keys)
$keyy = $key;
# Look above(if i = 0 then there are no products)
if ($i == 0) {
$done = "";
} else {
$SCROLL = "yes";
}
# check if stock warehouse was selected
if (isset($whidss)) {
foreach ($whidss as $key => $whid) {
if (isset($stkidss[$key]) && $stkidss[$key] != "-S" && isset($cust['pricelist'])) {
# skip if not selected
if ($whid == "-S") {
continue;
}
# Get selected warehouse name
db_conn("exten");
$sql = "SELECT whname FROM warehouses WHERE whid = '{$whid}' AND div = '" . USER_DIV . "'";
$whRslt = db_exec($sql);
$wh = pg_fetch_array($whRslt);
# Get selected stock in this warehouse
db_connect();
$sql = "SELECT * FROM stock WHERE stkid = '{$stkidss[$key]}' AND div = '" . USER_DIV . "' ORDER BY stkcod ASC";
$stkRslt = db_exec($sql);
$stk = pg_fetch_array($stkRslt);
if ($stk['serd'] == 'yes') {
$sers = ext_getavserials($stkidss[$key]);
$sernos = "<select class='width : 15'name='sernos[]' onChange='javascript:document.form.submit();'>";
foreach ($sers as $skey => $ser) {
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:67,代码来源:intinvoice-new.php
示例9: details
//.........这里部分代码省略.........
if (isb($ad['accid'])) {
continue;
}
if ($ad['accid'] == $stkd['account']) {
$sel = "selected";
} else {
$sel = "";
}
$Accounts .= "<option value='{$ad['accid']}' {$sel}>{$ad['accname']}</option>";
}
$Accounts .= "</select>";
$sernos = "";
# Input qty if not serialised
$qtyin = "<input type='text' size='3' name='qtys[]' value='{$stkd['qty']}'>";
$viewcost = "<input type='text' size='8' name='unitcost[]' value='{$stkd['unitcost']}'>";
# Put in product
$products .= "\n\t\t\t\t<input type='hidden' name='whids[]' value='{$stkd['whid']}'>\n\t\t\t\t<input type='hidden' name='stkids[]' value='{$stkd['stkid']}'>\n\t\t\t\t<input type='hidden' name='SCROLL' value='yes'>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td colspan='2'>{$Accounts}</td>\n\t\t\t\t\t<td><input type='text' size='20' name='descriptions[]' value='{$stkd['description']}'> {$sernos}</td>\n\t\t\t\t\t<td>{$qtyin}</td>\n\t\t\t\t\t<td>{$viewcost}</td>\n\t\t\t\t\t<td><input type='checkbox' name='remprod[]' value='{$key}'></td>\n\t\t\t\t</tr>";
$key++;
} else {
# keep track of selected stock amounts
$amts[$i] = $stkd['amt'];
$i++;
# get warehouse name
db_conn("exten");
$sql = "SELECT whname FROM warehouses WHERE whid = '{$stkd['whid']}' AND div = '" . USER_DIV . "'";
$whRslt = db_exec($sql);
$wh = pg_fetch_array($whRslt);
# get selected stock in this warehouse
db_connect();
$sql = "SELECT * FROM stock WHERE stkid = '{$stkd['stkid']}' AND div = '" . USER_DIV . "'";
$stkRslt = db_exec($sql);
$stk = pg_fetch_array($stkRslt);
# put in product
$products .= "\n\t\t\t\t<input type='hidden' name='accounts[]' value='0'>\n\t\t\t\t<input type='hidden' name='descriptions[]' value=''>\n\t\t\t\t<input type='hidden' name='stkids[]' value='{$stkd['stkid']}'>\n\t\t\t\t<input type='hidden' name='whids[]' value='{$stkd['whid']}'>\n\t\t\t\t<input type='hidden' name='SCROLL' value='yes'>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>{$wh['whname']}</td>\n\t\t\t\t\t<td><a href='#' onclick='openwindow(\"stock-amt-det.php?stkid={$stk['stkid']}\")'>{$stk['stkcod']}</a></td>\n\t\t\t\t\t<td>" . extlib_rstr($stk['stkdes'], 30) . "</td>\n\t\t\t\t\t<td><input type='text' size='3' name='qtys[]' value='{$stkd['qty']}'></td>\n\t\t\t\t\t<td><input type='text' size='8' name='unitcost[]' value='{$stkd['unitcost']}'></td>\n\t\t\t\t\t<td><input type='checkbox' name='remprod[]' value='{$key}'></td>\n\t\t\t\t</tr>";
$key++;
}
}
# Look above(remprod keys)
$keyy = $key;
# look above(if i = 0 then there are no products)
if ($i == 0) {
$done = "";
}
# check if stock warehouse was selected
if (isset($whidss)) {
foreach ($whidss as $key => $whid) {
if (isset($stkidss[$key]) && $stkidss[$key] != "-S" && isset($cust['pricelist'])) {
# skip if not selected
if ($whid == "-S") {
continue;
}
# get selected warehouse name
db_conn("exten");
$sql = "SELECT whname FROM warehouses WHERE whid = '{$whid}' AND div = '" . USER_DIV . "'";
$whRslt = db_exec($sql);
$wh = pg_fetch_array($whRslt);
# get selected stock in this warehouse
db_connect();
$sql = "SELECT * FROM stock WHERE stkid = '{$stkidss[$key]}' AND div = '" . USER_DIV . "' ORDER BY stkcod ASC";
$stkRslt = db_exec($sql);
$stk = pg_fetch_array($stkRslt);
# get price from price list if it is set
if (isset($cust['pricelist'])) {
# get selected stock in this warehouse
db_conn("exten");
$sql = "SELECT price FROM plist_prices WHERE listid = '{$cust['pricelist']}' AND stkid = '{$stk['stkid']}' AND div = '" . USER_DIV . "'";
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:67,代码来源:callout-new.php
示例10: details
//.........这里部分代码省略.........
$sel = "selected";
} else {
$sel = "";
}
$Vatcodes .= "<option value='{$vd['id']}' {$sel}>{$vd['code']}</option>";
}
$Vatcodes .= "</select>";
$stkd['unitcost'] = sprint($stkd['unitcost']);
$stkd['amt'] = sprint($stkd['amt']);
// $sql = "SELECT * FROM manufact.jobcards WHERE recipe!='yes' AND completion!='1'";
// $job_rslt = db_exec($sql) or errDie("Unable to retrieve jobs.");
//
// $job_sel = "<select name='job_id[]' style='width: 100%'>";
// while ($job_data = pg_fetch_array($job_rslt)) {
// if ($stkd["jobcard_id"] == $job_data["id"]) {
// $sel = "selected";
// } else {
// $sel = "";
// }
//
// $job_sel .= "<option value='$job_data[id]' $sel>
// $job_data[id] $job_data[description]
// </option>";
// }
// $job_sel .= "</select>";
// <tr>
// <td bgcolor='#ff0000' width='10%'>
// $job_sel<br />
// <input type='submit' name='pur[]' value='Add To Purchase Resource Planning'>
// </td>
// </tr>
// rowspan='2'
# put in product
$products .= "\n\t\t\t\t<input type='hidden' name='accounts[]' value='0'>\n\t\t\t\t<input type='hidden' name='descriptions[]' value=''>\n\t\t\t\t<input type='hidden' name='amt[]' value='{$stkd['amt']}'>\n\t\t\t\t<input type='hidden' name='pqty[{$stk['stkid']}]' value='{$stkd['qty']}' />\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td><input type='hidden' name='whids[]' value='{$stkd['whid']}'>{$wh['whname']}</td>\n\t\t\t\t\t<td><input type='hidden' name='stkids[]' value='{$stkd['stkid']}'><a href='#' onclick='openwindow(\"stock-amt-det.php?stkid={$stk['stkid']}\")'>{$stk['stkcod']}</a></td>\n\t\t\t\t\t<td>{$Vatcodes}</td>\n\t\t\t\t\t<td>" . extlib_rstr($stk['stkdes'], 30) . "</td>\n\t\t\t\t\t<td><input type='text' size='3' name='qtys[]' value='{$stkd['qty']}'></td>\n\t\t\t\t\t<td><input type='text' size='8' name='unitcost[]' value='{$stkd['unitcost']}'></td>\n\t\t\t\t\t<td><input type='text' size='4' name='disc[]' value='{$stkd['disc']}'> OR <input type='text' size='4' name='discp[]' value='{$stkd['discp']}' maxlength=5>%</td>\n\t\t\t\t\t<td>" . CUR . " {$stkd['amt']}</td>\n\t\t\t\t\t<td><input type='checkbox' name='remprod[]' value='{$key}'><input type='hidden' name='SCROLL' value='yes'></td>\n\t\t\t\t</tr>";
$key++;
}
}
# Look above(remprod keys)
$keyy = $key;
# look above(if i = 0 then there are no products)
if ($i == 0) {
$done = "";
}
#get negative stock setting
$neg_setting = getCsetting("SORDER_NEG_STOCK");
if (!isset($neg_setting) or strlen($neg_setting) < 1) {
$neg_setting = "yes";
}
if ($neg_setting == "yes") {
$search_neg_stock = "";
} else {
$search_neg_stock = " AND (units > 0) ";
}
# check if stock warehouse was selected
if (isset($whidss)) {
foreach ($whidss as $key => $whid) {
if (isset($stkidss[$key]) && $stkidss[$key] != "-S" && isset($cust['pricelist'])) {
# skip if not selected
if ($whid == "-S") {
continue;
}
# get selected stock in this warehouse
db_connect();
$sql = "SELECT * FROM stock WHERE stkid = '{$stkidss[$key]}' AND div = '" . USER_DIV . "' ORDER BY stkcod ASC";
$stkRslt = db_exec($sql);
$stk = pg_fetch_array($stkRslt);
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:67,代码来源:sorder-new.php
示例11: details
//.........这里部分代码省略.........
$Vatcodes .= "</select>";
//print "fo";
# Put in product
$products .= "<tr class='bg-odd'><td colspan=2>{$Accounts}<input type=hidden name=whids[] value='{$stkd['whid']}'></td><td><input type=hidden name=stkids[] value='{$stkd['stkid']}'>{$Vatcodes}</td><td><input type=text size=20 name=descriptions[] value='{$stkd['description']}'> {$sernos}</td><td>{$qtyin}</td><td>{$viewcost}</td><td><input type=hidden name=disc[] value='{$stkd['disc']}'><input type=hidden name=discp[] value='{$stkd['discp']}'></td><td><input type=hidden name=amt[] value='{$stkd['amt']}'> " . CUR . " {$stkd['amt']}</td><td><input type=checkbox name=remprod[] value='{$key}'><input type=hidden name=SCROLL value=yes></td></tr>";
$key++;
} else {
# keep track of selected stock amounts
$amts[$i] = $stkd['amt'];
$i++;
# get warehouse name
db_conn("exten");
$sql = "SELECT whname FROM warehouses WHERE whid = '{$stkd['whid']}' AND div = '" . USER_DIV . "'";
$whRslt = db_exec($sql);
$wh = pg_fetch_array($whRslt);
# get selected stock in this warehouse
db_connect();
$sql = "SELECT * FROM stock WHERE stkid = '{$stkd['stkid']}' AND div = '" . USER_DIV . "'";
$stkRslt = db_exec($sql);
$stk = pg_fetch_array($stkRslt);
db_conn('cubit');
$Sl = "SELECT * FROM vatcodes ORDER BY code";
$Ri = db_exec($Sl) or errDie("Unable to get vat codes");
$Vatcodes = "<select name=vatcodes[]>\n\t\t\t<option value='0'>Select</option>";
while ($vd = pg_fetch_array($Ri)) {
if ($stkd['vatcode'] == $vd['id']) {
$sel = "selected";
} else {
$sel = "";
}
$Vatcodes .= "<option value='{$vd['id']}' {$sel}>{$vd['code']}</option>";
}
$Vatcodes .= "</select>";
# put in product
$products .= "<input type=hidden name=accounts[] value=0>\n\t\t\t<input type=hidden name=descriptions[] value=''>\n\t\t\t<tr class='bg-odd'><td><input type=hidden name=whids[] value='{$stkd['whid']}'>{$wh['whname']}</td><td><input type=hidden name=stkids[] value='{$stkd['stkid']}'><a href='#' onclick='openwindow(\"stock-amt-det.php?stkid={$stk['stkid']}\")'>{$stk['stkcod']}</a></td><td>{$Vatcodes}</td><td>" . extlib_rstr($stk['stkdes'], 30) . "</td><td><input type=text size=3 name=qtys[] value='{$stkd['qty']}'></td><td><input type=text size=8 name=unitcost[] value='{$stkd['unitcost']}'></td><td><input type=text size=4 name=disc[] value='{$stkd['disc']}'> OR <input type=text size=4 name=discp[] value='{$stkd['discp']}' maxlength=5>%</td><td><input
|
请发表评论