• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getCSetting函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: create_dummy

function create_dummy($deptid, $cusnum)
{
    # Get selected customer info
    db_connect();
    $sql = "SELECT * FROM customers WHERE cusnum = '{$cusnum}' AND div = '" . USER_DIV . "'";
    $custRslt = db_exec($sql) or errDie("Unable to get customer information");
    $cust = pg_fetch_array($custRslt);
    $curr = getSymbol($cust['fcid']);
    $xrate = getRate($cust['fcid']);
    $trans_date_setting = getCSetting("USE_TRANSACTION_DATE");
    if (isset($trans_date_setting) and $trans_date_setting == "yes") {
        $trans_date_value = getCSetting("TRANSACTION_DATE");
        $date_arr = explode("-", $trans_date_value);
        $date_year = $date_arr[0];
        $date_month = $date_arr[1];
        $date_day = $date_arr[2];
    } else {
        $date_year = date("Y");
        $date_month = date("m");
        $date_day = date("d");
    }
    $odate = "{$date_year}-{$date_month}-{$date_day}";
    db_connect();
    # Insert purchase to DB
    $sql = "\n\t\tINSERT INTO nons_invoices (\n\t\t\tcusname, cusaddr, cusvatno, chrgvat, fcid, currency, \n\t\t\txrate, odate, sdate, subtot, balance, vat, total, done, username, prd, invnum, typ, ctyp, \n\t\t\ttval, location, div\n\t\t) VALUES (\n\t\t\t'{$cust['cusname']} {$cust['surname']}', '{$cust['addr1']}', '{$cust['vatnum']}', 'yes', '{$cust['fcid']}', '{$curr['symbol']}', \n\t\t\t'{$xrate}', '{$odate}', CURRENT_DATE, 0, 0, 0, 0, 'n', '" . USER_NAME . "', '" . PRD_DB . "', 0, 'inv', 's', \n\t\t\t'{$cusnum}', 'int', '" . USER_DIV . "'\n\t\t)";
    $rslt = db_exec($sql) or errDie("Unable to create template Non-Stock Invoice.", SELF);
    # Get next ordnum
    $invid = lastinvid();
    return $invid;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:30,代码来源:nons-intinvoice-new.php


示例2: edit

function edit(&$frm)
{
    /* @var $frm cForm */
    $frm->setkey("confirm");
    $frm->settitle("Point of Sale Settings");
    $frm->add_heading("Point of Sale Slips/Printing");
    /* point of sale message at the bottom of the slip */
    $posmsg = getCSetting("POSMSG");
    $frm->add_textarea("Message to Display at bottom of Slip", "posmsg", $posmsg, "1:255");
    return $frm->getfrm_input();
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:11,代码来源:pos-options.php


示例3: edit

function edit(&$frm)
{
    /* @var $frm cForm */
    $frm->setkey("write");
    $frm->settitle("Printing Options");
    $frm->add_heading("Details");
    $yn = array("y" => "Yes", "n" => "No");
    $print_dialog = getCSetting("PRINT_DIALOG");
    $frm->add_select("Automatically Display Print Dialog", "print_dialog", $print_dialog, $yn, "string", "1:1");
    $frm->add_ctrlbtn("Save", "submit", "btn_submit");
    return $frm->getfrm_input();
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:12,代码来源:printing.php


示例4: edit

function edit(&$frm)
{
    /* @var $frm cForm */
    $frm->setkey("write");
    $frm->settitle("Purchase Default VAT Setting");
    $frm->add_heading("Setting");
    $yn = array("yes" => "VAT Inclusive", "no" => "VAT Exclusive");
    $vat_setting = getCSetting("PURCH_DEFAULT_VAT_SETTING");
    $frm->add_select("Default Stock Purchase VAT Setting", "vat_setting", $vat_setting, $yn, "string", "2:3");
    $frm->add_ctrlbtn("Save", "submit", "btn_submit");
    return $frm->getfrm_input();
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:12,代码来源:purchase-default-vat-setting.php


示例5: do_setting

function do_setting()
{
    extract($_GET);
    $inv_set = getCSetting("NEWINV_SETTING");
    if (isset($vol) && $vol == "yes") {
        $script = "calc-cust-credit-stockinv.php";
    } else {
        $script = "cust-credit-stockinv.php";
    }
    if ($inv_set == "no") {
        return mkQuickLinks(ql("../{$script}", "Make Another Invoice"), ql("cust-credit-stockinv-newsetting.php?change=yes", "Change Setting To Create A New Invoice After Processing One."), ql("../invoice-view.php", "View Invoices"));
    } else {
        header("Location: ../{$script}");
    }
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:15,代码来源:cust-credit-stockinv-newsetting.php


示例6: change_settings

function change_settings($_POST)
{
    extract($_POST);
    $traddisc_check = getCSetting("SET_INV_TRADDISC");
    db_connect();
    if (!isset($traddisc_check) or strlen($traddisc_check) < 1) {
        #setting does not yet exist ... ad it :/
        $add_sql = "INSERT INTO cubit.settings (constant,label,value,type,datatype,minlen,maxlen,div,readonly) VALUES ('SET_INV_TRADDISC','Include/Exclude  Delivery Charge In Trade Discount','exclude','general','string','7','7','0','f');";
        $run_add = db_exec($add_sql) or errDie("Unable to get settings information.");
    } else {
        #update the setting ...
        $upd_sql = "UPDATE settings SET value = '{$traddisc}' WHERE constant = 'SET_INV_TRADDISC'";
        $run_upd = db_exec($upd_sql) or errDie("Unable to update setting information.");
    }
    return show_settings("<li class='err'>Settings Have Been Saved.</li><br>");
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:16,代码来源:change_settings.php


示例7: save_setting_val

function save_setting_val($_POST)
{
    extract($_POST);
    db_connect();
    #check for setting
    $check = getCSetting("JOBCARD_OPERATION_STOCK_CHECKBOX");
    if (!isset($check) or strlen($check) < 1) {
        #no setting ... insert
        $sql = "\n\t\t\tINSERT INTO cubit.settings (\n\t\t\t\tconstant, label, value, type, datatype, minlen, maxlen, div, readonly\n\t\t\t) VALUES (\n\t\t\t\t'JOBCARD_OPERATION_STOCK_CHECKBOX', 'Jobcard Operation Add Stock Checkbox Default Setting', '{$operation_setting}', 'general', 'allstring', '6', '14', '0', 'f'\n\t\t\t)";
        $run_sql = db_exec($sql) or errDie("Unable to record setting information.");
    } else {
        $upd_sql = "UPDATE settings SET value = '{$operation_setting}' WHERE constant = 'JOBCARD_OPERATION_STOCK_CHECKBOX'";
        $run_upd = db_exec($upd_sql) or errDie("Unable to update customer statement setting.");
    }
    return get_setting_val("<li class='err'>Jobcard Operation Add Stock Setting Updated.</li><br>");
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:16,代码来源:jobcard-operation-stock-setting.php


示例8: save_setting_val

function save_setting_val($_POST)
{
    extract($_POST);
    db_connect();
    #check for setting
    $check = getCSetting("STATEMENT_AGE");
    if (!isset($check) or strlen($check) < 1) {
        #no setting ... insert
        $sql = "\n\t\t\t\tINSERT INTO cubit.settings \n\t\t\t\t\t(constant,label,value,type,datatype,minlen,maxlen,div,readonly) \n\t\t\t\tVALUES \n\t\t\t\t\t('STATEMENT_AGE','Customer Statement','{$state_setting}','general','allstring','6','9','0','f')";
        $run_sql = db_exec($sql) or errDie("Unable to record setting information.");
    } else {
        $upd_sql = "UPDATE settings SET value = '{$state_setting}' WHERE constant = 'STATEMENT_AGE'";
        $run_upd = db_exec($upd_sql) or errDie("Unable to update customer statement setting.");
    }
    return get_setting_val("<li class='err'>Customer Statement Setting Updated.</li><br>");
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:16,代码来源:customer-statement-setting.php


示例9: show_receipt

function show_receipt($_GET)
{
    extract($_GET);
    if (!isset($recid) or strlen($recid) < 1) {
        return "<li class='err'>Invalid use of module. Invalid Receipt ID.</li>";
    }
    db_connect();
    $get_rec = "SELECT * FROM cashbook WHERE cashid = '{$recid}' LIMIT 1";
    $run_rec = db_exec($get_rec) or errDie("Unable to get receipt information.");
    if (pg_numrows($run_rec) < 1) {
        return "<li class='err'>Receipt information not found.</li>";
    } else {
        $cash_arr = pg_fetch_array($run_rec);
        #get customer information
        $get_cust = "SELECT accno,surname,paddr1 FROM customers WHERE cusnum = '{$cash_arr['cusnum']}' LIMIT 1";
        $run_cust = db_exec($get_cust) or errDie("Unable to get customer information.");
        if (pg_numrows($run_cust) < 1) {
            $cus_addr = "";
            $cus_accno = "";
        } else {
            $cus_arr = pg_fetch_array($run_cust);
            $cus_addr = $cus_arr['paddr1'];
            $cus_accno = $cus_arr['accno'];
        }
        $inv_ids = explode("|", $cash_arr['rinvids']);
        $inv_amts = explode("|", $cash_arr['amounts']);
        $null1 = array_shift($inv_ids);
        $null2 = array_shift($inv_amts);
        $listing = "";
        $total = 0;
        foreach ($inv_ids as $key => $each) {
            $listing .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td>{$cash_arr['date']}</td>\n\t\t\t\t\t<td>{$cash_arr['reference']}</td>\n\t\t\t\t\t<td>" . CUR . " " . sprint($inv_amts[$key]) . "</td>\n\t\t\t\t</tr>";
            $total = $total + $inv_amts[$key];
        }
        $unalloc = $cash_arr['amount'] - $total;
        if ($unalloc > 0) {
            $listing .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td>{$cash_arr['date']}</td>\n\t\t\t\t\t<td>{$cash_arr['reference']} (Unallocated)</td>\n\t\t\t\t\t<td>" . CUR . " " . sprint($unalloc) . "</td>\n\t\t\t\t</tr>";
            $total += $unalloc;
        }
        $listing .= "\n\t\t\t<tr>\n\t\t\t\t<td colspan='2' align='right'><b>Total:</b></td>\n\t\t\t\t<td>" . CUR . " " . sprint($total) . "</td>\n\t\t\t</tr>";
        $receiptnumber = $cash_arr['cashid'];
    }
    $comments = getCSetting("DEFAULT_BANK_RECPT_COMMENTS");
    $rborder = "style='border-right: 2px solid #000'";
    $display = "\n\t\t<style>\n\t\t\ttable { border: 2px solid #000 }\n\t\t</style>\n\t\t<table border='0' cellpadding='2' cellspacing='2' width='80%' align='center'>\n\t\t\t<tr>\n\t\t\t\t<td width='30%'></td>\n\t\t\t\t<td align='center'><font size='5'><b>" . COMP_NAME . "</b></font></td>\n\t\t\t\t<td align='right'><font size='4'><b>Customer Receipt</b></font></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<p>\n\t\t<table cellpadding='1' cellspacing='0' width='80%' align='center'>\n\t\t\t<tr>\n\t\t\t\t<td {$rborder}>\n\t\t\t\t\t<b>" . COMP_NAME . "</b><br>\n\t\t\t\t\t" . COMP_ADDRESS . "<br>\n\t\t\t\t\t" . COMP_PADDR . "\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<b>Received From:</b><br>\n\t\t\t\t\t{$cash_arr['name']}<br>\n\t\t\t\t\t{$cus_addr}<br>\n\t\t\t\t\t<br>\n\t\t\t\t\t<b>Account Number:</b> {$cus_accno}<br>\n\t\t\t\t\t<b>Receipt Number:</b> {$receiptnumber}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<p>\n\t\t<table " . TMPL_tblDflts . " width='80%' align='center'>\n\t\t\t<tr>\n\t\t\t\t<td><b>Date</b></td>\n\t\t\t\t<td><b>Ref Num</b></td>\n\t\t\t\t<td><b>Amount</b></td>\n\t\t\t</tr>\n\t\t\t{$listing}\n\t\t\t" . TBL_BR . "\n\t\t\t" . TBL_BR . "\n\t\t</table>\n\t\t<p>\n\t\t<table " . TMPL_tblDflts . " width='80%' align='center'>\n\t\t\t" . TBL_BR . "\n\t\t\t<tr>\n\t\t\t\t<td width='60%'>" . nl2br(base64_decode($comments)) . "</td>\n\t\t\t\t<td align='right'>_____________________________________</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td></td>\n\t\t\t\t<td align='center'>Signature</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<div style='position:absolute;left:11%'>\n\t\t<font size='1'>&#169 Cubit Accounting Software</font>\n\t\t</div>";
    return $display;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:47,代码来源:bank-recpt-inv-print.php


示例10: get_current_setting

function get_current_setting()
{
    db_connect();
    $sort_order_setting = getCSetting("ACCOUNT_SORT_ORDER");
    if (!isset($sort_order_setting) or strlen($sort_order_setting) < 1) {
        $sort_order_setting = "number";
    }
    if ($sort_order_setting == "number") {
        $checked1 = "checked='yes'";
        $checked2 = "";
    } else {
        $checked1 = "";
        $checked2 = "checked='yes'";
    }
    $display = "\n\t\t<h2>Accounts Selected Sort Order</h2>\n\t\t<form action='" . SELF . "' method='POST'>\n\t\t\t<input type='hidden' name='key' value='confirm'>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th>Accounts Sort Order</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>\n\t\t\t\t\t<input type='radio' name='sort_order' value='number' {$checked1}> Account Number - Account Name \n\t\t\t\t\t<input type='radio' name='sort_order' value='name' {$checked2}> Account Name - Account Number \n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr><td><br></td></tr>\n\t\t\t<tr>\n\t\t\t\t<td align='right'><input type='submit' value='Save Setting'></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</form>";
    return $display;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:17,代码来源:accounts-drop.php


示例11: select

function select($frm)
{
    extract($_REQUEST);
    if (!isset($emp_year)) {
        $emp_year = getCSetting("EMP_TAXYEAR");
    }
    /* @var $frm cForm */
    $frm->setkey("confirm");
    $frm->settitle("Select Active Employee Tax Year");
    $frm->setmsg("The employee's tax year will end on 28 February of the year you select below.<br />\n\t\t<li class='err'>Also note that, no matter which year is chosen below, the 2006/2007 PAYE\n\t\t\ttax tables will be used until current tax legislation is changed..</li>");
    $yrs = array();
    for ($i = 1990; $i < 2028; ++$i) {
        $yrs[$i] = $i;
    }
    $frm->add_heading("Select");
    $frm->add_select("Tax Year", "emp_year", $emp_year, $yrs, "num", "4:4");
    return $frm->getfrm_input();
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:18,代码来源:empyear.php


示例12: confirm_info_setting

function confirm_info_setting($_POST)
{
    extract($_POST);
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($pay_type, "string", 1, 15, "Invalid Payment Method");
    $v->isOk($process_type, "string", 1, 15, "Invalid Payment Process Method");
    # display errors, if any
    if ($v->isError()) {
        $confirmCust = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $confirmCust .= "<li class='err'>" . $e["msg"] . "</li>";
        }
        return $confirmCust;
    }
    db_connect();
    pglib_transaction("BEGIN") or errDie("Unable to start transaction.");
    $check = getCSetting("SUPP_PAY_TYPE");
    if (!isset($check) or strlen($check) < 1) {
        #no setting ... insert
        $ins_sql = "INSERT INTO settings (constant,label,value,type,datatype,minlen,maxlen,div,readonly) VALUES ('SUPP_PAY_TYPE','Supplier Payment Type','{$pay_type}','general','allstring','1','20','0','f')";
        $run_ins = db_exec($ins_sql) or errDie("Unable to record supplier payment setting.");
    } else {
        #settings ... update
        $upd_sql = "UPDATE settings SET value = '{$pay_type}' WHERE constant = 'SUPP_PAY_TYPE'";
        $run_upd = db_exec($upd_sql) or errDie("Unable to update supplier pay type setting.");
    }
    $check2 = getCSetting("SUPP_PROCESS_TYPE");
    if (!isset($check2) or strlen($check2) < 1) {
        #no setting ... insert
        $ins_sql = "INSERT INTO settings (constant,label,value,type,datatype,minlen,maxlen,div,readonly) VALUES ('SUPP_PROCESS_TYPE','Supplier Payment Process Type','{$process_type}','general','allstring','1','20','0','f')";
        $run_ins = db_exec($ins_sql) or errDie("Unable to record supplier payment setting.");
    } else {
        #settings ... update
        $upd_sql = "UPDATE settings SET value = '{$process_type}' WHERE constant = 'SUPP_PROCESS_TYPE'";
        $run_upd = db_exec($upd_sql) or errDie("Unable to update supplier pay type setting.");
    }
    pglib_transaction("COMMIT") or errDie("Unable to complete transaction.");
    return get_info_setting($_POST, "<li class='err'>Supplier Settings Updated</li><br>");
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:42,代码来源:supp-payment-type.php


示例13: write_setting

function write_setting($_POST)
{
    extract($_POST);
    if (!isset($setting) or strlen($setting) < 1) {
        $setting = "";
    }
    db_connect();
    #update setting
    $check = getCSetting("MARKET_MAIL_FROM");
    if (!isset($check) or strlen($check) < 1) {
        #no setting ... insert
        $ins_sql = "\n\t\t\tINSERT INTO settings (\n\t\t\t\tconstant, label, value, type, \n\t\t\t\tdatatype, minlen, maxlen, div, readonly\n\t\t\t) VALUES (\n\t\t\t\t'MARKET_MAIL_FROM', 'Marketing Email From Address', '{$setting}', 'general',\n\t\t\t\t'allstring', '1', '250', '0', 'f'\n\t\t\t);\n\t\t\t\t";
        $run_ins = db_exec($ins_sql) or errDie("Unable to remove marketing from email information.");
    } else {
        #setting ... update
        $upd_sql = "UPDATE settings SET value = '{$setting}' WHERE constant = 'MARKET_MAIL_FROM'";
        $run_upd = db_exec($upd_sql) or errDie("Unable to update marketing email information.");
    }
    return get_show_setting("<li class='err'>Email Setting Updated</li>");
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:20,代码来源:email-market-address.php


示例14: editSettings

function editSettings()
{
    # connect to db
    db_connect();
    /* static settings for dumb sars thing... you might as well just make your percentage 0 */
    $i = 0;
    if (!isset($sdlpayable)) {
        $sdlpayable = getCSetting("SDLPAYABLE");
    }
    if (!isset($emploan_int)) {
        $emploan_int = getCSetting("EMPLOAN_INT");
    }
    $settings = "";
    $settings .= "\n\t<script>\n\thelp_msgs = new Array();\n\n\thelp_msgs[0] =\n\t\t 'When the total annual salaries being paid out by your company is less than '\n\t\t+'R500 000, SARS will notify your company that no SDL needs to be paid. In the event '\n\t\t+'this amount does go above R500 000, you will again be notified otherwise.';\n\n\thelp_msgs[1] =\n\t\t 'This value is used as the default interest to be used when granting a loan to '\n\t\t+'an employee. At the time of granting, it is possible to change it again if '\n\t\t+'needed. Note that this is not and does not change the Official interest rate of 8%. '\n\t\t+'If the interest you charge on the loan is less than the official rate, '\n\t\t+'a fringe benefit equal to the difference of the interest you charged and '\n\t\t+'the possible interest at the official rate will be added to the employee\\'s '\n\t\t+'taxable income for PAYE calculation purposes.';\n\n\tfunction showhelp(obj, item) {\n\t\tXPopupShow(help_msgs[item], obj);\n\t}\n\t</script>\n\t<tr class='" . bg_class() . "'>\n\t\t<!--<td><a href='#top'>Top</a> | <a href='#bottom'>Bottom</a></td>//-->\n\t\t<td align='center'>SDL Payable [<a href='#' onClick='javascript:showhelp(this, 0);'>about</a>]</td>\n\t\t<td>\n\t\t\t<select name='sdlpayable'>\n\t\t\t\t<option value='y' " . ($sdlpayable != 'n' ? "selected" : "") . ">Yes</option>\n\t\t\t\t<option value='n' " . ($sdlpayable == 'n' ? "selected" : "") . ">No</option>\n\t\t\t</select>\n\t\t</td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<!--<td><a href='#top'>Top</a> | <a href='#bottom'>Bottom</a></td>//-->\n\t\t<td align='center'>Default Interest on Employee Loans [<a href='#' onClick='javascript:showhelp(this, 1);'>about</a>]</td>\n\t\t<td>\n\t\t\t<input type='text' name='emploan_int' value='{$emploan_int}'>\n\t\t</td>\n\t</tr>";
    # select editable settings from db
    $menu = "";
    $sql = "SELECT * FROM settings WHERE type='accounting' AND (readonly='f'::bool) ORDER BY label";
    $setRslt = db_exec($sql) or errDie("Unable to select settings from database.");
    $num_settings = pg_numrows($setRslt);
    if ($num_settings < 1) {
        errDie("No settings found in database!");
    }
    while ($mySet = pg_fetch_array($setRslt)) {
        //$menu .= (($i+1) % 4) ? "<a href='#$mySet[constant]' class=nav>$mySet[label]</a> | " : "<a href='#$mySet[constant]' class=nav>$mySet[label]</a><p>\n";
        $settings .= "\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<!--<td><a href='#top'>Top</a> | <a href='#bottom'>Bottom</a></td>//-->\n\t\t\t<td align=center><a name='{$mySet['constant']}'></a>{$mySet['label']}</td>\n\t\t\t<td><input type=text size=20 name='{$mySet['constant']}' value='{$mySet['value']}'></td>\n\t\t</tr>\n";
        $i++;
    }
    $Sl = "SELECT * FROM salset";
    $Ri = db_exec($Sl);
    if (pg_num_rows($Ri) > 0) {
        $set = "selected";
        $set2 = "";
    } else {
        $set = "";
        $set2 = "selected";
    }
    $sets = "<select name='set'>\n\t<option value='Yes' {$set}>Yes</option>\n\t<option value='No' {$set2}>No</option>\n\t</select>";
    # Set up table & form
    $enterSettings = "<h3>Edit accounting settings</h3>\n<a name=top></a>\n{$menu}\n<p>\n<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\n<form action='" . SELF . "' method=post>\n<input type=hidden name=key value=confirm>\n<tr><th>Description</th><th>Value</th></tr>\n{$settings}\n<tr><td colspan=3 align=right><input type=submit value='Confirm &raquo;'></td></tr>\n</form>\n</table>" . mkQuickLinks(ql("../admin-employee-add.php", "Add Employee"), ql("../admin-employee-view.php", "View Employees")) . "\n<a name=bottom></a>\n";
    return $enterSettings;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:41,代码来源:settings-acc-edit.php


示例15: create_dummy

function create_dummy($deptid)
{
    $trans_date_setting = getCSetting("USE_TRANSACTION_DATE");
    if (isset($trans_date_setting) and $trans_date_setting == "yes") {
        $trans_date_value = getCSetting("TRANSACTION_DATE");
        $date_arr = explode("-", $trans_date_value);
        $date_year = $date_arr[0];
        $date_month = $date_arr[1];
        $date_day = $date_arr[2];
    } else {
        $date_year = date("Y");
        $date_month = date("m");
        $date_day = date("d");
    }
    $odate = "{$date_year}-{$date_month}-{$date_day}";
    db_connect();
    # Insert purchase to DB
    $sql = "\n\t\tINSERT INTO nons_invoices (\n\t\t\tcusname, cusaddr, cusvatno, chrgvat, sdate, odate, subtot, balance, vat, total, done, username, prd, invnum, \n\t\t\ttyp, div, multiline \n\t\t) VALUES (\n\t\t\t'', '', '', 'yes', CURRENT_DATE, '{$odate}', 0, 0, 0, 0, 'n', '" . USER_NAME . "', '" . PRD_DB . "', 0, \n\t\t\t'quo', '" . USER_DIV . "', 'yes'\n\t\t)";
    $rslt = db_exec($sql) or errDie("Unable to create template Non-Stock Quote.", SELF);
    return lastinvid();
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:21,代码来源:nons-multiline-quote-new.php


示例16: get_current_setting

function get_current_setting()
{
    db_connect();
    $date_setting = getCSetting("TRANSACTION_DATE");
    $use_date_setting = getCSetting("USE_TRANSACTION_DATE");
    if (!isset($date_setting) or strlen($date_setting) < 1) {
        $date_setting = date("Y-m-d");
    }
    if (!isset($use_date_setting) or strlen($use_date_setting) < 1) {
        $use_date_setting = "no";
    }
    $date_arr = explode("-", $date_setting);
    if ($use_date_setting == "yes") {
        $checked1 = "";
        $checked2 = "checked='yes'";
    } else {
        $checked1 = "checked='yes'";
        $checked2 = "";
    }
    $display = "\n\t\t<h2>Transaction Date To Use</h2>\n\t\t<form action='" . SELF . "' method='POST'>\n\t\t\t<input type='hidden' name='key' value='confirm'>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th>Transaction Date Setting</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>\n\t\t\t\t\t<input type='radio' name='use_date_setting' value='no' {$checked1}> Use System Date \n\t\t\t\t\t<input type='radio' name='use_date_setting' value='yes' {$checked2}> Use This Date \n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr><td><br></td></tr>\n\t\t\t<tr>\n\t\t\t\t<th>Transaction Date To Use</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>" . mkDateSelect("transaction", "{$date_arr['0']}", "{$date_arr['1']}", "{$date_arr['2']}") . "</td>\n\t\t\t</tr>\n\t\t\t<tr><td><br></td></tr>\n\t\t\t<tr>\n\t\t\t\t<td align='right'><input type='submit' value='Save Setting'></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</form>";
    return $display;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:22,代码来源:transaction-date.php


示例17: write_setting

function write_setting()
{
    extract($_POST);
    db_connect();
    $check1 = getCSetting("BLOCKED_FROM");
    $check2 = getCSetting("BLOCKED_TO");
    if (!isset($check1) or strlen($check1) < 1) {
        $ins_sql = "\n\t\t\tINSERT INTO settings (\n\t\t\t\tconstant, label, value, type, \n\t\t\t\tdatatype, minlen, maxlen, div, readonly\n\t\t\t) VALUES (\n\t\t\t\t'BLOCKED_FROM', 'Blocked Period Date Range From', '{$from_year}-{$from_month}-{$from_day}', 'accounting', \n\t\t\t\t'allstring', '10', '10', '0','f'\n\t\t\t)";
        $run_ins = db_exec($ins_sql) or errDie("Unable to record blocked period information.");
    } else {
        $upd1_sql = "UPDATE settings SET value = '{$from_year}-{$from_month}-{$from_day}' WHERE constant = 'BLOCKED_FROM'";
        $run_upd1 = db_exec($upd1_sql) or errDie("Unable to update blocked period information.");
    }
    if (!isset($check2) or strlen($check2) < 1) {
        $ins_sql = "\n\t\t\tINSERT INTO settings (\n\t\t\t\tconstant, label, value, type, \n\t\t\t\tdatatype, minlen, maxlen, div, readonly\n\t\t\t) VALUES (\n\t\t\t\t'BLOCKED_TO', 'Blocked Period Date Range To', '{$to_year}-{$to_month}-{$to_day}', 'accounting', \n\t\t\t\t'allstring', '10', '10', '0','f'\n\t\t\t)";
        $run_ins = db_exec($ins_sql) or errDie("Unable to record blocked period information.");
    } else {
        $upd2_sql = "UPDATE settings SET value = '{$to_year}-{$to_month}-{$to_day}' WHERE constant = 'BLOCKED_TO'";
        $run_upd2 = db_exec($upd2_sql) or errDie("Unable to update blocked period information.");
    }
    return get_range("<li class='yay'>Setting has been saved.</li><br>");
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:22,代码来源:blocked-period.php


示例18: get_payprdmsg

function get_payprdmsg($payprd, $newval = false)
{
    $dispmsg = getCSetting("EMP_SALMSG");
    $isset = strpos($dispmsg, $payprd);
    if ($newval !== false) {
        /* must be enabled, and setting not in there yet */
        if ($newval == "true" && $isset === false) {
            $dispmsg = "{$dispmsg}{$payprd}";
        } else {
            if ($newval == "false" && $isset !== false) {
                $dispmsg = preg_replace("/{$payprd}/", "", $dispmsg);
            }
        }
        setCSetting("EMP_SALMSG", $dispmsg);
        $isset = strpos($dispmsg, $payprd);
    }
    if ($isset === false) {
        $payprd_msg = "";
    } else {
        switch ($payprd) {
            case "d":
                $payprd_msg = "The first step is for the employer to nominate how many\n\t\t\t\t\tworking hours there are in a week (This is done when adding/editing\n\t\t\t\t\tthe employee). Normally this is 40 hours. In a year there are normally\n\t\t\t\t\t2080 working hours (40 * 52). The system is configured so that the\n\t\t\t\t\tnumber of the working day is identified each time that an employee\n\t\t\t\t\tis paid on a daily basis.<br />\n\t\t\t\t\t<br />\n\t\t\t\t\tEXAMPLE 1: If the employee performs work\n\t\t\t\t\ton 15 March 2007 he will commence working on working day number 11. \n\t\t\t\t\tThe employee year starts 1 March 2007 and ends on 28 February 2008.\n\t\t\t\t\tIn this example there would be 10 previous working days of 8 hours each.\n\t\t\t\t\tThus, working hours are split between prior 10 March 2007 and subsequent\n\t\t\t\t\tto that date: 80 Hours prior and 2000 after 14 March.<br />\n\t\t\t\t\t<br />\n\t\t\t\t\tEXAMPLE 2: An employee's taxable income on 3 July 2007, that is,\n\t\t\t\t\ton working day number 89 is R1200. He has taxable income of R105600 in \n\t\t\t\t\tthe previous 88 days, in respect of which his previous employer has \n\t\t\t\t\tdeducted PAYE amounting in total to R24398. The annual equivalent of \n\t\t\t\t\tR105600 plus a potential 172 days with his new employer would be R312000 \n\t\t\t\t\t(105600 + [172*1200]). Tax on this annual equivalent amounts to R72085. \n\t\t\t\t\tThus in respect of 172 day he would have to pay R47687 - or R277.25 per \n\t\t\t\t\tday. If the employee has no previous employment, that is, it is his first \n\t\t\t\t\tjob, the PAYE deduction on 3 July 2007 would be as follows: Tax on his \n\t\t\t\t\tpotential taxable income of R206400 (1200 * 172 days) from his new employer\n\t\t\t\t\twould be R37305 - or R216.89 per day.";
                break;
            case "w":
                $payprd_msg = "The first step is for the employer to nominate how\n\t\t\t\t\tmany working hours there are in a week (This is done when adding/editing\n\t\t\t\t\tthe employee). Normally this is 40 hours. In a year there are 52 weeks.\n\t\t\t\t\tThe system will identify the week number. Note that the first week in the\n\t\t\t\t\t2008 tax year ends on 2 March 2007.<br />\n\t\t\t\t\t<br />\n\t\t\t\t\tEXAMPLE: If the employee commences work in the week ending 16 March 2007\n\t\t\t\t\the will be working in week number 3.<br />\n\t\t\t\t\tIf his taxable income for the whole week number 3 is R6000, and he has\n\t\t\t\t\tR12000 taxable income in week number 1 and 2 with a former employer who\n\t\t\t\t\tdeducted a total PAYE of R2772.50, it means that he would have earned \n\t\t\t\t\tR18000 during the first 3 weeks. The annual equivalent of this amount \n\t\t\t\t\tis R312000 (R18000 * 52 / 3).<br />\n\t\t\t\t\t<br />\n\t\t\t\t\tThe\ttax payable on R312 000 is R72 085. In week 3 the employee must pay a\n\t\t\t\t\tportion of this amount, 3 / 52, which equals R4158.75. PAYE paid in\n\t\t\t\t\tprior periods, period 1 in this example of R2772.50, must be deducted\n\t\t\t\t\tfrom R4158.75 = R1386.25. PAYE to be deducted in week 3 amounts to R1386.25.";
                break;
            case "f":
                $payprd_msg = "The first step is for the employer to nominate how\n\t\t\t\t\tmany working hours there are in a week (This is done when adding/editing\n\t\t\t\t\tthe employee). Normally this is 40 hours. In a year there are 26 fortnights.\n\t\t\t\t\tThe system will identify the fortnight number. Note that the first \n\t\t\t\t\tfortnight in the 2008 tax year ends on 16 March 2007.<br />\n\t\t\t\t\t<br />\n\t\t\t\t\tEXAMPLE: If the employee commences work in the week ending 16 March 2007\n\t\t\t\t\the will be commencing duties in the second fortnightly period, which ends\n\t\t\t\t\ton 30 March 2007.<br />\n\t\t\t\t\tIf his taxable income for the whole fortnight number 1 was R12000, and he\n\t\t\t\t\thas R12000 taxable income in fortnight number 1 with a former employer who\n\t\t\t\t\tdeducted PAYE of R2772.50, it means that he would have earned R24000 \n\t\t\t\t\tduring the first 2 fortnights. The annual equivalent of R12000 every \n\t\t\t\t\tfortnight amounts to R312000 (R12000 * 26).<br />\n\t\t\t\t\t<br />\n\t\t\t\t\tThe\ttax payable on R312 000 is R72 085. In fortnight number 2 the employee \n\t\t\t\t\tmust pay a portion of this amount, 2 / 26, which equals R5545.00. PAYE paid \n\t\t\t\t\tin prior periods, period 1 in this example of R2772.50, must be deducted\n\t\t\t\t\tfrom R5545.00 = R2772.50. PAYE to be deducted in fortnight number 2 amounts\n\t\t\t\t\tto R2772.50.";
                break;
            case "m":
                $payprd_msg = "Monthly";
        }
    }
    if (!empty($payprd_msg)) {
        $payprd_msg = "<li class='err'>{$payprd_msg}</li>";
    }
    return $payprd_msg;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:38,代码来源:payprdmsg.php


示例19: write

function write($_POST)
{
    # get vars
    extract($_POST);
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($purid, "num", 1, 20, "Invalid purchase number.");
    if (!isset($supid) && !isset($deptid)) {
        $v->isOk($supacc, "num", 1, 10, "Invalid Supplier Account number.");
    }
    $v->isOk($remarks, "string", 0, 255, "Invalid Remarks.");
    $v->isOk($refno, "string", 0, 255, "Invalid Delivery Reference No.");
    $v->isOk($shipchrg, "float", 0, 20, "Invalid Delivery Charges.");
    $pdate = $p_year . "-" . $p_month . "-" . $p_day;
    if (!checkdate($p_month, $p_day, $p_year)) {
        $v->isOk($date, "num", 1, 1, "Invalid Date.");
    }
    # used to generate errors
    $error = "asa@";
    # check quantities
    if (isset($qtys)) {
        foreach ($qtys as $keys => $qty) {
            $v->isOk($qty, "num", 1, 10, "Invalid Quantity for product number : <b>" . ($keys + 1) . "</b>");
            if ($qty > $qts[$keys]) {
                $v->isOk($qty, "num", 0, 0, "Error : Quantity for product number : <b>" . ($keys + 1) . "</b> is more that Qty Purchased");
            }
            $v->isOk($unitcost[$keys], "float", 1, 20, "Invalid Unit Price for product number : <b>" . ($keys + 1) . "</b>.");
            if ($qty < 1) {
                $v->isOk($qty, "num", 0, 0, "Error : Item Quantity must be at least one. Product number : <b>" . ($keys + 1) . "</b>");
            }
        }
    }
    # display errors, if any
    $err = "";
    if ($v->isError()) {
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $err .= "<li class='err'>" . $e["msg"] . "</li>";
        }
        return details($_POST, $err);
    }
    # Get purchase info
    db_connect();
    $sql = "SELECT * FROM nons_purchases WHERE purid = '{$purid}' AND div = '" . USER_DIV . "'";
    $purRslt = db_exec($sql) or errDie("Unable to get purchase information");
    if (pg_numrows($purRslt) < 1) {
        return "<li>- purchase Not Found</li>";
    }
    $pur = pg_fetch_array($purRslt);
    # CHECK IF THIS DATE IS IN THE BLOCKED RANGE
    $blocked_date_from = getCSetting("BLOCKED_FROM");
    $blocked_date_to = getCSetting("BLOCKED_TO");
    if (strtotime($pur['pdate']) >= strtotime($blocked_date_from) and strtotime($pur['pdate']) <= strtotime($blocked_date_to) and !user_is_admin(USER_ID)) {
        return "<li class='err'>Period Range Is Blocked. Only an administrator can process entries within this period.</li>";
    }
    $pur['pdate'] = $p_year . "-" . $p_month . "-" . $p_day;
    # Get selected supplier info
    db_connect();
    if (isset($supid)) {
        $sql = "SELECT * FROM suppliers WHERE supid = '{$supid}' AND div = '" . USER_DIV . "'";
        $supRslt = db_exec($sql) or errDie("Unable to get supplier");
        if (pg_numrows($supRslt) < 1) {
            $error = "<li class='err'> Supplier not Found.</li>";
            $confirm .= "{$error}<p><input type='button' onClick='JavaScript:history.back();' value='&laquo; Correct submission'>";
            return $confirm;
        } else {
            $sup = pg_fetch_array($supRslt);
            $pur['supplier'] = $sup['supname'];
            $pur['supaddr'] = $sup['supaddr'];
            # Get department info
            db_conn("exten");
            $sql = "SELECT * FROM  

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getCache函数代码示例发布时间:2022-05-15
下一篇:
PHP getCSS函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap