function try_add_user($login, $pass, $pass2, $realname, $session, $is_admin, $antispam) { $return_val = false; // Help prevent robot registrations if (!check_antispam($antispam)) { display_error("Invalid security code"); } else { if ($session != md5(session_id() . $_SERVER['REMOTE_ADDR'])) { display_error("Invalid session."); } else { if ($pass != $pass2) { display_warning("Password mismatch"); } else { if ($realname == '' || $pass == '' || $pass2 == '' || $login == '') { display_warning("Please fill out all fields"); } else { if (get_user_id($login) > 0) { display_error("The user <strong>{$login}</strong> already exists."); } else { add_user($login, $realname, $pass, $is_admin); $return_val = display_success("<strong>{$login}</strong> has been successfully created"); } } } } } return $return_val; }
function handle_errors($errlevel, $errstr, $errfile = '', $errline = '', $errcontext = '') { $message = htmlentities($errstr) . " [ On <strong>" . $errfile . "</strong> Line " . $errline . " ]"; if ($errlevel == E_WARNING && DEBUG_VALUES) { display_warning($message); } else { display_error($message); } }
// next contact date (to days after today) $nc_date = getdate(strtotime('+2 days')); $data['nc_year'] = $nc_date['year']; $data['nc_month'] = $nc_date['mon']; $data['nc_day'] = $nc_date['mday']; } else { // "edit a contact" mode $edit = true; // set flag $data = get_contact_details($_GET['cid']); if (empty($data)) { display_warning('Brak kontaktu.'); exit; } if ($_SESSION['valid_user_id'] != $data['user_id'] && !is_admin()) { display_warning('Nie jeste¶ uprawniony do edycji tego kontaktu!'); exit; } $data['contact_id'] = $_GET['cid']; list($data['year'], $data['month'], $data['day']) = explode('-', $data['date']); unset($data['date']); $data['nc_type'] = empty($data['next_contact_type']) ? 'brak' : $data['next_contact_type']; list($data['nc_year'], $data['nc_month'], $data['nc_day']) = empty($data['next_contact_date']) ? array(0, 0, 0) : explode('-', $data['next_contact_date']); unset($data['next_contact_type']); unset($data['next_contact_date']); } display_html_header(); display_document_header(); display_menu(); echo '<table width="90%">' . "\n"; echo '<tr><td align="center" class="naglowek">' . ($edit ? 'Edycja kontaktu' : 'Nowy kontakt') . ': ';
} if (!checkdate($_POST['month'], $_POST['day'], $_POST['year']) || mktime(0, 0, 0, $_POST['month'], $_POST['day'], $_POST['year']) > mktime() || !checkdate($_POST['nc_month'], $_POST['nc_day'], $_POST['nc_year']) || $_POST['nc_type'] !== 'brak' && mktime(0, 0, 0, $_POST['month'], $_POST['day'], $_POST['year']) > mktime(0, 0, 0, $_POST['nc_month'], $_POST['nc_day'], $_POST['nc_year'])) { display_warning('Wprowad¼ poprawn± datê!'); exit; } $data = array(); if (!isset($_POST['contact_id'])) { $data['organisation_id'] = $_POST['organisation_id']; $data['user_id'] = $_SESSION['valid_user_id']; $data['project_id'] = $_POST['project_id']; $warning[true] = 'Dodanie kontaktu zakoñczone sukcesem!'; $warning[false] = 'Dodanie kontaktu zakoñczone niepowodzeniem!'; } else { $data['contact_id'] = $_POST['contact_id']; $warning[true] = 'Edycja kontaktu zakoñczona sukcesem!'; $warning[false] = 'Edycja kontaktu zakoñczona niepowodzeniem!'; } $data['type'] = "'" . $_POST['type'] . "'"; $data['date'] = "'" . $_POST['year'] . '-' . $_POST['month'] . '-' . $_POST['day'] . "'"; $data['contact_person'] = "'" . $_POST['contact_person'] . "'"; $data['contact_function'] = "'" . $_POST['contact_function'] . "'"; $data['comments'] = "'" . str_replace("\r", '', $_POST['comments']) . "'"; $data['aim_id'] = $_POST['aim_id']; $data['next_contact_type'] = $_POST['nc_type'] == 'brak' ? 'null' : "'" . $_POST['nc_type'] . "'"; $data['next_contact_date'] = $_POST['nc_type'] == 'brak' ? 'null' : "'" . $_POST['nc_year'] . '-' . $_POST['nc_month'] . '-' . $_POST['nc_day'] . "'"; if (!isset($_POST['contact_id']) && contact_exists($data)) { display_warning('Kontakt zosta³ ju¿ dodany!'); exit; } display_warning($warning[add_contact($data)]);
<?php require_once '../lib/flip.php'; session_start(); check_valid_user(); if (!is_admin()) { display_html_header(); display_document_header(); display_menu(); display_no_auth(); display_document_footer(); exit; } if (!isset($_POST['project_id'])) { header('location: ../'); exit; } if (open_project($_POST['project_id'])) { $result = 'sukcesem'; } else { $result = 'niepowodzeniem'; } display_warning('Otwarcie projektu zako�czone ' . $result . '!');
} if (!isset($_POST['users'])) { header('location: add_users_form.php'); exit; } if (empty($_POST['users'])) { display_warning('Wype�nij poprawnie formularz!'); exit; } $users = str_replace("\r", '', $_POST['users']); $users = explode("\n", $users); $users = array_map('trim', $users); $valid_users = array(); foreach ($users as $user) { if (preg_match('/^[a-z.]+$/', $user) === 1) { $valid_users[] = $user; } } if (isset($_POST['confirmed'])) { if (!insert_users($valid_users)) { display_warning('Dodanie u�ytkownik�w zako�czone niepowodzeniem!'); exit; } display_warning('Dodanie u�ytkownik�w zako�czone sukcesem! Ich nowe has�o to ' . DEFAULT_PASSWORD . '.'); } else { display_html_header(); display_document_header(); display_menu(); display_add_users_conf_form($valid_users); display_document_footer(); }
if (!db_has_employee_payslip($_POST['year'], $_POST['month'], $_POST['empl_id'])) { start_table(TABLESTYLE2); echo '<tr>'; $from = Today(); $from = add_days($from, 1); $bal = get_balance_before_for_bank_account(1, $from); //echo $trans_no = kv_get_next_trans_no(99) + 1; if ($total_net <= $bal) { submit_cells('pay_salary', _("Process Payout"), '', _('Show Results'), 'default'); } else { display_warning(" Your Current Account Balance is lower than the payout!."); } echo '</tr>'; end_table(); } else { display_warning(" Paid Already!."); } div_end(); } end_form(); if (get_post('RefreshInquiry')) { $Ajax->activate('gross_salary'); $Ajax->activate('leave_days'); $Ajax->activate('monthly_loan'); $Ajax->activate('totals_tbl'); } if (get_post('pay_salary')) { global $Refs; $pay_slip_id = add_payslip($_POST['year'], $_POST['month'], $_POST['empl_id'], $_POST['basic'], $_POST['da'], $_POST['hra'], $_POST['convey_allow'], $_POST['edu_other_allow'], $_POST['pf'], $_POST['lop_amount'], $_POST['tds'], $_POST['total_ded'], $_POST['total_net'], $_POST['date_of_pay']); add_gl_trans(99, $pay_slip_id, $_POST['date_of_pay'], 5410, 0, 0, 'employee Salary #' . $_POST['empl_id'], $_POST['total_net']); add_gl_trans(99, $pay_slip_id, $_POST['date_of_pay'], 1060, 0, 0, 'employee Salary #' . $_POST['empl_id'], -$_POST['total_net']);
if (strstr($_POST['password'], $_SESSION["wa_current_user"]->username) != false) { display_error(_("The password cannot contain the user login.")); set_focus('password'); return false; } if ($_POST['password'] != $_POST['passwordConfirm']) { display_error(_("The passwords entered are not the same.")); set_focus('password'); return false; } return true; } if (isset($_POST['UPDATE_ITEM']) && check_csrf_token()) { if (can_process()) { if ($allow_demo_mode) { display_warning(_("Password cannot be changed in demo mode.")); } else { update_user_password($_SESSION["wa_current_user"]->user, $_SESSION["wa_current_user"]->username, md5($_POST['password'])); display_notification(_("Your password has been updated.")); } $Ajax->activate('_page_body'); } } start_form(); start_table(TABLESTYLE); $myrow = get_user($_SESSION["wa_current_user"]->user); label_row(_("User login:"******""; $_POST['passwordConfirm'] = ""; password_row(_("Password:"******"Repeat password:"), 'passwordConfirm', $_POST['passwordConfirm']);
$chg_date_format = user_date_format() != $_POST['date_format']; $chg_date_sep = user_date_sep() != $_POST['date_sep']; set_user_prefs(get_post(array('prices_dec', 'qty_dec', 'rates_dec', 'percent_dec', 'date_format', 'date_sep', 'tho_sep', 'dec_sep', 'print_profile', 'theme', 'page_size', 'language', 'startup_tab', 'show_gl' => 0, 'show_codes' => 0, 'show_hints' => 0, 'rep_popup' => 0, 'graphic_links' => 0, 'sticky_doc_date' => 0, 'query_size' => 10.0))); if ($chg_lang) { $_SESSION['language']->set_language($_POST['language']); } // refresh main menu flush_dir(company_path() . '/js_cache'); if ($chg_theme && $allow_demo_mode) { $_SESSION["wa_current_user"]->prefs->theme = $_POST['theme']; } if ($chg_theme || $chg_lang || $chg_date_format || $chg_date_sep) { meta_forward($_SERVER['PHP_SELF']); } if ($allow_demo_mode) { display_warning(_("Display settings have been updated. Keep in mind that changed settings are restored on every login in demo mode.")); } else { display_notification_centered(_("Display settings have been updated.")); } } } start_form(); start_outer_table(TABLESTYLE2); table_section(1); table_section_title(_("Decimal Places")); number_list_row(_("Prices/Amounts:"), 'prices_dec', user_price_dec(), 0, 10); number_list_row(_("Quantities:"), 'qty_dec', user_qty_dec(), 0, 10); number_list_row(_("Exchange Rates:"), 'rates_dec', user_exrate_dec(), 0, 10); number_list_row(_("Percentages:"), 'percent_dec', user_percent_dec(), 0, 10); table_section_title(_("Dateformat and Separators")); dateformats_list_row(_("Dateformat:"), "date_format", user_date_format());
} //$prev = get_balance(null, $begin, $_POST['TransFromDate'], false, false); //$curr = get_balance(null, $_POST['TransFromDate'], $_POST['TransToDate'], true, true); //$tot = get_balance(null, $begin, $_POST['TransToDate'], false, true); if (!check_value('Balance')) { start_row("class='inquirybg' style='font-weight:bold'"); label_cell(_("Total") . " - " . $_POST['TransToDate'], "colspan=2"); amount_cell($pdeb); amount_cell($pcre); amount_cell($cdeb); amount_cell($ccre); amount_cell($tdeb); amount_cell($tcre); end_row(); } start_row("class='inquirybg' style='font-weight:bold'"); label_cell(_("Ending Balance") . " - " . $_POST['TransToDate'], "colspan=2"); display_debit_or_credit_cells($pbal); display_debit_or_credit_cells($cbal); display_debit_or_credit_cells($tbal); end_row(); end_table(1); if (($pbal = round2($pbal, user_price_dec())) != 0 && $_POST['Dimension'] == 0 && $_POST['Dimension2'] == 0) { display_warning(_("The Opening Balance is not in balance, probably due to a non closed Previous Fiscalyear.")); } div_end(); //---------------------------------------------------------------------------------------------------- end_page(); ?>
<?php require_once 'utils.php'; require_once 'dbo.php'; require_once 'xhtml.php'; global $LSP_URL; if (!SESSION_EMPTY() && (get_user_id(SESSION()) == get_file_owner(GET('file')) || is_admin(get_user_id(SESSION())))) { if (GET('confirmation') == "true") { if (delete_file(GET('file'))) { display_success('File deleted successfully', array('Delete')); } else { display_error('Sorry, file ' . GET('file') . ' could not be deleted', array('Delete')); } get_latest(); } else { display_warning('This will delete all comments and ratings.', array('Delete', get_file_url())); echo '<div class="col-md-9">'; $form = new form(null, 'Confirm Delete', 'fa-trash'); ?> <p class="lead">Confirm deletion of <strong><?php echo get_file_name(GET('file')); ?> </strong>?</p> <div class="form-group"> <a class="btn btn-danger" href="<?php echo "{$LSP_URL}?content=delete&confirmation=true&file=" . GET('file'); ?> "> <span class="fa fa-check"></span> Delete</a> <a class="btn btn-warning" href="<?php echo "{$LSP_URL}?action=show&file=" . GET('file');
<?php require_once '../lib/flip.php'; session_start(); check_valid_user(); if (!isset($_GET['cid'])) { display_warning('Wybierz kontakt!'); exit; } display_html_header(); display_document_header(); display_menu(); echo '<table width="90%">' . "\n"; $details = get_contact_details($_GET['cid']); if ($details === false) { echo '<tr><td>B³±d bazy danych, spróbuj pó¼niej.</td></tr>' . "\n"; } else { if (empty($details)) { echo '<tr><td>Brak kontaktu.</td></tr>'; } else { echo '<tr><td align="center" class="naglowek">Szczegó³y kontaktu'; if ($details['user_id'] == $_SESSION['valid_user_id'] || is_admin()) { echo ' [<a href="../add/add_contact_form.php?cid=' . $_GET['cid'] . '" class="menu">Edytuj</a>]'; } echo '<hr></td></tr>' . "\n"; echo '<tr><td align="center"><table><tr><td width="50%" align="right">'; $prev_cid = get_other_contact($_GET['cid'], '<'); if ($prev_cid) { display_link_to_contact($prev_cid, '<< Poprzedni', false, '[', ']', false); } else { echo ' ';
<?php require_once '../lib/flip.php'; session_start(); check_valid_user(); if (!is_admin()) { display_html_header(); display_document_header(); display_menu(); display_no_auth(); display_document_footer(); exit; } if (!isset($_POST['project_id'])) { header('location: ../'); exit; } if (close_project($_POST['project_id'])) { $result = 'sukcesem'; } else { $result = 'niepowodzeniem'; } display_warning('Zakmni�cie projektu zako�czone ' . $result . '!');
if ((list($width, $height, $type, $attr) = getimagesize($_FILES['pic']['tmp_name'])) !== false) { $imagetype = $type; } else { $imagetype = false; } //$imagetype = exif_imagetype($_FILES['pic']['tmp_name']); if ($imagetype != IMAGETYPE_GIF && $imagetype != IMAGETYPE_JPEG && $imagetype != IMAGETYPE_PNG) { //File type Check display_warning(_('Only graphics files can be uploaded')); $upload_file = 'No'; } elseif (!in_array(strtoupper(substr(trim($_FILES['pic']['name']), strlen($_FILES['pic']['name']) - 3)), array('JPG', 'PNG', 'GIF'))) { display_warning(_('Only graphics files are supported - a file extension of .jpg, .png or .gif is expected')); $upload_file = 'No'; } elseif ($_FILES['pic']['size'] > $max_image_size * 1024) { //File Size Check display_warning(_('The file size is over the maximum allowed. The maximum size allowed in KB is') . ' ' . $max_image_size); $upload_file = 'No'; } elseif (file_exists($filename)) { $result = unlink($filename); if (!$result) { display_error(_('The existing image could not be removed')); $upload_file = 'No'; } } if ($upload_file == 'Yes') { $result = move_uploaded_file($_FILES['pic']['tmp_name'], $filename); } $Ajax->activate('details'); /* EOF Add Image upload for New Item - by Ori */ } check_db_has_stock_categories(_("There are no item categories defined in the system. At least one item category is required to add a item."));
<?php require_once 'utils.php'; require_once 'dbo.php'; require_once 'xhtml.php'; global $LSP_URL; if (!SESSION_EMPTY()) { if (!POST('addcomment', false) || POST_EMPTY('text')) { if (POST_EMPTY('text') && POST('addcomment', false)) { display_error('Please type a message', array('Comment', get_file_url())); } else { display_warning('Do not submit offending, pornographic, racist or violent content.', array('Comment', get_file_url())); } echo '<div class="col-md-9">'; $form = new form($LSP_URL . '?comment=add&' . file_show_query_string(), 'Comment', 'fa-comment'); ?> <div class="form-group"> <label for="text">Add comment to "<?php echo get_file_name(GET('file')); ?> "</label> <textarea id="comment" name="text" class="form-control"></textarea> </div> <button type="submit" class="btn btn-primary" name="addcomment" value="Comment"><span class="fa fa-check"></span> Comment</button> <a href="<?php echo $LSP_URL . '?action=show&file=' . GET('file'); ?> " class="btn btn-warning"></span><span class="fa fa-close"></span> Cancel</a> <?php $form->close(); echo '</div>';
check_valid_user(); if (!isset($_POST['project_id'])) { display_warning('Musisz wybraæ projekt!'); exit; } if (!is_ocp($_SESSION['valid_user_id'], $_POST['project_id']) && !is_admin()) { display_html_header(); display_document_header(); display_menu(); display_no_auth(); display_document_footer(); exit; } $success = delete_oc($_POST['project_id']); if ($success === false) { display_warning('B³±d bazy danych, spróbuj pó¼niej.'); exit; } else { if (isset($_POST['oc_ids'])) { foreach ($_POST['oc_ids'] as $oc_member) { $success_insert = insert_oc_member($oc_member, $_POST['project_id']); if ($success_insert === false) { display_warning('B³±d bazy danych, spróbuj pó¼niej.'); exit; } } } } update_projects_orgs($_POST['project_id']); display_warning('Operacja zakoñczona sukcesem! Przejd¼ ' . '<a href="dispense_orgs_form.php?project_id=' . $_POST['project_id'] . '&show=all" class="org_nowa">tu</a>' . ', aby rozdysponowaæ organizacje teraz.');
<?php require_once '../lib/flip.php'; session_start(); check_valid_user(); if (!isset($_GET['org_id'])) { display_warning('Wybierz organizacjê!'); exit; } display_html_header(); display_document_header(); display_menu(); echo '<table width="90%">' . "\n"; echo '<tr><td align="center" class="naglowek">Dane organizacji <i>' . htmlspecialchars(stripslashes(get_org_name($_GET['org_id']))) . '</i>'; if (is_responsible($_SESSION['valid_user_id'], $_GET['org_id']) || is_admin()) { echo ' [<a href="../add/add_org_info_form.php?org_id=' . $_GET['org_id'] . '" class="menu">Edytuj</a>]'; } echo "<hr></td></tr>\n"; $org_info = get_org_info($_GET['org_id']); echo '<tr><td>'; if (!$org_info) { echo 'Brak danych o organizacji.</td></tr>'; } else { echo '<table align="center">'; $content = array('Adres' => htmlspecialchars($org_info['city'] . ', ' . $org_info['street']), 'Telefon' => htmlspecialchars(parse_phone_number($org_info['phone'])), 'Fax' => htmlspecialchars(parse_phone_number($org_info['fax'])), 'WWW' => strpos($org_info['www'], '.') === false ? '-' : '<a href="' . htmlspecialchars($org_info['www']) . '" target="_blank" class="menu">' . htmlspecialchars($org_info['www']) . '</a>', 'Profil dzia³alno¶ci' => htmlspecialchars($org_info['profile']), 'Data ostatniej aktualizacji' => $org_info['date']); $contact_person = get_contact_person($_GET['org_id']); if ($contact_person !== false && !empty($contact_person)) { $content['Osoba kontaktowa'] = htmlspecialchars($contact_person); } foreach ($content as $label => $value) { echo '<tr><td width="50%" align="right"><b>' . $label . ':</b></td><td width="50%" align="left">';
<?php require_once 'utils.php'; require_once 'dbo.php'; require_once 'xhtml.php'; global $TMP_DIR; global $DATA_DIR; global $LSP_URL; if (!SESSION_EMPTY()) { if (POST_EMPTY('ok') && POST_EMPTY('addfinalok')) { display_warning('Do not submit offending, pornographic, racist or violent content.', array('<a href="">Add File</a>')); echo '<div class="col-md-9">'; $form = new form($LSP_URL . '?content=add', 'Add File', 'fa-upload'); ?> <label for="filename">File to add</label> <div class="form-group"> <span class="pull-left btn btn-default btn-file"> <span class="fa fa-folder-open"></span> Select file<input type="file" name="filename" /> </span><strong><span class="text-center"><pre class="text-warning" id="file-selected">No file selected</pre></span></strong> <small>Maximum file size: 1 MB</small> </div> <div class="form-group"> <input type="checkbox" id="nocopyright" name="nocopyright" /> <label for="nocopyright">Does not violate any existing copyright, law or trademark</label> </div> <button type="submit" name="ok" value="OK" class="btn btn-primary"><span class="fa fa-upload"></span> Upload</button> <a href="<?php echo $LSP_URL; ?> " class="btn btn-warning"><span class="fa fa-close"></span> Cancel</a> <?php
function voiding_controls() { global $selected_id; $not_implemented = array(ST_PURCHORDER, ST_SALESORDER, ST_SALESQUOTE, ST_COSTUPDATE); start_form(); start_table(TABLESTYLE_NOBORDER); start_row(); systypes_list_cells(_("Type:"), 'filterType', null, true, $not_implemented); if (list_updated('filterType')) { $selected_id = -1; } if (!isset($_POST['FromTransNo'])) { $_POST['FromTransNo'] = "1"; } if (!isset($_POST['ToTransNo'])) { $_POST['ToTransNo'] = "999999"; } ref_cells(_("from #:"), 'FromTransNo'); ref_cells(_("to #:"), 'ToTransNo'); submit_cells('ProcessSearch', _("Search"), '', '', 'default'); end_row(); end_table(1); $trans_ref = false; $sql = get_sql_for_view_transactions($_POST['filterType'], $_POST['FromTransNo'], $_POST['ToTransNo'], $trans_ref); if ($sql == "") { return; } $cols = array(_("#") => array('insert' => true, 'fun' => 'view_link'), _("Reference") => array('fun' => 'ref_view'), _("Date") => array('type' => 'date', 'fun' => 'date_view'), _("GL") => array('insert' => true, 'fun' => 'gl_view'), _("Select") => array('insert' => true, 'fun' => 'select_link')); $table =& new_db_pager('transactions', $sql, $cols); $table->width = "40%"; display_db_pager($table); start_table(TABLESTYLE2); if ($selected_id != -1) { hidden('trans_no', $selected_id); hidden('selected_id', $selected_id); } else { hidden('trans_no', ''); $_POST['memo_'] = ''; } label_row(_("Transaction #:"), $selected_id == -1 ? '' : $selected_id); date_row(_("Voiding Date:"), 'date_'); textarea_row(_("Memo:"), 'memo_', null, 30, 4); end_table(1); if (!isset($_POST['ProcessVoiding'])) { submit_center('ProcessVoiding', _("Void Transaction"), true, '', 'default'); } else { if (!exist_transaction($_POST['filterType'], $_POST['trans_no'])) { display_error(_("The entered transaction does not exist or cannot be voided.")); unset($_POST['trans_no']); unset($_POST['memo_']); unset($_POST['date_']); submit_center('ProcessVoiding', _("Void Transaction"), true, '', 'default'); } else { display_warning(_("Are you sure you want to void this transaction ? This action cannot be undone."), 0, 1); br(); submit_center_first('ConfirmVoiding', _("Proceed"), '', true); submit_center_last('CancelVoiding', _("Cancel"), '', 'cancel'); } } end_form(); }
<?php require_once '../lib/flip.php'; session_start(); check_valid_user(); if (!isset($_GET['project_id'])) { display_warning('Nie wybrano projektu!'); exit; } display_html_header(); display_document_header(); display_menu(); if (is_ocp($_SESSION['valid_user_id'], $_GET['project_id']) || is_admin()) { display_edit_oc_form($_GET['project_id']); } else { display_no_auth(); } display_document_footer();
<?php require_once '../lib/flip.php'; session_start(); check_valid_user(); array_map($_POST, 'trim'); if (empty($_POST['question']) || empty($_POST['answer'])) { display_warning('Wype�nij poprawnie formularz!'); exit; } $data = array(); $data['question'] = $_POST['question']; $data['answer'] = $_POST['answer']; $data['helper_id'] = $_SESSION['valid_user_id']; $data['category_id'] = $_POST['category_id']; if (isset($_POST['question_id'])) { //edit the question $data['question_id'] = $_POST['question_id']; $result = help_edit_question($data); } else { //add new question $result = help_add_question($data); } if ($result === false) { display_warning('Operacja zako�czona niepowodzeniem!'); } else { display_warning('Operacja zako�czona sukcesem!'); }
function check_item_data() { global $SysPrefs, $allow_negative_prices; $is_inventory_item = is_inventory_item(get_post('stock_id')); if (!get_post('stock_id_text', true)) { display_error(_("Item description cannot be empty.")); set_focus('stock_id_edit'); return false; } elseif (!check_num('qty', 0) || !check_num('Disc', 0, 100)) { display_error(_("The item could not be updated because you are attempting to set the quantity ordered to less than 0, or the discount percent to more than 100.")); set_focus('qty'); return false; } elseif (!check_num('price', 0) && (!$allow_negative_prices || $is_inventory_item)) { display_error(_("Price for inventory item must be entered and can not be less than 0")); set_focus('price'); return false; } elseif (isset($_POST['LineNo']) && isset($_SESSION['Items']->line_items[$_POST['LineNo']]) && !check_num('qty', $_SESSION['Items']->line_items[$_POST['LineNo']]->qty_done)) { set_focus('qty'); display_error(_("You attempting to make the quantity ordered a quantity less than has already been delivered. The quantity delivered cannot be modified retrospectively.")); return false; } $cost_home = get_standard_cost(get_post('stock_id')); // Added 2011-03-27 Joe Hunt $cost = $cost_home / get_exchange_rate_from_home_currency($_SESSION['Items']->customer_currency, $_SESSION['Items']->document_date); if (input_num('price') < $cost) { $dec = user_price_dec(); $curr = $_SESSION['Items']->customer_currency; $price = number_format2(input_num('price'), $dec); if ($cost_home == $cost) { $std_cost = number_format2($cost_home, $dec); } else { $price = $curr . " " . $price; $std_cost = $curr . " " . number_format2($cost, $dec); } display_warning(sprintf(_("Price %s is below Standard Cost %s"), $price, $std_cost)); } return true; }
<?php require_once 'lib/flip.php'; session_start(); check_valid_user(); if (!isset($_POST['subject']) || !isset($_POST['body'])) { header('location: feedback_form.php'); } $valid_user_login = get_user_login($_SESSION['valid_user_id']); $long_subject = date('Y-m-d H:i') . ' ' . $valid_user_login . ': "' . stripslashes($_POST['subject']) . '"'; $long_body = 'U¿ytkownik ' . $valid_user_login . ' przesy³a nastêpuj±c± uwagê:' . "\n----------------------------------\n" . stripslashes($_POST['body']) . "\n----------------------------------\n"; $long_body .= "Aby odpowiedzieæ na t± uwagê, u¿yj opcji 'Odpowied¼' lub napisz na ten adres: " . $valid_user_login . '@aiesec.uni.lodz.pl'; $long_body .= "\n\n\nFLIP"; $headers = "From: FLIP <*****@*****.**>\r\n" . 'Reply-To: ' . $valid_user_login . "@aiesec.uni.lodz.pl\r\n"; if (mail(ADMIN_MAIL, $long_subject, $long_body, $headers)) { $warning = 'Dziêkujemy! Twoje uwagi zosta³y przyjête.'; } else { $warning = 'Wys³anie uwag zakoñczone niepowodzeniem!'; } display_warning($warning);
<?php require_once '../lib/flip.php'; session_start(); check_valid_user(); if (!isset($_GET['category_id'])) { display_warning('Wybierz kategoriê!'); exit; } display_html_header(); display_document_header(); display_menu(); if (!is_admin()) { display_no_auth(); display_document_footer(); exit; } echo '<table width="90%">' . "\n"; echo '<tr><td align="center" class="naglowek">'; if (isset($_GET['question_id'])) { echo 'Edytuj pytanie'; $qsn_details = help_get_question_details($_GET['category_id'], $_GET['question_id']); $question = htmlspecialchars($qsn_details['question']); $answer = htmlspecialchars($qsn_details['answer']); } else { echo 'Nowe pytanie'; $question = ''; $answer = ''; } echo "<hr></td></tr>\n"; echo '<form action="add_question.php" method="post">' . "\n";
function handle_add_new_item() { $allow_update = check_data(); if ($allow_update == true) { if (count($_SESSION['PO']->line_items) > 0) { foreach ($_SESSION['PO']->line_items as $order_item) { /* do a loop round the items on the order to see that the item is not already on this order */ if ($order_item->stock_id == $_POST['stock_id']) { display_warning(_("The selected item is already on this order.")); } } /* end of the foreach loop to look for pre-existing items of the same code */ } if ($allow_update == true) { $result = get_short_info($_POST['stock_id']); if (db_num_rows($result) == 0) { $allow_update = false; } if ($allow_update) { $myrow = db_fetch($result); $_SESSION['PO']->add_to_order(count($_SESSION['PO']->line_items), $_POST['stock_id'], input_num('qty'), get_post('stock_id_text'), input_num('price'), '', $_SESSION['PO']->trans_type == ST_PURCHORDER ? $_POST['req_del_date'] : '', 0, 0); unset_form_variables(); $_POST['stock_id'] = ""; } else { display_error(_("The selected item does not exist or it is a kit part and therefore cannot be purchased.")); } } /* end of if not already on the order and allow input was true*/ } line_start_focus(); }
<?php session_start(); require_once '../lib/flip.php'; check_valid_user(); if (!is_admin()) { display_html_header(); display_document_header(); display_menu(); display_no_auth(); display_document_footer(); exit; } if (in_array($_POST['project_id'], array_keys(get_org_projects($_POST['organisation_id'])))) { display_warning('Ta organizacja jest ju� w projekcie!'); exit; } if (!isset($_POST['project_id']) || !isset($_POST['organisation_id'])) { header('location: ..'); exit; } if (add_org_to_project($_POST['organisation_id'], $_POST['project_id'])) { header('location: ../show/show_org.php?org_id=' . $_POST['organisation_id']); } else { display_warning('Dodanie organizacji do projektu zako�czone niepowodzeniem!'); }
hidden('customer_id', $_POST['customer_id']); } if (list_updated('customer_id') || $new && list_updated('bank_account')) { $_SESSION['alloc']->read(); $_POST['memo_'] = $_POST['amount'] = $_POST['discount'] = ''; $Ajax->activate('alloc_tbl'); } if (db_customer_has_branches($_POST['customer_id'])) { customer_branches_list_row(_("Branch:"), $_POST['customer_id'], 'BranchID', null, false, true, true); } else { hidden('BranchID', ANY_NUMERIC); } read_customer_data(); set_global_customer($_POST['customer_id']); if (isset($_POST['HoldAccount']) && $_POST['HoldAccount'] != 0) { display_warning(_("This customer account is on hold.")); } $display_discount_percent = percent_format($_POST['pymt_discount'] * 100) . "%"; table_section(2); if (!list_updated('bank_account')) { $_POST['bank_account'] = get_default_customer_bank_account($_POST['customer_id']); } //Chaitanya : 13-OCT-2011 - Is AJAX call really needed ??? //bank_accounts_list_row(_("Into Bank Account:"), 'bank_account', null, true); bank_accounts_list_row(_("Into Bank Account:"), 'bank_account', null, false); text_row(_("Reference:"), 'ref', null, 20, 40); table_section(3); date_row(_("Date of Deposit:"), 'DateBanked', '', true, 0, 0, 0, null, true); $comp_currency = get_company_currency(); $cust_currency = get_customer_currency($_POST['customer_id']); $bank_currency = get_bank_account_currency($_POST['bank_account']);
<?php require_once '../lib/flip.php'; session_start(); check_valid_user(); if (!isset($_GET['org_id'])) { display_warning('Musisz wybraæ organizacjê!'); exit; } if (!is_responsible($_SESSION['valid_user_id'], $_GET['org_id']) && !is_admin()) { display_warning('Nie mo¿esz zmieniaæ danych tej organizacji!'); exit; } display_html_header(); display_document_header(); display_menu(); echo '<table width="90%">' . "\n"; echo '<tr><td align="center" class="naglowek">Uzupe³nij dane o organizacji <i>' . htmlspecialchars(get_org_name($_GET['org_id'])) . "</i><hr></td></tr>\n"; echo '<tr><td><table align="center">'; echo '<form method="POST" action="add_org_info.php">' . "\n"; echo '<input type="hidden" name="org_id" value="' . $_GET['org_id'] . '">' . "\n"; if (isset($_GET['project_id'])) { echo '<input type="hidden" name="project_id" value="' . $_GET['project_id'] . '">' . "\n"; } $org_info = get_org_info($_GET['org_id']); $defaults = array(); $defaults['name'] = get_org_name($_GET['org_id']); if ($org_info === false) { $defaults['street'] = 'ul. '; $defaults['city'] = '£ód¼'; $defaults['phone'] = '+4842 ';
display_warning('¬le wype³niony formularz!'); exit; } $condition = array(); $select_flag = 0; if ($_GET['in_questions'] == 'on') { $select_flag += 1; $condition['in_questions'] = "question like '%" . $_GET['search'] . "%'"; } if ($_GET['in_answers'] == 'on') { $select_flag += 2; $condition['in_answers'] = "answer like '%" . $_GET['search'] . "%'"; } switch ($select_flag) { case 0: display_warning('Wybierz elementy do wyszukiwania!'); exit; case 1: $final_condition = $condition['in_questions']; break; case 2: $final_condition = $condition['in_answers']; break; case 3: $final_condition = $condition['in_questions'] . ' or ' . $condition['in_answers']; break; } display_html_header(); display_document_header(); display_menu(); echo '<table width="90%">' . "\n";
$sal_list = array(); $sal_list = get_current_month_payslip($_POST['year'], $_POST['month']); start_table(TABLESTYLE, "width=90%"); $th = array(_("Month"), _("Employee Name"), _("Gross Pay"), _("Basic"), _("D A"), _("HRA"), _("Conveyance Allowance"), _("Edu & Other Allowance"), _("LOP Amount"), _("PF "), _("Total Deduction"), _("Net Salary")); table_header($th); global $hrm_months_list; foreach ($sal_list as $single_sal) { start_row(); label_cell($hrm_months_list[$single_sal['month']]); label_cell(kv_get_empl_name($single_sal['empl_id'])); label_cell(kv_get_empl_grosspay($single_sal['empl_id'])); label_cell($single_sal['basic']); label_cell($single_sal['da']); label_cell($single_sal['hra']); label_cell($single_sal['convey_allow']); label_cell($single_sal['edu_other_allow']); label_cell($single_sal['lop_amount']); label_cell($single_sal['pf']); label_cell($single_sal['total_ded']); //label_cell($single_sal['adv_sal']); label_cell($single_sal['total_net']); end_row(); } unset($sal_list); end_table(1); div_end(); } else { display_warning(_(" Sorry, no Pay data's in your system.")); } end_form(); end_page();