本文整理汇总了PHP中error_message函数的典型用法代码示例。如果您正苦于以下问题:PHP error_message函数的具体用法?PHP error_message怎么用?PHP error_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了error_message函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: show_results
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0)
{
global $nb_per_page;
global $base_url;
global $caller;
global $callback;
global $msg;
global $charset;
global $no_display;
// on récupére le nombre de lignes qui vont bien
if (!$id) {
if ($user_input == "") {
$requete = "SELECT COUNT(1) FROM publishers where ed_id!='{$no_display}'";
} else {
$aq = new analyse_query(stripslashes($user_input));
if ($aq->error) {
error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message));
exit;
}
$requete = $aq->get_query_count("publishers", "ed_name", "index_publisher", "ed_id", "ed_id!='{$no_display}'");
}
$res = mysql_query($requete, $dbh);
$nbr_lignes = @mysql_result($res, 0, 0);
} else {
$nbr_lignes = 1;
}
if (!$page) {
$page = 1;
}
$debut = ($page - 1) * $nb_per_page;
if ($nbr_lignes) {
// on construit la vraie requête
if (!$id) {
if ($user_input == "") {
$requete = "SELECT * FROM publishers where ed_id!='{$no_display}' ORDER BY index_publisher LIMIT {$debut},{$nb_per_page} ";
} else {
$members = $aq->get_query_members("publishers", "ed_name", "index_publisher", "ed_id");
$requete = "select *," . $members["select"] . " as pert from publishers where " . $members["where"] . " and ed_id!='{$no_display}' group by ed_id order by pert desc,index_publisher limit {$debut},{$nb_per_page}";
}
} else {
$requete = "select * from publishers where ed_id='" . $id . "'";
}
$res = @mysql_query($requete, $dbh);
while ($ed = mysql_fetch_object($res)) {
$editeur = new editeur($ed->ed_id);
print pmb_bidi("\n \t\t\t\t<a href='#' onclick=\"set_parent('{$caller}', '{$ed->ed_id}', '" . htmlentities(addslashes($editeur->display), ENT_QUOTES, $charset) . "','{$callback}')\">" . htmlentities($editeur->display, ENT_QUOTES, $charset) . "</a><br />");
}
mysql_free_result($res);
// constitution des liens
$nbepages = ceil($nbr_lignes / $nb_per_page);
$suivante = $page + 1;
$precedente = $page - 1;
// affichage pagination
print "<div class='row'> <hr /></div><div align='center'>";
$url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input));
$nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true);
print $nav_bar;
print "</div>";
}
}
开发者ID:bouchra012,项目名称:PMB,代码行数:60,代码来源:editeur.inc.php
示例2: github
public function github()
{
//this function needs to be called wherever your redirect_uri goes to
$is_authorized = $this->github->authorize();
//Login failed!
if (!$is_authorized) {
$this->session->set_flashdata('message', error_message($this->github->get_error()));
redirect(base_url(), 'location');
} else {
//show how to get access token from session here
$github_user = $this->github->user();
$user = array('github_id' => $github_user->id, 'name' => $github_user->name, 'email' => $github_user->email, 'login' => $github_user->login, 'type' => $github_user->type, 'company' => $github_user->company, 'avatar_url' => $github_user->avatar_url, 'hireable' => $github_user->hireable, 'blog' => $github_user->blog, 'bio' => $github_user->bio, 'gravatar_id' => $github_user->gravatar_id, 'location' => $github_user->location, 'access_token' => $this->github->get_access_token());
// Checks to see if the user exists already
// $this->load->model('users_model');
// $db_user = $this->users_model->get_user_by('github_id', $github_user->id);
// If User exists update otherwise create a new record
// if ($db_user)
// {
// $this->users_model->update($db_user->id, $user);
// }
// else
// {
// $this->users_model->create($user);
// }
// For the purpose of example, we store everything in the session instead of the database
$this->session->set_userdata($user);
$this->session->set_flashdata('message', 'Boom! You\'re logged in! Welcome.');
redirect('secure', 'location');
}
}
开发者ID:jahanzaibbahadur,项目名称:Github-API-Library-For-CodeIgniter,代码行数:30,代码来源:authorize.php
示例3: get_XML_file
/**
* Get XML file object from hashed project file name
* @param $fileHash: md5 hashed project name
* $projectFile: project file name ( empty var passed by reference )
* @return XML project file object
*/
function get_XML_file($fileHash, &$projectFile)
{
try {
$projects = scandir("../projects");
$projects = array_diff($projects, array('.', '..'));
$userProject = $fileHash;
$projectFile = null;
foreach ($projects as $project) {
if ($userProject == md5($project)) {
$projectFile = $project;
break;
}
}
if (!$projectFile) {
throw new RuntimeException('Project file not found.');
}
// validate simpleXML extension enabled
if (!function_exists(simpleXML_load_file)) {
throw new RuntimeException('Please, enable simplexml extention in your php.ini configuration file.');
}
// validate that the file is not corrupted
@($xmlFile = simpleXML_load_file("../projects/{$projectFile}"));
if (!$xmlFile) {
throw new RuntimeException('Invalid axp file.');
}
return $xmlFile;
} catch (RuntimeException $e) {
echo "<br>" . error_message($e->getMessage());
exit;
}
}
开发者ID:TokaMElTorkey,项目名称:northwind,代码行数:37,代码来源:plugins-common.php
示例4: show_results
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0)
{
global $nb_per_page;
global $base_url;
global $caller;
global $msg;
global $no_display;
global $charset;
// on récupére le nombre de lignes qui vont bien
if ($user_input == "") {
$requete = "SELECT COUNT(1) FROM notices where notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1' ";
} else {
$aq = new analyse_query(stripslashes($user_input));
if ($aq->error) {
error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message));
exit;
}
$members = $aq->get_query_members("notices", "index_wew", "index_sew", "notice_id");
$requete = "select count(notice_id) from notices where (" . $members["where"] . " or code like '" . stripslashes($user_input) . "') and notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1'";
}
$res = pmb_mysql_query($requete, $dbh);
$nbr_lignes = @pmb_mysql_result($res, 0, 0);
if (!$page) {
$page = 1;
}
$debut = ($page - 1) * $nb_per_page;
if ($nbr_lignes) {
// on lance la vraie requête
if ($user_input == "") {
$requete = "SELECT notice_id, tit1, code FROM notices where notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1' ORDER BY tit1, code LIMIT {$debut},{$nb_per_page} ";
} else {
$requete = "select notice_id, tit1, code, " . $members["select"] . " as pert from notices where (" . $members["where"] . " or code like '" . stripslashes($user_input) . "') and notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1' group by notice_id order by pert desc, index_serie, tnvol, index_sew, code limit {$debut},{$nb_per_page}";
}
$res = @pmb_mysql_query($requete, $dbh);
print "<table><tr>";
while ($notice = pmb_mysql_fetch_object($res)) {
$notice_entry = $notice->tit1 . " " . $notice->code;
print "\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<a href='#' onclick=\"set_parent('{$caller}', '{$notice->notice_id}', '" . htmlentities(addslashes($notice->tit1), ENT_QUOTES, $charset) . " ({$notice->code})')\">" . htmlentities($notice->tit1, ENT_QUOTES, $charset) . "</a></td>\n\t\t\t\t\t<td>{$notice->code}</td>";
print "</tr>";
}
print "</table>";
pmb_mysql_free_result($res);
// constitution des liens
$nbepages = ceil($nbr_lignes / $nb_per_page);
$suivante = $page + 1;
$precedente = $page - 1;
}
// affichage de la pagination
print "<div class='row'> <hr /></div><div align='center'>";
$url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input));
$nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true);
print $nav_bar;
print "</div>";
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:54,代码来源:perio.inc.php
示例5: open_file
function open_file($dir, $fileName)
{
if (!$fileName) {
error_message("Файл не выбран");
}
$dirW = iconv('UTF-8', 'CP1251', $dir);
$fileW = iconv('UTF-8', 'CP1251', $fileName);
if (!is_file("{$dirW}/{$fileW}")) {
error_message("Невозможно открыть файл {$fileName}");
}
return htmlspecialchars(file_get_contents("{$dirW}/{$fileW}"));
}
开发者ID:AleksandrAstapov,项目名称:Source_IT,代码行数:12,代码来源:si_homework_5_2.php
示例6: gettemplate
function gettemplate($template, $replace, $endung, $folder)
{
return;
if (file_exists($folder . "/" . $template . "." . $endung)) {
// Tag anpassen
$replace = add_tag($replace);
$templatecontent = strtr(implode("", file($folder . "/" . $template . "." . $endung)), $replace);
} else {
error_message("Template nicht gefunden: " . $folder . "/" . $template . "." . $endung);
}
return $templatecontent;
}
开发者ID:nchiapol,项目名称:ecamp,代码行数:12,代码来源:template.php
示例7: familyValues
function familyValues($arg)
{
$result = mysql_query("select familyvalues.description, toname,\n\t\tcharacterinfo.name \n\t\tfrom family, familyvalues, characterinfo \n\t\twhere family.name =\n\t\t'" . quote_smart($_REQUEST["name"]) . "' and \n\t\tfamily.description = familyvalues.id and\n\t\tcharacterinfo.name = family.toname", $arg) or error_message("Query failed : " . mysql_error());
printf("<B>Family Relations:</B><BR><UL>");
while ($myrow = mysql_fetch_array($result)) {
if ($myrow[2] == null) {
printf("<LI>%s of %s<BR>", $myrow[0], $myrow[1]);
} else {
printf("<LI>%s of <A\nHREF=\"/scripts/charactersheet.php?name=%s\">%s</A><BR>", $myrow[0], $myrow[1], $myrow[1]);
}
}
printf("</UL>");
}
开发者ID:nickicolem,项目名称:Land-of-Karchan,代码行数:13,代码来源:charactersheet.php
示例8: pageAccess
function pageAccess($roles, $allowed = array())
{
foreach ($allowed as $key => $val) {
if (in_array($val, $roles)) {
$access_allowed = 1;
}
}
if ($access_allowed != 1) {
$errors[] = "You do not have sufficient permissions to access this page";
echo error_message($errors);
exit;
}
}
开发者ID:jankichaudhari,项目名称:yii-site,代码行数:13,代码来源:secure.inc.php
示例9: get_data
public function get_data()
{
$ObjDb = new connect_db();
$ObjDb->db_connect();
$query = "SELECT site FROM {$this->site_tablename} WHERE user_id = '{$this->user_id}' GROUP BY site";
$result = mysql_query($query);
if (!$result) {
error_message(mysql_error());
}
for ($i = 0; $i < mysql_num_rows($result); $i++) {
$query_data = mysql_fetch_array($result);
$site = $query_data['site'];
//$SiteArray[] = iconv('windows-1251', 'utf-8', $site);
$SiteArray[] = $site;
}
if (count($SiteArray) != 0) {
$SiteArray = array_unique($SiteArray);
$temp = $SiteArray;
$SiteArray = array();
foreach ($temp as $value) {
$SiteArray[] = $value;
}
unset($temp);
}
//----------------------поиск сайтов с неуказаными запросами в таблице
if (count($SiteArray) != 0) {
foreach ($SiteArray as $site) {
//$site = iconv('utf-8', 'windows-1251', $site);
$query = "SELECT keyword FROM {$this->site_tablename} WHERE user_id = '{$this->user_id}' AND site = '{$site}'";
$result = mysql_query($query);
if (!$result) {
error_message(mysql_error());
}
for ($i = 0; $i < mysql_num_rows($result); $i++) {
$query_data = mysql_fetch_array($result);
$keyword = $query_data['keyword'];
if ($keyword == null) {
$keywordBool[] = 0;
break;
} else {
$keywordBool[] = 1;
$bool = 1;
break;
}
}
}
}
$data = array('sitearray' => $SiteArray, 'bool' => $bool, 'keywordbool' => $keywordBool, 'seacher' => $this->seacher);
$ObjDb->db_close();
return $data;
}
开发者ID:agalardo,项目名称:i-tim-local,代码行数:51,代码来源:model_services.php
示例10: update
public function update($id, $cpm_quota)
{
try {
$data = array("cpm_quota" => $cpm_quota, "update_user" => $this->session->userdata("username"));
$this->db->where("id", $id);
$query = $this->db->update("tbl_cpm", $data);
if (!$query) {
throw new Exception();
}
return true;
} catch (Exception $e) {
$errNo = $this->db->_error_number();
//$errMsg = $this->db->_error_message();
return error_message($errNo);
}
}
开发者ID:shinichi81,项目名称:ams,代码行数:16,代码来源:cpm_model.php
示例11: show_list_biblio
function show_list_biblio()
{
global $dbh;
global $msg;
global $charset;
//Récupération de l'utilisateur
$requete_user = "SELECT userid FROM users where username='" . SESSlogin . "' limit 1 ";
$res_user = pmb_mysql_query($requete_user, $dbh);
$row_user = pmb_mysql_fetch_row($res_user);
$user_userid = $row_user[0];
//Affichage de la liste des etablissements auxquels a acces l'utilisateur
$aff = "<table>";
$q = entites::list_biblio($user_userid);
$res = pmb_mysql_query($q, $dbh);
$nbr = pmb_mysql_num_rows($res);
if (!$nbr) {
//Pas d'etablissements définis pour l'utilisateur
$error = true;
$error_msg .= htmlentities($msg["acquisition_err_coord"], ENT_QUOTES, $charset) . "<div class='row'></div>";
}
if ($error) {
error_message($msg[321], $error_msg . htmlentities($msg["acquisition_err_par"], ENT_QUOTES, $charset), '1', './admin.php?categ=acquisition');
die;
}
if ($nbr == '1') {
$row = pmb_mysql_fetch_object($res);
show_list_exer($row->id_entite);
} else {
$parity = 1;
while ($row = pmb_mysql_fetch_object($res)) {
if ($parity % 2) {
$pair_impair = "even";
} else {
$pair_impair = "odd";
}
$parity += 1;
$tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" onmousedown=\"document.location='./admin.php?categ=acquisition&sub=compta&action=list&ent={$row->id_entite}';\" ";
$aff .= "<tr class='{$pair_impair}' {$tr_javascript} style='cursor: pointer'><td><i>{$row->raison_sociale}</i></td></tr>";
}
$aff .= "</table>";
print $aff;
}
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:43,代码来源:comptabilite.inc.php
示例12: getAccess
public function getAccess($level_id)
{
try {
$this->db->select("a.access_data, b.menu, b.create, b.read, b.update, b.delete, b.progress");
$this->db->from("tbl_level a");
$this->db->join("tbl_level_access b", "a.id = b.level_id");
$this->db->where("a.id", $level_id);
$this->db->where("a.active_status", "Y");
$query = $this->db->get();
if (!$query) {
throw new Exception();
}
$result = $query->result();
return $result;
} catch (Exception $e) {
$errNo = $this->db->_error_number();
//$errMsg = $this->db->_error_message();
return error_message($errNo);
}
}
开发者ID:shinichi81,项目名称:ams,代码行数:20,代码来源:login_model.php
示例13: update
public function update($username, $password, $name, $email)
{
try {
if ($password == "false") {
$data = array("name" => $name, "email" => $email, "update_user" => $this->session->userdata("username"));
} else {
$data = array("password" => md5($password), "name" => $name, "email" => $email, "update_user" => $this->session->userdata("username"));
}
$this->db->where("username", $username);
$query = $this->db->update("tbl_user", $data);
if (!$query) {
throw new Exception();
}
return true;
} catch (Exception $e) {
$errNo = $this->db->_error_number();
//$errMsg = $this->db->_error_message();
return error_message($errNo);
}
}
开发者ID:shinichi81,项目名称:ams,代码行数:20,代码来源:myaccount_model.php
示例14: Render
function Render()
{
global $Translation;
$eo['silentErrors'] = true;
$result = sql($this->Query . ' limit ' . datalist_auto_complete_size, $eo);
if ($eo['error'] != '') {
$this->HTML = error_message(htmlspecialchars($eo['error']) . "\n\n<!--\n{$Translation['query:']}\n {$this->Query}\n-->\n\n");
return;
}
$this->ItemCount = db_num_rows($result);
$combo = new Combo();
$combo->Class = $this->Class;
$combo->Style = $this->Style;
$combo->SelectName = $this->SelectName;
$combo->SelectedData = $this->SelectedData;
$combo->SelectedText = $this->SelectedText;
$combo->SelectedClass = 'SelectedOption';
$combo->ListType = $this->ListType;
$combo->ListBoxHeight = $this->ListBoxHeight;
$combo->RadiosPerLine = $this->RadiosPerLine;
$combo->AllowNull = $this->ListType == 2 ? 0 : $this->AllowNull;
while ($row = db_fetch_row($result)) {
$combo->ListData[] = htmlspecialchars($row[0], ENT_QUOTES, 'iso-8859-1');
$combo->ListItem[] = $row[1];
}
$combo->Render();
$this->MatchText = $combo->MatchText;
$this->SelectedText = $combo->SelectedText;
$this->SelectedData = $combo->SelectedData;
if ($this->ListType == 2) {
$rnd = rand(100, 999);
$SelectedID = htmlspecialchars(urlencode($this->SelectedData));
$pt_perm = getTablePermissions($this->parent_table);
if ($pt_perm['view'] || $pt_perm['edit']) {
$this->HTML = str_replace(">{$this->MatchText}</label>", ">{$this->MatchText}</label> <button type=\"button\" class=\"btn btn-default view_parent hspacer-lg\" id=\"{$this->parent_table}_view_parent\" title=" . htmlspecialchars($Translation['View']) . "><i class=\"glyphicon glyphicon-eye-open\"></i></button>", $combo->HTML);
}
$this->HTML = str_replace(' type="radio" ', ' type="radio" onclick="' . $this->SelectName . '_changed();" ', $this->HTML);
} else {
$this->HTML = $combo->HTML;
}
}
开发者ID:TokaMElTorkey,项目名称:northwind,代码行数:41,代码来源:data_combo.class.php
示例15: register
function register($username, $password, $confirm)
{
if (empty($username)) {
return error_message(E_REGISTER, E_NO_USERNAME);
}
if (empty($password)) {
return error_message(E_REGISTER, E_NO_PASSWORD);
}
if (empty($confirm)) {
return error_message(E_REGISTER, E_NO_CONFIRM);
}
if ($password !== $confirm) {
return error_message(E_REGISTER, 'Mismatch');
}
$user = look_up_key_value($username, USER_ACCOUNT_FILE);
if (!empty($user)) {
return error_message(E_REGISTER, E_ACCOUNT_EXISTS);
}
add_key_value($username, [$username, password_hash($password, PASSWORD_DEFAULT)], USER_ACCOUNT_FILE);
set_user($username);
return '';
}
开发者ID:nomad-mystic,项目名称:CIS195PHP,代码行数:22,代码来源:coal_login_functions.php
示例16: Render
function Render()
{
global $Translation;
$eo['silentErrors'] = true;
$result = sql($this->Query . ' limit ' . datalist_auto_complete_size, $eo);
if ($eo['error'] != '') {
$this->HTML = error_message(htmlspecialchars($eo['error']) . "\n\n<!--\n{$Translation['query:']}\n {$this->Query}\n-->\n\n");
return;
}
$this->ItemCount = db_num_rows($result);
$combo = new Combo();
$combo->Class = $this->Class;
$combo->Style = $this->Style;
$combo->SelectName = $this->SelectName;
$combo->SelectedData = $this->SelectedData;
$combo->SelectedText = $this->SelectedText;
$combo->SelectedClass = 'SelectedOption';
$combo->ListType = $this->ListType;
$combo->ListBoxHeight = $this->ListBoxHeight;
$combo->RadiosPerLine = $this->RadiosPerLine;
$combo->AllowNull = $this->ListType == 2 ? 0 : $this->AllowNull;
while ($row = db_fetch_row($result)) {
$combo->ListData[] = htmlspecialchars($row[0], ENT_QUOTES);
$combo->ListItem[] = $row[1];
}
$combo->Render();
$this->MatchText = $combo->MatchText;
$this->SelectedText = $combo->SelectedText;
$this->SelectedData = $combo->SelectedData;
if ($this->ListType == 2) {
$rnd = rand(100, 999);
$SelectedID = htmlspecialchars(urlencode($this->SelectedData));
$this->HTML = str_replace(">{$this->MatchText}</label>", ">{$this->MatchText}</label> <span id=\"{$this->parent_table}_plink{$rnd}\"><a href=\"{$this->parent_table}_view.php?SelectedID={$SelectedID}\" class=\"btn btn-default btn-sm\"><i class=\"glyphicon glyphicon-search\"></i></a></span>", $combo->HTML);
$this->HTML = str_replace(' type="radio" ', ' type="radio" onclick="' . $this->SelectName . '_changed();" ', $this->HTML);
} else {
$this->HTML = $combo->HTML;
}
}
开发者ID:vishwanathhsinhaa,项目名称:tieuthuong-org,代码行数:38,代码来源:data_combo.class.php
示例17: my_mail
function my_mail($mail_parts)
{
$mail_to = $mail_parts["mail_to"];
$mail_from = $mail_parts["mail_from"];
$mail_reply_to = $mail_parts["mail_reply_to"];
$mail_cc = $mail_parts["mail_cc"];
$mail_bcc = $mail_parts["mail_bcc"];
$mail_subject = $mail_parts["mail_subject"];
$mail_body = $mail_parts["mail_body"];
if (empty($mail_to)) {
error_message("Empty To field!");
}
if (empty($mail_subject)) {
error_message("Empty Subject field!");
}
if (empty($mail_body)) {
error_message("Empty Body!");
}
$mail_to = str_replace(";", ",", $mail_to);
$mail_headers = ' ';
if (!empty($mail_from)) {
$mail_headers .= "From: {$mail_from}\n";
}
if (!empty($mail_reply_to)) {
$mail_headers .= "Reply_to: {$mail_reply_to}\n";
}
if (!empty($mail_cc)) {
$mail_headers .= "Cc: " . str_replace(";", ",", $mail_cc) . "\n";
}
if (!empty($mail_bcc)) {
$mail_headers .= "Bcc: " . str_replace(";", ",", $mail_bcc) . "\n";
}
$mail_subject = stripslashes($mail_subject);
$mail_body = stripslashes($mail_body);
return mail($mail_to, $mail_subject, $mail_body);
}
开发者ID:HenryTaunt,项目名称:InTheFootstepsOf,代码行数:36,代码来源:mailer.php
示例18: mysql_query
case 'modif':
if ($id != "") {
$requete = "SELECT archempla_libelle FROM arch_emplacement WHERE archempla_id={$id} ";
$res = mysql_query($requete, $dbh);
if (mysql_num_rows($res)) {
$row = mysql_fetch_object($res);
emplacement_form($row->archempla_libelle, $id);
} else {
show_emplacement($dbh);
}
} else {
show_emplacement($dbh);
}
break;
case 'del':
if ($id != "") {
$total = 0;
$total = mysql_num_rows(mysql_query("select 1 from collections_state where collstate_emplacement='" . $id . "' limit 0,1", $dbh));
if ($total == 0) {
$requete = "DELETE FROM arch_emplacement WHERE archempla_id={$id} ";
$res = mysql_query($requete, $dbh);
show_emplacement($dbh);
} else {
error_message($msg[294], $msg["collstate_emplacement_used"], 1, 'admin.php?categ=collstate&sub=emplacement&action=');
}
}
break;
default:
show_emplacement($dbh);
break;
}
开发者ID:bouchra012,项目名称:PMB,代码行数:31,代码来源:emplacement.inc.php
示例19: customers_form
function customers_form($selected_id = '', $AllowUpdate = 1, $AllowInsert = 1, $AllowDelete = 1, $ShowCancel = 0)
{
// function to return an editable form for a table records
// and fill it with data of record whose ID is $selected_id. If $selected_id
// is empty, an empty form is shown, with only an 'Add New'
// button displayed.
global $Translation;
// mm: get table permissions
$arrPerm = getTablePermissions('customers');
if (!$arrPerm[1] && $selected_id == '') {
return '';
}
$AllowInsert = $arrPerm[1] ? true : false;
// print preview?
$dvprint = false;
if ($selected_id && $_REQUEST['dvprint_x'] != '') {
$dvprint = true;
}
// populate filterers, starting from children to grand-parents
// unique random identifier
$rnd1 = $dvprint ? rand(1000000, 9999999) : '';
// combobox: Country
$combo_Country = new Combo();
$combo_Country->ListType = 0;
$combo_Country->MultipleSeparator = ', ';
$combo_Country->ListBoxHeight = 10;
$combo_Country->RadiosPerLine = 1;
if (is_file(dirname(__FILE__) . '/hooks/customers.Country.csv')) {
$Country_data = addslashes(implode('', @file(dirname(__FILE__) . '/hooks/customers.Country.csv')));
$combo_Country->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($Country_data)));
$combo_Country->ListData = $combo_Country->ListItem;
} else {
$combo_Country->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions("Afghanistan;;Albania;;Algeria;;American Samoa;;Andorra;;Angola;;Anguilla;;Antarctica;;Antigua, Barbuda;;Argentina;;Armenia;;Aruba;;Australia;;Austria;;Azerbaijan;;Bahamas;;Bahrain;;Bangladesh;;Barbados;;Belarus;;Belgium;;Belize;;Benin;;Bermuda;;Bhutan;;Bolivia;;Bosnia, Herzegovina;;Botswana;;Bouvet Is.;;Brazil;;Brunei Darussalam;;Bulgaria;;Burkina Faso;;Burundi;;Cambodia;;Cameroon;;Canada;;Canary Is.;;Cape Verde;;Cayman Is.;;Central African Rep.;;Chad;;Channel Islands;;Chile;;China;;Christmas Is.;;Cocos Is.;;Colombia;;Comoros;;Congo, D.R. Of;;Congo;;Cook Is.;;Costa Rica;;Croatia;;Cuba;;Cyprus;;Czech Republic;;Denmark;;Djibouti;;Dominica;;Dominican Republic;;Ecuador;;Egypt;;El Salvador;;Equatorial Guinea;;Eritrea;;Estonia;;Ethiopia;;Falkland Is.;;Faroe Is.;;Fiji;;Finland;;France;;French Guiana;;French Polynesia;;French Territories;;Gabon;;Gambia;;Georgia;;Germany;;Ghana;;Gibraltar;;Greece;;Greenland;;Grenada;;Guadeloupe;;Guam;;Guatemala;;Guernsey;;Guinea-bissau;;Guinea;;Guyana;;Haiti;;Heard, Mcdonald Is.;;Honduras;;Hong Kong;;Hungary;;Iceland;;India;;Indonesia;;Iran;;Iraq;;Ireland;;Israel;;Italy;;Ivory Coast;;Jamaica;;Japan;;Jersey;;Jordan;;Kazakhstan;;Kenya;;Kiribati;;Korea, D.P.R Of;;Korea, Rep. Of;;Kuwait;;Kyrgyzstan;;Lao Peoples D.R.;;Latvia;;Lebanon;;Lesotho;;Liberia;;Libyan Arab Jamahiriya;;Liechtenstein;;Lithuania;;Luxembourg;;Macao;;Macedonia, F.Y.R Of;;Madagascar;;Malawi;;Malaysia;;Maldives;;Mali;;Malta;;Mariana Islands;;Marshall Islands;;Martinique;;Mauritania;;Mauritius;;Mayotte;;Mexico;;Micronesia;;Moldova;;Monaco;;Mongolia;;Montserrat;;Morocco;;Mozambique;;Myanmar;;Namibia;;Nauru;;Nepal;;Netherlands Antilles;;Netherlands;;New Caledonia;;New Zealand;;Nicaragua;;Niger;;Nigeria;;Niue;;Norfolk Island;;Norway;;Oman;;Pakistan;;Palau;;Palestinian Terr.;;Panama;;Papua New Guinea;;Paraguay;;Peru;;Philippines;;Pitcairn;;Poland;;Portugal;;Puerto Rico;;Qatar;;Reunion;;Romania;;Russian Federation;;Rwanda;;Samoa;;San Marino;;Sao Tome, Principe;;Saudi Arabia;;Senegal;;Seychelles;;Sierra Leone;;Singapore;;Slovakia;;Slovenia;;Solomon Is.;;Somalia;;South Africa;;South Georgia;;South Sandwich Is.;;Spain;;Sri Lanka;;St. Helena;;St. Kitts, Nevis;;St. Lucia;;St. Pierre, Miquelon;;St. Vincent, Grenadines;;Sudan;;Suriname;;Svalbard, Jan Mayen;;Swaziland;;Sweden;;Switzerland;;Syrian Arab Republic;;Taiwan;;Tajikistan;;Tanzania;;Thailand;;Timor-leste;;Togo;;Tokelau;;Tonga;;Trinidad, Tobago;;Tunisia;;Turkey;;Turkmenistan;;Turks, Caicoss;;Tuvalu;;Uganda;;Ukraine;;United Arab Emirates;;United Kingdom;;United States;;Uruguay;;Uzbekistan;;Vanuatu;;Vatican City;;Venezuela;;Viet Nam;;Virgin Is. British;;Virgin Is. U.S.;;Wallis, Futuna;;Western Sahara;;Yemen;;Yugoslavia;;Zambia;;Zimbabwe")));
$combo_Country->ListData = $combo_Country->ListItem;
}
$combo_Country->SelectName = 'Country';
if ($selected_id) {
// mm: check member permissions
if (!$arrPerm[2]) {
return "";
}
// mm: who is the owner?
$ownerGroupID = sqlValue("select groupID from membership_userrecords where tableName='customers' and pkValue='" . makeSafe($selected_id) . "'");
$ownerMemberID = sqlValue("select lcase(memberID) from membership_userrecords where tableName='customers' and pkValue='" . makeSafe($selected_id) . "'");
if ($arrPerm[2] == 1 && getLoggedMemberID() != $ownerMemberID) {
return "";
}
if ($arrPerm[2] == 2 && getLoggedGroupID() != $ownerGroupID) {
return "";
}
// can edit?
if ($arrPerm[3] == 1 && $ownerMemberID == getLoggedMemberID() || $arrPerm[3] == 2 && $ownerGroupID == getLoggedGroupID() || $arrPerm[3] == 3) {
$AllowUpdate = 1;
} else {
$AllowUpdate = 0;
}
$res = sql("select * from `customers` where `CustomerID`='" . makeSafe($selected_id) . "'", $eo);
if (!($row = db_fetch_array($res))) {
return error_message($Translation['No records found']);
}
$urow = $row;
/* unsanitized data */
$hc = new CI_Input();
$row = $hc->xss_clean($row);
/* sanitize data */
$combo_Country->SelectedData = $row['Country'];
} else {
$combo_Country->SelectedText = $_REQUEST['FilterField'][1] == '9' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "";
}
$combo_Country->Render();
// code for template based detail view forms
// open the detail view template
if ($dvprint) {
$templateCode = @file_get_contents('./templates/customers_templateDVP.html');
} else {
$templateCode = @file_get_contents('./templates/customers_templateDV.html');
}
// process form title
$templateCode = str_replace('<%%DETAIL_VIEW_TITLE%%>', 'Detail View', $templateCode);
$templateCode = str_replace('<%%RND1%%>', $rnd1, $templateCode);
$templateCode = str_replace('<%%EMBEDDED%%>', $_REQUEST['Embedded'] ? 'Embedded=1' : '', $templateCode);
// process buttons
if ($arrPerm[1] && !$selected_id) {
// allow insert and no record selected?
if (!$selected_id) {
$templateCode = str_replace('<%%INSERT_BUTTON%%>', '<button type="submit" class="btn btn-success" id="insert" name="insert_x" value="1" onclick="return customers_validateData();"><i class="glyphicon glyphicon-plus-sign"></i> ' . $Translation['Save New'] . '</button>', $templateCode);
}
$templateCode = str_replace('<%%INSERT_BUTTON%%>', '<button type="submit" class="btn btn-default" id="insert" name="insert_x" value="1" onclick="return customers_validateData();"><i class="glyphicon glyphicon-plus-sign"></i> ' . $Translation['Save As Copy'] . '</button>', $templateCode);
} else {
$templateCode = str_replace('<%%INSERT_BUTTON%%>', '', $templateCode);
}
// 'Back' button action
if ($_REQUEST['Embedded']) {
$backAction = 'window.parent.jQuery(\'.modal\').modal(\'hide\'); return false;';
} else {
$backAction = '$$(\'form\')[0].writeAttribute(\'novalidate\', \'novalidate\'); document.myform.reset(); return true;';
}
if ($selected_id) {
if (!$_REQUEST['Embedded']) {
$templateCode = str_replace('<%%DVPRINT_BUTTON%%>', '<button type="submit" class="btn btn-default" id="dvprint" name="dvprint_x" value="1" onclick="$$(\'form\')[0].writeAttribute(\'novalidate\', \'novalidate\'); document.myform.reset(); return true;"><i class="glyphicon glyphicon-print"></i> ' . $Translation['Print Preview'] . '</button>', $templateCode);
//.........这里部分代码省略.........
开发者ID:ahmedandroid1980,项目名称:appgini,代码行数:101,代码来源:customers_dml.php
示例20: die
if (!$res) {
die(mysql_error());
}
}
}
$guestbook = Guestbook::get_all_guestbooks();
?>
<?php
our_header("guestbook");
?>
<div class="column prepend-1 span-24 first last">
<h2>Guestbook</h2>
<?php
error_message();
?>
<h4>See what people are saying about us!</h4>
<?php
if ($guestbook) {
foreach ($guestbook as $guest) {
?>
<p class="comment"><?php
echo $guest["comment"];
?>
</p>
<p> - by <?php
echo h($guest["name"]);
?>
</p>
开发者ID:kostyll,项目名称:WackoPicko,代码行数:31,代码来源:guestbook.php
注:本文中的error_message函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论