function display_wo_issue_details($issue_no) { $result = get_work_order_issue_details($issue_no); if (db_num_rows($result) == 0) { display_note(_("There are no items for this issue.")); } else { start_table(TABLESTYLE); $th = array(_("Component"), _("Quantity"), _("Units")); table_header($th); $j = 1; $k = 0; //row colour counter $total_cost = 0; while ($myrow = db_fetch($result)) { alt_table_row_color($k); label_cell($myrow["stock_id"] . " - " . $myrow["description"]); qty_cell($myrow["qty_issued"], false, get_qty_dec($myrow["stock_id"])); label_cell($myrow["units"]); end_row(); $j++; if ($j == 12) { $j = 1; table_header($th); } //end of page full new headings if } //end of while end_table(); } }
function show_admins($user, $teamid) { page_head("Add or remove Team Admins"); echo "\n\t\tYou can select team members as 'Team Admins'.\n\t\tTeam Admins can:\n\t\t<ul>\n\t\t<li>Edit team information (name, URL, description, country).</li>\n\t\t<li>View the team's join/quit history.</li>\n\t\t<li>Moderate the team forum, if any (admins get emails notification of moderation events and red X reports).</li>\n\t\t</ul>\n\t\tTeam Admins cannot:\n\t\t<ul>\n\t\t<li>Change the team founder.</li>\n\t\t<li>Remove members.</li>\n\t\t<li>Add or remove Team Admins.</li>\n\t\t</ul>\n\t\tIf a Team Admin quits the team, they cease to be a Team Admin.\n\t\t<p>\n\t\tWe recommend that you select only people\n\t\tyou know and trust very well as Team Admins.\n\t"; $admins = BoincTeamAdmin::enum("teamid={$teamid}"); start_table(); if (count($admins) == 0) { row1("There are currently no Team Admins"); } else { row1("Current Team Admins", 3); table_header("Name", "Became Team Admin on", ""); foreach ($admins as $admin) { show_admin($user, $admin); } } end_table(); echo ' <p> <form action="team_admins.php"> <input type="hidden" name="action" value="add"> <input type="hidden" name="teamid" value="$teamid"> '; echo form_tokens($user->authenticator); start_table(); row1("Add Team Admin"); row2('Email address of team member:', '<input name="email_addr">'); row2('', '<input type="submit" action value="Add">'); end_table(); echo "</form>"; page_tail(); }
function show_admins($user, $teamid) { page_head(tra("Add or remove Team Admins")); echo tra("You can select team members as 'Team Admins'. Team Admins can:") . "\n <ul>\n <li>" . tra("Edit team information (name, URL, description, country)") . "\n <li>" . tra("View the team's join/quit history") . "\n <li>" . tra("Moderate the team forum, if any (admins get email notification of moderation events and red X reports)") . "\n </ul>\n " . tra("Team Admins cannot:") . "\n <ul>\n <li>" . tra("Change the team founder") . "\n <li>" . tra("Remove members") . "\n <li>" . tra("Add or remove Team Admins") . "\n </ul>\n " . tra("If a Team Admin quits the team, they cease to be a Team Admin.") . "\n <br /><br />" . tra("We recommend that you select only people you know and trust very well as Team Admins."); $admins = BoincTeamAdmin::enum("teamid={$teamid}"); start_table(); if (count($admins) == 0) { row1(tra("There are currently no Team Admins")); } else { row1(tra("Current Team Admins"), 3); table_header(tra("Name"), tra("Became Team Admin on"), ""); foreach ($admins as $admin) { show_admin($user, $admin); } } end_table(); echo "\n <p>\n <form action=team_admins.php>\n <input type=hidden name=action value=add>\n <input type=hidden name=teamid value={$teamid}>\n "; echo form_tokens($user->authenticator); start_table(); row1(tra("Add Team Admin")); row2(tra("Email address of team member:"), "<input name=email_addr>"); row2("", "<input type=submit action value=\"" . tra("Add") . "\">"); end_table(); echo "</form>"; page_tail(); }
function display_customer_summary($customer_record) { global $table_style; $past1 = get_company_pref('past_due_days'); $past2 = 2 * $past1; if ($customer_record["dissallow_invoices"] != 0) { echo "<center><font color=red size=4><b>" . tr("CUSTOMER ACCOUNT IS ON HOLD") . "</font></b></center>"; } $nowdue = "1-" . $past1 . " " . tr('Days'); $pastdue1 = $past1 + 1 . "-" . $past2 . " " . tr('Days'); $pastdue2 = tr('Over') . " " . $past2 . " " . tr('Days'); start_table("width=80% {$table_style}"); $th = array(tr("Currency"), tr("Terms"), tr("Current"), $nowdue, $pastdue1, $pastdue2, tr("Total Balance")); table_header($th); start_row(); label_cell($customer_record["curr_code"]); label_cell($customer_record["terms"]); amount_cell($customer_record["Balance"] - $customer_record["Due"]); amount_cell($customer_record["Due"] - $customer_record["Overdue1"]); amount_cell($customer_record["Overdue1"] - $customer_record["Overdue2"]); amount_cell($customer_record["Overdue2"]); amount_cell($customer_record["Balance"]); end_row(); end_table(); }
function show_results() { global $path_to_root; /*Now get the transactions */ div_start('trans_tbl'); start_table(TABLESTYLE); $netAmounts = check_value('NetAmounts'); if ($netAmounts) { $net = _("Net"); } else { $net = _("Gross"); } $th = array(_("Type"), _("Description"), _("Tax") . "<br>" . _("Amount"), $net . "<br>" . _("Outputs") . "/" . _("Inputs")); table_header($th); $k = 0; $total = 0; $bdate = date2sql($_POST['TransFromDate']); $edate = date2sql($_POST['TransToDate']); $taxes = get_tax_cash_summary($_POST['TransFromDate'], $_POST['TransToDate']); while ($tx = db_fetch($taxes)) { $payable = $tx['payable']; $collectible = $tx['collectible']; $net = $collectible + $payable; $total += $net; alt_table_row_color($k); label_cell($tx['name'] . " " . $tx['rate'] . "%"); label_cell(_("Charged on sales") . " (" . _("Output Tax") . "):"); amount_cell($payable); if ($netAmounts) { amount_cell($tx['net_output']); } else { amount_cell($tx['gross_output']); } end_row(); alt_table_row_color($k); label_cell($tx['name'] . " " . $tx['rate'] . "%"); label_cell(_("Paid on purchases") . " (" . _("Input Tax") . "):"); amount_cell($collectible); if ($netAmounts) { amount_cell($tx['net_input']); } else { amount_cell($tx['gross_input']); } end_row(); alt_table_row_color($k); label_cell("<b>" . $tx['name'] . " " . $tx['rate'] . "%</b>"); label_cell("<b>" . _("Net payable or collectible") . ":</b>"); amount_cell($net, true); label_cell(""); end_row(); } alt_table_row_color($k); label_cell(""); label_cell("<b>" . _("Total payable or refund") . ":</b>"); amount_cell($total, true); label_cell(""); end_row(); end_table(2); div_end(); }
function render($id, $title) { global $path_to_root; include_once $path_to_root . "/includes/ui.inc"; $today = date2sql(Today()); $sql = "SELECT bank_act, bank_account_name, SUM(amount) balance FROM " . TB_PREF . "bank_trans bt" . " INNER JOIN " . TB_PREF . "bank_accounts ba ON bt.bank_act = ba.id" . " WHERE trans_date < '{$today}'" . " AND inactive <> 1"; if ($this->data_filter != '') { $sql .= ' AND ' . $this->data_filter; } $sql .= " GROUP BY bank_act, bank_account_name" . " ORDER BY bank_account_name"; $result = db_query($sql); br(); $th = array(_("Account"), _("Balance")); start_table(TABLESTYLE, "width=98%"); table_header($th); $k = 0; //row colour counter while ($myrow = db_fetch($result)) { alt_table_row_color($k); label_cell($myrow["bank_account_name"]); amount_cell($myrow['balance']); end_row(); } end_table(1); }
function weight2latex($data, $sample_term, $M) { //echo($sample_term . '<br>W from .csv <pre>'); print_r($data); echo('</pre><hr>'); //expert,we,C1,C2,C3,C4,C5,C6,C7,C8,C9 $output = table_header($M + 2, 2); $n = count($data); for ($z = 0; $z < $n; $z++) { //for each line line for ($x = -1; $x < $M; $x++) { if ($x < 0) { $output .= "\\begin{scriptsize}\$E_{" . $data[$z]['expert'] . "}\$\\end{scriptsize} & "; $output .= "\\begin{scriptsize}" . $data[$z]['we'] . "\\end{scriptsize}"; } else { $y = "C" . ($x + 1); $output .= $data[$z][$y]; } if ($x < $M - 1) { $output .= " & "; } else { $output .= "\\\\ <br>"; } } } $output .= table_footer("{$sample_term} example weights", $sample_term); echo $output . "<hr>"; }
function render($id, $title) { global $path_to_root, $systypes_array; include_once $path_to_root . "/includes/ui.inc"; $start_date = add_days(Today(), -$this->days_past); $end_date = add_days(Today(), $this->days_future); $result = get_bank_trans_for_bank_account($this->bank_act, $start_date, $end_date); start_table(TABLESTYLE, 'width=98%'); $th = array(_("#"), _("Date"), _("Receipt"), _("Payment"), _("Balance"), _("Person/Item"), _("Memo"), ""); table_header($th); $bfw = get_balance_before_for_bank_account($this->bank_act, $start_date); $credit = $debit = 0; start_row("class='inquirybg' style='font-weight:bold'"); label_cell(_("Opening Balance") . " - " . $start_date, "colspan=4"); display_debit_or_credit_cells($bfw); label_cell(""); label_cell("", "colspan=2"); end_row(); $running_total = $bfw; if ($bfw > 0) { $debit += $bfw; } else { $credit += $bfw; } $j = 1; $k = 0; //row colour counter while ($myrow = db_fetch($result)) { alt_table_row_color($k); $running_total += $myrow["amount"]; label_cell(get_trans_view_str($myrow["type"], $myrow["trans_no"])); $trandate = sql2date($myrow["trans_date"]); label_cell($trandate); display_debit_or_credit_cells($myrow["amount"]); amount_cell($running_total); label_cell(payment_person_name($myrow["person_type_id"], $myrow["person_id"])); label_cell(get_comments_string($myrow["type"], $myrow["trans_no"])); label_cell(get_gl_view_str($myrow["type"], $myrow["trans_no"])); end_row(); if ($myrow["amount"] > 0) { $debit += $myrow["amount"]; } else { $credit += $myrow["amount"]; } if ($j == 12) { $j = 1; table_header($th); } $j++; } //end of while loop start_row("class='inquirybg' style='font-weight:bold'"); label_cell(_("Ending Balance") . " - " . $end_date, "colspan=4"); amount_cell($debit + $credit); label_cell(""); label_cell("", "colspan=2"); end_row(); end_table(2); }
function show_form($all) { if ($all) { echo "<a href=manage_app_versions.php>Don't show deprecated app versions</a>\n"; } else { echo "<a href=manage_app_versions.php?all=1>Show deprecated app versions</a>\n"; } $_platforms = BoincPlatform::enum(""); foreach ($_platforms as $platform) { $platforms[$platform->id] = $platform; } $_apps = BoincApp::enum(""); foreach ($_apps as $app) { $apps[$app->id] = $app; } start_table(""); table_header("ID #<br><p class=\"text-muted\">click for details</p>", "Application<br><p class=\"text-muted\">click for details</p>", "Version", "Platform", "Plan class", "minimum<br>client version", "maximum<br>client version", "beta?", "deprecated?", ""); $clause = $all ? "true" : "deprecated = 0"; $avs = BoincAppVersion::enum("{$clause} order by appid, platformid, plan_class, version_num"); $i = 0; foreach ($avs as $av) { // grey out deprecated versions // $f1 = $f2 = ''; if ($av->deprecated) { $f1 = "<font color='GREY'>"; $f2 = "</font>"; } $all_value = $all ? 1 : 0; echo "<tr class=row{$i}><form action=manage_app_versions.php?all={$all_value}#av_{$av->id} method=POST>\n"; $i = 1 - $i; echo "<input type=hidden name=id value={$av->id}>"; echo " <TD>{$f1} <a id='av_{$av->id}' href=db_action.php?table=app_version&id={$av->id}>{$av->id}</a> {$f2}</TD>\n"; $app = $apps[$av->appid]; echo " <TD>{$f1} <a href=app_details.php?appid={$app->id}>{$app->name}</a> {$f2}</TD>\n"; echo " <TD>{$f1} {$av->version_num} {$f2}</TD>\n"; $platform = $platforms[$av->platformid]; echo " <TD>{$f1} {$platform->name} {$f2}</TD>\n"; echo " <td><input type=text name=plan_class size=12 value='{$av->plan_class}'></td>\n"; $v = $av->min_core_version; echo " <TD><input type='text' size='4' name=min_core_version value='{$v}'></TD>\n"; $v = $av->max_core_version; echo " <TD><input type='text' size='4' name=max_core_version value='{$v}'></TD>\n"; $v = ''; if ($av->beta) { $v = ' CHECKED '; } echo " <TD> <input name=beta type='checkbox' {$v}></TD>\n"; $v = ''; if ($av->deprecated) { $v = ' CHECKED '; } echo " <TD> <input name=deprecated type='checkbox' {$v}></TD>\n"; echo "<td><input class=\"btn btn-default\" name=submit type=submit value=Update>"; echo "</tr></form>"; } end_table(); }
function render($id, $title) { global $path_to_root; include_once $path_to_root . "/includes/ui.inc"; include_once $path_to_root . "/reporting/includes/class.graphic.inc"; if (!defined('FLOAT_COMP_DELTA')) { define('FLOAT_COMP_DELTA', 0.004); } if (!isset($this->top)) { $this->top = 10; } $begin = begin_fiscalyear(); $today = Today(); $begin1 = date2sql($begin); $today1 = date2sql($today); $sql = "SELECT SUM((trans.ov_amount + trans.ov_discount) * rate) AS total, s.supplier_id, s.supp_name FROM\n " . TB_PREF . "supp_trans AS trans, " . TB_PREF . "suppliers AS s WHERE trans.supplier_id=s.supplier_id\n AND (trans.type = " . ST_SUPPINVOICE . " OR trans.type = " . ST_SUPPCREDIT . ")\n AND tran_date >= '{$begin1}' AND tran_date <= '{$today1}' "; if ($this->data_filter != '') { $sql .= ' AND ' . $this->data_filter; } $sql .= "GROUP by s.supplier_id ORDER BY total DESC, s.supplier_id " . " LIMIT " . $this->top; $result = db_query($sql); if ($this->graph_type == 'Table') { $th = array(_("Supplier"), _("Amount")); start_table(TABLESTYLE, "width=98%"); table_header($th); $k = 0; //row colour counter while ($myrow = db_fetch($result)) { alt_table_row_color($k); $name = $myrow["supplier_id"] . " " . $myrow["supp_name"]; label_cell($name); amount_cell($myrow['total']); end_row(); } end_table(1); } else { $pg = new graph(); $i = 0; while ($myrow = db_fetch($result)) { $name = $myrow["supplier_id"] . " " . $myrow["supp_name"]; $pg->x[$i] = $name; $pg->y[$i] = $myrow['total']; $i++; } $pg->title = $title; $pg->axis_x = _("Supplier"); $pg->axis_y = _("Amount"); $pg->graphic_1 = $today; $pg->type = 2; $pg->skin = 1; $pg->built_in = false; $filename = company_path() . "/pdf_files/" . uniqid("") . ".png"; $pg->display($filename, true); echo "<img src='{$filename}' border='0' alt='{$title}' style='max-width:100%'>"; } }
function show_courses() { $courses = BoltCourse::enum(); start_table(); table_header("Course", "Tools"); foreach ($courses as $course) { show_course($course); } end_table(); }
function render($id, $title) { global $path_to_root; include_once $path_to_root . "/reporting/includes/class.graphic.inc"; if (!defined('FLOAT_COMP_DELTA')) { define('FLOAT_COMP_DELTA', 0.004); } if (!isset($this->top)) { $this->top = 10; } $begin = begin_fiscalyear(); $today = Today(); $begin1 = date2sql($begin); $today1 = date2sql($today); $sql = "SELECT SUM((ov_amount + ov_discount) * rate * IF(trans.type = " . ST_CUSTCREDIT . ", -1, 1)) AS total,d.debtor_no, d.name" . " FROM " . TB_PREF . "debtor_trans AS trans, " . TB_PREF . "debtors_master AS d" . " WHERE trans.debtor_no=d.debtor_no" . " AND (trans.type = " . ST_SALESINVOICE . " OR trans.type = " . ST_CUSTCREDIT . ")" . " AND tran_date >= '{$begin1}' AND tran_date <= '{$today1}'"; if ($this->data_filter != '') { $sql .= ' AND ' . $this->data_filter; } $sql .= " GROUP by d.debtor_no ORDER BY total DESC, d.debtor_no " . " LIMIT " . $this->top; $result = db_query($sql); if ($this->graph_type == 'Table') { $th = array(null, _("Customer"), _("Amount")); start_table(TABLESTYLE, "width=98%"); table_header($th); $k = 0; //row colour counter $i = 0; while ($myrow = db_fetch($result)) { alt_table_row_color($k); label_cell(viewer_link($myrow["debtor_no"], 'sales/inquiry/customer_inquiry.php?customer_id=' . $myrow["debtor_no"])); label_cell(viewer_link($myrow["name"], 'sales/inquiry/customer_inquiry.php?customer_id=' . $myrow["debtor_no"])); amount_cell($myrow['total']); end_row(); } end_table(1); } else { $pg = new graph(); $i = 0; while ($myrow = db_fetch($result)) { $pg->x[$i] = $myrow["debtor_no"] . " " . $myrow["name"]; $pg->y[$i] = $myrow['total']; $i++; } $pg->title = $title; $pg->axis_x = _("Customer"); $pg->axis_y = _("Amount"); $pg->graphic_1 = $today; $pg->type = 2; $pg->skin = 1; $pg->built_in = false; $filename = company_path() . "/pdf_files/" . uniqid("") . ".png"; $pg->display($filename, true); echo "<img src='{$filename}' border='0' alt='{$title}' style='max-width:100%'>"; } }
function render($id, $title) { global $path_to_root; if (!isset($this->top)) { $this->top = 10; } global $path_to_root; $pg = new graph(); $begin = begin_fiscalyear(); $today = Today(); $begin1 = date2sql($begin); $today1 = date2sql($today); $sql = "SELECT SUM(-t.amount) AS total, d.reference, d.name FROM\n " . TB_PREF . "gl_trans AS t," . TB_PREF . "dimensions AS d WHERE\n (t.dimension_id = d.id OR t.dimension2_id = d.id) AND\n t.tran_date >= '{$begin1}' AND t.tran_date <= '{$today1}' "; if ($this->data_filter != '') { $sql .= ' AND ' . $this->data_filter; } $sql .= "GROUP BY d.id ORDER BY total DESC LIMIT " . $this->top; $result = db_query($sql, "Transactions could not be calculated"); if ($this->graph_type == 'Table') { $title = _("Top 10 Dimensions in fiscal year"); br(2); display_heading($title); br(); $th = array(_("Dimension"), _("Amount")); start_table(TABLESTYLE, "width=98%"); table_header($th); $k = 0; //row colour counter while ($myrow = db_fetch($result)) { alt_table_row_color($k); label_cell($myrow['reference'] . " " . $myrow["name"]); amount_cell($myrow['total']); end_row(); } end_table(2); } else { $pg = new graph(); $i = 0; while ($myrow = db_fetch($result)) { $pg->x[$i] = $myrow['reference'] . " " . $myrow["name"]; $pg->y[$i] = abs($myrow['total']); $i++; } $pg->title = $title; $pg->axis_x = _("Dimension"); $pg->axis_y = _("Amount"); $pg->graphic_1 = $today; $pg->type = 5; $pg->skin = 1; $pg->built_in = false; $filename = company_path() . "/pdf_files/" . uniqid("") . ".png"; $pg->display($filename, true); echo "<img src='{$filename}' border='0' alt='{$title}' style='max-width:100%'>"; } }
function show_batches($user) { $batches = BoincBatch::enum("user_id={$user->id}"); page_head("Batches"); start_table(); table_header("Batch ID", "Submitted", "# jobs"); foreach ($batches as $batch) { echo "<tr>\n <td><a href=submit_status.php?action=show_batch&batch_id={$batch->id}>{$batch->id}</a></td>\n <td>" . time_str($batch->create_time) . "</td>\n <td>{$batch->njobs}</td>\n </tr>\n "; } end_table(); page_tail(); }
function display_po_receive_items() { div_start('grn_items'); start_table(TABLESTYLE, "colspan=7 width='90%'"); $th = array(_("Item Code"), _("Description"), _("Ordered"), _("Units"), _("Received"), _("Outstanding"), _("This Delivery"), _("Price"), _("Total")); table_header($th); /*show the line items on the order with the quantity being received for modification */ $total = 0; $k = 0; //row colour counter if (count($_SESSION['PO']->line_items) > 0) { foreach ($_SESSION['PO']->line_items as $ln_itm) { alt_table_row_color($k); $qty_outstanding = $ln_itm->quantity - $ln_itm->qty_received; if (!isset($_POST['Update']) && !isset($_POST['ProcessGoodsReceived']) && $ln_itm->receive_qty == 0) { //If no quantites yet input default the balance to be received $ln_itm->receive_qty = $qty_outstanding; } $line_total = $ln_itm->receive_qty * $ln_itm->price; $total += $line_total; label_cell($ln_itm->stock_id); if ($qty_outstanding > 0) { text_cells(null, $ln_itm->stock_id . "Desc", $ln_itm->item_description, 30, 50); } else { label_cell($ln_itm->item_description); } $dec = get_qty_dec($ln_itm->stock_id); qty_cell($ln_itm->quantity, false, $dec); label_cell($ln_itm->units); qty_cell($ln_itm->qty_received, false, $dec); qty_cell($qty_outstanding, false, $dec); if ($qty_outstanding > 0) { qty_cells(null, $ln_itm->line_no, number_format2($ln_itm->receive_qty, $dec), "align=right", null, $dec); } else { label_cell(number_format2($ln_itm->receive_qty, $dec), "align=right"); } amount_decimal_cell($ln_itm->price); amount_cell($line_total); end_row(); } } $colspan = count($th) - 1; $display_sub_total = price_format($total); label_row(_("Sub-total"), $display_sub_total, "colspan={$colspan} align=right", "align=right"); $taxes = $_SESSION['PO']->get_taxes(input_num('freight_cost'), true); $tax_total = display_edit_tax_items($taxes, $colspan, $_SESSION['PO']->tax_included); $display_total = price_format($total + input_num('freight_cost') + $tax_total); start_row(); label_cells(_("Amount Total"), $display_total, "colspan={$colspan} align='right'", "align='right'"); end_row(); end_table(); div_end(); }
function show_form() { $_platforms = BoincPlatform::enum(""); foreach ($_platforms as $platform) { $platforms[$platform->id] = $platform; } $_apps = BoincApp::enum(""); foreach ($_apps as $app) { $apps[$app->id] = $app; } start_table(""); table_header("ID #<br><span class=note>click for details</span>", "Application<br><span class=note>click for details</span>", "Version", "Platform", "Plan Class", "minimum<br>client version", "maximum<br>client version", "beta?", "deprecated?", ""); $avs = BoincAppVersion::enum("true order by appid, platformid, plan_class, version_num"); $i = 0; foreach ($avs as $av) { // grey out deprecated versions // $f1 = $f2 = ''; if ($av->deprecated) { $f1 = "<font color='GREY'>"; $f2 = "</font>"; } echo "<tr class=row{$i}><form action=manage_app_versions.php method=POST>\n"; $i = 1 - $i; echo "<input type=hidden name=id value={$av->id}>"; echo " <TD>{$f1} <a href=db_action.php?table=app_version&id={$av->id}>{$av->id}</a> {$f2}</TD>\n"; $app = $apps[$av->appid]; echo " <TD>{$f1} <a href=app_details.php?appid={$app->id}>{$app->name}</a> {$f2}</TD>\n"; echo " <TD>{$f1} {$av->version_num} {$f2}</TD>\n"; $platform = $platforms[$av->platformid]; echo " <TD>{$f1} {$platform->name} {$f2}</TD>\n"; echo " <td>{$f1} {$av->plan_class} {$f2}</td>\n"; $v = $av->min_core_version; echo " <TD><input type='text' size='4' name=min_core_version value='{$v}'></TD>\n"; $v = $av->max_core_version; echo " <TD><input type='text' size='4' name=max_core_version value='{$v}'></TD>\n"; $v = ''; if ($av->beta) { $v = ' CHECKED '; } echo " <TD> <input name=beta type='checkbox' {$v}></TD>\n"; $v = ''; if ($av->deprecated) { $v = ' CHECKED '; } echo " <TD> <input name=deprecated type='checkbox' {$v}></TD>\n"; echo "<td><input name=submit type=submit value=Update>"; echo "</tr></form>"; } end_table(); }
function handle_list() { page_head("Job submission access control"); echo "The following users are allowed to submit jobs.\n <p>\n "; $us = BoincUserSubmit::enum(""); start_table(); table_header("User<br><p class=\"text-muted\">Click to change permissions or quota</p>", "Can submit jobs for", "Quota", "Max jobs in progress<br><p class=\"text-muted\">0 means no limit</p>", "Current priority<br><p class=\"text-muted\">Later time = lower priority</p>"); foreach ($us as $u) { user_row($u); } end_table(); show_button("manage_project.php?action=add_form", "Add user", "Allow a new user to submit jobs"); page_tail(); }
function handle_list() { page_head("Project-wide management functions"); echo "<h3>User permissions and quotas</h3>\n The following users are allowed to submit jobs.\n <p>\n "; show_button("manage_project.php?action=add_form", "Add user", "Allow a new user to submit jobs"); $us = BoincUserSubmit::enum(""); start_table(); table_header("User", "Can submit jobs for", "Quota"); foreach ($us as $u) { user_row($u); } end_table(); page_tail(); }
function show_form() { start_table(); table_header("ID", "name", "title", "image URL", "type<br><p class=\"text-muted\">0=user<br>1=team<br>optional</p>", "description<br><p class=\"text-muted\">optional</p>", "level<br><p class=\"text-muted\">optional</p>", "tags<br><p class=\"text-muted\">optional</p>", "SQL rule<br><p class=\"text-muted\">optional</p>", "", ""); $badges = BoincBadge::enum(""); $i = 0; foreach ($badges as $badge) { echo "<tr class=row{$i} valign=top><form action=badge_admin.php method=POST>"; $i = 1 - $i; echo "<td>{$badge->id}</td>\n"; echo "<input type=hidden name=id value={$badge->id}>"; $nu = BoincBadgeUser::count("badge_id={$badge->id}"); $nt = BoincBadgeTeam::count("badge_id={$badge->id}"); $x = "<br><p class=\"text-muted\">Assigned to {$nu} users<br>Assigned to {$nt} teams</p>"; echo "<td><input name=\"name\" value=\"{$badge->name}\">{$x}</td>\n"; echo "<td><input name=\"title\" value=\"{$badge->title}\"></td>\n"; $x = ""; if ($badge->image_url) { if (strstr($badge->image_url, "http") == $badge->image_url) { $y = $badge->image_url; } else { $y = url_base() . $badge->image_url; } $x = " <img align=right height=64 src=\"{$y}\">"; } echo "<td><input name=\"image_url\" value=\"{$badge->image_url}\">{$x}</td>\n"; echo "<td><input name=\"type\" size=4 value=\"{$badge->type}\"></td>\n"; echo "<td><input name=\"description\" value=\"{$badge->description}\"></td>\n"; echo "<td><input name=\"level\" value=\"{$badge->level}\"></td>\n"; echo "<td><input name=\"tags\" value=\"{$badge->tags}\"></td>\n"; echo "<td><input name=\"sql_rule\" value=\"{$badge->sql_rule}\"></td>\n"; echo "<td><input class=\"btn btn-default\" type=submit name=\"update\" value=Update>\n"; echo "<td><input class=\"btn btn-danger\" type=submit name=\"delete\" value=Delete>\n"; echo "</form></tr>\n"; } echo "<tr><form action=badge_admin.php method=POST>"; echo "<td><br></td>\n"; echo "<td><input name=\"name\"></td>\n"; echo "<td><input name=\"title\"></td>\n"; echo "<td><input name=\"image_url\"></td>\n"; echo "<td><input name=\"type\" size=4></td>\n"; echo "<td><input name=\"description\"></td>\n"; echo "<td><input name=\"level\"></td>\n"; echo "<td><input name=\"tags\"></td>\n"; echo "<td><input name=\"sql_rule\"></td>\n"; echo "<td colspan=2><input class=\"btn btn-primary\" type=submit name=\"add_badge\" value=\"Create badge\"></td>\n"; echo "</form></tr>\n"; end_table(); }
function display_gl_heading($myrow) { global $table_style; $trans_name = systypes::name($_GET['type_id']); start_table("{$table_style} width=95%"); $th = array(tr("General Ledger Transaction Details"), tr("Date"), tr("Person/Item")); table_header($th); start_row(); label_cell("{$trans_name} #" . $_GET['trans_no']); label_cell(sql2date($myrow["tran_date"])); label_cell(payment_person_types::person_name($myrow["person_type_id"], $myrow["person_id"])); end_row(); comments_display_row($_GET['type_id'], $_GET['trans_no']); end_table(1); }
function show_assigns() { admin_page_head("Assignments"); $asgns = BoincAssignment::enum(); if (count($asgns)) { start_table(); table_header("Assignment ID/time", "target", "workunit", "result"); foreach ($asgns as $asgn) { show_assign($asgn); } end_table(); } else { echo "No assignments"; } admin_page_tail(); }
function display_gl_heading($myrow) { global $systypes_array; $trans_name = $systypes_array[$_GET['type_id']]; start_table(TABLESTYLE, "width='95%'"); $th = array(_("General Ledger Transaction Details"), _("Reference"), _("Date"), _("Person/Item")); table_header($th); start_row(); label_cell("{$trans_name} #" . $_GET['trans_no']); label_cell($myrow["reference"]); label_cell(sql2date($myrow["tran_date"])); label_cell(payment_person_name($myrow["person_type_id"], $myrow["person_id"])); end_row(); comments_display_row($_GET['type_id'], $_GET['trans_no']); end_table(1); }
function list_files($user, $err_msg) { $dir = sandbox_dir($user); $d = opendir($dir); if (!$d) { error_page("Can't open sandbox directory"); } page_head("file sandbox for {$user->name}"); echo "\n <form action=sandbox.php method=post ENCTYPE=\"multipart/form-data\">\n <input type=hidden name=action value=upload_file>\n Upload a file to your sandbox:\n <p><input size=80 type=file name=new_file>\n <p> <input type=submit value=Upload>\n </form>\n <hr>\n "; if (strcmp($err_msg, "") != 0) { echo "<p>{$err_msg}<hr>"; } $files = array(); while (($f = readdir($d)) !== false) { if ($f == '.') { continue; } if ($f == '..') { continue; } $files[] = $f; } if (count($files) == 0) { echo "Your sandbox is currently empty."; } else { sort($files); start_table(); table_header("Name<br><span class=note>(click to view)</span>", "Modified", "Size (bytes)", "MD5", "Delete", "Download"); foreach ($files as $f) { $path = "{$dir}/{$f}"; list($error, $size, $md5) = sandbox_parse_link_file($path); if ($error) { table_row($f, "Can't parse link file", "", "<a href=sandbox.php?action=delete_files&name={$f}>delete</a>"); continue; } $p = sandbox_physical_path($user, $md5); if (!is_file($p)) { table_row($f, "Physical file not found", "", ""); continue; } $ct = time_str(filemtime($path)); table_row("<a href=sandbox.php?action=view_file&name={$f}>{$f}</a>", $ct, $size, $md5, button_text("sandbox.php?action=delete_file&name={$f}", "Delete"), button_text("sandbox.php?action=download_file&name={$f}", "Download")); } end_table(); } page_tail(); }
function display_po_receive_items() { global $table_style; start_table("colspan=7 {$table_style} width=90%"); $th = array(tr("Item Code"), tr("Description"), tr("Ordered"), tr("Units"), tr("Received"), tr("Outstanding"), tr("This Delivery"), tr("Price"), tr("Total")); table_header($th); /*show the line items on the order with the quantity being received for modification */ $total = 0; $k = 0; //row colour counter if (count($_SESSION['PO']->line_items) > 0) { foreach ($_SESSION['PO']->line_items as $ln_itm) { alt_table_row_color($k); $qty_outstanding = $ln_itm->quantity - $ln_itm->qty_received; if ($ln_itm->receive_qty == 0) { //If no quantites yet input default the balance to be received $ln_itm->receive_qty = $qty_outstanding; } $line_total = $ln_itm->receive_qty * $ln_itm->price; $total += $line_total; label_cell($ln_itm->stock_id); if ($qty_outstanding > 0) { text_cells(null, $ln_itm->stock_id . "Desc", $ln_itm->item_description, 30, 50); } else { label_cell($ln_itm->item_description); } qty_cell($ln_itm->quantity); label_cell($ln_itm->units); qty_cell($ln_itm->qty_received); qty_cell($qty_outstanding); if ($qty_outstanding > 0) { qty_cells(null, $ln_itm->line_no, qty_format($ln_itm->receive_qty), "align=right"); } else { qty_cells(null, $ln_itm->line_no, qty_format($ln_itm->receive_qty), "align=right", "disabled"); } amount_cell($ln_itm->price); amount_cell($line_total); end_row(); } } $display_total = number_format2($total, user_price_dec()); label_row(tr("Total value of items received"), $display_total, "colspan=8 align=right", "nowrap align=right"); end_table(); }
function display_gl_heading($myrow) { global $systypes_array; $title = ""; //moodlearning if ($myrow['type'] == 55 || $myrow['type'] == 1) { if ($myrow['type'] == 0) { $title = "JV No."; $num = substr($ser['year'], 2); } if ($myrow['type'] == 55) { $voucher_type = "Check Voucher"; $title = "CV No."; $myDateTime = DateTime::createFromFormat('Y-m-d', $myrow['tran_date']); $newDateString = $myDateTime->format('d-m-Y'); $year = substr($newDateString, 8) . "-"; } } $trans_name = $systypes_array[$_GET['type_id']]; start_table(TABLESTYLE, "width=95%"); if ($myrow['type'] == 0 || $myrow['type'] == 1 || $myrow['type'] == 55) { $th = array(_("General Ledger Transaction Details"), _("Reference"), _("Date"), _("Person/Item"), $title); } else { $th = array(_("General Ledger Transaction Details"), _("Reference"), _("Date"), _("Person/Item")); } table_header($th); start_row(); if ($custom == 0) { label_cell("{$trans_name} #" . $_GET['type_id']); } else { label_cell("{$trans_name} #" . get_customized_no($myrow['type'], $myrow['type_no'])); } label_cell($myrow["reference"]); label_cell(sql2date($myrow["tran_date"])); label_cell(payment_person_name($myrow["person_type_id"], $myrow["person_id"])); if ($myrow['type'] == 0 || $myrow['type'] == 1 || $myrow['type'] == 55) { label_cell($year . str_pad(get_customized_no($myrow['type'], $myrow['type_no']), 4, 0, STR_PAD_LEFT)); } //moodlearning end_row(); comments_display_row($_GET['type_id'], $_GET['trans_no']); end_table(1); }
function display_wo_production($prod_id) { $myrow = get_work_order_produce($prod_id); br(1); start_table(TABLESTYLE); $th = array(_("Production #"), _("Reference"), _("For Work Order #"), _("Item"), _("Quantity Manufactured"), _("Date")); table_header($th); start_row(); label_cell($myrow["id"]); label_cell($myrow["reference"]); label_cell(get_trans_view_str(ST_WORKORDER, $myrow["workorder_id"])); label_cell($myrow["stock_id"] . " - " . $myrow["StockDescription"]); qty_cell($myrow["quantity"], false, get_qty_dec($myrow["stock_id"])); label_cell(sql2date($myrow["date_"])); end_row(); comments_display_row(ST_MANURECEIVE, $prod_id); end_table(1); is_voided_display(ST_MANURECEIVE, $prod_id, _("This production has been voided.")); }
function display_wo_production($prod_id) { global $table_style; $myrow = get_work_order_produce($prod_id); start_table($table_style); $th = array(tr("Production #"), tr("Reference"), tr("For Work Order #"), tr("Item"), tr("Quantity Manufactured"), tr("Date")); table_header($th); start_row(); label_cell($myrow["id"]); label_cell($myrow["reference"]); label_cell(get_trans_view_str(systypes::work_order(), $myrow["workorder_id"])); label_cell($myrow["stock_id"] . " - " . $myrow["StockDescription"]); qty_cell($myrow["quantity"]); label_cell(sql2date($myrow["date_"])); end_row(); comments_display_row(29, $prod_id); end_table(1); is_voided_display(29, $prod_id, tr("This production has been voided.")); }
function display_rates($curr_code) { global $table_style; $result = get_exchange_rates($curr_code); br(2); start_table($table_style); $th = array(tr("Date to Use From"), tr("Exchange Rate"), "", ""); table_header($th); $k = 0; //row colour counter while ($myrow = db_fetch($result)) { alt_table_row_color($k); label_cell(sql2date($myrow["date_"])); label_cell(number_format2($myrow["rate_buy"], user_exrate_dec()), "nowrap align=right"); edit_link_cell("selected_id=" . $myrow["id"]); delete_link_cell("selected_id=" . $myrow["id"] . "&delete=1"); end_row(); } //END WHILE LIST LOOP end_table(); }
function display_supplier_summary($supplier_record) { $past1 = get_company_pref('past_due_days'); $past2 = 2 * $past1; $nowdue = "1-" . $past1 . " " . _('Days'); $pastdue1 = $past1 + 1 . "-" . $past2 . " " . _('Days'); $pastdue2 = _('Over') . " " . $past2 . " " . _('Days'); start_table(TABLESTYLE, "width='80%'"); $th = array(_("Currency"), _("Terms"), _("Current"), $nowdue, $pastdue1, $pastdue2, _("Total Balance")); table_header($th); start_row(); label_cell($supplier_record["curr_code"]); label_cell($supplier_record["terms"]); amount_cell($supplier_record["Balance"] - $supplier_record["Due"]); amount_cell($supplier_record["Due"] - $supplier_record["Overdue1"]); amount_cell($supplier_record["Overdue1"] - $supplier_record["Overdue2"]); amount_cell($supplier_record["Overdue2"]); amount_cell($supplier_record["Balance"]); end_row(); end_table(1); }
function display_kit_items($selected_kit) { $result = get_item_kit($selected_kit); div_start('bom'); start_table(TABLESTYLE, "width='60%'"); $th = array(_("Stock Item"), _("Description"), _("Quantity"), _("Units"), '', ''); table_header($th); $k = 0; while ($myrow = db_fetch($result)) { alt_table_row_color($k); label_cell($myrow["stock_id"]); label_cell($myrow["comp_name"]); qty_cell($myrow["quantity"], false, $myrow["units"] == '' ? 0 : get_qty_dec($myrow["comp_name"])); label_cell($myrow["units"] == '' ? _('kit') : $myrow["units"]); edit_button_cell("Edit" . $myrow['id'], _("Edit")); delete_button_cell("Delete" . $myrow['id'], _("Delete")); end_row(); } //END WHILE LIST LOOP end_table(); div_end(); }