if (!isset($_POST['dim2'])) { $_POST['dim2'] = 0; } if ($dim == 2) { dimensions_list_row(tr("Dimension") . " 1", 'dim1', $_POST['dim1'], true, null, false, 1); dimensions_list_row(tr("Dimension") . " 2", 'dim2', $_POST['dim2'], true, null, false, 2); } else { if ($dim == 1) { dimensions_list_row(tr("Dimension"), 'dim1', $_POST['dim1'], true, null, false, 1); hidden('dim2', 0); } else { hidden('dim1', 0); hidden('dim2', 0); } } submit_row('submit', tr("Get")); end_table(1); start_table($table_style2); $showdims = $dim == 1 && $_POST['dim1'] == 0 || $dim == 2 && $_POST['dim1'] == 0 && $_POST['dim2'] == 0; if ($showdims) { $th = array(tr("Period"), tr("Amount"), tr("Dim. incl."), tr("Last Year")); } else { $th = array(tr("Period"), tr("Amount"), tr("Last Year")); } table_header($th); $year = $_POST['fyear']; $sql = "SELECT * FROM fiscal_year WHERE id={$year}"; $result = db_query($sql, "could not get current fiscal year"); $fyear = db_fetch($result); $begin = sql2date($fyear['begin']); $end = sql2date($fyear['end']);
foreach ($db_connections as $id => $conn) { $conn['dbuser'] = $_POST['user']; $conn['dbpassword'] = $_POST['passwd']; if (!($db = db_open($conn))) { display_error("Wrong user name or password - " . mysql_error()); } else { if (!db_import($_FILES['uploadfile']['tmp_name'], $conn)) { display_error("Bad SQL file or you have already updated the company: " . $id . " " . $conn['name'] . " - " . mysql_error()); } else { display_notification("Database has been updated for company: " . $id . " " . $conn['name']); } } } } } } if (!isset($_POST['passwd'])) { $_POST['passwd'] = ""; } echo "<form enctype='multipart/form-data' method='post' action='" . $_SERVER['PHP_SELF'] . "'>\n"; echo "<table align='center' width='50%' cellpadding=3 border=1 bordercolor='#cccccc' style='border-collapse: collapse'>\n"; text_row_ex("Database User", "user", 20); label_row("Password", "<input name='passwd' type='password' value='" . $_POST['passwd'] . "' />"); label_row("Upload Script", "<input name='uploadfile' type='file'>"); submit_row("submit", "Update"); echo "</table>\n"; echo "<br><br>"; echo "<center><span>Choose from Database update scripts in SQL folder. No Datase is updated without a script.</span></center>\n"; echo "<br>"; echo "</form>\n"; echo "</body></html>\n";
start_form(true, true); start_outer_table(TABLESTYLE2); table_section(1); table_section_title(_("Create backup")); textarea_row(_("Comments:"), 'comments', null, 30, 8); compress_list_row(_("Compression:"), 'comp'); vertical_space("height='20px'"); submit_row('creat', _("Create Backup"), false, "colspan=2 align='center'", '', 'process'); table_section(2); table_section_title(_("Backup scripts maintenance")); start_row(); echo "<td style='padding-left:20px' align='left'>" . get_backup_file_combo() . "</td>"; echo "<td style='padding-left:20px' valign='top'>"; start_table(); submit_row('view', _("View Backup"), false, '', '', false); submit_row('download', _("Download Backup"), false, '', '', false); submit_row('restore', _("Restore Backup"), false, '', '', 'process'); submit_js_confirm('restore', _("You are about to restore database from backup file.\nDo you want to continue?")); submit_row('deldump', _("Delete Backup"), false, '', '', true); // don't use 'delete' name or IE js errors appear submit_js_confirm('deldump', sprintf(_("You are about to remove selected backup file.\nDo you want to continue ?"))); end_table(); echo "</td>"; end_row(); start_row(); echo "<td style='padding-left:20px' align='left'><input name='uploadfile' type='file'></td>"; submit_cells('upload', _("Upload file"), "style='padding-left:20px'", '', true); end_row(); end_outer_table(); end_form(); end_page();
$Ajax->activate('_page_body'); } $selected_kit = $_POST['item_code']; //---------------------------------------------------------------------------------- if (get_post('item_code') == '') { // New sales kit entry start_table(TABLESTYLE2); text_row(_("Alias/kit code:"), 'kit_code', null, 20, 21); } else { // Kit selected so display bom or edit component $_POST['description'] = $props['description']; $_POST['category'] = $props['category_id']; start_table(TABLESTYLE2); text_row(_("Description:"), 'description', null, 50, 200); stock_categories_list_row(_("Category:"), 'category', null); submit_row('update_name', _("Update"), false, 'align=center colspan=2', _('Update kit/alias name'), true); end_row(); end_table(1); display_kit_items($selected_kit); echo '<br>'; start_table(TABLESTYLE2); } if ($Mode == 'Edit') { $myrow = get_item_code($selected_id); $_POST['component'] = $myrow["stock_id"]; $_POST['quantity'] = number_format2($myrow["quantity"], get_qty_dec($myrow["stock_id"])); } hidden("selected_id", $selected_id); sales_local_items_list_row(_("Component:"), 'component', null, false, true); // if (get_post('description') == '') // $_POST['description'] = get_kit_name($_POST['component']);
vertical_space("height='20px'"); submit_row('creat', _("Create Backup"), false, "colspan=2 align='center'", '', 'process'); table_section(2); table_section_title(_("Backup scripts maintenance")); start_row(); echo "<td style='padding-left:20px' align='left'>" . get_backup_file_combo() . "</td>"; echo "<td style='padding-left:20px' valign='top'>"; start_table(); submit_row('view', _("View Backup"), false, '', '', false); submit_row('download', _("Download Backup"), false, '', '', false); submit_row('rendump', _("Rename Backup"), false, '', '', 'process'); submit_js_confirm('rendump', _("You are about to rename database backup file.\nDo you want to continue?")); submit_row('restore', _("Restore Backup"), false, '', '', 'process'); submit_js_confirm('restore', _("You are about to restore database from backup file.\nDo you want to continue?")); submit_row('deldump', _("Delete Backup"), false, '', '', true); // don't use 'delete' name or IE js errors appear submit_js_confirm('deldump', sprintf(_("You are about to remove selected backup file.\nDo you want to continue ?"))); if ($enable_shell_button) { submit_row('shcmds', _("Shell Commands"), false, '', '', 'process'); submit_js_confirm('shcmds', _("You are about to execute shell commands on the server.\nDo you want to continue?")); } end_table(); echo "</td>"; end_row(); start_row(); echo "<td style='padding-left:20px' align='left'><input name='uploadfile' type='file'></td>"; submit_cells('upload', _("Upload file"), "style='padding-left:20px'", '', true); end_row(); end_outer_table(); end_form(); end_page();
if (!isset($_POST['dim2'])) { $_POST['dim2'] = 0; } if ($dim == 2) { dimensions_list_row(_("Dimension") . " 1", 'dim1', $_POST['dim1'], true, null, false, 1); dimensions_list_row(_("Dimension") . " 2", 'dim2', $_POST['dim2'], true, null, false, 2); } else { if ($dim == 1) { dimensions_list_row(_("Dimension"), 'dim1', $_POST['dim1'], true, null, false, 1); hidden('dim2', 0); } else { hidden('dim1', 0); hidden('dim2', 0); } } submit_row('submit', _("Get"), true, '', '', true); end_table(1); div_start('budget_tbl'); start_table(TABLESTYLE2); $showdims = $dim == 1 && $_POST['dim1'] == 0 || $dim == 2 && $_POST['dim1'] == 0 && $_POST['dim2'] == 0; if ($showdims) { $th = array(_("Period"), _("Amount"), _("Dim. incl."), _("Last Year")); } else { $th = array(_("Period"), _("Amount"), _("Last Year")); } table_header($th); $year = $_POST['fyear']; if (get_post('update') == '') { $fyear = get_fiscalyear($year); $_POST['begin'] = sql2date($fyear['begin']); $_POST['end'] = sql2date($fyear['end']);
function voucher_details($id) { div_start('voucher_table'); br(); if (!isset($_POST['imc']) || list_updated($_POST['imc'])) { $imc = get_post('imc'); $row = get_salesman_trans($imc); $_POST['sales'] = $row['salesman_name']; $_POST['invoice_no'] = $row['customized_no']; $_POST['client'] = $row['br_name']; $_POST['provision'] = $row['provision']; $_POST['total'] = $row['InvoiceTotal']; } div_start('detail_table'); start_outer_table(TABLESTYLE2); table_section(1); date_row(_("Date:"), 'date'); text_row(_("IMC: "), 'sales'); text_row(_("Invoice No."), 'invoice_no'); text_row(_("Client: "), 'client'); hidden('gross', $_POST['gross']); table_section(2); amount_row(_("Commission %: "), 'provision'); label_row(_("Gross Commission: "), price_format($_POST['netsales'])); label_row(_("W/Tax: "), price_format($_POST['tax'])); label_row(_("Net Commission: "), price_format($_POST['total'])); hidden('netsales', $_POST['netsales']); hidden('tax', $_POST['tax']); hidden('total', $_POST['total']); submit_row('Compute', _("Compute"), '', 'default'); hidden('br_id', $_POST['br_id']); hidden('discount', $_POST['discount']); hidden('returns', $_POST['returns']); end_outer_table(1); div_start('controls'); if (isset($_POST['Compute'])) { submit_center_first('Submit', _("Create Commission Voucher"), '', 'default'); } div_end(); br(); start_table(TABLESTYLE, "width=90%"); $th = array(_('IMC'), _('Invoice #'), _('Date'), _('Client'), ''); table_header($th); $k = 0; $res = get_salesman_trans($_POST['imc'], $_POST['customNum']); while ($myrow = db_fetch($res)) { alt_table_row_color($k); if (checkvouchexists($myrow['customized_no']) == 0) { if ($myrow['Voided'] == '') { label_cell($myrow['salesman_name']); label_cell($myrow['customized_no']); label_cell($myrow['tran_date']); label_cell($myrow['br_name']); edit_button_cell("Edit" . $myrow['customized_no'], _("Select")); } } end_row(); } end_table(1); div_end(); div_end(); br(); }