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


PHP pg_numrows函数代码示例

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


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

示例1: printcheq

function printcheq()
{
    // Set up table to display in
    $OUTPUT = "<h3>View Cheque Records</h3>\r\n        <table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n        <form action='../bank/bank-bankall.php' method=post>\r\n        <tr><th>Bank Name</th><th>Account Name</th><th>Date</th><th>Paid to/Received from</th><th>Description</th><th>Transaction Type</th><th>Amount</th><th>Account paid<br>/received from</th></tr>";
    // Connect to database
    db_Connect();
    $sql = "SELECT * FROM cashbook WHERE cheqnum > 0 and banked='no' AND div = '" . USER_DIV . "' ORDER BY date DESC";
    $accntRslt = db_exec($sql) or errDie("ERROR: Unable to retrieve bank cheqque transaction details from database.", SELF);
    $numrows = pg_numrows($accntRslt);
    if ($numrows < 1) {
        $OUTPUT = "<li class=err> There are no outstanding bank cheque Records yet in Cubit.";
        require "../template.php";
    }
    # display all bank cheques
    for ($i = 0; $i < $numrows; $i++) {
        $accnt = pg_fetch_array($accntRslt, $i);
        # get account name for account involved
        $accRslt = get("core", "accname", "accounts", "accid", $accnt['accinv']);
        $acc = pg_fetch_array($accRslt);
        # get account name for bank account
        db_connect();
        $sql = "SELECT accname,bankname  FROM bankacct WHERE bankid= '{$accnt['bankid']}' AND div = '" . USER_DIV . "'";
        $bankRslt = db_exec($sql);
        $bank = pg_fetch_array($bankRslt);
        $OUTPUT .= "<tr class='" . bg_class() . "'><td>{$bank['bankname']}</td><td align=center>{$bank['accname']}</td><td align=center>{$accnt['date']}</td><td align=center>{$accnt['name']}</td><td>{$accnt['descript']}</td><td align=center>{$accnt['trantype']}</td><td align=center>" . CUR . " {$accnt['amount']}<td align=center>{$acc['accname']}</td></td>";
        if ($accnt['banked'] == "no") {
            $OUTPUT .= "<td><input type=checkbox name='bank[]' value='{$accnt['cashid']}'>&nbsp;<a href='../bank/bank-bank.php?cashid={$accnt['cashid']}'>Bank</td><td><a href='../bank/cheq-cancel.php?cashid={$accnt['cashid']}'>Cancel</td></tr>";
        } else {
            $OUTPUT .= "</tr>";
        }
    }
    $OUTPUT .= "<tr><td colspan=8><br></td><td colspan=2><input type=submit value='Bank all selected'></td></tr></form></table>";
    // all template to display the info and die
    require "../template.php";
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:35,代码来源:out-cheq.php

示例2: slctacc

function slctacc()
{
    # from period
    $prds = "<select name=prd>";
    db_conn(YR_DB);
    $sql = "SELECT * FROM info WHERE prdname !=''";
    $prdRslt = db_exec($sql);
    if (pg_numrows($prdRslt) < 1) {
        return "<li class=err>ERROR : There are no periods set for the current year";
    }
    while ($prd = pg_fetch_array($prdRslt)) {
        if ($prd['prddb'] == PRD_DB) {
            $sel = "selected";
        } else {
            $sel = "";
        }
        $prds .= "<option value='{$prd['prddb']}' {$sel}>{$prd['prdname']}</option>";
    }
    $prds .= "</select>";
    db_connect();
    $sql = "SELECT * FROM customers WHERE div = '" . USER_DIV . "' ORDER BY cusnum ASC";
    $cusRslt = db_exec($sql) or errDie("Could not retrieve Customers Information from the Database.", SELF);
    if (pg_numrows($cusRslt) < 1) {
        return "<li class=err> There are no Customers in Cubit.";
    }
    $custs = "<select name=cusnums[] multiple size=10>";
    while ($cus = pg_fetch_array($cusRslt)) {
        $custs .= "<option value='{$cus['cusnum']}'>{$cus['cusname']} {$cus['surname']}</option>";
    }
    $custs .= "</select>";
    $slctacc = "\n\t<p>\n\t<h3>Debtors Ledger</h3>\n\t<h4>Select Options</h4>\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\n\t<form action='" . SELF . "' method=post>\n\t<input type=hidden name=key value=viewtran>\n\t<tr><th>Field</th><th>Value</th></tr>\n\t<tr class='bg-even'><td valign=top>Customers</td><td><input type=radio name=accnt value=slct checked=yes>Selected Accounts | <input type=radio name=accnt value=all>All Accounts</td></tr>\n\t<tr class='bg-odd'><td valign=top>Select Customer(s)</td><td>{$custs}</td></tr>\n\t<tr class='bg-even'><td>Select period</td><td>{$prds}</td></tr>\n\t<tr class='bg-odd'><td>Order By</td><td>Transaction Date<input type=radio name=t checked value='t'>System Date<input type=radio name=t value='s'></td></tr>\n\t<tr><td><br></td></tr>\n\t<tr><td></td><td align=right><input type=submit value='Continue &raquo;'></td></tr>\n\t</table>\n\t<p>\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width=25%>\n\t\t<tr><td><br></td></tr>\n\t\t<tr><th>Quick Links</th></tr>\n\t\t<script>document.write(getQuicklinkSpecial());</script>\n\t</table>";
    return $slctacc;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:33,代码来源:cust-ledger-xls.php

示例3: confirm

function confirm($cashid)
{
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($cashid, "num", 1, 20, "Invalid Reference number.");
    # 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='&laquo; Correct submission'>";
        return $confirm;
    }
    # Connect to database
    db_Connect();
    $sql = "SELECT * FROM pettycashbook WHERE cashid = '{$cashid}' AND div = '" . USER_DIV . "'";
    $cashRslt = db_exec($sql) or errDie("ERROR: Unable to retrieve cashbook entry details from database.", SELF);
    if (pg_numrows($cashRslt) < 1) {
        $OUTPUT = "<li clss=err>Requisistion not found in Cubit.";
        return $OUTPUT;
    }
    $cash = pg_fetch_array($cashRslt);
    # Get account name for the account involved
    $accRslt = get("core", "accname,accnum,topacc", "accounts", "accid", $cash['accid']);
    $acc = pg_fetch_array($accRslt);
    // Layout
    $confirm = "<h3>Cancel Requisistion</h3>\r\n\t<h4>Confirm entry</h4>\r\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n\t<form action='" . SELF . "' method=post>\r\n\t<input type=hidden name=key value=cancel>\r\n\t<input type=hidden name=cashid value='{$cash['cashid']}'>\r\n\t<tr><th>Field</th><th>Value</th></tr>\r\n\t<tr class='bg-odd'><td>Date</td><td>{$cash['date']}</td></tr>\r\n\t<tr class='bg-even'><td>Paid to</td><td>{$cash['name']}</td></tr>\r\n\t<tr class='bg-odd'><td>Details</td><td><pre>{$cash['det']}</pre></td></tr>\r\n\t<tr class='bg-even'><td>Amount</td><td>" . CUR . " {$cash['amount']}</td></tr>\r\n\t<tr class='bg-odd'><td>Account</td><td>{$acc['topacc']}/{$acc['accnum']} - {$acc['accname']}</td></tr>\r\n\t<tr><td><br></td></tr>\r\n\t<tr><td\t><input type=button value='&laquo Back' onClick='javascript:history.back()'></td><td align=right><input type=submit value='Cancel &raquo'></td></tr>\r\n\t</table></form>\r\n\t<p>\r\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width=15%>\r\n\t\t<tr><th>Quick Links</th></tr>\r\n\t\t<tr class='bg-odd'><td><a href='pettycashbook-view.php'>View Petty Cash Requisitions</a></td></tr>\r\n\t\t<tr class='bg-odd'><td><a href='../main.php'>Main Menu</a></td></tr>\r\n\t</table>";
    return $confirm;
}
开发者ID:kumarsivarajan,项目名称:accounting-123,代码行数:32,代码来源:petty-req-can.php

示例4: confirmPaye

function confirmPaye($_GET)
{
    # get vars
    foreach ($_GET as $key => $value) {
        ${$key} = $value;
    }
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($id, "num", 1, 20, "Invalid PAYE ID.");
    # display errors, if any
    if ($v->isError()) {
        $confirmCust = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $confirmCust .= "<li class=err>" . $e["msg"];
        }
        $confirmCust .= "<p><input type=button onClick='JavaScript:history.back();' value='&laquo; Correct submission'>";
        return $confirmCust;
    }
    # connect to db
    db_connect();
    # select paye bracket
    $sql = "SELECT * FROM paye WHERE id='{$id}'";
    $payeRslt = db_exec($sql) or errDie("Unable to select PAYE bracket from database.", SELF);
    if (pg_numrows($payeRslt) < 1) {
        return "No PAYE brackets found in database.";
    }
    # get result
    $myPaye = pg_fetch_array($payeRslt);
    $confirmPaye = "\n<h3>Confirm removal of PAYE bracket</h3>\n\n<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\n<form action='" . SELF . "' method=post>\n<input type=hidden name=key value=write>\n<input type=hidden name=id value='{$myPaye['id']}'>\n<tr><th>Field</th><th>Value</th></tr>\n<tr class='bg-odd'><td>Minimum gross</td><td align=right>" . CUR . " {$myPaye['min']}</td></tr>\n<tr class='bg-even'><td>Maximum gross</td><td align=right>" . CUR . " {$myPaye['max']}</td></tr>\n<tr class='bg-odd'><td>Percentage</td><td align=right>{$myPaye['percentage']}%</td></tr>\n<tr class='bg-even'><td>Cash amount extra</td><td align=right>" . CUR . " {$myPaye['extra']}</td></tr>\n<tr><td><br></td><td align=right><input type=submit value='Remove PAYE bracket &raquo;'></td></tr>\n</form>\n</table>" . mkQuickLinks(ql("../admin-employee-add.php", "Add Employee"), ql("../admin-employee-view.php", "View Employees"));
    return $confirmPaye;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:33,代码来源:paye-rem.php

示例5: allocate_centers

function allocate_centers($_POST)
{
    extract($_POST);
    if (!isset($adds) or !is_array($adds)) {
        return get_allocation($_POST, "<li class='err'>Please select at least one Cost Center to add.</li>");
    }
    if (!isset($project) or strlen($project) < 1) {
        return "<li class='err'>Invalid Use Of Module. (Invalid Project)</li>";
    }
    if (!isset($subsub) or strlen($subsub) < 1) {
        return "<li class='err'>Invalid Use Of Module. (Invalid Sub Sub Project)</li>";
    }
    db_connect();
    $get_pro2 = "SELECT sub_project_id FROM sub_sub_projects WHERE id = '{$subsub}' LIMIT 1";
    $run_pro2 = db_exec($get_pro2) or errDie("Unable to get sub project information.");
    if (pg_numrows($run_pro2) < 1) {
        $project2 = "";
    } else {
        $parr = pg_fetch_array($run_pro2);
        $project2 = $parr['sub_project_id'];
    }
    foreach ($adds as $each) {
        $ins_sql = "DELETE FROM costcenters_links WHERE ccid = '{$each}' AND project1 = '{$project}' AND project3 = '{$subsub}'";
        $run_ins = db_exec($ins_sql) or errDie("Unable to add cost center information.");
    }
    header("Location: costcenter-allocation-rem.php?project={$project}&subsub={$subsub}");
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:27,代码来源:costcenter-allocation-rem.php

示例6: start_maint

function start_maint()
{
    custom_db("cubit");
    pg_exec("VACUUM");
    pg_exec("VACUUM FULL");
    pg_exec("VACUUM ANALYZE");
    pg_exec("REINDEX DATABASE cubit");
    $get_comps = "SELECT * FROM companies WHERE status = 'active'";
    $run_comps = pg_exec($get_comps) or errDie("Unable to get active companies");
    if (pg_numrows($run_comps) < 1) {
        return "<li class='err'>No Active Companies Found To Process.</li>";
    } else {
        #process the blk1 db
        custom_db("cubit_blk1");
        pg_exec("VACUUM");
        pg_exec("VACUUM FULL");
        pg_exec("VACUUM ANALYZE");
        pg_exec("REINDEX DATABASE cubit_blk1");
        #process the active companies
        while ($carr = pg_fetch_array($run_comps)) {
            $company = "cubit_" . $carr['code'];
            custom_db("{$company}");
            pg_exec("VACUUM");
            pg_exec("VACUUM FULL");
            pg_exec("VACUUM ANALYZE");
            pg_exec("REINDEX DATABASE {$company}");
        }
    }
    $display = "\r\n\t\t<table " . TMPL_tblDflts . ">\r\n\t\t\t<tr>\r\n\t\t\t\t<td><li class='err'>Process Has Been Completed.</li></td>\r\n\t\t\t</tr>\r\n\t\t</table>";
    return $display;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:31,代码来源:speed_update.php

示例7: edit

function edit($div)
{
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($div, "num", 1, 50, "Invalid branch 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 Branch
    db_connect();
    $sql = "SELECT * FROM branches WHERE div = '{$div}'";
    $branRslt = db_exec($sql) or errDie("Unable to access databse.", SELF);
    if (pg_numrows($branRslt) < 1) {
        return "<li> Invalid Branch ID.";
    } else {
        $bran = pg_fetch_array($branRslt);
    }
    // layout
    $edit = "<h3>Edit Branch Branch</h3>\r\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n\t<form action='" . SELF . "' method=post>\r\n\t<input type=hidden name=key value=confirm>\r\n\t<input type=hidden name=div value='{$div}'>\r\n\t<tr><th>Field</th><th>Value</th></tr>\r\n\t<tr class='bg-odd'><td>Branch code</td><td><input type=text size=20 name='brancod' value='{$bran['brancod']}'></td></tr>\r\n\t<tr class='bg-even'><td>" . REQ . "Branch name</td></td><td><input type=text size=20 name='branname' value='{$bran['branname']}'></td></tr>\r\n\t<tr class='bg-odd'><td valign=top>Details</td><td><textarea cols=18 rows=5 name='brandet'>{$bran['brandet']}</textarea></td></tr>\r\n\t<tr><td><br></td></tr>\r\n\t<tr><td></td><td align=right><input type=submit value='Confirm &raquo'></td></tr>\r\n\t</form>\r\n\t</table>\r\n\t<p>\r\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n\t<tr><th>Quick Links</th></tr>\r\n\t<tr class='bg-odd'><td><a href='admin-branview.php'>View Branches</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 $edit;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:28,代码来源:admin-branedit.php

示例8: 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

示例9: do_search

function do_search()
{
    global $_POST;
    extract($_POST);
    db_connect();
    $search_sql = "SELECT * FROM training WHERE course_name LIKE '%{$search_string}%' OR other_details LIKE '%{$search_string}%' LIMIT 25";
    $run_search = db_exec($search_sql);
    if (pg_numrows($run_search) < 1) {
        $results = "";
    } else {
        $results = "";
        $i = 0;
        while ($tarr = pg_fetch_array($run_search)) {
            $empval = $tarr['empnum'];
            $tarr['empnum'] = $empval + 0;
            #get this employee name
            $get_emp = "SELECT fnames,sname FROM employees WHERE empnum = '{$tarr['empnum']}' LIMIT 1";
            $run_emp = db_exec($get_emp);
            if (pg_numrows($run_emp) < 1) {
                $employee_name = "Unknown";
            } else {
                $earr = pg_fetch_array($run_emp);
                $employee_name = "{$earr['fnames']} {$earr['sname']}";
            }
            $results .= "\n\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t<td>{$employee_name}</td>\n\t\t\t\t\t\t<td>{$tarr['course_name']}</td>\n\t\t\t\t\t\t<td>{$tarr['date_date']}</td>\n\t\t\t\t\t\t<td>{$tarr['commence_date']}</td>\n\t\t\t\t\t\t<td>{$tarr['completed_date']}</td>\n\t\t\t\t\t\t<td>{$tarr['competent_date']}</td>\n\t\t\t\t\t\t<td>" . nl2br($tarr['other_details']) . "</td>\n\t\t\t\t\t</tr>";
            $i++;
        }
    }
    $display = "\n\t\t\t<h2>Search Results</h2>\n\t\t\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>Employee</th>\n\t\t\t\t\t<th>Course Name</th>\n\t\t\t\t\t<th>Enter Date</th>\n\t\t\t\t\t<th>Start Date</th>\n\t\t\t\t\t<th>End Date</th>\n\t\t\t\t\t<th>Competent Date</th>\n\t\t\t\t\t<th>Other Details</th>\n\t\t\t\t</tr>\n\t\t\t\t{$results}\n\t\t\t</table>\n\t\t";
    return $display;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:31,代码来源:training-search.php

示例10: slctacc

function slctacc()
{
    # from period
    $prds = "<select name=prd>";
    db_conn(YR_DB);
    $sql = "SELECT * FROM info WHERE prdname !=''";
    $prdRslt = db_exec($sql);
    if (pg_numrows($prdRslt) < 1) {
        return "<li class=err>ERROR : There are no periods set for the current year";
    }
    while ($prd = pg_fetch_array($prdRslt)) {
        if ($prd['prddb'] == PRD_DB) {
            $sel = "selected";
        } else {
            $sel = "";
        }
        $prds .= "<option value='{$prd['prddb']}' {$sel}>{$prd['prdname']}</option>";
    }
    $prds .= "</select>";
    core_connect();
    $sql = "SELECT * FROM accounts WHERE div = '" . USER_DIV . "' ORDER BY accname ASC";
    $accRslt = db_exec($sql) or errDie("Could not retrieve Categories Information from the Database.", SELF);
    if (pg_numrows($accRslt) < 1) {
        return "<li class=err> There are no Accounts in Cubit.";
    }
    $accs = "<select name=accids[] multiple size=10>";
    while ($acc = pg_fetch_array($accRslt)) {
        $accs .= "<option value='{$acc['accid']}'>{$acc['accname']}</option>";
    }
    $accs .= "</select>";
    $slctacc = "\n\t<p>\n\t<h3>General Ledger</h3>\n\t<h4>Select Options</h4>\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\n\t<form action='" . SELF . "' method=post>\n\t<input type=hidden name=key value=viewtran>\n\t<tr><th>Field</th><th>Value</th></tr>\n\t<tr class='bg-even'><td valign=top>Accounts</td><td><input type=radio name=accnt value=slct checked=yes>Selected Accounts | <input type=radio name=accnt value=all>All Accounts</td></tr>\n\t<tr class='bg-odd'><td valign=top>Select account(s)</td><td>{$accs}</td></tr>\n\t<tr class='bg-even'><td>Select period</td><td>{$prds}</td></tr>\n\t<tr><td><br></td></tr>\n\t<tr><td align=center><input type=button value='&laquo Back' onClick='javascript:history.back()'></td><td align=center><input type=submit value='Continue &raquo;'></td></tr>\n\t</table>\n\t<p>\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width=25%>\n\t\t<tr><td><br></td></tr>\n\t\t<tr><th>Quick Links</th></tr>\n\t\t<tr class=datacell><td align=center><a target=_blank href='../core/acc-new2.php'>Add account (New Window)</a></td></tr>\n\t\t<script>document.write(getQuicklinkSpecial());</script>\n\t</table>";
    return $slctacc;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:33,代码来源:old-ledger.php

示例11: view

function view($cusname = "", $addr1 = "", $addr2 = "", $addr3 = "", $paddr1 = "", $paddr2 = "", $paddr3 = "", $tel = "", $fax = "", $email = "", $err = "")
{
    # account paid to
    $stockacc = "<select name='stockacc'>";
    $sql = "SELECT * FROM accounts WHERE acctype ='B'";
    $accRslt = db_exec($sql);
    $numrows = pg_numrows($accRslt);
    if (empty($numrows)) {
        $stockacc = "There are no Balance accounts yet in Cubit.";
    } else {
        while ($acc = pg_fetch_array($accRslt)) {
            $stockacc .= "<option value='{$acc['accid']}'>{$acc['accname']}</option>";
        }
    }
    $stockacc .= "</select>";
    # account paid to
    $paid = "<select name='accpaid'>";
    $sql = "SELECT * FROM accounts WHERE acctype ='B'";
    $accRslt = db_exec($sql);
    $numrows = pg_numrows($accRslt);
    if (empty($numrows)) {
        $paid = "There are no Balance accounts yet in Cubit.";
    } else {
        while ($acc = pg_fetch_array($accRslt)) {
            $paid .= "<option value='{$acc['accid']}'>{$acc['accname']}</option>";
        }
    }
    $paid .= "</select>";
    //layout
    $view = "\r\n<h3>Add New Customer Invoice</h3>\r\n<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width=400>\r\n<form action='" . SELF . "' method=post name=form>\r\n<input type=hidden name=key value=details>\r\n{$err}\r\n<tr><th>Field</th><th>Value</th></tr>\r\n<tr class='bg-odd'><td>Customer Name</td><td valign=center><input type=text size=20 name=cusname value='{$cusname}'></td></tr>\r\n<tr class='bg-even'><td rowspan=3 valign=top>Customer Address</td><td valign=center><input type=text size=20 name=addr1 value='{$addr1}'></td></tr>\r\n<tr class='bg-odd'><!-- rowspan --><td><input type=text size=20 name=addr2 value='{$addr2}'></td></tr>\r\n<tr class='bg-even'><!-- rowspan --><td><input type=text size=20 name=addr3 value='{$addr3}'></td></tr>\r\n<tr class='bg-odd'><td rowspan=3 valign=top>Customer Postal Address</td><td valign=center><input type=text size=20 name=paddr1 value='{$paddr1}'></td></tr>\r\n<tr class='bg-even'><!-- rowspan --><td><input type=text size=20 name=paddr2 value='{$paddr2}'></td></tr>\r\n<tr class='bg-odd'><!-- rowspan --><td><input type=text size=20 name=paddr3 value='{$paddr3}'></td></tr>\r\n<tr class='bg-even'><td>Telephone No.</td><td valign=center><input type=text size=10 name=tel value='{$tel}'></td></tr>\r\n<tr class='bg-odd'><td>Fax No.</td><td valign=center><input type=text size=10 name=fax value='{$fax}'></td></tr>\r\n<tr class='bg-even'><td>E-mail Address</td><td valign=center><input type=text size=20 name=email value='{$email}'></td></tr>\r\n<tr class='bg-odd'><td>Order Date</td><td valign=center><input type=text size=2 name=oday maxlength=2>-<input type=text size=2 name=omon maxlength=2 value='" . date("m") . "'>-<input type=text size=4 name=oyear maxlength=4 value='" . date("Y") . "'> DD-MM-YYYY</td></tr>\r\n<tr class='bg-even'><td>Invoice date</td><td valign=center><input type=text size=2 name=invday maxlength=2 value='" . date("d") . "'>-<input type=text size=2 name=invmon maxlength=2 value='" . date("m") . "'>-<input type=text size=4 name=invyear maxlength=4 value='" . date("Y") . "'></td></tr>\r\n<tr class='bg-odd'><td>Account paid</td><td valign=center>{$paid}</td></tr>\r\n<tr class='bg-even'><td>Stock Account (ie. Stock)</td><td valign=center>{$stockacc}</td></tr>\r\n<tr><td><input type=button value='< Cancel' onClick='javascript:history.back();'></td><td valign=center><input type=submit value='Add >'></td></tr>\r\n</form>\r\n</table>";
    return $view;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:32,代码来源:stockinv-new.php

示例12: bal

function bal($id)
{
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($id, "num", 1, 20, "Invalid Trial Balance number.");
    # display errors, if any
    if ($v->isError()) {
        $theseErrors = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $theseErrors .= "<li class=err>" . $e["msg"];
        }
        $theseErrors .= "<p><input type=button onClick='JavaScript:history.back();' value='&laquo; Correct submission'>";
        return $theseErrors;
    }
    # connect to core DB
    core_connect();
    # get the Trial Balance
    $sql = "SELECT * FROM save_trial_bal WHERE id = '{$id}' AND div = '" . USER_DIV . "'";
    $balRslt = db_exec($sql) or errDie("Unable to retrieve Trial Balance from the Database", SELF);
    if (pg_numrows($balRslt) < 1) {
        return "<center><li> Invalid Trial Balance Number.";
    }
    $bal = pg_fetch_array($balRslt);
    $balance = base64_decode($bal['output']);
    $OUTPUT = $balance;
    include "temp.xls.php";
    Stream("TB", $OUTPUT);
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:30,代码来源:tb-xls.php

示例13: show_branches

function show_branches($active_search = FALSE)
{
    db_connect();
    $get_branches = "SELECT * FROM branches_data ORDER BY branch_name";
    $run_branches = db_exec($get_branches) or errDie("Unable to get branch information.");
    if (pg_numrows($run_branches) < 1) {
        $listing = "\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t<td colspan='7'>No Branches Found.</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t";
    } else {
        $listing = "";
        while ($barr = pg_fetch_array($run_branches)) {
            if ($active_search == FALSE) {
                $status = "Unknown";
            } else {
                if ($connect_test = @fsockopen("{$barr['branch_ip']}", 80, $errno, $errstr, 4)) {
                    #online ...
                    $status = "Online";
                } else {
                    $status = "Offline";
                }
            }
            $get_username = "SELECT username FROM users WHERE userid = '{$barr['branch_localuser']}' LIMIT 1";
            $run_username = db_exec($get_username) or errDie("Unable to get user information.");
            if (pg_numrows($run_username) < 1) {
            }
            $listing .= "\n\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t<td>{$barr['branch_name']}</td>\n\t\t\t\t\t\t\t\t<td>" . nl2br($barr['branch_desc']) . "</td>\n\t\t\t\t\t\t\t\t<td>{$barr['branch_username']}</td>\n\t\t\t\t\t\t\t\t<td>{$barr['branch_contact']}</td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td>{$barr['branch_ip']}</td>\n\t\t\t\t\t\t\t\t<td>{$status}</td>\n\t\t\t\t\t\t\t\t<td><a href='branches-rem.php?bid={$barr['id']}'>Remove</a></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t";
        }
    }
    $display = "\n\t\t\t\t\t<h3>Current Branches on Cubit</h3>\n\t\t\t\t\t<table " . TMPL_tblDflts . ">\n\t\t\t\t\t<form action='" . SELF . "' method='POST'>\n\t\t\t\t\t\t<input type='hidden' name='key' value='confirm'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>Branch Name</th>\n\t\t\t\t\t\t\t<th>Branch Description</th>\n\t\t\t\t\t\t\t<th>Branch Username</th>\n\t\t\t\t\t\t\t<th>Branch Contact</th>\n\t\t\t\t\t\t\t<th>Local Username</th>\n\t\t\t\t\t\t\t<th>Branch IP</th>\n\t\t\t\t\t\t\t<th>Status</th>\n\t\t\t\t\t\t\t<th>Remove</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t{$listing}\n\t\t\t\t\t\t<tr><td><br></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><input type='submit' value='Update Status'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</form>\n\t\t\t\t\t</table>\n\t\t\t\t";
    return $display;
}
开发者ID:kumarsivarajan,项目名称:accounting-123,代码行数:30,代码来源:branches-view.php

示例14: printDep

function printDep()
{
    # Set up table to display in
    $printDep = "\n\t\t<h3>View Employee Departments</h3>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th>Department</th>\n\t\t\t\t<th colspan='2'>Options</th>\n\t\t\t</tr>";
    # connect to database
    db_connect();
    # Query server
    $i = 0;
    $sql = "SELECT * FROM departments ORDER BY department ASC";
    $depRslt = db_exec($sql) or errDie("Unable to retrieve employee departments from database.");
    if (pg_numrows($depRslt) < 1) {
        return "<li>There are no employee departments in Cubit.</li>";
    }
    while ($dep = pg_fetch_array($depRslt)) {
        $printDep .= "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td align='center'>{$dep['department']}</td>\n\t\t\t\t<td><a href='empdepartment-edit.php?id={$dep['id']}'>Edit</a></td>";
        $sql = "SELECT * FROM employees WHERE department='{$dep['id']}'";
        $depRslt = db_exec($sql) or ereDie("Unable to retrieve employee departments from database.");
        if (pg_numrows($depRslt) < 1) {
            $printDep .= "<td><a href='empdepartment-rem.php?id={$dep['id']}'>Remove</a></td></tr>";
        } else {
            $printDep .= "</tr>";
        }
        $i++;
    }
    $printDep .= "\n\t\t</table>\n\t\t<p>\n\t\t<table " . TMPL_tblDflts . " width='15%'>\n\t\t\t<tr><td><br></td></tr>\n\t\t\t<tr>\n\t\t\t\t<th>Quick Links</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td><a href='empdepartment-add.php'>Add Employee Department</a></td>\n\t\t\t</tr>\n\t\t\t<script>document.write(getQuicklinkSpecial());</script>\n\t\t</table>";
    return $printDep;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:27,代码来源:empdepartment-view.php

示例15: rem

function rem($clasid)
{
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($clasid, "num", 1, 50, "Invalid Classification 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_connect();
    $sql = "SELECT * FROM stockclass WHERE clasid = '{$clasid}' AND div = '" . USER_DIV . "'";
    $clasRslt = db_exec($sql) or errDie("Unable to access databse.", SELF);
    if (pg_numrows($clasRslt) < 1) {
        return "<li> Invalid Category ID.";
    } else {
        $clas = pg_fetch_array($clasRslt);
    }
    $enter = "<h3>Remove Classification</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=clasid value='{$clas['clasid']}'>\r\n\t<input type=hidden name=classname value='{$clas['classname']}'>\r\n\t<input type=hidden name=classcode value='{$clas['classcode']}'>\r\n\t<tr><th>Field</th><th>Value</th></tr>\r\n\t<tr class='bg-odd'><td>Classification Code</td><td align=center>{$clas['classcode']}</td></tr>\r\n\t<tr class='bg-even'><td>Classification</td><td align=center>{$clas['classname']}</td></tr>\r\n\t<tr><td colspan=2 align=right><input type=submit value='Remove &raquo;'></td></tr>\r\n\t<tr><td><br></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='stockclass-view.php'>View Classifications</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 $enter;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:27,代码来源:stockclass-rem.php


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