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


PHP bgcolor函数代码示例

本文整理汇总了PHP中bgcolor函数的典型用法代码示例。如果您正苦于以下问题:PHP bgcolor函数的具体用法?PHP bgcolor怎么用?PHP bgcolor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: view

function view($frm)
{
    extract($_REQUEST);
    if ($msg = cForm::validateValue($supid, "num", 1, 10)) {
        return "<li class='err'>The supplier ID is invalid. {$msg}</li>\n\t\t\t<input type='button' onclick='window.history.back();' value='&laquo; Correction' />";
    }
    /* @var frm cForm */
    $frm->settitle("Supplier Pricelist");
    $frm->setkey("import");
    $frm->add_heading("Import New Pricelist");
    $frm->add_message("\n\t\t\t<li class='err'>Pricelists has to be in CSV format and to import them\n\t\t\t\tyou have to specify the order and format of the fields<br />\n\t\t\t\tby selecting what each of them are in the same order as they appear\n\t\t\t\tin the file. Only the stock code<br />\n\t\t\t\tand the price is needed, so for the other fields you simply\n\t\t\t\tselect the '-' options.\n\t\t\t</li>", "inst");
    $frm->add_message("\n\t\t\t<li class='err'>Note that the stock codes of the supplier should be added\n\t\t\t\tby editing the stock item and selecting the<br />\n\t\t\t\t'Add/Edit/Remove' button below the stock code input field.\n\t\t\t</li>", "suppstkcod");
    $frm->add_hidden("supid", $supid, "num");
    $frm->add_file("Pricelist", "supplist");
    $frm->add_checkbox("VAT Inclusive", "vatinc", true, true);
    $frm->add_heading("Comma Seperated Volume (CSV) Fields");
    $frm->add_layout("\n\t<tr %bgc>\n\t\t<td colspan='2' nowrap='t'>\n\t\t\t<strong>\n\t\t\t\t%fldonly ,\n\t\t\t\t%fldonly ,\n\t\t\t\t%fldonly ,\n\t\t\t\t%fldonly ,\n\t\t\t\t%fldonly ,\n\t\t\t\t%fldonly\n\t\t\t</strong>\n\t\t</td>\n\t</tr>");
    // field types
    $ft = array("ignore" => "-", "stkcod" => "Stock Code", "price" => "Price");
    $frm->add_select("", "fld[0]", "stkcod", $ft, "string", "5:6");
    $frm->add_select("", "fld[1]", "price", $ft, "string", "5:6");
    $frm->add_select("", "fld[2]", "ignore", $ft, "string", "5:6");
    $frm->add_select("", "fld[3]", "ignore", $ft, "string", "5:6");
    $frm->add_select("", "fld[4]", "ignore", $ft, "string", "5:6");
    $frm->add_select("", "fld[5]", "ignore", $ft, "string", "5:6");
    $frm->add_ctrlbtn("Import", "submit", "btn_import");
    $OUT = $frm->getfrm_input();
    /* supplier info */
    $suppinfo = qrySupplier($supid);
    $supcur = qryCurrency($suppinfo["fcid"]);
    $supcur = $supcur["symbol"];
    /* list current pricelist */
    $OUT .= "\n\t<table " . TMPL_tblDflts . ">\n\t<tr>\n\t\t<th>Stock Code</td>\n\t\t<th>Supplier Stock Code</th>\n\t\t<th>Current Supplier Price</th>\n\t\t<th>Current Selling Price</th>\n\t</tr>";
    $sql = "SELECT pli.*\n\t\t\tFROM exten.spricelist pl INNER JOIN exten.splist_prices pli\n\t\t\t\tON pl.listid=pli.listid\n\t\t\tWHERE pl.suppid='{$supid}'";
    $qry = new dbSql($sql);
    $qry->run();
    if ($qry->num_rows() <= 0) {
        $OUT .= "\n\t\t<tr bgcolor='" . bgcolorc(0) . "'>\n\t\t\t<td colspan='4'>No pricelist.</td>\n\t\t</tr>";
    }
    $i = 0;
    while ($row = $qry->fetch_array()) {
        if (empty($row["supstkcod"])) {
            $our_stkcod = "No supplier stock code";
            $our_price = "";
        } else {
            if (($stkid = suppStkid($supid, $row["supstkcod"])) === false) {
                $our_stkcod = "<li class='err'>No such stock item.\n\t\t\t\t<a href='stock-add.php?stkcod={$row['supstkcod']}&supid={$supid}&supstkcod={$row['supstkcod']}'>Add Stock</a> /\n\t\t\t\t<a href='stock-view.php'>Edit Stock</li>";
                $our_price = "";
            } else {
                $stkrow = qryStock($stkid, "stkcod, selamt");
                $our_stkcod = "<strong>{$stkrow['stkcod']}</strong>";
                $our_price = CUR . " " . sprint($stkrow["selamt"]);
            }
        }
        $OUT .= "\n\t\t<tr bgcolor='" . bgcolor($i) . "'>\n\t\t\t<td>{$our_stkcod}</td>\n\t\t\t<td>{$row['supstkcod']}</td>\n\t\t\t<td align='right'>{$supcur} " . sprint($row["price"]) . "</td>\n\t\t\t<td align='right'>{$our_price}</td>\n\t\t</tr>";
    }
    $OUT .= "\n\t</table>";
    return $OUT;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:59,代码来源:supp-pricelist.php

示例2: enter

function enter()
{
    extract($_POST);
    $qry = new dbSelect("config", "trh", grp(m("where", "readonly='f'")));
    $qry->run();
    while ($row = $qry->fetch_array()) {
        if (!isset(${$row["name"]})) {
            ${$row["name"]} = array("desc" => $row["description"], "value" => $row["value"], "type" => $row["type"]);
        }
    }
    $display = array("General Settings" => array("INTERVAL", "MANAGEUSER"), "SMTP Settings" => array("SMTP_SERVER", "SMTP_USER", "SMTP_PASS", "SMTP_FROM"), "POP3 Settings" => array("POP3_SERVER", "POP3_USER", "POP3_PASS"));
    $cat = false;
    $OUT = "\n\t<h3>Transactioning Configuration</h3>\n\t<form method='post' action='" . SELF . "'>\n\t<input type='hidden' name='key' value='write' />\n\t<table " . TMPL_tblDflts . " width='400'>";
    $pc = false;
    foreach ($display as $cat => $cnames) {
        if ($cat != $pc) {
            if ($pc != false) {
                $OUT .= TBL_BR;
            }
            $OUT .= "\n\t\t\t<tr>\n\t\t\t\t<th colspan='2'>{$cat}</th>\n\t\t\t</tr>";
        }
        $i = 0;
        foreach ($cnames as $vname) {
            if (!isset($vname)) {
                $vname = "";
            }
            $OUT .= "\n\t\t\t<input type='hidden' name='{$vname}[desc]' value='" . ${$vname}["desc"] . "' />\n\t\t\t<input type='hidden' name='{$vname}[type]' value='" . ${$vname}["type"] . "' />\n\t\t\t<tr bgcolor='" . bgcolor($i) . "'>\n\t\t\t\t<td>" . ${$vname}["desc"] . "</td>\n\t\t\t\t<td>";
            switch (${$vname}["type"]) {
                case "yn":
                    $OUT .= "\n\t\t\t\t\t<select name='{$vname}[value]'>\n\t\t\t\t\t\t<option value='y' " . (${$vname}["value"] != "n") . ">Yes</option>\n\t\t\t\t\t\t<option value='n' " . (${$vname}["value"] == "n") . ">Yes</option>\n\t\t\t\t\t</select>";
                    break;
                case "passwd":
                    $OUT .= "\n\t\t\t\t\t<input type='password' name='{$vname}[value]' value='" . ${$vname}["value"] . "' />";
                    break;
                case "ulist":
                    $uq = qryUsers();
                    $OUT .= db_mksel($uq, "{${'vname'}}[value]", ${'vname'}["value"], "#userid", "#username");
                    break;
                case "str":
                default:
                    $OUT .= "\n\t\t\t\t\t<input type='text' name='{$vname}[value]' value='" . ${$vname}["value"] . "' />";
                    break;
            }
            $OUT .= "\n\t\t\t\t</td>\n\t\t\t</tr>";
        }
    }
    $OUT .= "\n\t<tr>\n\t\t<td colspan='2' align='right'><input type='submit' value='Save' /></td>\n\t</tr>\n\t</table>\n\t</form>";
    return $OUT;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:49,代码来源:configuration.php

示例3: printComp

function printComp()
{
    $OUT = "\n    <h3>View Companies</h3>\n    <table " . TMPL_tblDflts . ">\n    <tr>\n    \t<th>Company Code</th>\n    \t<th>Company Name</th>\n    \t<th>Status</th>\n    \t<th>Options</th>\n    </tr>";
    $qry = new dbSelect("companies", DB_MCUBIT, grp(m("order", "name ASC")));
    $qry->run();
    $i = 0;
    while ($comp = $qry->fetch_array()) {
        $bgcolor = bgcolor($i);
        $status = ucfirst($comp["status"]);
        $OUT .= "\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>{$comp['code']}</td>\n\t\t\t<td>{$comp['name']}</td>\n\t\t\t<td>{$status}</td>";
        if ($comp["status"] == "removed") {
            $OUT .= "\n\t\t\t<td><a href='company-rem.php?key=recover&code={$comp['code']}'>Recover</a></td>";
        }
        $OUT .= "\n\t\t\t<td><a href='company-rem.php?key=confirm&perm=t&code={$comp['code']}'>" . ($comp["status"] == "removed" ? "Remove Permanently (CAN NOT BE RECOVERED)" : "Remove") . "</a></td>\n\t\t</tr>";
    }
    $OUT .= "\n\t</table>" . mkQuickLinks(ql("company-new.php", "Add New Company"));
    return $OUT;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:18,代码来源:company-view.php

示例4: phorum_get_file_name

$sTitle = " sorry :(";
require "./common.php";
include phorum_get_file_name("header");
?>
<center>
<table class="PhorumListTable" width="$ForumTableWidth" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td <?php 
echo bgcolor($ForumTableHeaderColor);
?>
 valign="TOP" nowrap="nowrap"><font color="<?php 
echo $ForumTableHeaderFontColor;
?>
">&nbsp;<?php 
echo $lViolationTitle;
?>
</font></td>
  </tr>
  <tr>
    <td width="100%" align="LEFT" valign="MIDDLE" <?php 
echo bgcolor($ForumTableBodyColor2);
?>
><?php 
echo $lViolation;
?>
</td>
</td>
</tr>
</table>
<?php 
include phorum_get_file_name("footer");
开发者ID:carriercomm,项目名称:Exult,代码行数:31,代码来源:violation.php

示例5: bgcolor

</table>
<?php 
if (!$ForumMultiLevel || ${$phcollapse}) {
    include "{$include_path}/threads.php";
} else {
    include "{$include_path}/multi-threads.php";
}
?>
<table class="PhorumListTable" width="<?php 
echo $ForumTableWidth;
?>
" cellspacing="0" cellpadding="3" border="0">
<tr>
  <td width="60%" nowrap <?php 
echo bgcolor($ForumNavColor);
?>
><?php 
echo $LowLeftNav;
?>
</td>
  <td align="right" width="40%" <?php 
echo bgcolor($ForumNavColor);
?>
><div class=nav><?php 
echo $LowRightNav;
?>
</div></td>
</tr>
</table>
<?php 
include phorum_get_file_name("footer");
开发者ID:carriercomm,项目名称:xmec,代码行数:31,代码来源:list.php

示例6: recvpayment

function recvpayment()
{
    extract($_POST);
    $v = new validate();
    $v->isOk($cusnum, "num", 1, 10, "Invalid customer id.");
    $v->isOk($invid, "num", 1, 10, "Invalid invoice id.");
    $v->isOk($pcc, "float", 1, 40, "Invalid credit card amount.");
    $v->isOk($pcash, "float", 1, 40, "Invalid cash amount.");
    $v->isOk($pcheque, "float", 1, 40, "Invalid cheque amount.");
    $date = mkdate($pinv_year, $pinv_month, $pinv_day);
    $v->isOk($date, "date", 1, 1, "Invalid invoice date.");
    if ($v->isError()) {
        return details($_POST, $v->genErrors());
    }
    $amt = sprint($pcc + $pcash + $pcheque);
    $cus = qryCustomer($cusnum);
    $bank_acc = qryAccountsName("Cash on Hand");
    $OUT = "\n\t<table " . TMPL_tblDflts . ">\n\t<tr>\n\t\t<th colspan='2'>Payment Details</th>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Account</td>\n\t\t<td>{$bank_acc['topacc']}/{$bank_acc['accnum']} {$bank_acc['accname']}</td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Date</td>\n\t\t<td valign='center'>{$date}</td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Received from</td>\n\t\t<td valign='center'>{$cus['cusname']} {$cus['surname']}</td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Description</td>\n\t\t<td valign='center'>POS Payment Received</td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Amount</td>\n\t\t<td valign='center'>" . CUR . " {$amt}</td>\n\t</tr>\n\t</table>\n\n\t<form method='post' action='" . SELF . "'>\n\t<input type='hidden' name='key' value='recvpayment_write' />\n\t<input type='hidden' name='bank_acc' value='{$bank_acc['accid']}' />\n\t<input type='hidden' name='invid' value='{$invid}' />\n\t<input type='hidden' name='pcc' value='{$pcc}' />\n\t<input type='hidden' name='pcash' value='{$pcash}' />\n\t<input type='hidden' name='pcheque' value='{$pcheque}' />\n\t<input type='hidden' name='amt' value='{$amt}' />\n\t<input type='hidden' name='date' value='{$date}' />\n\t<input type='hidden' name='cusnum' value='{$cusnum}' />\n\t<input type='hidden' name='descript' value='POS Payment Received' />\n\n\t<input type='hidden' name='stkerr' value='{$stkerr}' />\n\t<input type='hidden' name='prev_cusnum' value='{$prev_cusnum}' />\n\t<input type='hidden' name='deptid' value='{$deptid}' />\n\t<input type='hidden' name='telno' value='{$telno}' />\n\t<input type='hidden' name='cordno' value='{$cordno}' />\n\t<input type='hidden' name='bar' value='{$bar}' />\n\t<input type='hidden' name='des' value='{$des}' />\n\t<input type='hidden' name='sel_frm' value='{$sel_frm}' />\n\t<input type='hidden' name='ordno' value='{$ordno}' />\n\t<input type='hidden' name='pinv_day' value='{$pinv_day}' />\n\t<input type='hidden' name='pinv_month' value='{$pinv_month}' />\n\t<input type='hidden' name='pinv_year' value='{$pinv_year}' />\n\t<input type='hidden' name='chrgvat' value='{$chrgvat}' />\n\t<input type='hidden' name='salespn' value='{$salespn}' />\n\t<input type='hidden' name='traddisc' value='{$traddisc}' />\n\t<input type='hidden' name='delchrg' value='{$delchrg}' />\n\t<input type='hidden' name='delvat' value='{$delvat}' />\n\t<input type='hidden' name='user' value='{$user}' />\n\t<input type='hidden' name='SUBTOT' value='{$subtot}' />\n\t<input type='hidden' name='comm' value='{$comm}' />\n\n\t<table " . TMPL_tblDflts . ">";
    // Connect to database
    db_connect();
    $sql = "SELECT invnum,invid,balance,terms,odate FROM invoices\n\t\t\tWHERE cusnum = '{$cusnum}' AND printed = 'y' AND balance>0\n\t\t\t\tAND div = '" . USER_DIV . "'\n\t\t\tORDER BY odate ASC";
    $prnInvRslt = db_exec($sql);
    $i = 0;
    while (($inv = pg_fetch_array($prnInvRslt)) && $amt > 0) {
        if ($i == 0) {
            $OUT .= "\n\t\t\t<tr>\n\t\t\t\t<td colspan='2'>&nbsp;</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td colspan='2'><h3>Outstanding Invoices</h3></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th>Invoice</th>\n\t\t\t\t<th>Outstanding Amount</th>\n\t\t\t\t<th>Terms</th>\n\t\t\t\t<th>Date</th>\n\t\t\t\t<th>Amount</th>\n\t\t\t</tr>";
        }
        $invid = $inv['invid'];
        $val = allocamt($amt, $inv["balance"]);
        $OUT .= "\n\t\t<input type='hidden' name='paidamt[{$invid}]' size=10 value='{$val}'>\n\t\t<input type='hidden' size=20 name=invids[{$invid}] value='{$inv['invid']}'>\n\t\t<tr bgcolor='" . bgcolor($i) . "'>\n\t\t\t<td>{$inv['invnum']}</td>\n\t\t\t<td>" . CUR . " {$inv['balance']}</td>\n\t\t\t<td>{$inv['terms']} days</td>\n\t\t\t<td>{$inv['odate']}</td>\n\t\t\t<td>" . CUR . " {$val}</td>\n\t\t</tr>";
    }
    $sql = "SELECT invnum,invid,balance,sdate as odate FROM nons_invoices\n\t\t\tWHERE cusid='{$cusnum}' AND done='y' AND balance>0\n\t\t\t\tAND div='" . USER_DIV . "'\n\t\t\tORDER BY odate ASC";
    $prnInvRslt = db_exec($sql);
    while (($inv = pg_fetch_array($prnInvRslt)) && $amt > 0) {
        if ($i == 0) {
            $OUT .= "\n\t\t\t<tr>\n\t\t\t\t<td colspan='2'>&nbsp;</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td colspan='2'><h3>Outstanding Non-Stock Invoices</h3></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th>Invoice</th>\n\t\t\t\t<th>Outstanding Amount</th>\n\t\t\t\t<th></th>\n\t\t\t\t<th>Date</th>\n\t\t\t\t<th>Amount</th>\n\t\t\t</tr>";
        }
        $invid = $inv['invid'];
        $val = allocamt($amt, $inv["balance"]);
        $OUT .= "\n\t\t\t\t<input type='hidden' name='paidamt[{$invid}]' value='{$val}'>\n\t\t\t\t<input type='hidden' name='itype[{$invid}]' value='Yes'>\n\t\t\t\t<tr bgcolor='" . bgcolor($i) . "'>\n\t\t\t\t\t<td><input type='hidden' size='20' name='invids[{$invid}]' value='{$inv['invid']}'>{$inv['invnum']}</td>\n\t\t\t\t\t<td>" . CUR . " {$inv['balance']}</td>\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td>{$inv['odate']}</td>\n\t\t\t\t\t<td>" . CUR . " {$val}</td>\n\t\t\t\t</tr>";
    }
    $amt = sprint($amt);
    /* pos invoices */
    $sqls = array();
    for ($i = 1; $i <= 12; ++$i) {
        $sqls[] = "SELECT invnum,invid,balance,odate FROM \"{$i}\".pinvoices\n\t\t\t\t\tWHERE cusnum='{$cusnum}' AND done='y' AND balance>0\n\t\t\t\t\t\tAND div='" . USER_DIV . "'";
    }
    $sql = implode(" UNION ", $sqls);
    $prnInvRslt = db_exec($sql);
    if (pg_numrows($prnInvRslt) > 0) {
        $OUT .= "\n\t\t<tr>\n\t\t\t<td colspan='2'><br></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td colspan='2'><h3>Outstanding POS Invoices</h3></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th>Invoice</th>\n\t\t\t<th>Outstanding Amount</th>\n\t\t\t<th></th>\n\t\t\t<th>Date</th>\n\t\t\t<th>Amount</th>\n\t\t</tr>";
        $i = 0;
        while ($inv = pg_fetch_array($prnInvRslt)) {
            $invid = $inv['invid'];
            $val = allocamt($amt, $inv["balance"]);
            $OUT .= "\n\t\t\t<input type='hidden' size='20' name='invids[{$invid}]' value='{$inv['invid']}'>\n\t\t\t<input type='hidden' name='paidamt[{$invid}]' size=10 value='{$val}'>\n\t\t\t<input type='hidden' name='ptype[{$invid}]' value='YnYn'>\n\t\t\t<tr bgcolor='" . bgcolor($i) . "'>\n\t\t\t\t<td>{$inv['invnum']}</td>\n\t\t\t\t<td>" . CUR . " {$inv['balance']}</td>\n\t\t\t\t<td></td>\n\t\t\t\t<td>{$inv['odate']}</td>\n\t\t\t\t<td>" . CUR . " {$val}</td>\n\t\t\t</tr>";
        }
    }
    if ($amt > 0) {
        /* START OPEN ITEMS */
        $ox = "";
        $sql = "SELECT * FROM cubit.open_stmnt WHERE balance>0 AND cusnum='{$cusnum}'\n\t\t\t\t\tAND type!='Invoice' AND type!='Non-Stock Invoice'\n\t\t\t\t\tAND type!='Interest on Outstanding balance'\n\t\t\t\tORDER BY date";
        $rslt = db_exec($sql) or errDie("Unable to get open items.");
        $open_out = $amt;
        $i = 0;
        while ($od = pg_fetch_array($rslt)) {
            if ($open_out == 0) {
                continue;
            }
            $oid = $od['id'];
            if ($open_out >= $od['balance']) {
                $open_amount[$oid] = $od['balance'];
                $open_out = sprint($open_out - $od['balance']);
                $ox .= "\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td><input type='hidden' size='20' name='open[{$oid}]' value='{$oid}'>{$od['type']}</td>\n\t\t\t\t\t<td>" . CUR . " {$od['balance']}</td>\n\t\t\t\t\t<td>{$od['date']}</td>\n\t\t\t\t\t<td><input type='hidden' name='open_amount[{$oid}]' value='{$open_amount[$oid]}'>" . CUR . " {$open_amount[$oid]}</td>\n\t\t\t\t</tr>";
            } elseif ($open_out < $od['balance']) {
                $open_amount[$oid] = $open_out;
                $open_out = 0;
                $ox .= "\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td><input type='hidden' size='20' name='open[{$oid}]' value='{$od['id']}'>{$od['type']}</td>\n\t\t\t\t\t<td>" . CUR . " {$od['balance']}</td>\n\t\t\t\t\t<td>{$od['date']}</td>\n\t\t\t\t\t<td><input type='hidden' name='open_amount[{$oid}]' value='{$open_amount[$oid]}'>" . CUR . " {$open_amount[$oid]}</td>\n\t\t\t\t</tr>";
            }
            $i++;
        }
        if (open()) {
            $OUT .= "\n\t\t\t" . TBL_BR . "\n\t\t\t<input type='hidden' name='bout' value='{$amt}'>\n\t\t\t<tr>\n\t\t\t\t<td colspan='2'><h3>Outstanding Transactions</h3></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th>Description</th>\n\t\t\t\t<th>Outstanding Amount</th>\n\t\t\t\t<th>Date</th>\n\t\t\t\t<th>Amount</th>\n\t\t\t</tr>";
            $OUT .= $ox;
            $bout = $amt;
            $amt = $open_out;
            if ($amt > 0) {
                $OUT .= "\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td colspan='4'><b>A general transaction will credit the client's account with " . CUR . " {$amt}</b></td>\n\t\t\t\t</tr>";
            }
            //$amt=$bout;
        } else {
            $OUT .= "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='4'><b>A general transaction will credit the client's account with " . CUR . " {$amt} </b></td>\n\t\t\t</tr>";
        }
    }
    $OUT .= "\n\t<input type='hidden' name='out' value='{$amt}' />\n\t<tr>\n\t\t<td colspan='5' align='right'>\n\t\t\t<input type='submit' name='btn_back' value='&laquo; Correction' />\n\t\t\t<input type='submit' value='Record Payment' />\n\t\t</td>\n\t</table>";
    return $OUT;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:97,代码来源:pos-invoice-new-no-neg.php

示例7: details

function details($_GET)
{
    extract($_GET);
    $ids = explode(",", $ids);
    # validate input
    require_lib("validate");
    $v = new validate();
    foreach ($ids as $invid) {
        $v->isOk($invid, "num", 1, 20, "Invalid recuring invoice number.");
    }
    # display errors, if any
    if ($v->isError()) {
        $err = $v->genErrors();
        $confirm = "{$err}<p><input type=button onClick='JavaScript:history.back();' value='&laquo; Correct submission'>";
        return $confirm;
    }
    /* --- Start Display --- */
    $printInv = "\n\t<h3>Confirm Invoice Printing Process</h3>\n\t<form action='" . SELF . "' method='POST'>\n\t\t<input type='hidden' name='key' value='process'>\n\t<table " . TMPL_tblDflts . ">\n\t\t<tr>\n\t\t\t<td colspan='6' class='err'>Please Note : This process might take long depending on the number of invoices. It is best to run it overnight.</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th>Invoice No.</th>\n\t\t\t<th>Invoice Date</th>\n\t\t\t<th>Customer Name</th>\n\t\t\t<th>Grand Total</th>\n\t\t</tr>";
    $i = 0;
    foreach ($ids as $key => $invid) {
        # Get recuring invoice info
        db_connect();
        $sql = "SELECT * FROM nons_invoices WHERE invid = '{$invid}' AND div = '" . USER_DIV . "' AND done!='y'";
        $invRslt = db_exec($sql) or errDie("Unable to get recuring invoice information");
        if (pg_numrows($invRslt) < 1) {
            return "<i class='err'>Invoice Not Found, Please make sure you have selected a unprinted invoice.</i>";
        }
        $inv = pg_fetch_array($invRslt);
        $bgColor = bgcolor($i);
        $inv['total'] = sprint($inv['total']);
        $inv['balance'] = sprint($inv['balance']);
        $printInv .= "\n\t\t<input type=hidden name='invids[]' value='{$inv['invid']}'>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>T {$inv['invid']}</td>\n\t\t\t<td valign='center'>{$inv['odate']}</td>\n\t\t\t<td>{$inv['cusname']}</td>\n\t\t\t<td align=right>" . CUR . " {$inv['total']}</td>\n\t\t</tr>";
    }
    $bgColor = bgcolor($i);
    $printInv .= "<tr class='" . bg_class() . "'><td colspan=6 align=right>Totals Invoices : {$i}</td></tr>\n\t<tr><td><br></td></tr>\n\t<tr><td colspan=6 align=right><input type=submit value='Process >>'></td></tr>\n\t</form></table>\n\t<p>\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\n\t<tr><th>Quick Links</th></tr>\n\t<tr class='bg-odd'><td><a href='rec-nons-invoice-new.php'>New Recurring Non-stock Invoice</a></td></tr>\n\t<tr class='bg-odd'><td><a href='rec-nons-invoice-view.php'>View Recurring Non-stock Invoices</a></td></tr>\n\t<script>document.write(getQuicklinkSpecial());</script>\n\t</table>";
    return $printInv;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:37,代码来源:nons-invoices-print.php

示例8: printSord

function printSord()
{
    extract($_REQUEST);
    if (isset($key)) {
        $key = strtolower($key);
        switch ($key) {
            case "export to spreadsheet":
            case "print":
            case "save":
                $pure = true;
                break;
            case "view":
            default:
                $pure = false;
        }
    } else {
        $pure = false;
    }
    if (!isset($from_year)) {
        explodeDate(false, $from_year, $from_month, $from_day);
        explodeDate(false, $to_year, $to_month, $to_day);
    }
    $printSord = "";
    if (!$pure) {
        $printSord .= "\n\t\t<form method='post' action='" . SELF . "'>\n\t    <table " . TMPL_tblDflts . ">\n\t    <tr>\n\t    \t<th colspan='2'>View Options</th>\n\t    </tr>\n\t    <tr class='" . bg_class() . "'>\n\t    \t<td>Begin Date:</td>\n\t    \t<td>" . mkDateSelect("from", $from_year, $from_month, $from_day) . "</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t    \t<td>End Date:</td>\n\t    \t<td>" . mkDateSelect("to", $to_year, $to_month, $to_day) . "</td>\n\t    </tr>\n\t    <tr>\n\t    \t<td colspan='2' align='right'><input type='submit' value='Filter' /></td>\n\t    </tr>\n\t    </table>";
    }
    if (!isset($key)) {
        $printSord .= "</form>";
        return $printSord;
    }
    $printSord .= "\n\t<table " . TMPL_tblDflts . ">\n\t<tr>\n\t\t<th>Department</th>\n\t\t<th>Sales Person</th>\n\t\t<th>Sales Order No.</th>\n\t\t<th>Sales Order Date</th>\n\t\t<th>Customer Name</th>\n\t\t<th>Order No</th>\n\t\t" . ($pure ? "" : "<th colspan=6>Options</th>") . "\n\t</tr>";
    $i = 0;
    $sql = "SELECT * FROM cubit.sorders\n    \t\tWHERE accepted = 'n' AND done = 'y' AND div = '" . USER_DIV . "' AND\n    \t\t\todate BETWEEN '{$from_year}-{$from_month}-{$from_day}' AND \n    \t\t\t\t'{$to_year}-{$to_month}-{$to_day}' AND slip_done='n'\n    \t\tORDER BY sordid DESC";
    $sordRslt = db_exec($sql) or errDie("Unable to retrieve Sales Orders.");
    if (pg_numrows($sordRslt) < 1) {
        $printSord .= "\n\t\t<tr bgcolor='" . bgcolorc(0) . "'>\n\t\t\t<td colspan='13'>No Sales Orders matching criteria.</td>\n\t\t</tr>";
    } else {
        while ($sord = pg_fetch_array($sordRslt)) {
            # alternate bgcolor
            $bgColor = bgcolor($i);
            # format date
            $sord['odate'] = explode("-", $sord['odate']);
            $sord['odate'] = $sord['odate'][2] . "-" . $sord['odate'][1] . "-" . $sord['odate'][0];
            $det = "sorder-details.php";
            $cancel = "sorder-cancel.php";
            $accept = "sorder-accept.php";
            $print = "sorder-print.php";
            $edit = "sorder-new.php";
            if ($sord['location'] == 'int') {
                $det = "intsorder-details.php";
                $cancel = "intsorder-cancel.php";
                $accept = "intsorder-accept.php";
                $print = "intsorder-print.php";
                $edit = "intsorder-new.php";
            }
            $sp4 = "&nbsp;&nbsp;&nbsp;&nbsp;";
            $bcurr = CUR;
            if ($sord['location'] == 'int') {
                $bcurr = $sord['currency'];
            }
            if ($sord["username"] == USER_NAME || user_is_admin(USER_NAME)) {
                $done = "\n\t\t\t\t<a href='picking_slip_done.php?sordid={$sord['sordid']}'>\n\t\t\t\t\tCancel\n\t\t\t\t</a>";
            } else {
                $done = "";
            }
            $printSord .= "<tr class='" . bg_class() . "'>\n\t\t\t\t<td>{$sord['deptname']}</td>\n\t\t\t\t<td>{$sord['salespn']}</td>\n\t\t\t\t<td>{$sord['sordid']}</td>\n\t\t\t\t<td align=center>{$sord['odate']}</td>\n\t\t\t\t<td>{$sord['cusname']} {$sord['surname']}</td>\n\t\t\t\t<td align=right>{$sord['ordno']}</td>\n\t\t\t\t<td>\n\t\t\t\t\t<a href='javascript:printer(\"picking_slips/picking_slip_print.php?sordid={$sord['sordid']}\")'>\n\t\t\t\t\t\tPrint Picking Slip\n\t\t\t\t\t</a>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<a href='" . SELF . "?key=invoice&sordid={$sord['sordid']}'>\n\t\t\t\t\t\tInvoice\n\t\t\t\t\t</a>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<a href='" . SELF . "?key=pos_invoice&sordid={$sord['sordid']}'>\n\t\t\t\t\t\tPOS Invoice\n\t\t\t\t\t</a>\n\t\t\t\t</td>\n\t\t\t\t<td>{$done}</td>";
        }
    }
    if (!$pure) {
        $printSord .= "\n\t\t</table>\n\t\t</form>";
    } else {
        $printSord .= "\n\t\t</table>";
        $OUTPUT = clean_html($printSord);
        switch ($key) {
            case "export to spreadsheet":
                require_lib("xls");
                StreamXLS("sorders", $OUTPUT);
                break;
            case "print":
                $OUTPUT = "<h3>Sales Orders</h3>{$OUTPUT}";
                require "tmpl-print.php";
                break;
            case "save":
                $pure = true;
                break;
        }
    }
    return $printSord;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:89,代码来源:sorder-view.php

示例9: getfrm_tmpl

 /**
  * makes the template used by getfrm_input() and getfrm_confirm()
  */
 private function getfrm_tmpl()
 {
     $OUT = "<h3>{$this->title}</h3>";
     if (!empty($this->title_msg)) {
         $OUT .= "{$this->title_msg}<br /><br />";
     }
     /* add defaults buttons if none was added */
     if (!$this->has_buttons) {
         /* if this is a confirm screen */
         if (array_search($this->key, $this->keys) > 0) {
             $this->add_ctrlbtn("&laquo; Correction", "submit", "btn_back");
         }
         $this->add_ctrlbtn("Submit", "submit", "btn_submit");
     }
     /* form encoding */
     if ($this->dataform === true) {
         $et = "enctype='multipart/form-data'";
     } else {
         $et = "";
     }
     /* validation errors */
     $errs = "";
     if (isset($this->errors[$this->key])) {
         foreach ($this->errors[$this->key] as $ifldname => $flderr) {
             $errs .= "<li class='err'>{$flderr}</li>";
         }
     }
     /* start output */
     $totcols = $this->cols * 2;
     $OUT .= "\n\t\t<form name='{$this->frmname}' method='{$this->method}' action='{$this->action}' {$et}>";
     /* class information */
     $OUT .= $this->getpasson();
     $OUT .= "%%CUBIT_FLD%HIDDEN%%";
     /* main table layout */
     $CELLOUT = array();
     /* column table layout */
     $OUT .= "\n\t\t<table " . TMPL_tblDflts . ">";
     if (!empty($errs)) {
         $OUT .= "\n\t\t\t<tr>\n\t\t\t\t<th colspan='{$totcols}'>There are problems with values of the following fields:</th>\n\t\t\t<tr>\n\t\t\t<tr bgcolor='" . bgcolorc(0) . "'>\n\t\t\t\t<td colspan='{$totcols}'>{$errs}</td>\n\t\t\t</tr>";
     }
     /* add fields */
     $i = 0;
     // bgcolor counter
     $maxcols = 1;
     // maximum number of columns of any row
     $ctrlbtns = array();
     // store ctrlbutton names as they are found
     $layout = "";
     // buffer for layout filling
     $layout_capacity = false;
     // capacity of current layout to still be filled
     foreach ($this->fields as $ifldname => $fldopt) {
         $fldname = base64_decode($ifldname);
         #manual error handling
         if (!isset($fldopt["pos_col"])) {
             $fldopt["pos_col"] = "";
         }
         if (!isset($fldopt["pos_row"])) {
             $fldopt["pos_row"] = "";
         }
         /* count max columns */
         if ($fldopt["pos_col"] > $maxcols) {
             $maxcols = $fldopt["pos_col"];
         }
         /* create pointer to the output cell variable */
         if (!isset($CELLOUT[$fldopt["pos_row"]])) {
             $CELLOUT[$fldopt["pos_row"]] = array($fldopt["pos_col"] => "");
         } else {
             if (!isset($CELLOUT[$fldopt["pos_row"]][$fldopt["pos_col"]])) {
                 $CELLOUT[$fldopt["pos_row"]][$fldopt["pos_col"]] = "";
             }
         }
         $fOUT =& $CELLOUT[$fldopt["pos_row"]][$fldopt["pos_col"]];
         /* heading type */
         if ($fldopt["type"] == "heading") {
             $fOUT .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan='2'>{$fldopt['disp']}</th>\n\t\t\t\t</tr>";
         } else {
             if ($fldopt["type"] == "message") {
                 $fOUT .= "\n\t\t\t\t<tr bgcolor='" . bgcolor($i) . "'>\n\t\t\t\t\t<td colspan='2'>{$fldopt['disp']}</td>\n\t\t\t\t</tr>";
             } else {
                 if ($fldopt["type"] == "ctrlbutton") {
                     if ($fldopt["dispkey"] == $this->key) {
                         $ctrlbtns[] = $ifldname;
                     }
                 } else {
                     if ($fldopt["type"] == "layout") {
                         if ($this->key == $fldopt["dispkey"] || $fldopt["sticky"]) {
                             //print_r($fldopt);
                             if ($fldopt["capacity"] == 0) {
                                 $fOUT .= $fldopt["data"];
                             } else {
                                 $layout .= $fldopt["data"];
                                 $layout_capacity += $fldopt["capacity"];
                             }
                         }
                     } else {
                         /* find positions in sequence of each key */
//.........这里部分代码省略.........
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:101,代码来源:form.lib.php

示例10: _

                <td><?php 
    echo $max_c_date['year'];
    ?>
</td>
            </tr>
            <?php 
}
if (isset($max_a['year'])) {
    ?>
            <tr>
                <th><?php 
    echo _('Max A Level (last year)');
    ?>
</th>
                <td bgcolor="<?php 
    echo bgcolor($max_a['year'], $threshold_a);
    ?>
">
                    <font color="<?php 
    echo fontcolor($max_a['year'], $threshold_a);
    ?>
"><b><?php 
    echo $max_a['year'];
    ?>
</b></font>
                </td>
                <td><?php 
    echo $max_a_date['year'];
    ?>
</td>
            </tr>
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:metrics.php

示例11: echo_data

function echo_data($image, $topic, $row_color)
{
    global $ForumTableWidth, $ForumTableHeaderColor, $ForumTableHeaderFontColor;
    global $ForumTableBodyColor1, $ForumTableBodyFontColor1, $ForumTableBodyColor2, $ForumTableBodyFontColor2;
    global $read_page, $ext, $collapse, $id, $UseCookies, $phflat, ${$phflat};
    global $space_gif, $num, $old_message, $haveread, $use_haveread;
    global $lNew, $GetVars, $users, $moderators;
    $thread_total = "";
    if ($row_color % 2 == 0) {
        $bgcolor = $ForumTableBodyColor1;
        $font_color = $ForumTableBodyFontColor1;
    } else {
        $bgcolor = $ForumTableBodyColor2;
        $font_color = $ForumTableBodyFontColor2;
    }
    $subject = "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" " . bgcolor($bgcolor) . ">\n";
    $subject .= "<tr>\n<td>";
    $subject .= $space_gif;
    $subject .= $image . "</td>\n<td><font color=\"{$font_color}\">&nbsp;";
    if (!empty($users[$topic["userid"]])) {
        $author = $users[$topic["userid"]]["name"];
        if (isset($moderators[$topic["userid"]])) {
            $author = "<b>{$author}</b>";
        }
    } else {
        $author = chop($topic["author"]);
    }
    $datestamp = date_format($topic["datestamp"]);
    if ($id == $topic["id"] && ($read = true)) {
        $subject .= "<b>" . $topic["subject"] . "</b>";
        $author = "<b>" . $author . "</b>";
        $datestamp = "<b>" . $datestamp . "</b>";
    } else {
        $subject .= "<a href=\"{$read_page}.{$ext}?f={$num}&i=" . $topic["id"];
        $reply_name = '';
        if (${$phflat}) {
            $reply_name = "#reply_" . $topic["id"];
        }
        $subject .= "&t=" . $topic["thread"] . "{$GetVars}{$reply_name}\">" . $topic["subject"] . "</a>";
    }
    $subject .= "&nbsp;&nbsp;</font>";
    if ($UseCookies) {
        $isnew = false;
        if ($use_haveread == true) {
            if ($old_message < $topic["id"]) {
                if (!isset($haveread[$topic["id"]])) {
                    $isnew = true;
                }
            }
        } elseif ($old_message < $topic["id"]) {
            $isnew = true;
        }
        if ($isnew) {
            $subject .= "<font class=\"PhorumNewFlag\">" . $lNew . "</font>";
        }
    }
    $subject .= "</td>\n</tr>\n</TABLE>";
    ?>
<tr valign=middle>
<td class="PhorumListRow" <?php 
    echo bgcolor($bgcolor);
    ?>
><?php 
    echo $subject;
    ?>
</td>
<td class="PhorumListRow" <?php 
    echo bgcolor($bgcolor);
    ?>
 nowrap><font color="<?php 
    echo $font_color;
    ?>
"><?php 
    echo $author;
    ?>
</font></td>
<td class="PhorumListRow" <?php 
    echo bgcolor($bgcolor);
    ?>
 nowrap><font color="<?php 
    echo $font_color;
    ?>
"><?php 
    echo $datestamp;
    ?>
&nbsp;</font></td>
</tr>
<?php 
}
开发者ID:carriercomm,项目名称:xmec,代码行数:89,代码来源:multi-threads.php

示例12: enter_data2

function enter_data2($_POST)
{
    extract($_POST);
    global $_SESSION;
    $out = "\n\t\t<h3>Trial Balance Import</h3>\n\t\t%%USEDNUMS_MSG%%\n\t\t<form action='" . SELF . "' method='POST'>\n\t\t\t<input type='hidden' name='key' value='confirm' />\n\t\t\t<input type='hidden' name='login' value='1' />\n\t\t\t<input type='hidden' name='div' value='{$_SESSION['USER_DIV']}' />\n\t\t\t<input type='hidden' name='login_user' value='{$_SESSION['USER_NAME']}' />\n\t\t\t<input type='hidden' name='login_pass' value='{$_SESSION['USER_PASS']}' />\n\t\t\t<input type='hidden' name='code' value='{$_SESSION['code']}' />\n\t\t\t<input type='hidden' name='comp' value='{$_SESSION['comp']}' />\n\t\t\t<input type='hidden' name='noroute' value='1' />\n\t\t\t<input type='hidden' name='prd' value='{$prd}' />\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th colspan='2'>Importing into " . getMonthName($prd) . " " . getYearOfFinMon($prd) . "</th>\n\t\t\t</tr>\n\t\t\t" . TBL_BR . "\n\t\t\t<tr>\n\t\t\t\t<th>Acc No</th>\n\t\t\t\t<th>Account Name</th>\n\t\t\t\t<th>Debit</th>\n\t\t\t\t<th>Credit</th>\n\t\t\t\t<th>Confrim Account to link to/Select category of new account</th>\n\t\t\t</tr>";
    db_conn('exten');
    $Sl = "SELECT stkacc FROM warehouses";
    $Ri = db_exec($Sl);
    $wd = pg_fetch_array($Ri);
    $ic = $wd['stkacc'];
    $Sl = "SELECT debtacc,credacc FROM departments";
    $Ri = db_exec($Sl);
    $dd = pg_fetch_array($Ri);
    $cc = $dd['debtacc'];
    $sc = $dd['credacc'];
    db_conn('cubit');
    $Sl = "SELECT * FROM import_data ORDER BY des1";
    $Ri = db_exec($Sl);
    $i = 0;
    $tot_debit = 0;
    $tot_credit = 0;
    db_conn('core');
    $Sl = "SELECT accnum FROM salacc WHERE name='salaries control'";
    $Rt = db_exec($Sl);
    $sd = pg_fetch_array($Rt);
    $salc = $sd['accnum'];
    $blocked = array();
    $cc_tot = 0;
    $sc_tot = 0;
    $sal_tot = 0;
    $i_tot = 0;
    $usednums_msg = $dupnums_msg = "";
    while ($fd = pg_fetch_array($Ri)) {
        $fid = $fd['id'];
        $bgcolor = bgcolor($i);
        $accnum_parts = explode("/", $fd["des1"]);
        $accnum = "{$fd['des1']}";
        if (substr($accounts[$fid], 0, 1) == "n") {
            $check_num = new dbSelect("accounts", "core", grp(m("where", wgrp(m("topacc", $accnum_parts[0]), m("accnum", $accnum_parts[1])))));
            $check_num->run();
        } else {
            $check_num = false;
        }
        $check_dup = new dbSelect("import_data", "cubit", grp(m("where", "des1='{$fd['des1']}' AND id!='{$fd['id']}'")));
        $check_dup->run();
        if ($check_num && $check_num->num_rows() > 0 || $check_dup->num_rows() > 0) {
            $mark = "";
            if ($check_dup->num_rows() > 0) {
                $mark .= IMP;
                $dupnums_msg = "\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan='2' class='err'>Accounts marked with " . IMP . " have account numbers\n\t\t\t\t\t\tused by other accounts in the import. Please change them so all\n\t\t\t\t\t\taccounts have unique numbers.\n\t\t\t\t\t</tr>\n\t\t\t\t</tr>";
            }
            if ($check_num && $check_num->num_rows() > 0) {
                $mark .= REQ;
                $usednums_msg = "\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan='2' class='err'>Accounts marked with " . REQ . " have account numbers\n\t\t\t\t\t\talready in use by Cubit. Either delete these accounts from Cubit or change the\n\t\t\t\t\t\taccount numbers in the fields provided.\n\t\t\t\t\t</td>\n\t\t\t\t</tr>";
            }
            $recommended_accnums = "\n\t\t\t<tr>\n\t\t\t\t<td colspan='2' class='err'><u><b>Recommended Account Numbers:</b></u></td>\n\t\t\t</tr>\n\t\t\t<tr class='err'>\n\t\t\t\t<td nowrap><b>Income Account</b>:</td>\n\t\t\t\t<td width='100%'>" . str_pad(MIN_INC, 4, '0', STR_PAD_LEFT) . "/000 <i>to</i> " . MAX_INC . "/999</td>\n\t\t\t</tr>\n\t\t\t<tr class='err'>\n\t\t\t\t<td nowrap><b>Expense Account</b>:</td>\n\t\t\t\t<td width='100%'>" . MIN_EXP . "/000 <i>to</i> " . MAX_EXP . "/999</td>\n\t\t\t</tr>\n\t\t\t<tr class='err'>\n\t\t\t\t<td nowrap><b>Balance Sheet Account</b>:</td>\n\t\t\t\t<td width='100%'>" . MIN_BAL . "/000 <i>to</i> " . MAX_BAL . "/999</td>\n\t\t\t</tr>";
            $accnum = "{$mark}\n\t\t\t\t<input type='text' size='4' name='topacc[{$fid}]' value='{$accnum_parts['0']}' /> /\n\t\t\t\t<input type='text' size='3' name='accnum[{$fid}]' value='{$accnum_parts['1']}' />";
        }
        if (substr($accounts[$fid], 0, 1) == "n") {
            switch (substr($accounts[$fid], 1, 1)) {
                case "1":
                    $catsa = array("-- INCOME", "other_income" => "Other Income", "sales" => "Sales");
                    break;
                case "2":
                    $catsa = array("-- EXPENSES", "expenses" => "Expenses", "cost_of_sales" => "Cost of Sales");
                    break;
                case "3":
                    $catsa = array("-- ASSETS", "fixed_asset" => "Fixed Assets", "investments" => "Investments", "other_fixed_asset" => "Other Fixed Assets", "current_asset" => "Current Assets", "-- EQUITY AND LIABILITIES", "share_capital" => "Share Capital", "retained_income" => "Retained Income", "shareholders_loan" => "Shareholders Loan", "non_current_liability" => "Non-current Liabilities", "long_term_borrowing" => "Long Term Borrowings", "other_long_term_liability" => "Other Long Term Liabilities", "current_liability" => "Current Liabilities");
            }
            $cats = "<select name='cat[{$fid}]'>";
            $optgrouped = false;
            foreach ($catsa as $dbval => $humanval) {
                if (isset($cat) && $cat[$fid] == "{$dbval}:{$humanval}") {
                    $sel = "selected";
                } else {
                    $sel = "";
                }
                if (substr($humanval, 0, 3) == "-- ") {
                    if ($optgrouped) {
                        $cats .= "</optgroup>";
                    }
                    $cats .= "<optgroup label='" . substr($humanval, 3) . "'>";
                    continue;
                }
                $cats .= "<option value='{$dbval}:{$humanval}' {$sel}>{$humanval}</option>";
            }
            if ($optgrouped) {
                $cats .= "</optgroup>";
            }
            $cats .= "</select>";
            $add = "{$cats}</td>";
        } else {
            $accounts[$fid] += 0;
            if (in_array($accounts[$fid], $blocked)) {
                $Sl = "SELECT accid,accname FROM accounts WHERE accid='{$accounts[$fid]}'";
                $Rx = db_exec($Sl);
                $ad = pg_fetch_array($Rx);
                return enter_data($_POST) . "<li class='err'>You cannot link an account to more than one account({$ad['accname']}).</li>";
            }
            $blocked[] = $accounts[$fid];
//.........这里部分代码省略.........
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:101,代码来源:import-tb.php

示例13: rr_row

function rr_row($soa, $rr = NULL)
{
    global $rr_use_active, $rr_active_types, $query_host, $query_origin, $page, $query, $allow_ixfr;
    $values = $rr;
    $widget = NULL;
    if (isset($values['edata'])) {
        if (strlen($values['edata'])) {
            $values['data'] .= $values['edata'];
        }
    }
    if (!strlen($values['name'])) {
        $values['name'] = $soa['origin'];
    }
    /* Build '$match', a name to highlight if we find it */
    $match = strlen($query_host) ? $query_host . "." . $query_origin : NULL;
    /* Set background color - highlighted if this name matches $match */
    $bgcolor = bgcolor();
    if ($match) {
        $name = $values['name'];
        if (!ends_with_dot($name)) {
            $name = $name . "." . $soa['origin'];
        }
        if (!strcasecmp($match, $name)) {
            $bgcolor = bgcolor(1);
        }
    }
    if ($rr == NULL) {
        /* Empty (new) resource record */
        $new_rr = 1;
        if (isset($_POST['done']) && $_POST['done'] == "1" && isset($_POST['zone'])) {
            $values = rr_post_vars();
            $widget = "ErrorSmall.png";
            $widget_text = "Error";
        } else {
            $rr = array();
            $rr['active'] = $rr_active_types[1];
            $rr['ttl'] = $soa['ttl'];
            $rr['type'] = "A";
            $values = $rr;
        }
        $add_button = formbutton("Add new RR", "Click this button to add these fields as a new resource record.", $bgcolor);
        $buttons = $add_button;
    } else {
        /* Existing resource record */
        $new_rr = 0;
        if (isset($_POST['id']) && $rr['id'] == $_POST['id']) {
            $values['serial'] = $_POST['serial'];
            $values['stamp'] = $_POST['stamp'];
            $values['active'] = $rr_active_types[gettrinary($_POST['active'])];
            $values['name'] = $_POST['name'];
            $values['ttl'] = $_POST['ttl'];
            $values['aux'] = $_POST['aux'];
            $values['data'] = $_POST['data'];
            $widget = "ErrorSmall.png";
            $widget_text = "Error";
        }
        $update_button = formbutton("Update", "Click this button to update this resource record.", $bgcolor);
        $delete_button = formbutton("Delete", "Click this button to permanently remove this resource record.", $bgcolor);
        $buttons = "{$update_button} {$delete_button}";
    }
    /* Set widget (the icon displayed in the first column) if applicable */
    if (!$new_rr) {
        rr_set_warnings($soa, $rr, $widget, $widget_text);
    }
    if (!$widget) {
        /* Set default widget if none was set previously */
        $widget = "blank.gif";
        $widget_text = "";
    }
    /* Make sure 'values' are set to avoid "Undefined index" errors */
    foreach (array('name', 'ttl', 'type', 'aux', 'data') as $n) {
        if (!isset($values[$n])) {
            $values[$n] = '';
        }
    }
    ?>
<TABLE class=rrBox cellspacing=0>
<FORM action="<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
" method=POST>
<TR bgcolor="<?php 
    echo $bgcolor;
    ?>
">
<TD class=rrCellLeft>
<?php 
    /* Output widget icon */
    echo "<IMG src=\"{$_SERVER['PHP_SELF']}?img={$widget}\" width=16 height=16 alt=\"{$widget_text}\" title=\"{$widget_text}\">\n";
    ?>
</TD>
<?php 
    /* Output "active" checkbox/selectbox if supported */
    if ($rr_use_active) {
        if ($allow_ixfr) {
            echo "<TD class=rrCell title=\"Record status selection.\">\n";
            echo "<TABLE><TR>";
            foreach ($rr_active_types as $rat) {
                echo "<TD>";
                echo "\t<INPUT class=activeList ";
//.........这里部分代码省略.........
开发者ID:evmuc,项目名称:mydns-ng,代码行数:101,代码来源:admin.php

示例14: foreach

                            <th>User's</th>
                            <th>Manage Course</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
$count = 1;
if (isset($mentor_details)) {
    foreach ($mentor_details as $res) {
        echo "<tr>";
        echo "<td>" . $count++ . "</td>";
        echo "<td>" . $res->registration_no . "</td>";
        echo "<td>" . $res->user_fname . "</td>";
        echo "<td>" . $res->user_email . "</td>";
        echo "<td>" . $res->course_name . "</td>";
        echo "<td><small class='badge " . bgcolor(2) . "'>" . $res->sub_count . "</small></td>";
        echo "<td><button type='button' class='btn btn-danger' onClick='unlink_mentor_course(\"{$res->user_id}\",\"{$res->map_id}\");'>Un-Link</button></td>";
        echo "</tr>";
    }
}
function bgcolor($value)
{
    switch ($value) {
        case '2':
            return 'bg-green';
            break;
        case '8':
            return 'bg-yellow';
            break;
        default:
            return '';
开发者ID:sriram1991,项目名称:SHARE,代码行数:31,代码来源:mentor_course_link.php

示例15: printCust


//.........这里部分代码省略.........
                    $cashbook->run();
                    if ($cashbook->num_rows() <= 0 && $cust['balance'] == 0) {
                        $rm = "<td><a href='cust-rem.php?cusnum={$cust['cusnum']}'>Remove</a></td>";
                    } else {
                        $rm = "<td></td>";
                    }
                }
                if (strlen(trim($cust['bustel'])) < 1) {
                    $cust['bustel'] = $cust['tel'];
                }
                $cust['balance'] = sprint($cust['balance']);
                if ($cust["location"] == "int") {
                    if ($rate != 0.0) {
                        $tot = $tot + $cust['fbalance'] * $rate;
                    } else {
                        $tot = $tot + $cust['balance'];
                    }
                } else {
                    $tot = $tot + $cust['balance'];
                }
                /* determine which template to use when printing customer invoices */
                if (templateScript("invoices") != "pdf/cust-pdf-print-invoices.php") {
                    $template = "pdf/pdf-tax-invoice.php?type=cusprintinvoices";
                } else {
                    $template = "pdf/pdf-tax-invoice.php?type=cusprintinvoices";
                }
                $inv = "";
                $inv = "\n\t\t\t<td>\n\t\t\t\t<a href='{$template}&cusnum={$cust['cusnum']}' target='_blank'>Print Invoices</a>\n\t\t\t</td>";
                # Locations drop down
                $locs = array("loc" => "Local", "int" => "International", "" => "");
                $loc = $locs[$cust['location']];
                $fbal = "--";
                $ocurr = CUR;
                $trans = "\n\t\t\t<td>\n\t\t\t\t<a href='core/cust-trans.php?cusnum={$cust['cusnum']}'>Transaction</a>\n\t\t\t</td>";
                if ($cust['location'] == 'int') {
                    $fbal = "{$cust['currency']} {$cust['fbalance']}";
                    $ocurr = CUR;
                    $trans = "\n\t\t\t\t<td>\n\t\t\t\t\t<a href='core/intcust-trans.php?cusnum={$cust['cusnum']}'>Transaction</a>\n\t\t\t\t</td>";
                    $receipt = "<a href='bank/bank-recpt-inv-int.php?cusid={$cust['cusnum']}&amp;cash=yes'>Add Receipt</a>";
                } else {
                    $receipt = "<a href='bank/bank-recpt-inv.php?cusnum={$cust['cusnum']}&amp;cash=yes'>Add Receipt</a>";
                }
                # alternate bgcolor
                $bgColor = bgcolor($i);
                $ajaxCust .= "<tr class='" . bg_class() . "'>";
                if ($action == "contact_acc") {
                    $updatelink = "javascript: updateAccountInfo(\"{$cust['cusnum']}\", \"{$cust['accno']}\");";
                    $ajaxCust .= "\n\t\t\t\t\t<td><a href='{$updatelink}'>{$cust['accno']}</a></td>\n\t\t\t\t\t<td><a href='{$updatelink}'>{$cust['surname']}</a></td>";
                } else {
                    if ($action == "select") {
                        $ajaxCust .= "\n\t\t\t\t\t<td><a href='" . SELF . "?key=select&cusnum={$cust['cusnum']}&" . frmupdate_passon(true) . "'>{$cust['accno']}</a></td>\n\t\t\t\t\t<td><a href='" . SELF . "?key=select&cusnum={$cust['cusnum']}&" . frmupdate_passon(true) . "'>{$cust['surname']}</a></td>";
                    } else {
                        $ajaxCust .= "\n\t\t\t\t\t<td>{$cust['accno']}</td>\n\t\t\t\t\t<td>{$cust['surname']}</td>";
                    }
                }
                $ajaxCust .= "\n\t\t\t\t\t<td>{$cust['bustel']}</td>\n\t\t\t\t\t<td>{$cust['catname']}</td>\n\t\t\t\t\t<td>{$cust['classname']}</td>\n\t\t\t\t\t<td align='right' nowrap>{$ocurr} {$cust['balance']}</td>\n\t\t\t\t\t<td align='center' nowrap>{$fbal}</td>\n\t\t\t\t\t<td align='right' nowrap>{$ocurr} {$overd}</td>";
                if (!$pure) {
                    if ($action == "listcust") {
                        $ajaxCust .= "\n\t\t\t\t\t\t<td>{$receipt}</td>\n\t\t\t\t\t\t<td><a href='delnote-report.php?cusnum={$cust['cusnum']}'>Outstanding Stock</a></td>\n\t\t\t\t\t\t<td><a href='cust-det.php?cusnum={$cust['cusnum']}'>Details</a></td>\n\t\t\t\t\t\t<td><a href='customers-new.php?cusnum={$cust['cusnum']}'>Edit</a></td>\n\t\t\t\t\t\t<td><a href='#' onClick='openPrintWin(\"cust-stmnt.php?cusnum={$cust['cusnum']}\");'>Statement</a></td>\n\t\t\t\t\t\t{$trans} {$inv}";
                        if ($cust['blocked'] == 'yes') {
                            $ajaxCust .= "<td><a href='cust-unblock.php?cusnum={$cust['cusnum']}'>Unblock</a></td>";
                        } else {
                            $ajaxCust .= "<td><a href='cust-block.php?cusnum={$cust['cusnum']}'>Block</a></td>";
                        }
                        $ajaxCust .= "<td><a href='transheks/pricelist_send.php?cusnum={$cust['cusnum']}'>Send Pricelist</a></td>";
                        $ajaxCust .= "{$rm} <td><a href='conper-add.php?type=cust&amp;id={$cust['cusnum']}'>Add Contact</a></td>\n\t\t\t\t\t<td><input type='checkbox' name='cids[]' value='{$cust['cusnum']}' /></td>";
                    } else {
                        $ajaxCust .= "\n\t\t\t\t\t\t<td align=center>\n\t\t\t\t\t\t\t<a href='javascript: popupSized(\"cust-det.php?cusnum={$cust['cusnum']}\", \"custdetails\", 550, 400, \"\");'>Details</a>\n\t\t\t\t\t\t</td>";
                    }
                }
                $ajaxCust .= "</tr>";
            }
            $bgColor = bgcolor($i);
            $tot = sprint($tot);
            $totoverd = sprint($totoverd);
            $i--;
            $ajaxCust .= "\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td colspan='5'>Total Amount Outstanding, from {$i} " . ($i > 1 ? "clients" : "client") . "</td>\n\t\t\t<td align='right' nowrap>" . CUR . " {$tot}</td>\n\t\t\t<td></td>\n\t\t\t<td align='right' nowrap>" . CUR . " {$totoverd}</td>\n\t\t\t" . ($pure ? "" : "<td colspan='11' align='right'><input type='submit' value='Email Statements' /></td>") . "\n\t\t</tr>";
            if (!$pure) {
                $ajaxCust .= "\n\t\t\t<tr>\n\t\t\t\t<td colspan='20'>\n\t\t\t\t<table width='100%' border='0'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right' width='50%'>{$os_prev}</td>\n\t\t\t\t\t<td align='left' width='50%'>{$os_next} {$os_viewall}</td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>";
            }
        }
        if ($pure) {
            $ajaxCust .= "</table>";
        } else {
            $ajaxCust .= "\n\t\t" . TBL_BR . "\n\t\t</table>\n\t\t</form>\n\t\t<form action='" . SELF . "' method='post'>\n\t\t<table>\n\t\t\t<input type='hidden' name='export' value='yes' />\n\t\t\t<input type='hidden' name='filter' value='{$filter}' />\n\t\t\t<input type='hidden' name='fval' value='{$fval}' />\n\t\t\t<tr>\n\t\t\t\t<td colspan='3'><input type='submit' value='Export to Spreadsheet' /></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</form>";
        }
        /* FIND CUSTOMER END */
    } else {
        $ajaxCust = "";
    }
    $printCust_end = "\n\t</div>";
    if (!$pure) {
        $printCust_end .= mkQuickLinks(ql("customers-new.php", "Add New Customer"));
    }
    if (AJAX) {
        return $ajaxCust;
    } else {
        return "{$printCust_begin}{$ajaxCust}{$printCust_end}";
    }
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:101,代码来源:midcustomers-view.php


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