本文整理汇总了PHP中JB_mysql_query函数的典型用法代码示例。如果您正苦于以下问题:PHP JB_mysql_query函数的具体用法?PHP JB_mysql_query怎么用?PHP JB_mysql_query使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了JB_mysql_query函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_stats
function show_stats()
{
// this is a function called back from the hook, initialized on the StatsBox() constructor
global $label;
$sql = "SELECT * FROM jb_variables WHERE `key`='POST_COUNT_AP' or `key`='EMPLOYER_COUNT' or `key`='USER_COUNT' ";
$result = JB_mysql_query($sql) or die(mysql_error());
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
if ($row['key'] == 'POST_COUNT_AP') {
$jobs = $row['val'];
} elseif ($row['key'] == 'EMPLOYER_COUNT') {
$emp = $row['val'];
} elseif ($row['key'] == 'USER_COUNT') {
$seek = $row['val'];
}
}
// you can call any of the functions defined by the job board:
//echo "<p >";
if ($this->config['frame_border'] == 'YES') {
JB_render_box_top($width = "98%", $label['StatsBox_heading'], $body_bg_color = '#ffffff');
}
$label['StatsBox_jobs'] = str_replace('%COUNT%', $jobs, $label['StatsBox_jobs']);
$label['StatsBox_seekers'] = str_replace('%COUNT%', $seek, $label['StatsBox_seekers']);
$label['StatsBox_emp'] = str_replace('%COUNT%', $emp, $label['StatsBox_emp']);
echo $label['StatsBox_jobs'] . "<br>";
echo $label['StatsBox_seekers'] . "<br>";
echo $label['StatsBox_emp'] . "<br>";
if ($this->config['frame_border'] == 'YES') {
JB_render_box_bottom();
}
//echo "</p>";
}
示例2: JB_load_sitemap_data
function JB_load_sitemap_data()
{
$data = array();
$sql = "SELECT val FROM jb_variables where `key`='SMAP_MAIN_PRIORITY' ";
$result = JB_mysql_query($sql);
$row = mysql_fetch_row($result);
$data['main_priority'] = $row[0];
if ($data['main_priority'] == '') {
$data['main_priority'] = '0.5';
}
$sql = "SELECT val FROM jb_variables where `key`='SMAP_JOBS_PRIORITY' ";
$result = JB_mysql_query($sql);
$row = mysql_fetch_row($result);
$data['jobs_priority'] = $row[0];
if ($data['jobs_priority'] == '') {
$data['jobs_priority'] = '0.5';
}
$sql = "SELECT val FROM jb_variables where `key`='SMAP_JOBS_MAX' ";
$result = JB_mysql_query($sql);
$row = mysql_fetch_row($result);
$data['jobs_max'] = $row[0];
if ($data['jobs_max'] == '') {
$data['jobs_max'] = '10000';
}
$sql = "SELECT val FROM jb_variables where `key`='SMAP_EMP_PRIORITY' ";
$result = JB_mysql_query($sql);
$row = mysql_fetch_row($result);
$data['emp_priority'] = $row[0];
if ($data['emp_priority'] == '') {
$data['emp_priority'] = '0.5';
}
$sql = "SELECT val FROM jb_variables where `key`='SMAP_CAT_PRIORITY' ";
$result = JB_mysql_query($sql);
$row = mysql_fetch_row($result);
$data['cat_priority'] = $row[0];
if ($data['cat_priority'] == '') {
$data['cat_priority'] = '0.5';
}
$sql = "SELECT * FROM sitemaps_urls ";
$result = JB_mysql_query($sql);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$data['extra_urls'] = $data['extra_urls'] . $row['url'] . ' ' . $row['priority'] . ' ' . $row['changefreq'] . "\n";
}
return $data;
}
示例3: JB_load_motd
function JB_load_motd($type)
{
if ($type != 'E' && $type != 'U') {
return false;
}
$data = array();
$sql = "SELECT * FROM `motd` where `motd_type` = '" . jb_escape_sql($type) . "' AND `motd_lang`='" . jb_escape_sql($_SESSION['LANG']) . "' ";
$result = @JB_mysql_query($sql) or $DB_ERROR = mysql_error();
$row = @mysql_fetch_array($result, MYSQL_ASSOC);
$data['title'] = $row['motd_title'];
$data['message'] = $row['motd_message'];
$data['updated'] = $row['motd_date_updated'];
$sql = "SELECT * FROM `jb_variables` where `key` = 'MOTD_" . jb_escape_sql($type) . "_DISPLAY' ";
$result = @JB_mysql_query($sql) or $DB_ERROR = mysql_error();
$row = @mysql_fetch_array($result, MYSQL_ASSOC);
$data['display'] = $row['val'];
return $data;
}
示例4: membership_plan_list
function membership_plan_list()
{
global $label;
$PLM =& JB_get_ListMarkupObject('JBProductListMarkup');
// get the sublass of JBListMarkup.php, defined in that template file
$PLM->list_heading($label['emp_member_header']);
$PLM->list_sub_heading($label['emp_member_sub_head']);
$PLM->set_colspan(3);
$PLM->open_form('form1', 'order.php?action=membership');
$PLM->list_start('membership_plans', 'order_table');
$PLM->list_head_open();
$PLM->list_head_cell_open();
echo $label['emp_member_option'];
$PLM->list_head_cell_close();
$PLM->list_head_cell_open();
echo $label['emp_member_price'];
$PLM->list_head_cell_close();
$PLM->list_head_cell_open();
echo $label['emp_member_descr'];
$PLM->list_head_cell_close();
$PLM->list_head_close();
$PLM->list_head_close();
// employer memberships..
$sql = "SELECT * from memberships WHERE type='E' order by price ASC, name ";
$result = JB_mysql_query($sql);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$PLM->set_values($row);
$PLM->list_item_open();
$PLM->list_cell_open('nowrap');
$PLM->product_selection('membership_id', $row['membership_id'], $row['name']);
$PLM->list_cell_close();
$PLM->list_cell_open('nowrap');
$PLM->data_cell('price');
$PLM->list_cell_close();
$PLM->list_cell_open('fullwidth');
$PLM->product_label($row['membership_id']);
$PLM->list_cell_close();
$PLM->list_item_close();
}
$PLM->list_end();
$PLM->place_order_button($label['emp_member_placeorder']);
$PLM->close_form();
}
示例5: list_code_groups
function list_code_groups($form_id)
{
$form_id = (int) $form_id;
$sql = "select * FROM `form_fields` WHERE form_id='{$form_id}' AND (field_type='CHECK' OR field_type='RADIO' OR field_type='SELECT' OR field_type='MSELECT' ) ";
$result = JB_mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($result) == 0) {
echo " (0 codes)";
}
echo "<ul>";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
?>
<li><a href="" onclick="window.open('maintain_codes.php?field_id=<?php
echo $row['field_id'];
?>
', '', 'toolbar=no,scrollbars=yes,location=no,statusbar=no,menubar=no,resizable=1,width=400,height=500,left = 150,top = 150');return false;" ><?php
echo $row['field_label'];
?>
</a>
<?php
}
echo "</ul>";
}
示例6: JB_load_help
function JB_load_help($type)
{
if ($type != 'E' && $type != 'U') {
return false;
}
$data = array();
$sql = "SELECT * FROM `help_pages` where `help_type` = '{$type}' AND `help_lang`='" . jb_escape_sql($_SESSION['LANG']) . "' ";
$result = @JB_mysql_query($sql) or $DB_ERROR = mysql_error();
$row = @mysql_fetch_array($result, MYSQL_ASSOC);
$data['title'] = $row['help_title'];
$data['message'] = $row['help_message'];
$data['updated'] = $row['help_date_updated'];
/*$sql = "SELECT * FROM `jb_variables` where `key` = 'HELP_$type"."_DISPLAY' ";
$result = @JB_mysql_query($sql) or $DB_ERROR = mysql_error();
$row = @mysql_fetch_array($result, MYSQL_ASSOC);
$data['display']=$row['val'];
*/
if ($data['message'] == '') {
$data['message'] = jb_extract_old_help_file($type);
global $label;
$data['title'] = $label['c_help_heading'];
}
return $data;
}
示例7: disable
function disable()
{
$sql = "UPDATE jb_config set val='N' where `key`='_2CO_ENABLED' ";
$result = JB_mysql_query($sql) or die(mysql_error() . $sql);
}
示例8: JB_load_post_data
}
$data = JB_load_post_data($post_id);
if ($_SESSION['JB_ID'] != '' && $_SESSION['JB_Domain'] == 'CANDIDATE' || JB_ONLINE_APP_SIGN_IN != 'YES') {
$sql = "SELECT app_id FROM applications WHERE post_id='" . jb_escape_sql($post_id) . "' AND user_id='" . jb_escape_sql($_SESSION['JB_ID']) . "' ";
$result = JB_mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($result, MYSQL_ASSOC);
if ($row['app_id'] != '') {
echo $label["app_already_applied"] . "<br>";
} else {
// increment the application count
$sql = "UPDATE `posts_table` SET `applications`=`applications`+1 WHERE `post_id`='" . jb_escape_sql($post_id) . "' ";
JB_mysql_query($sql) or die(mysql_error());
}
// load the users' resume (if one exists)
$sql = "SELECT resume_id FROM resumes_table WHERE user_id='" . jb_escape_sql($_SESSION['JB_ID']) . "'";
$resume_result = JB_mysql_query($sql) or die(mysql_error());
$resume_row = mysql_fetch_array($resume_result, MYSQL_ASSOC);
if ($resume_row['resume_id'] != '') {
require_once dirname(__FILE__) . "/include/resumes.inc.php";
$resume_data = JB_load_resume_data($resume_row['resume_id']);
}
if ($data['post_mode'] != 'premium') {
// standard post?
if (JB_ONLINE_APP_REVEAL_STD == 'YES' && $resume_data['anon'] == 'Y') {
// reveal candidate's resume, even if hidden?
JB_grant_request($resume_data['user_id'], $data['user_id']);
}
} elseif ($data['post_mode'] == 'premium') {
// premium posts?
if (JB_ONLINE_APP_REVEAL_PREMIUM == 'YES' && $resume_data['anon'] == 'Y') {
// reveal candidate's resume, even if hidden?
示例9: JB_set_employer_session
function JB_set_employer_session(&$emp_row)
{
$_SESSION['JB_ID'] = $emp_row['ID'];
$_SESSION['JB_FirstName'] = $emp_row['FirstName'];
$_SESSION['JB_LastName'] = $emp_row['LastName'];
$_SESSION['JB_Username'] = $emp_row['Username'];
$_SESSION['Rank'] = $emp_row['Rank'];
$_SESSION['JB_Domain'] = "EMPLOYER";
$_SESSION['JB_Base'] = JB_BASE_HTTP_PATH;
if ($row['lang'] != '') {
$_SESSION['LANG'] = $emp_row['lang'];
}
$now = gmdate("Y-m-d H:i:s");
$sql = "UPDATE `employers` SET `login_date`='{$now}', `last_request_time`='{$now}', `logout_date`=0, `login_count`=`login_count`+1 WHERE `Username`='" . jb_escape_sql(addslashes($emp_row['Username'])) . "' ";
JB_mysql_query($sql) or die(mysql_error());
}
示例10: JB_expire_post
function JB_expire_post($post_id)
{
$post_id = (int) $post_id;
$sql = "UPDATE posts_table SET expired='Y' where post_id='" . jb_escape_sql($post_id) . "' ";
JB_mysql_query($sql) or $DB_ERROR = mysql_error();
JBPLUG_do_callback('expire_post', $post_id);
// col val is post_id
if (JB_EMAIL_POST_EXP_SWITCH == 'YES') {
// Send Expiration email
$Form = JB_get_DynamicFormObject(1);
$Form->load($post_id);
$TITLE = $Form->get_raw_template_value("TITLE");
$DATE = JB_get_formatted_date($Form->get_template_value("DATE"));
$POSTED_BY_ID = $Form->get_value('user_id');
// get the employer
$sql = "SELECT * FROM employers WHERE ID='" . jb_escape_sql($POSTED_BY_ID) . "' ";
$emp_result = jb_mysql_query($sql);
$emp_row = mysql_fetch_array($emp_result);
// get the email template
$template_result = JB_get_email_template(210, $emp_row['lang']);
$t_row = mysql_fetch_array($template_result);
$to_address = $emp_row['Email'];
$to_name = JB_get_formatted_name($emp_row['FirstName'], $emp_row['LastName']);
$subject = $t_row['EmailSubject'];
$message = $t_row['EmailText'];
$from_name = $t_row['EmailFromName'];
$from_address = $t_row['EmailFromAddress'];
$message = str_replace("%LNAME%", $emp_row['LastName'], $message);
$message = str_replace("%FNAME%", $emp_row['FirstName'], $message);
$message = str_replace("%SITE_NAME%", JB_SITE_NAME, $message);
$message = str_replace("%SITE_URL%", JB_BASE_HTTP_PATH, $message);
$message = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $message);
$message = str_replace("%POST_TITLE%", $TITLE, $message);
$message = str_replace("%POST_DATE%", $DATE, $message);
$message = str_replace("%VIEWS%", $Form->get_value('hits'), $message);
$message = str_replace("%APPS%", $Form->get_value('applications'), $message);
$message = strip_tags($message);
// plugin can change the recipient
JBPLUG_do_callback('expire_post_set_recipient_email', $to_address);
JBPLUG_do_callback('expire_post_set_recipient_name', $to_name);
// Place the email on the queue!
JB_queue_mail($to_address, $to_name, $from_address, $from_name, $subject, $message, '', 210);
}
}
示例11: JB_is_valid_code
function JB_is_valid_code($field_id, $code)
{
$sql = "SELECT `code` FROM `codes` WHERE field_id='" . jb_escape_sql($field_id) . "' AND code='" . jb_escape_sql($code) . "' ";
$result = JB_mysql_query($sql) or die($sql . mysql_error());
if (mysql_num_rows($result) > 0) {
return true;
} else {
return false;
}
}
示例12: htmlentities
echo htmlentities($_SERVER['PHP_SELF']);
?>
?action=send&letter_id=<?php
echo $row['letter_id'];
?>
'">
<?php
}
// end if action
if ($action == "edit" || $action == "new" && $unsent_newsletters == 0) {
if ($action == 'edit') {
echo "Note: Editing a mailing list will not reset the recipient list.";
}
if ($_REQUEST['letter_id'] != '') {
$sql = "SELECT * from `newsletters` WHERE `letter_id`='" . jb_escape_sql($_REQUEST['letter_id']) . "' ";
$result = JB_mysql_query($sql) or die($sql . mysql_error());
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$to = $row['to'];
$message = $row['message'];
$subject = $row['subject'];
} else {
$subject = stripslashes($subject);
$message = stripslashes($message);
}
?>
<h2>Newsletter Editor</h2>
<form method="post" action="<?php
echo htmlentities($_SERVER['PHP_SELF']);
?>
?action=save">
示例13: JB_is_privileged_user
function JB_is_privileged_user($employer_id, $type)
{
$row = false;
if (JB_SUBSCRIPTION_FEE_ENABLED == 'YES') {
// check subscription quotas
$row = jb_get_active_subscription_invoice($employer_id);
// This user is subscribed
// Therefore cannot be privileged... return false
if ($row) {
return false;
}
}
$sql = "SELECT * FROM `employers` WHERE ID='" . jb_escape_sql($employer_id) . "'";
$result = JB_mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($result, MYSQL_ASSOC);
if ($type == 'resume') {
if ($row['subscription_can_view_resume'] == 'Y') {
// subscribed to view resumes posts
$PRIVILEGED = true;
}
} elseif ($type == 'premium') {
// premium
if ($row['subscription_can_premium_post'] == 'Y') {
// subscribed to view resumes posts
$PRIVILEGED = true;
}
} elseif (JB_POSTING_FEE_ENABLED == 'YES') {
// standard posts
if ($row['subscription_can_post'] == 'Y') {
// subscribed to view resumes posts
$PRIVILEGED = true;
}
}
return $PRIVILEGED;
}
示例14: JB_match_category_id_from_name
function JB_match_category_id_from_name($name, $form_id = 1, $lang = '')
{
if (!$lang) {
$lang = JB_get_default_lang();
}
$sql = "SELECT t1.category_id as CID FROM `categories` as t1, `cat_name_translations` as t2 WHERE t1.category_id=t2.category_id AND `t2`.`category_name` = '" . jb_escape_sql($name) . "' AND form_id='" . jb_escape_sql($form_id) . "' AND lang='" . jb_escape_sql($lang) . "' ";
$result = JB_mysql_query($sql) or die($sql . mysql_error());
if ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
return $row['CID'];
} else {
return false;
}
}
示例15: JB_merge_language_files
function JB_merge_language_files($force_update = false)
{
if (JB_DEMO_MODE == 'YES') {
return;
}
global $label;
// load in the main english_default labels
$source_label = array();
include_once jb_get_english_default_dir() . 'english_default.php';
// the master lang/english_default
$source_label = array_merge($source_label, $label);
// default english labels
unset($label);
$label = array();
$last_mtime = filemtime(jb_get_english_default_dir() . 'english_default.php');
// load the english_default.php labels for all themes
//
global $JB_LANG_THEMES;
$themes = $JB_LANG_THEMES;
if (isset($_REQUEST['jb_theme'])) {
// Admin->Main Config, Admin-> Languagess
if (isset($_REQUEST['lang_code'])) {
$lang = $_REQUEST['lang_code'];
// comes from Admin->Languages
} else {
$lang = $_SESSION['LANG'];
}
$themes[$lang] = $_REQUEST['jb_theme'];
}
$themes = array_unique($themes);
// get the english_default.php for each theme
foreach ($themes as $key => $theme) {
$theme_path = JB_get_theme_dir() . $theme . '/';
if (file_exists($theme_path . 'lang/english_default.php')) {
include $theme_path . 'lang/english_default.php';
$source_label = array_merge($source_label, $label);
// default english labels
unset($label);
$label = array();
$m_time = filemtime($theme_path . "lang/english_default.php");
if ($m_time > $last_mtime) {
$last_mtime = $m_time;
}
}
}
if ($force_update) {
$last_mtime = time();
}
// Now we should have all the source labels in $source_label and
// last modification time in $last_mtime
// Grab all the languages installed
$sql = "SELECT * FROM lang ";
$result = JB_mysql_query($sql) or die(mysql_error());
// Now merge the english_default.php strings with the language files
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
// now that we have all the source labels, we can merge them with
// the langauge file. Any key that is present in the source, but
// not present
if (is_writable(jB_get_lang_dir() . $row['lang_filename'])) {
if ($last_mtime > filemtime(jB_get_lang_dir() . $row['lang_filename'])) {
echo "Merging language strings for " . jb_escape_html($row['lang_filename']) . ".. <br>";
// Now merge the english defaults with the langauge file
include jB_get_lang_dir() . $row['lang_filename'];
// customized labels
$dest_label = array_merge($source_label, $label);
$label = null;
// write out the new file:
$out = "<?php\n";
$out .= "///////////////////////////////////////////////////////////////////////////\n";
$out .= "// IMPORTANT NOTICE\n";
$out .= "///////////////////////////////////////////////////////////////////////////\n";
$out .= "// This file was generated by a script!\n";
$out .= "// (JB_merge_language_files() function)\n";
$out .= "// Please do not edit the language files by hand\n";
$out .= "// - please always use the Language Translation / Editing tool found\n";
$out .= "// in Admin->Languages\n";
$out .= "// To add a new phrase for the \$label, please edit english_default.php, and\n";
$out .= "// then vist Admin->Main Summary where the language files will be\n";
$out .= "// automatically merged with this file.\n";
$out .= "///////////////////////////////////////////////////////////////////////////\n";
foreach ($dest_label as $key => $val) {
$val = str_replace("'", "\\'", $val);
$out .= "\$label['{$key}']='" . JB_clean_str($val) . "'; \n";
}
$out .= "?>\n";
$handler = fopen(jB_get_lang_dir() . $row['lang_filename'], "w");
fputs($handler, $out);
fclose($handler);
}
} else {
echo "<font color='red'><b>- " . jB_get_lang_dir() . $row['lang_filename'] . " file is not writable. Give write permissions (" . decoct(JB_NEW_FILE_CHMOD) . ") to " . jB_get_lang_dir() . $row['lang_filename'] . " file and then disable & re-enable this plugin</b></font><br>";
}
}
if ($out) {
echo " Done.<br>";
}
}