本文整理汇总了PHP中jb_mysql_query函数的典型用法代码示例。如果您正苦于以下问题:PHP jb_mysql_query函数的具体用法?PHP jb_mysql_query怎么用?PHP jb_mysql_query使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了jb_mysql_query函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete_saved_resumes
function delete_saved_resumes($user_id, $resume_ids)
{
$user_id = (int) $user_id;
if (is_array($resume_ids) && sizeof($resume_ids) > 0) {
foreach ($resume_ids as $resume_id) {
$resume_id = (int) $resume_id;
$sql = "DELETE FROM `saved_resumes` WHERE resume_id='" . jb_escape_sql($resume_id) . "' AND user_id='" . jb_escape_sql($user_id) . "' ";
jb_mysql_query($sql);
}
return true;
}
return false;
}
示例2: correct_default_lang
function correct_default_lang()
{
$sql = "SELECT * FROM `lang` WHERE is_active='Y' AND is_default='Y' ";
$result = jb_mysql_query($sql);
if (mysql_num_rows($result) == 0) {
// nothing active and default?
// reset default
$sql = "UPDATE lang SET is_default='N' ";
JB_mysql_query($sql);
$sql = "SELECT * FROM `lang` WHERE is_active='Y' LIMIT 1 ";
$result = jb_mysql_query($sql);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$sql = "UPDATE lang set is_default='Y' where lang_code='" . jb_escape_sql($row['lang_code']) . "' ";
JB_mysql_query($sql);
}
}
示例3: jb_parse_csv
function jb_parse_csv($lines, $table_name = '')
{
//$delimiter = empty($options['delimiter']) ? "," : $options['delimiter'];
//$to_object = empty($options['to_object']) ? false : true;
$delimiter = ",";
$to_object = false;
$expr = "/,(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))/";
// added
$lines = explode("\n", $lines);
$cols = array_shift($lines);
$field_names = explode($delimiter, $cols);
foreach ($lines as $line) {
// Skip the empty line
if (empty($line)) {
continue;
}
$fields = preg_split($expr, trim($line));
// added
$fields = preg_replace("/^\"(.*)\"\$/", "\$1", $fields);
//added
//$fields = explode($delimiter, $line);
$_res = $to_object ? new stdClass() : array();
foreach ($field_names as $key => $f) {
$f = trim($f);
$key = trim($key);
if (preg_match('#^".+"$#', $fields[$key])) {
// if string is quoted
$fields[$key] = trim($fields[$key], '"');
}
$fields[$key] = str_replace('""', '"', $fields[$key]);
// escaped quotes
$_res[$f] = $fields[$key];
}
$res[] = $_res;
}
if ($table_name != '') {
// check that the columns correspond to the database
$sql = "SELECT {$cols} FROM {$table_name} limit 1 ";
$result = jb_mysql_query($sql) or $res = false;
}
return $res;
}
示例4: JB_seed_mod_rewrite_for_categories
function JB_seed_mod_rewrite_for_categories()
{
$sql = "SELECT * FROM `categories` WHERE `categories`.`form_id`=1 ";
$result = jb_mysql_query($sql);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
if (!trim($row['seo_fname'])) {
$fname = JB_utf8_to_html(urldecode(jb_format_url_string($row['category_name'])));
$i = 0;
$postfix = '';
$sql = "SELECT category_id FROM `categories` WHERE `seo_fname` = '" . jb_escape_sql($fname . $postfix . '.html') . "' ";
$result2 = jb_mysql_query($sql);
while (mysql_num_rows($result2) > 0) {
$i++;
$postfix = '-' . $i;
$sql = "SELECT category_id FROM `categories` WHERE `seo_fname` = '" . jb_escape_sql($fname . $postfix . '.html') . "' ";
$result2 = jb_mysql_query($sql);
}
$fname .= $postfix . '.html';
$sql = "update `categories` set `seo_fname`='" . jb_escape_sql($fname) . "' where category_id='" . $row['category_id'] . "' ";
jb_mysql_query($sql);
}
}
}
示例5: jb_escape_sql
// sort descending by default
}
if ($_REQUEST['order_by'] == '' || !JB_is_field_valid($_REQUEST['order_by'], 5)) {
// by default, order by the post_date
$order = " `SignupDate` ";
} else {
$order = " `" . jb_escape_sql($_REQUEST['order_by']) . "` ";
}
$_REQUEST['offset'] = (int) $_REQUEST['offset'];
if ($_REQUEST['offset'] < 0) {
$_REQUEST['offset'] = abs($_REQUEST['offset']);
}
$records_per_page = 20;
$sql = "select SQL_CALC_FOUND_ROWS * FROM `users` WHERE 1=1 " . $where_sql . " ORDER BY {$order} " . jb_escape_sql($ord) . " LIMIT " . jb_escape_sql($_REQUEST['offset']) . ", " . jb_escape_html($records_per_page) . "";
$result = JB_mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_row(jb_mysql_query("SELECT FOUND_ROWS()"));
$count = $row[0];
if ($_REQUEST['action'] == 'search') {
$q_string = JB_generate_candidate_q_string();
}
if ($count > 0) {
// calculate number of pages & current page
$pages = ceil($count / $records_per_page);
$cur_page = $_REQUEST['offset'] / $records_per_page;
$cur_page++;
?>
<center><b><?php
echo mysql_num_rows($result);
?>
Candidate's Accounts Returned (<?php
示例6: jb_get_variable
function jb_get_variable($var)
{
$sql = "SELECT * from jb_variables WHERE `key`='" . jb_escape_sql($var) . "' ";
$result = jb_mysql_query($sql);
if ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
return $row['val'];
}
}
示例7: JB_update_post_category_counters
function JB_update_post_category_counters($leaf_cat_id, $field_id, $search_set = '')
{
static $level;
$level++;
$row = jb_get_category($leaf_cat_id);
if (strlen(trim($search_set)) == 0) {
$sql = "SELECT search_set FROM categories WHERE category_id='" . jb_escape_sql($leaf_cat_id) . "' AND search_set != '' ";
$result = jb_mysql_query($sql);
if (mysql_num_rows($result) > 0) {
$search_set = array_pop(mysql_fetch_row($result));
}
}
if (strlen($search_set) > 0) {
$search_set .= ',' . $leaf_cat_id;
} else {
$search_set = $leaf_cat_id;
}
$search_set_sql = JB_get_optimized_search_set_query($search_set, $field_id);
$sql = "SELECT count(*) FROM posts_table WHERE approved='Y' AND expired='N' " . $search_set_sql . " ";
$result = JB_mysql_query($sql) or die(mysql_error() . $sql);
$row = mysql_fetch_row($result);
$count = $row[0];
$sql = "UPDATE categories SET obj_count='{$count}' WHERE category_id='" . jb_escape_sql($leaf_cat_id) . "' AND form_id=1 ";
JB_mysql_query($sql) or die(mysql_error() . $sql);
// go down the tree to the root
$sql = "SELECT category_id, parent_category_id, search_set FROM categories WHERE category_id='" . jb_escape_sql($leaf_cat_id) . "' ";
$result = JB_mysql_query($sql) or die(mysql_error() . $sql);
if ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
if (mysql_num_rows($result) > 0) {
$sql = "SELECT category_id, search_set from categories WHERE category_id='" . jb_escape_sql($row['parent_category_id']) . "' ";
$result = JB_mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($result) > 0) {
$row = mysql_fetch_array($result, MYSQL_ASSOC);
JB_update_post_category_counters($row['category_id'], $field_id, $row['search_set']);
}
}
}
$level--;
}
示例8: insert_job
function insert_job($employer_id)
{
// get guid
$element = $this->FMD->getOption('guid');
// get key of guid element
$guid = $this->clean_data($this->data[$element]['data']);
// check to see if GUID is unique
$sql = "SELECT post_id FROM `posts_table` WHERE `guid`='" . jb_escape_sql($guid) . "' ";
$result = jb_mysql_query($sql);
if (mysql_num_rows($result) > 0) {
// return the existing post_id
$this->echo_import_error('Post ' . jb_escape_html($guid) . ' already exists');
return array_pop(mysql_fetch_row($result));
}
// check if enough credits
if (JB_POSTING_FEE_ENABLED == 'YES' && $this->FMD->getOption('deduct_credits') > 0) {
$sql = "SELECT `ID` FROM `employers` WHERE (`posts_balance` - " . jb_escape_sql($this->FMD->getOption('deduct_credits')) . ") >= 0 AND `ID`='" . jb_escape_sql($employer_id) . "' ";
$result = jb_mysql_query($sql);
if (mysql_num_rows($result) == 0) {
$this->set_import_error('Not enough credits for employer id:' . $employer_id);
return false;
}
}
// get the fiels part of the INSERT query
$sql_fields = $this->get_sql_insert_fields(1);
if ($sql_fields === false) {
return false;
}
// get the values part of the INSERT query
$sql_values = $this->get_sql_insert_values(1);
if ($sql_values === false) {
return false;
}
// post_date
$element = $this->FMD->getOption('post_date');
$post_date = $this->data[$element]['data'];
if ($time = strtotime($post_date)) {
$post_date = gmdate("Y-m-d H:i:s", $time);
} else {
$post_date = gmdate("Y-m-d H:i:s");
// post as now
}
// post_mode
$element = $this->FMD->getOption('post_mode');
// get it from the feed
$post_mode = $this->data[$element]['data'];
if ($post_mode == '' || $post_mode != 'normal' || $post_mode != 'free' || $post_mode != 'premium') {
if (JB_POSTING_FEE_ENABLED == 'YES') {
// not present in the feed, default to normal.
$post_mode = 'normal';
}
}
// approval
$element = $this->FMD->getOption('approved');
$approved = $this->data[$element]['data'];
if ($approved != 'N' && $approved != 'Y') {
// get the setting from 'map fields'
$approved = $this->FMD->getOption('default_approved');
if ($approved != 'N' && $approved != 'Y') {
// get the setting from Admin->Main Config
if (JB_POSTS_NEED_APPROVAL == 'NO') {
$approved = 'Y';
} else {
$approved = 'N';
}
}
}
// application type
// get app_url
$element = $this->FMD->getOption('app_url');
// get key of guid element
$app_url = $this->clean_data($this->data[$element]['data']);
//echo $this->FMD->getOption('default_app_type'); die();
if ($app_url != false) {
$app_type = "R";
// redirect
} elseif ($this->FMD->getOption('default_app_type')) {
$app_type = $this->FMD->getOption('default_app_type');
} else {
$app_type = "N";
// app_type can be: O=online R = Url, N = None,
}
$sql = "INSERT INTO `posts_table` ( `guid`, `post_date`, `user_id`, `approved`, `expired`, `post_mode`, `app_type`, `app_url` " . $sql_fields . ") VALUES ( '" . jb_escape_sql($guid) . "', '" . $post_date . "', '" . $employer_id . "', '" . jb_escape_sql($approved) . "', 'N', '" . jb_escape_sql($post_mode) . "', '" . jb_escape_sql($app_type) . "', '" . jb_escape_sql($app_url) . "' " . $sql_values . ") ";
//echo $sql.'<br>'."\n";
$result = jb_mysql_query($sql);
$post_id = jb_mysql_insert_id();
$this->log_entry('Inserted Job | ID:' . $post_id . ' | GUID:' . $guid . ' | Emp.ID:' . $employer_id);
// deduct credits
if (JB_POSTING_FEE_ENABLED == 'YES' && $this->FMD->getOption('deduct_credits') > 0) {
$sql = "UPDARE `employers` SET `posts_balance`= (`posts_balance` - " . jb_escape_sql($this->FMD->getOption('deduct_credits')) . ") WHERE `ID`='" . jb_escape_sql($employer_id) . "' ";
$result = jb_mysql_query($sql);
}
return $post_id;
}
示例9: JB_expire_short_URLs
function JB_expire_short_URLs()
{
// expire urls which were not accessed within the last 90 days
$now = gmdate("Y-m-d H:i:s");
$sql = "DELETE FROM short_urls WHERE DATE_SUB('{$now}', INTERVAL 90 DAY) > `date` ";
jb_mysql_query($sql);
}
示例10: JB_do_upgrade
//.........这里部分代码省略.........
JB_mysql_query($sql) or mysql_error() . 'dffdc22';
}
$sql = "INSERT INTO `form_lists` (`form_id`, `field_type`, `sort_order`, `field_id`, `template_tag`, `column_id`, `admin`, `truncate_length`, `linked`, `clean_format`, `is_bold`, `is_sortable`, `no_wrap`) VALUES (5, 'TEXT', 9, 'IP', 'IP', 35, 'N', 0, '', 'N', 'N', 'N', 'Y');";
if ($flag) {
JB_mysql_query($sql) or mysql_error() . 'dffdc33';
}
$sql = "INSERT INTO `form_lists` (`form_id`, `field_type`, `sort_order`, `field_id`, `template_tag`, `column_id`, `admin`, `truncate_length`, `linked`, `clean_format`, `is_bold`, `is_sortable`, `no_wrap`) VALUES (3, 'TEXT', 1, '65', 'PROFILE_BNAME', 37, 'Y', 0, '', 'N', 'N', 'N', 'Y');";
if ($flag) {
JB_mysql_query($sql) or mysql_error() . 'dffdc22';
}
$sql = "INSERT INTO `form_lists` (`form_id`, `field_type`, `sort_order`, `field_id`, `template_tag`, `column_id`, `admin`, `truncate_length`, `linked`, `clean_format`, `is_bold`, `is_sortable`, `no_wrap`) VALUES (3, 'RADIO', 2, '67', 'PROFILE_BTYPE', 38, 'N', 0, '', 'N', 'N', 'N', 'Y');";
if ($flag) {
JB_mysql_query($sql) or mysql_error() . 'dffdc11';
}
$sql = "INSERT INTO `form_lists` (`form_id`, `field_type`, `sort_order`, `field_id`, `template_tag`, `column_id`, `admin`, `truncate_length`, `linked`, `clean_format`, `is_bold`, `is_sortable`, `no_wrap`) VALUES (3, 'TEXT', 3, '72', 'PROFILE_CNAME', 39, 'N', 0, '', 'N', 'N', 'N', 'Y');";
if ($flag) {
JB_mysql_query($sql) or mysql_error() . 'dffdcff';
}
$sql = "INSERT INTO `form_lists` (`form_id`, `field_type`, `sort_order`, `field_id`, `template_tag`, `column_id`, `admin`, `truncate_length`, `linked`, `clean_format`, `is_bold`, `is_sortable`, `no_wrap`) VALUES (3, 'TEXT', 4, '83', 'PROFILE_COUNTRY', 40, 'N', 0, '', 'N', 'N', 'N', 'Y');";
if ($flag) {
JB_mysql_query($sql) or mysql_error() . 'dffffdc';
}
$sql = "INSERT INTO `form_lists` (`form_id`, `field_type`, `sort_order`, `field_id`, `template_tag`, `column_id`, `admin`, `truncate_length`, `linked`, `clean_format`, `is_bold`, `is_sortable`, `no_wrap`) VALUES (3, 'TEXT', 5, '75', 'PROFILE_EMAIL', 41, 'N', 0, '', 'N', 'N', 'N', 'Y');";
if ($flag) {
JB_mysql_query($sql) or mysql_error() . 'dffggdc';
}
$sql = "INSERT INTO `form_lists` (`form_id`, `field_type`, `sort_order`, `field_id`, `template_tag`, `column_id`, `admin`, `truncate_length`, `linked`, `clean_format`, `is_bold`, `is_sortable`, `no_wrap`) VALUES (3, 'TEXT', 6, '74', 'PROFILE_WEBURL', 42, 'N', 0, '', 'N', 'N', 'N', 'Y');";
if ($flag) {
JB_mysql_query($sql) or mysql_error() . 'dfhffdc';
}
/// fix template tags with the colums (only needed when upgrading)
// simply copy over the template tags from form_fields to form_lists.
if ($flag) {
$result1 = jb_mysql_query("SELECT * FROM form_lists");
while ($row = mysql_fetch_array($result1)) {
$result2 = jb_mysql_query("SELECT template_tag FROM form_fields WHERE field_id='" . $row['field_id'] . "'");
$row2 = mysql_fetch_array($result2);
if ($row2['template_tag'] != '') {
// copy from form_fields to form_lists
jb_mysql_query("UPDATE form_lists SET template_tag='" . $row2['template_tag'] . "' WHERE field_id='" . $row['field_id'] . "' ");
} else {
// copy from form_lists to form_fields
jb_mysql_query("UPDATE form_fields SET template_tag='" . $row['template_tag'] . "' WHERE field_id='" . $row['field_id'] . "'");
}
}
}
}
if (!does_field_exist("jb_config", "key")) {
$sql = "CREATE TABLE `jb_config` (\n\t\t`key` VARCHAR( 255 ) NOT NULL ,\n\t\t`val` VARCHAR( 255 ) NOT NULL ,\n\t\tPRIMARY KEY ( `key` ) \n\t\t)";
//$sql = "ALTER TABLE `blocks` ADD `published` SET( 'Y', 'N') NOT NULL ";
if ($flag) {
JB_mysql_query($sql) or die("<p><b>CANNOT UPGRADE YOUR DATABASE!<br>Please run the follwoing query manually from PhpMyAdmin:</b><br><pre>{$sql}</pre><br>");
}
$upgrade_needed = true;
if ($flag) {
if (MULTI_PAY_PAYPAL_ON == 'YES') {
$sql = "REPLACE INTO jb_config (`key`, val) VALUES ('PAYPAL_ENABLED', 'Y')";
JB_mysql_query($sql);
$sql = "REPLACE INTO jb_config (`key`, val) VALUES ('PAYPAL_EMAIL', '" . PAYPAL_EMAIL . "')";
JB_mysql_query($sql);
$sql = "REPLACE INTO jb_config (`key`, val) VALUES ('PAYPAL_CURRENCY', '" . PAYPAL_CURRENCY . "')";
JB_mysql_query($sql);
$sql = "REPLACE INTO jb_config (`key`, val) VALUES ('PAYPAL_BUTTON_URL', '" . PAYPAL_BUTTON_URL . "')";
$sql = "REPLACE INTO jb_config (`key`, val) VALUES ('PAYPAL_SUBSCR_BUTTON_URL', 'https://www.paypal.com/en_US/i/btn/x-click-butcc-subscribe.gif')";
JB_mysql_query($sql);
$sql = "REPLACE INTO jb_config (`key`, val) VALUES ('PAYPAL_RETURN_URL', '')";
示例11: str_replace
//$users[$i];
$from = $your_email;
// Enter your email adress here
$msg = "" . $label['taf_msg_to'] . " {$to_name} <{$to_email}>\r\n" . $label['taf_msg_from'] . " {$your_name} <{$your_email}>\r\n\r\n" . str_replace('%SITE_NAME%', JB_SITE_NAME, $label['taf_msg_line']) . "\r\n\r\n" . $label['taf_msg_link'] . "\r\n" . "{$url}\r\n\r\n" . $label['taf_msg_comments'] . "\r\n" . $message;
// to discourage spam, include IP of sender:
$ip = $_SERVER['REMOTE_ADDR'];
if (!empty($_SERVER['X-FORWARDED-FOR'])) {
$ip = $_SERVER['REMOTE_ADDR'];
}
$msg .= "---\nX-Sender-IP: " . $ip;
echo $label['taf_sending_email'];
// anti-spam, we check the email queue, find the last 10 emails in the last 5 minutes
// then we silently discard if matches our basic checks
$discard = false;
$sql = "SELECT * FROM `mail_queue` WHERE `template_id` =46 AND mail_date > DATE_SUB( NOW( ) , INTERVAL 5 MINUTE ) LIMIT 10 ";
$result = jb_mysql_query($sql);
if (mysql_num_rows($result) > 0) {
$score = 0;
$max_score = 40;
// adjust this when adjusting the score rules below
while ($row = mysql_fetch_array($result)) {
if ($row['subject'] === $subject) {
// repeat subject
$score += 2;
}
if (strpos($row['message'], $your_name) !== false) {
// re-used name
$score++;
}
if (strpos($row['message'], $your_email) !== false) {
// re-used email
示例12: JB_schema_change_table
function JB_schema_change_table($form_id, $field_id, $new_field_type, $field_label)
{
$form_id = (int) $form_id;
$field_id = (int) $field_id;
$table_name = JB_get_table_name_by_id($form_id);
preg_match('#\\d#', mysql_get_server_info(), $m);
if ($m[0] > 5 && strlen($field_label) > 0) {
// mysql v5 or higher?
$comment = "COMMENT '" . addslashes($field_label) . "'";
}
// get the old definition. Delete auxillary fields
$sql = "SELECT * FROM `form_fields` WHERE `form_id`='" . JB_escape_sql($form_id) . "' AND `field_id`='" . JB_escape_sql($field_id) . "' ";
$result = jb_mysql_query($sql);
$row = mysql_fetch_array($result);
$old_def = JB_get_definition($row['field_type']);
// $old_field_type = $row['field_type']
if (is_array($old_def)) {
// drop auxillary fields
foreach ($old_def as $postfix => $data_type) {
$sql = "ALTER TABLE `{$table_name}` DROP `" . $field_id . "_" . $postfix . "` ";
JB_mysql_query($sql);
}
}
//
$new_def = JB_get_definition($new_field_type);
if (is_array($new_def)) {
// create auxillary fields
foreach ($new_def as $postfix => $data_type) {
$sql = "ALTER TABLE `{$table_name}` ADD `" . $field_id . "_" . $postfix . "` " . $data_type;
JB_mysql_query($sql);
}
}
$sql = "ALTER TABLE " . $table_name . " CHANGE `" . JB_escape_sql($field_id) . "` `" . JB_escape_sql($field_id) . "` " . JB_get_definition($new_field_type) . " {$comment} ";
JBPLUG_do_callback('schema_change_table', $sql, $form_id, $field_id, $new_field_type, $field_label);
//plugins can alter the sql
JB_mysql_query($sql);
JB_cache_del_keys_for_form($form_id);
return true;
}
示例13: multiple_query
function multiple_query($q)
{
global $jb_mysql_link;
$queries = query_parser($q);
$n = count($queries);
$results = array();
for ($i = 0; $i < $n; $i++) {
$results[$i] = array(jb_mysql_query($queries[$i]), mysql_errno(), mysql_error(), $queries[$i]);
}
return $results;
}
示例14: JB_list_profiles
function JB_list_profiles($admin = false, $order, $offset)
{
global $label;
// languages array
$records_per_page = 40;
// process search result
if ($_REQUEST['action'] == 'search') {
$q_string = JB_generate_q_string(3);
$where_sql = JB_generate_search_sql(3);
}
// JB_DATE_FORMAT(`adate`, '%d-%b-%Y') AS formatted_date
$order = $_REQUEST['order_by'];
if ($_REQUEST['ord'] == 'asc') {
$ord = 'ASC';
} elseif ($_REQUEST['ord'] == 'desc') {
$ord = 'DESC';
} else {
$ord = 'DESC';
// sort descending by default
}
if ($order == '' || !JB_is_field_valid($order, 3)) {
// by default, order by the post_date
$order = " `profile_date` ";
} else {
$order = " `" . jb_escape_sql($order) . "` ";
}
$offset = (int) $_REQUEST['offset'];
if ($offset < 0) {
$offset = abs($offset);
}
$sql = "Select SQL_CALC_FOUND_ROWS *, DATE_FORMAT(`profile_date`, '%d-%b-%Y') AS formatted_profile_date FROM `profiles_table` WHERE 1=1 {$where_sql} ORDER BY {$order} {$ord} LIMIT {$offset}, {$records_per_page}";
//echo "[".$sql."]";
$result = JB_mysql_query($sql) or die(mysql_error());
############
# get the count
/*
$count = mysql_num_rows($result);
if ($count > $records_per_page) {
mysql_data_seek($result, $offset);
}
*/
$row = mysql_fetch_row(jb_mysql_query("SELECT FOUND_ROWS()"));
$count = $row[0];
if ($count > 0) {
if ($pages == 1) {
} else {
$pages = ceil($count / $records_per_page);
$cur_page = $_REQUEST['offset'] / $records_per_page;
$cur_page++;
echo '<p class="nav_page_links">';
//echo "Page $cur_page of $pages - ";
$label["navigation_page"] = str_replace("%CUR_PAGE%", $cur_page, $label["navigation_page"]);
$label["navigation_page"] = str_replace("%PAGES%", $pages, $label["navigation_page"]);
echo "<span > " . $label["navigation_page"] . "</span> ";
$nav = JB_nav_pages_struct($result, $q_string, $count, $records_per_page);
$LINKS = 10;
JB_render_nav_pages($nav, $LINKS, $q_string, $show_emp, $cat);
echo "</p>";
}
?>
<table style="margin: 0 auto; width:100%; border:0px; background-color:d9d9d9; " cellspacing="1" cellpadding="5" >
<tr bgcolor="#EAEAEA">
<?php
if ($admin == true) {
echo '<td> </td>';
JBPLUG_do_callback('profile_list_head_admin_action', $A = false);
}
JBPLUG_do_callback('profile_list_head_user_action', $A = false);
JB_echo_list_head_data(3, $admin);
?>
</tr>
<?php
$i = 0;
$ProfileForm =& JB_get_DynamicFormObject(3);
while (($row = mysql_fetch_array($result, MYSQL_ASSOC)) && $i < $records_per_page) {
$ProfileForm->set_values($row);
$i++;
?>
<tr bgcolor="<?php
echo JB_LIST_BG_COLOR;
?>
" onmouseover="old_bg=this.getAttribute('bgcolor');this.setAttribute('bgcolor', '<?php
echo JB_LIST_HOVER_COLOR;
?>
', 0);" onmouseout="this.setAttribute('bgcolor', old_bg, 0);">
<?php
if ($admin == true) {
echo '<td>';
?>
<input style="font-size: 8pt" type="button" value="Delete" onClick="if (!confirmLink(this, 'Delete, are you sure?')) {return false;} window.location='<?php
echo htmlentities($_SERVER['PHP_SELF']);
?>
?action=delete&profile_id=<?php
echo $row['profile_id'];
?>
'"><br>
<input type="button" style="font-size: 8pt" value="Edit" onClick="window.location='<?php
//.........这里部分代码省略.........
示例15: showSubcat
function showSubcat($c)
{
//global $connection;
global $JobsFiller_default_l;
global $JobsFiller_default_k;
$query = " SELECT *, categories.category_id as CID, seo_keys FROM categories LEFT JOIN JobsFiller_keywords ON categories.category_id = JobsFiller_keywords.category_id WHERE parent_category_id = '{$c}' and form_id=1 ORDER BY list_order, category_name ASC ";
$result = jb_mysql_query($query) or die(mysql_error());
//echo "<b>cateid:".$row2[1]." $query </b>";
if (mysql_num_rows($result) == 0) {
$query = " SELECT kw, loc, categories.category_id as CID, seo_keys FROM categories LEFT JOIN JobsFiller_keywords ON categories.category_id = JobsFiller_keywords.category_id WHERE categories.category_id = '{$c}' and form_id=1 ";
$result = jb_mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result, MYSQL_ASSOC);
if (trim($row['loc']) == '') {
$row['loc'] = $JobsFiller_default_l;
}
if (trim($row['kw']) == '') {
$row['kw'] = $row['seo_keys'];
}
if (trim($row['kw']) == '') {
// still empty?
$row['kw'] = JB_getCatName($row['CID']);
//$JobsFiller_default_k;
}
?>
What: <input size='36' type="text" value="<?php
echo jb_escape_html($row['kw']);
?>
" name='kw_<?php
echo $row['CID'];
?>
'>
Where: <input size='36' type="text" value="<?php
echo jb_escape_html($row['loc']);
?>
" name='loc_<?php
echo $row['CID'];
?>
'><br>
<?php
} else {
$x = 0;
echo "<br><div style='margin-left: 20px;'>";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$x++;
if ($x > SHOW_SUBCATS) {
break;
}
//if ($row['allow_records']=='N') echo "<b>†</b>";
echo "<A HREF=" . $_SERVER['PHP_SELF'] . "?cat=" . $row['CID'] . "><font color=#0000FF>" . jb_escape_html($row['category_name']) . "</font></A> ";
//;echo "<small>(ID: ". ($row[0]).")</small>";
if (trim($row['loc']) == '') {
$row['loc'] = $JobsFiller_default_l;
}
if (trim($row['kw']) == '') {
$row['kw'] = $row['seo_keys'];
}
if (trim($row['kw']) == '') {
// still empty?
//$row['kw'] = $JobsFiller_default_k;
$row['kw'] = JB_getCatName($row['CID']);
}
?>
What: <input size='35' type="text" value="<?php
echo jb_escape_html($row['kw']);
?>
" name='kw_<?php
echo $row['CID'];
?>
'>
Where: <input size='35' type="text" value="<?php
echo jb_escape_html($row['loc']);
?>
" name='loc_<?php
echo $row['CID'];
?>
'>
<br>
<?php
// does this category have sub-categories?
$query = " SELECT * FROM categories LEFT JOIN JobsFiller_keywords ON categories.category_id = JobsFiller_keywords.category_id WHERE parent_category_id = '" . $row['CID'] . "' ORDER BY list_order, category_name ASC ";
$result2 = jb_mysql_query($query);
if (mysql_num_rows($result2) > 0) {
echo "<br>";
$row2 = mysql_fetch_row($result2);
?>
<table style="margin-left: 15px;" cellspacing="1" border="0" width="100%">
<?php
showAllCat($row['CID'], 1);
?>
</table>
<?php
}
}
}
echo "</div>";
}