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


PHP display_warning函数代码示例

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


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

示例1: try_add_user

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;
}
开发者ID:kmklr72,项目名称:lmms.io,代码行数:28,代码来源:register.php

示例2: handle_errors

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);
    }
}
开发者ID:nikhildixit,项目名称:Generatrix,代码行数:9,代码来源:startup.php

示例3: getdate

    // 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') . ': ';
开发者ID:exviva,项目名称:flip,代码行数:31,代码来源:add_contact_form.php

示例4: display_warning

}
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)]);
开发者ID:exviva,项目名称:flip,代码行数:30,代码来源:add_contact.php

示例5: session_start

<?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 . '!');
开发者ID:exviva,项目名称:flip,代码行数:23,代码来源:open_project.php

示例6: header

}
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();
}
开发者ID:exviva,项目名称:flip,代码行数:31,代码来源:add_users.php

示例7: start_table

    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']);
开发者ID:kvvaradha,项目名称:Simple-HRM-for-FrontAccounting,代码行数:31,代码来源:payslip.php

示例8: display_error

    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:"), $myrow['user_id']);
$_POST['password'] = "";
$_POST['passwordConfirm'] = "";
password_row(_("Password:"), 'password', $_POST['password']);
password_row(_("Repeat password:"), 'passwordConfirm', $_POST['passwordConfirm']);
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:31,代码来源:change_current_user_password.php

示例9: user_date_format

        $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());
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:31,代码来源:display_prefs.php

示例10: start_row

}
//$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();
?>

开发者ID:raqib,项目名称:ac_dev,代码行数:29,代码来源:gl_trial_balance.php

示例11: display_success

<?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>&nbsp;Delete</a>
		<a class="btn btn-warning" href="<?php 
        echo "{$LSP_URL}?action=show&file=" . GET('file');
开发者ID:kmklr72,项目名称:lmms.io,代码行数:31,代码来源:delete_file.php

示例12: session_start

<?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 '&nbsp;';
开发者ID:exviva,项目名称:flip,代码行数:31,代码来源:show_contact.php

示例13: session_start

<?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 . '!');
开发者ID:exviva,项目名称:flip,代码行数:23,代码来源:close_project.php

示例14: display_warning

    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."));
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:31,代码来源:items.php

示例15: display_error

<?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>&nbsp;Comment</button>&nbsp;
		<a href="<?php 
        echo $LSP_URL . '?action=show&file=' . GET('file');
        ?>
" class="btn btn-warning"></span><span class="fa fa-close"></span>&nbsp;Cancel</a>
		<?php 
        $form->close();
        echo '</div>';
开发者ID:kmklr72,项目名称:lmms.io,代码行数:31,代码来源:comment_file.php


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