Example #1
0
// Copyright Jamit Software LTD 2010
/*
The Iframe is used for marking the location on the map when the form is in
editing mode.
Iframe is not used for displaying the map
*/
define('NO_HOUSE_KEEPING', true);
$dir = dirname(__FILE__);
$dir = explode(DIRECTORY_SEPARATOR, $dir);
array_pop($dir);
array_pop($dir);
array_pop($dir);
$dir = implode('/', $dir);
require $dir . '/config.php';
require_once JB_basedirpath() . 'include/classes/JBGoogleMap.php';
$GMAP = JBGoogleMap::get_instance();
$map_id = (int) $_REQUEST['map_id'];
$form_id = (int) $_REQUEST['form_id'];
if (is_numeric($_REQUEST['lat']) && is_numeric($_REQUEST['lng']) && $_REQUEST['lat'] != 0) {
    if (is_numeric($_REQUEST['z'])) {
        $zoom = (int) $_REQUEST['z'];
    } else {
        $zoom = JB_GMAP_ZOOM;
    }
    $coords = $GMAP->add_map($map_id, array('lat' => $_REQUEST['lat'], 'lng' => $_REQUEST['lng']), $zoom);
    $lat = $_REQUEST['lat'];
    $lng = $_REQUEST['lng'];
} else {
    // use the default lat and lng
    $coords = $GMAP->add_map($map_id, array('lat' => JB_GMAP_LAT, 'lng' => JB_GMAP_LNG), JB_GMAP_ZOOM);
Example #2
0
		<h3><center><?php 
        echo $label['e_thanks_payment_return'];
        ?>

		</center></h3>

		<?php 
        //process_payment_return('authorizeNet');
        $_PAYMENT_OBJECTS['authorizeNet']->process_payment_return();
        JB_template_candidates_footer();
        // Add a base tag to point to the candidates section
        $c = ob_get_contents();
        $c = preg_replace('/<HEAD>/i', '<HEAD><base href="' . JB_BASE_HTTP_PATH . JB_CANDIDATE_FOLDER . '" >', $c);
    } else {
        chdir(JB_basedirpath() . JB_EMPLOYER_FOLDER);
        // This is a clone of the employers/thanks.php page
        JB_template_employers_header();
        ?>
		<h3><center><?php 
        echo $label['e_thanks_payment_return'];
        ?>

		</center></h3>
		<?php 
        $_PAYMENT_OBJECTS['authorizeNet']->process_payment_return();
        JB_template_employers_footer();
        // Add a base tag to point to the candidates section
        $c = ob_get_contents();
        $c = preg_replace('/<HEAD>/i', '<head><base href="' . JB_BASE_HTTP_PATH . JB_EMPLOYER_FOLDER . '" >', $c);
    }
Example #3
0
<?php

###########################################################################
# Copyright Jamit Software 2012, http://www.jamit.com
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
###########################################################################
?>

<link rel="stylesheet" type="text/css" href="<?php 
echo JB_get_text_menucss_url();
?>
" >

   <div id="menu1" style="display: none"></div>
<DIV style="float: right;"><?php 
echo $label["employer_menu_logged_in"];
?>
 <b><?php 
echo $_SESSION['JB_Username'];
?>
</b> | <a href="logout.php"><?php 
echo $label["employer_menu_logout"];
?>
</a></DIV>
 <?php 
require JB_basedirpath() . 'include/tabbed_menu_functions.php';
$active_button = JB_tabbed_show_menu($jb_menu);
JB_tabbed_show_sub_menu($active_button);
Example #4
0
<?php

###########################################################################
# Copyright Jamit Software 2012, http://www.jamit.com
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
###########################################################################
define('NO_HOUSE_KEEPING', true);
if (function_exists('JB_basedirpath')) {
    // config.php was required
    $dir = JB_basedirpath();
} else {
    $dir = '../';
}
if (!defined('JB_SITE_NAME')) {
    require $dir . '/config.php';
}
require_once $dir . '/include/resumes.inc.php';
ini_set('max_execution_time', 100200);
$DO_SEND = '';
if (defined('JB_RESUME_ALERTS_DO_SEND')) {
    // cron
    $DO_SEND = "YES";
} else {
    // from Admin
    require dirname(__FILE__) . '/admin_common.php';
    // require Admin login
    if (JB_RESUME_ALERTS_ENABLED != 'YES') {
        echo 'Resume Alerts feature is not enabled in Admin->Main Config';
        return;
Example #5
0
- text_menu.php
- js_menu.php
*/
global $jb_menu;
$jb_menu = array();
$sub_menu1 = array(0 => array('label' => $label["c_menu_main"], 'link' => 'index.php', 'image' => ''), 1 => array('label' => $label["c_menu_membership"], 'link' => 'membership.php', 'image' => '', 'condition1' => 'JB_CANDIDATE_MEMBERSHIP_ENABLED', 'cond' => 'OR'), 2 => array('label' => $label["c_menu_pwchange"], 'link' => 'password.php', 'image' => ''), 3 => array('label' => $label["c_menu_ac_details"], 'link' => 'account.php', 'image' => ''), 4 => array('label' => $label["c_menu_select_lang"], 'link' => 'language.php', 'image' => '', 'condition1' => 'JB_CAN_LANG_ENABLED', 'cond' => 'OR'), 5 => array('label' => $label["c_menu_logout"], 'link' => 'logout.php', 'image' => ''));
$sub_menu2 = array(0 => array('label' => $label["c_menu_view"], 'link' => 'resume.php', 'image' => ''), 1 => array('label' => $label["c_menu_edit"], 'link' => 'edit.php', 'image' => ''));
$sub_menu4 = array(0 => array('label' => $label["c_menu_search"], 'link' => 'search.php', 'image' => ''), 1 => array('label' => $label["c_menu_category"], 'link' => 'browse.php', 'image' => ''), array('label' => $label["c_menu_saved"], 'link' => 'save.php', 'image' => '', 'condition1' => 'JB_SAVE_JOB_ENABLED', 'cond' => 'OR'), array('label' => $label["c_menu_apps"], 'link' => 'apps.php', 'image' => '', 'condition1' => 'JB_ONLINE_APP_ENABLED', 'cond' => 'OR'), array('label' => $label["c_menu_alerts"], 'link' => 'alerts.php', 'image' => '', 'condition1' => 'JB_JOB_ALERTS_ENABLED', 'cond' => 'OR'));
$label["c_menu_about"] = str_replace("%SITE_NAME%", JB_SITE_NAME, $label["c_menu_about"]);
$sub_menu5 = array(0 => array('label' => $label["c_menu_contents"], 'link' => 'help.php', 'image' => ''), array('label' => $label["c_menu_about"], 'link' => 'about.php', 'image' => ''));
/// Menu Buttons
$jb_menu[0]['button'] = array('label' => $label["c_menu_account"], 'link' => 'index.php', 'image' => '');
$jb_menu[0]['sub'] = $sub_menu1;
$jb_menu[1]['button'] = array('label' => $label["c_menu_resume"], 'link' => 'resume.php', 'image' => '');
$jb_menu[1]['sub'] = $sub_menu2;
$jb_menu[3]['button'] = array('label' => $label["c_menu_jobs"], 'link' => 'search.php', 'image' => '');
// postit-small.gif
$jb_menu[3]['sub'] = $sub_menu4;
$jb_menu[4]['button'] = array('label' => $label["c_menu_help"], 'link' => 'help.php', 'image' => '');
$jb_menu[4]['sub'] = $sub_menu5;
JBPLUG_do_callback('candidate_menu_init', $jb_menu);
if (!defined('JB_CANDIDATE_MENU_TYPE')) {
    define('JB_CANDIDATE_MENU_TYPE', 'JS');
}
if (JB_CANDIDATE_MENU_TYPE == 'JS') {
    require JB_basedirpath() . JB_CANDIDATE_FOLDER . "js_menu.php";
} elseif (JB_CANDIDATE_MENU_TYPE == 'TXT') {
    require JB_basedirpath() . JB_CANDIDATE_FOLDER . "/text_menu.php";
} else {
    require JB_basedirpath() . JB_CANDIDATE_FOLDER . "/js_menu.php";
}
Example #6
0
function JB_do_upgrade($flag)
{
    $upgrade_needed = false;
    global $jb_mysql_link;
    global $JBMarkup;
    if (defined('JB_VERSION')) {
        $version = jb_get_variable('JB_VERSION');
        if ($version == JB_VERSION) {
            // current version database
            return false;
            // upgrade not needed
        }
    }
    $sql = "DELETE FROM `form_fields` WHERE `field_id` = 999193 LIMIT 1";
    if ($flag) {
        JB_mysql_query($sql);
    }
    $sql = "DELETE FROM `form_fields` WHERE `field_id` = 999194 LIMIT 1";
    if ($flag) {
        JB_mysql_query($sql);
    }
    $sql = "UPDATE `form_fields` SET `template_tag`='RESUME_EMAIL' WHERE form_id=2 and field_label='Email' AND field_id=40 ";
    if ($flag) {
        JB_mysql_query($sql) or die(mysql_error());
    }
    if (!does_field_exist("xml_export_elements", "is_mandatory")) {
        $sql = "DROP TABLE IF EXISTS `xml_export_elements`";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "CREATE TABLE `xml_export_elements` (\n\t\t  `element_id` int(11) NOT NULL auto_increment,\n\t\t  `element_name` varchar(255) NOT NULL default '',\n\t\t  `is_cdata` set('Y','N') NOT NULL default '',\n\t\t  `parent_element_id` int(11) default '0',\n\t\t  `form_id` int(11) NOT NULL default '0',\n\t\t  `field_id` varchar(128) NOT NULL default '0',\n\t\t  `schema_id` int(11) NOT NULL default '0',\n\t\t  `attributes` varchar(255) NOT NULL default '',\n\t\t  `static_data` varchar(255) NOT NULL default '',\n\t\t  `is_pivot` set('Y','N') NOT NULL default '',\n\t\t  `description` varchar(255) NOT NULL default '',\n\t\t  `fieldcondition` varchar(255) NOT NULL default '',\n\t\t  `is_boolean` set('Y','N') NOT NULL default 'N',\n\t\t  `qualify_codes` set('Y','N') NOT NULL default 'N',\n\t\t  `qualify_cats` set('Y','N') NOT NULL default 'N',\n\t\t  `truncate` int(11) NOT NULL default '0',\n\t\t  `strip_tags` set('Y','N') NOT NULL default 'N',\n\t\t  `is_mandatory` set('Y','N') NOT NULL default '',\n\t\t  PRIMARY KEY  (`element_id`) )";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (1, 'rss', 'N', 0, 1, '0', 1, 'version =\"2.0\" xmlns:g=\"http://base.google.com/ns/1.0\"', '', '', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (2, 'channel', 'N', 1, 1, '0', 1, '', '', '', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (4, 'description', 'N', 2, 1, '0', 1, '', '%SITE_DESCRIPTION%', '', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (5, 'link', 'N', 2, 1, '0', 1, '', '%BASE_HTTP_PATH%', '', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (6, 'item', 'N', 2, 1, '0', 1, '', '', 'Y', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (11, 'g:expiration_date', 'N', 6, 1, '', 1, '', '%EXPIRE_DATE%', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (14, 'g:immigration_status', 'N', 6, 1, '', 1, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (19, 'g:location', 'N', 6, 1, '', 1, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (20, 'g:salary', 'N', 6, 1, '', 1, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (21, 'g:salary_type', 'N', 6, 1, '', 1, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (23, 'publisher', 'N', 22, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (24, 'publisherurl', 'N', 22, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (25, 'lastBuildDate', 'N', 22, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (26, 'job', 'N', 22, 1, '', 2, '', '', 'Y', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (27, 'title', 'Y', 26, 1, '2', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (28, 'date', 'Y', 26, 1, 'post_date', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (29, 'referencenumber', 'Y', 26, 1, 'post_id', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (31, 'company', 'Y', 26, 1, '8', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (32, 'city', 'Y', 26, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (34, 'country', 'Y', 26, 1, '', 2, '', 'USA', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (35, 'postalcode', 'Y', 26, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (36, 'description', 'Y', 26, 1, 'summary', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (37, 'salary', 'Y', 26, 1, '10', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (38, 'experience', 'Y', 26, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (40, 'jobtype', 'Y', 26, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (42, 'jobs', 'N', 0, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (43, 'job', 'N', 42, 1, '', 4, '', '', 'Y', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (44, 'title', 'N', 43, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (45, 'job-code', 'N', 43, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (46, 'action', 'N', 43, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (47, 'job-board-name', 'N', 43, 1, '', 4, '', '%SITE_NAME%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (48, 'job-board-url', 'N', 43, 1, '', 4, '', '%BASE_HTTP_PATH%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (49, 'detail-url', 'N', 43, 1, '', 4, '', '%LINK%', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (50, 'apply-url', 'N', 43, 1, '', 4, '', '%LINK%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (51, 'description', 'N', 43, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (52, 'summary', 'N', 51, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'Y', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (53, 'required-skills', 'N', 51, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (54, 'required-education', 'N', 51, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (55, 'required-experience', 'N', 51, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (56, 'full-time', 'N', 51, 1, '', 4, '', '', 'N', '', '', 'Y', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (57, 'part-time', 'N', 51, 1, '', 4, '', '', 'N', '', '', 'Y', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (59, 'flex-time', 'N', 51, 1, '', 4, '', '', 'N', '', '', 'Y', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (60, 'internship', 'N', 51, 1, '', 4, '', '', 'N', '', '', 'Y', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (61, 'volunteer', 'N', 51, 1, '', 4, '', '', 'N', '', '', 'Y', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (62, 'exempt', 'N', 51, 1, '', 4, '', '', 'N', '', '', 'Y', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (63, 'contract', 'N', 51, 1, '', 4, '', '', 'N', '', '', 'Y', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (64, 'permanent', 'N', 51, 1, '', 4, '', '', 'N', '', '', 'Y', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (65, 'temporary', 'N', 51, 1, '', 4, '', '', 'N', '', '', 'Y', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (66, 'telecommute', 'N', 51, 1, '', 4, '', '', 'N', '', '', 'Y', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (67, 'compensation', 'N', 43, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (68, 'salary-range', 'N', 67, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (69, 'salary-amount', 'N', 67, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (70, 'salary-currency', 'N', 67, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (71, 'benefits', 'N', 67, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (72, 'posted-date', 'N', 43, 1, '', 4, '', '%DATE%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (73, 'close-date', 'N', 43, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (74, 'location', 'N', 43, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (75, 'address', 'N', 74, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        $sql = "INSERT INTO `xml_export_elements` VALUES (76, 'city', 'N', 74, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (77, 'state', 'N', 74, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (78, 'zip', 'N', 74, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (79, 'country', 'N', 74, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (80, 'area-code', 'N', 74, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (81, 'contact', 'N', 43, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (82, 'name', 'N', 81, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (84, 'email', 'N', 81, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (85, 'hiring-manager-name', 'N', 81, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (86, 'hiring-manager-email', 'N', 81, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (87, 'phone', 'N', 81, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (88, 'fax', 'N', 81, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (89, 'company', 'N', 43, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (90, 'name', 'N', 89, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (91, 'description', 'N', 89, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (92, 'industry', 'N', 89, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (93, 'url', 'N', 89, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (94, 'title', 'N', 2, 1, '', 1, '', '%SITE_NAME%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (96, 'title', 'N', 6, 1, '', 1, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (97, 'description', 'N', 6, 1, '', 1, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'Y', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (98, 'g:job_function', 'N', 6, 1, '', 1, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (99, 'g:job_industry', 'N', 6, 1, '', 1, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (100, 'g:job_type', 'N', 6, 1, '', 1, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (101, 'link', 'N', 6, 1, '', 1, '', '%LINK%', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (102, 'g:publish_date', 'N', 6, 1, '', 1, '', '%DATE%', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (103, 'g:education', 'N', 6, 1, '', 1, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (104, 'g:employer', 'N', 6, 1, '', 1, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (105, 'guid', 'N', 6, 1, '', 1, '', '%LINK%', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (106, 'image_link', 'N', 6, 1, '', 1, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (107, 'source', 'N', 0, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (108, 'publisher', 'N', 107, 1, '', 2, '', '%SITE_NAME%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (109, 'publisherurl', 'N', 107, 1, '', 2, '', '%BASE_HTTP_PATH%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (110, 'lastBuildDate', 'N', 107, 1, '', 2, '', '%FEED_DATE%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (111, 'job', 'N', 107, 1, '', 2, '', '', 'Y', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (112, 'title', 'N', 111, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (113, 'date', 'N', 111, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (114, 'referencenumber', 'N', 111, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (115, 'url', 'N', 111, 1, '', 2, '', '%LINK%', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (116, 'company', 'N', 111, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (117, 'city', 'N', 111, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (118, 'state', 'N', 111, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (119, 'country', 'N', 111, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (120, 'postalcode', 'N', 111, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (121, 'description', 'N', 111, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'Y', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (122, 'salary', 'Y', 111, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (123, 'education', 'Y', 111, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (124, 'jobtype', 'Y', 111, 1, '', 2, '', '', 'N', '', '', 'N', 'Y', 'Y', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (125, 'category', 'Y', 111, 1, '', 2, '', '', 'N', '', '', 'N', 'Y', 'Y', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (126, 'experience', 'Y', 111, 1, '', 2, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (127, 'job-category', 'N', 43, 1, '', 4, '', '', 'N', '', '', 'N', 'N', 'Y', 0, 'N', 'N')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (128, 'rss', 'N', 0, 1, '', 3, 'version=\"2.0\"', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (129, 'channel', 'N', 128, 1, '', 3, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (130, 'title', 'N', 129, 1, '', 3, '', '%SITE_NAME%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (131, 'link', 'N', 129, 1, '', 3, '', '%BASE_HTTP_PATH%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (132, 'description', 'N', 129, 1, '', 3, '', '%SITE_DESCRIPTION%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (133, 'language', 'N', 129, 1, '', 3, '', '%DEFAULT_LANG%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (134, 'pubDate', 'N', 129, 1, '', 3, '', '%FEED_DATE%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (135, 'lastBuildDate', 'N', 129, 1, '', 3, '', '%FEED_DATE%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (136, 'docs', 'N', 129, 1, '', 3, '', 'http://blogs.law.harvard.edu/tech/rss', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (137, 'generator', 'N', 129, 1, '', 3, '', 'Jamit Job Board XML export tool', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (138, 'managingEditor', 'N', 129, 1, '', 3, '', '%SITE_CONTACT_EMAIL%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (139, 'webMaster', 'N', 129, 1, '', 3, '', '%SITE_CONTACT_EMAIL%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (140, 'image', 'N', 129, 1, '', 3, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (141, 'link', 'N', 140, 1, '', 3, '', '%BASE_HTTP_PATH%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (142, 'title', 'N', 140, 1, '', 3, '', '%SITE_NAME%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (143, 'url', 'N', 140, 1, '', 3, '', '%RSS_FEED_LOGO%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (144, 'height', 'N', 140, 1, '', 3, '', '%RSS_LOGO_HEIGHT%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (145, 'width', 'N', 140, 1, '', 3, '', '%RSS_LOGO_WIDTH%', 'N', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (146, 'item', 'N', 129, 1, '', 3, '', '', 'Y', '', '', 'N', 'N', 'N', 0, 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (147, 'title', 'N', 146, 1, '', 3, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (148, 'link', 'N', 146, 1, '', 3, '', '%LINK%', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (149, 'description', 'N', 146, 1, '', 3, '', '', 'N', '', '', 'N', 'N', 'N', 300, 'Y', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (151, 'pubDate', 'N', 146, 1, '', 3, '', '', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_elements` VALUES (152, 'guid', 'N', 146, 1, '', 3, '', '%LINK%', 'N', '', '', 'N', 'N', 'N', 0, 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("categories", "seo_fname")) {
        $sql = "ALTER TABLE categories ADD `seo_fname` VARCHAR(100) NULL default NULL";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("categories", "seo_title")) {
        $sql = "ALTER TABLE categories ADD `seo_title` VARCHAR(255) NULL default NULL";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("categories", "seo_desc")) {
        $sql = "ALTER TABLE categories ADD `seo_desc` VARCHAR(255) NULL default NULL";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("categories", "seo_keys")) {
        $sql = "ALTER TABLE categories ADD `seo_keys` VARCHAR(255) NULL default NULL";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
        // update the Indexes
        $sql = "ALTER TABLE `categories` DROP PRIMARY KEY ";
        if ($flag) {
            JB_mysql_query($sql);
        }
        $sql = "ALTER TABLE `categories` DROP INDEX `category_id` ";
        if ($flag) {
            JB_mysql_query($sql);
        }
        $sql = "ALTER TABLE `categories` ADD INDEX ( `seo_fname` ) ";
        if ($flag) {
            JB_mysql_query($sql);
        }
        $sql = "ALTER TABLE `categories` ADD PRIMARY KEY ( `category_id` ) ";
        if ($flag) {
            JB_mysql_query($sql);
        }
    }
    if (!does_field_exist('categories', 'allow_records')) {
        $sql = "ALTER TABLE `categories` ADD `allow_records` SET( 'Y', 'N' ) DEFAULT 'Y' NOT NULL";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("categories", "has_child")) {
        $sql = "ALTER TABLE `categories` ADD `has_child` SET( 'Y', 'N' ) DEFAULT NULL ;";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        if ($flag) {
            JB_compute_cat_has_child();
        }
        if ($flag) {
            JB_cache_flush();
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('lang', 'is_default')) {
        $sql = "ALTER TABLE `lang` ADD `is_default` SET( 'Y', 'N' ) DEFAULT 'N' NOT NULL";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('lang', 'charset')) {
        $sql = "ALTER TABLE `lang` ADD `charset` VARCHAR( 32 ) NOT NULL ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('employers', 'newsletter_last_run')) {
        $sql = "ALTER TABLE `employers` ADD `newsletter_last_run` DATETIME NOT NULL ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('users', 'newsletter_last_run')) {
        $sql = "ALTER TABLE `users` ADD `newsletter_last_run` DATETIME NOT NULL ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('package_invoices', 'payment_method')) {
        $sql = "ALTER TABLE `package_invoices` ADD `payment_method` VARCHAR( 64 ) NOT NULL  ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('subscription_invoices', 'payment_method')) {
        $sql = "ALTER TABLE `subscription_invoices` ADD `payment_method` VARCHAR( 64 ) NOT NULL ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('users', 'lang')) {
        $sql = "ALTER TABLE `users` ADD `lang` VARCHAR( 3 ) NOT NULL ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('skill_matrix', 'matrix_id')) {
        $sql = "CREATE TABLE `skill_matrix` ( " . "`matrix_id` INT NOT NULL AUTO_INCREMENT , " . "`field_id` INT NOT NULL , " . "`row_count` VARCHAR( 255 ) NOT NULL , " . "PRIMARY KEY ( `matrix_id` ) " . ")  ;";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('skill_matrix_data', 'field_id')) {
        $sql = "CREATE TABLE `skill_matrix_data` ( " . "`field_id` INT NOT NULL , " . "`row` INT NOT NULL , " . "`object_id` INT NOT NULL , " . " `user_id` INT NOT NULL , " . "`name` VARCHAR( 255 ) NOT NULL , " . "`years` VARCHAR( 2 ) NOT NULL , " . "`rating` VARCHAR( 2 ) NOT NULL , " . "PRIMARY KEY ( `field_id` , `row` ) " . ")  ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . "f53cjku");
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('skill_matrix_data', 'user_id')) {
        $sql = "ALTER TABLE skill_matrix_data ADD `user_id` int ( 11 ) NOT NULL  ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . "jhjkh");
        }
        $upgrade_needed = true;
    }
    $sql = "ALTER TABLE `applications` CHANGE `app_id` `app_id` INT( 11 ) NOT NULL AUTO_INCREMENT ";
    if ($flag) {
        JB_mysql_query($sql) or die(mysql_error() . "hgfhdde4");
    }
    if (!does_field_exist('currencies', 'code')) {
        $sql = "CREATE TABLE `currencies` ( " . "`code` VARCHAR( 3 ) NOT NULL , " . "`name` VARCHAR( 50 ) NOT NULL , " . "`rate` DECIMAL (10,4) NOT NULL , " . "`is_default` SET( 'Y', 'N' ) NOT NULL, " . "`sign` VARCHAR (8) NOT NULL , " . "`decimal_places` SMALLINT NOT NULL, " . "`decimal_point` VARCHAR( 3 ) NOT NULL , " . "`thousands_sep` VARCHAR( 3 ) NOT NULL , " . "PRIMARY KEY (`code`))";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . "hjhj");
        }
        if ($flag) {
            mysql_query("INSERT INTO `currencies` VALUES ('AUD', 'Australian Dollar', 1.3228, 'N', '\$', 2, '.', ',')") or die(mysql_error() . "hjhj1");
        }
        if ($flag) {
            mysql_query("INSERT INTO `currencies` VALUES ('CAD', 'Canadian Dollar', 1.1998, 'N', '\$', 2, '.', ',')") or die(mysql_error() . "hjhj2");
        }
        if ($flag) {
            mysql_query("INSERT INTO `currencies` VALUES ('EUR', 'Euro', 0.8138, 'N', '€', 2, '.', ',')") or die(mysql_error() . "hjhj3");
        }
        if ($flag) {
            mysql_query("INSERT INTO `currencies` VALUES ('GBP', 'British Pound', 0.5555, 'N', '£', 2, '.', ',')") or die(mysql_error() . "hjhj4");
        }
        if ($flag) {
            mysql_query("INSERT INTO `currencies` VALUES ('JPY', 'Japanese Yen', 110.1950, 'N', 'Â¥', 0, '.', ',')") or die(mysql_error() . "hjhj5");
        }
        if ($flag) {
            mysql_query("INSERT INTO `currencies` VALUES ('KRW', 'Korean Won', 1028.8000, 'N', '&#8361;', 0, '.', ',')") or die(mysql_error() . "hjhj6");
        }
        if ($flag) {
            mysql_query("INSERT INTO `currencies` VALUES ('USD', 'U.S. Dollar', 1, 'Y', '\$', 2, '.', ',')") or die(mysql_error() . "hjhj7");
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('currencies', 'sign')) {
        $sql = "ALTER TABLE currencies ADD `sign` VARCHAR( 8 ) NOT NULL  ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . "ghgg7fcd");
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('currencies', 'decimal_places')) {
        $sql = "ALTER TABLE currencies ADD `decimal_places` SMALLINT NOT NULL  ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . "gdd3hgg7fcd");
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('currencies', 'decimal_point')) {
        $sql = "ALTER TABLE currencies ADD `decimal_point` VARCHAR( 1 ) NOT NULL  ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . "ghgg7fcd");
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('currencies', 'thousands_sep')) {
        $sql = "ALTER TABLE currencies ADD `thousands_sep` VARCHAR( 3 ) NOT NULL  ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . "ghgg7fcd");
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('packages', 'currency_code')) {
        $sql = "ALTER TABLE packages ADD `currency_code` VARCHAR( 3 ) NOT NULL  ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . "gh7fcd");
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('subscriptions', 'currency_code')) {
        $sql = "ALTER TABLE subscriptions ADD `currency_code` VARCHAR( 3 ) NOT NULL  ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hjkh');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('subscription_invoices', 'currency_code')) {
        $sql = "ALTER TABLE subscription_invoices ADD `currency_code` VARCHAR( 3 ) NOT NULL  ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hjddkh');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('subscription_invoices', 'currency_rate')) {
        $sql = "ALTER TABLE subscription_invoices ADD `currency_rate` DECIMAL( 10, 4) NOT NULL  ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hjw3dkh');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('package_invoices', 'currency_code')) {
        $sql = "ALTER TABLE package_invoices ADD `currency_code` VARCHAR( 3 ) NOT NULL  ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hjddkh');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('package_invoices', 'currency_rate')) {
        $sql = "ALTER TABLE package_invoices ADD `currency_rate` DECIMAL( 10, 4) NOT NULL  ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hjw3dkh');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('form_fields', 'is_cat_multiple')) {
        $sql = "ALTER TABLE form_fields ADD `is_cat_multiple` SET ('Y', 'N') NOT NULL DEFAULT 'N' ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hjw3sdh');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('form_fields', 'multiple_sel_all')) {
        $sql = "ALTER TABLE form_fields ADD `multiple_sel_all` char(1) NOT NULL default 'N' ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrwgkh');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('form_fields', 'cat_multiple_rows')) {
        $sql = "ALTER TABLE form_fields ADD `cat_multiple_rows` INT(11) NOT NULL DEFAULT 1 ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hw33rdkh');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('form_fields', 'is_blocked')) {
        $sql = "ALTER TABLE form_fields ADD `is_blocked` char(1) NOT NULL default 'N' ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrwgkh');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('form_fields', 'is_prefill')) {
        $sql = "ALTER TABLE form_fields ADD `is_prefill` char(1) NOT NULL default 'N' ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrwgkh');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('form_fields', 'is_member')) {
        $sql = "ALTER TABLE form_fields ADD `is_member` char(1) NOT NULL default 'N' ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrkjwgkh');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('subscriptions', 'can_view_blocked')) {
        $sql = "ALTER TABLE subscriptions ADD `can_view_blocked` set('Y', 'N') NOT NULL default 'Y' ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrwgkh');
        }
        $sql = "UPDATE subscriptions SET `can_view_blocked` = 'Y' ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrwgkh');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('subscription_invoices', 'can_view_blocked')) {
        $sql = "ALTER TABLE subscription_invoices ADD `can_view_blocked` set('Y', 'N') NOT NULL default 'Y' ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrwgkh');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('categories', 'list_order')) {
        $sql = "ALTER TABLE categories ADD `list_order` smallint(6) NOT NULL default '1' ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrwgkh');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('categories', 'search_set')) {
        $sql = "ALTER TABLE categories ADD `search_set` text NOT NULL  ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrhjhwgkh');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('mail_queue', 'mail_id')) {
        $sql = "CREATE TABLE `mail_queue` (\n  `mail_id` int(11) NOT NULL auto_increment,\n  `mail_date` datetime NOT NULL default '0000-00-00 00:00:00',\n  `to_address` varchar(128) NOT NULL default '',\n  `to_name` varchar(128) NOT NULL default '',\n  `from_address` varchar(128) NOT NULL default '',\n  `from_name` varchar(128) NOT NULL default '',\n  `subject` varchar(255) NOT NULL default '',\n  `message` text NOT NULL,\n  `html_message` text NOT NULL,\n  `attachments` set('Y','N') NOT NULL default '',\n  `status` set('queued','sent','error') NOT NULL default '',\n  `error_msg` varchar(255) NOT NULL default '',\n  `retry_count` smallint(6) NOT NULL default '0',\n  `template_id` int(11) NOT NULL default '0',\n  `att1_name` varchar(128) NOT NULL default '',\n  `att2_name` varchar(128) NOT NULL default '',\n  `att3_name` varchar(128) NOT NULL default '',\n  `date_stamp` datetime NOT NULL default '0000-00-00 00:00:00',\n  PRIMARY KEY  (`mail_id`)) ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrjhhjhwgkh');
        }
        $upgrade_needed = true;
        $sql = "INSERT INTO `email_templates` (`EmailID`,  `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`) VALUES (60,  'Dear  %LNAME%, %FNAME%\r\n\r\nYour order on %SITE_NAME% was confirmed, thank you.\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nPosts: %QUANTITY% \r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Confirmed\r\nPayment Method: Bank Deposit\r\n--------------------------.\r\n\r\nPlease deposit %INVOICE_AMOUNT% to the following account:\r\n\tBank: %BANK_NAME%\r\n        Bank Address: %BANK_ADDRESS%\r\n        SWIFT CODE: %BANK_AC_SWIFT%\r\n\tA/C Name: %AC_NAME%\r\n\tA/C Number: %AC_NUMBER%\r\n\r\nAfter making the deposit, please send an email to \r\ntest@example.com with the following \r\nOrder Number: %INVOICE_CODE% to help us speed up the process. \r\n\r\nFeel free to contact %SITE_CONTACT_EMAIL% if you have \r\nany questions / problems. \r\n\r\nThank you!\r\n\r\n\r\n%SITE_NAME% team.\r\n%SITE_URL%\r\n\r\nNote: This is an automated email.', '*****@*****.**', 'Order confirmed', 'Jamit Demo')";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrjhhjhwgkh');
        }
        $sql = "INSERT INTO `email_templates` (`EmailID`,  `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`) VALUES (61,  'Dear  %LNAME%, %FNAME%\r\n\r\nYour order on %SITE_NAME% was confirmed, thank you.\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nPosts: %QUANTITY% \r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Confirmed\r\nPayment Method: Check / Money Order\r\n--------------------------.\r\n\r\nPlease send Check / Money Order to:\r\n\tName: %PAYEE_NAME%\r\n        Address: %PAYEE_ADDRESS%\r\n        Amount: %INVOICE_AMOUNT%\r\n        Currency: %CHECK_CURRENCY%\r\n\r\n\r\nFeel free to contact %SITE_CONTACT_EMAIL% if you have \r\nany questions / problems. \r\n\r\nThank you!\r\n\r\n\r\n%SITE_NAME% team.\r\n%SITE_URL%\r\n\r\nNote: This is an automated email.', '*****@*****.**', 'Confirmed Order', 'Jamit Demo')";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrjhhjhwgkh');
        }
        $sql = "INSERT INTO `email_templates` (`EmailID`,  `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`) VALUES (62,  'Dear  %LNAME%, %FNAME%\r\n\r\nYour order on %SITE_NAME% was confirmed, thank you.\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nPosts: %QUANTITY% \r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Confirmed\r\nPayment Method: Instant (%PAYMENT_METHOD%)\r\n\r\n--------------------------\r\n\r\nFeel free to contact %SITE_CONTACT_EMAIL% if you have \r\nany questions / problems. \r\n\r\nThank you!\r\n\r\n\r\n%SITE_NAME% team.\r\n%SITE_URL%\r\n\r\nNote: This is an automated email.', '*****@*****.**', 'Order Confirmed', 'Jamit Demo')";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrjhhjhwgkh');
        }
        $sql = "INSERT INTO `email_templates` (`EmailID`,  `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`) VALUES (63,  'Dear  %LNAME%, %FNAME%\r\n\r\nYour order on %SITE_NAME% was confirmed, thank you.\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nPosts: %QUANTITY% \r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Confirmed\r\nPayment Method: Instant (%PAYMENT_METHOD%)\r\n\r\n--------------------------\r\n\r\nFeel free to contact %SITE_CONTACT_EMAIL% if you have \r\nany questions / problems. \r\n\r\nThank you!', '*****@*****.**', 'Order Completed', 'Jamit Demo')";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrjhhjhwgkh');
        }
        $sql = "INSERT INTO `email_template_translations` (`EmailID`, `lang`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`) VALUES (60, 'EN', 'Dear  %LNAME%, %FNAME%\r\n\r\nYour order on %SITE_NAME% was confirmed, thank you.\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nPosts: %QUANTITY% \r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Confirmed\r\nPayment Method: Bank Deposit\r\n--------------------------.\r\n\r\nPlease deposit %INVOICE_AMOUNT% to the following account:\r\n\tBank: %BANK_NAME%\r\n        Bank Address: %BANK_ADDRESS%\r\n        SWIFT CODE: %BANK_AC_SWIFT%\r\n\tA/C Name: %AC_NAME%\r\n\tA/C Number: %AC_NUMBER%\r\n\r\nAfter making the deposit, please send an email to \r\ntest@example.com with the following \r\nOrder Number: %INVOICE_CODE% to help us speed up the process. \r\n\r\nFeel free to contact %SITE_CONTACT_EMAIL% if you have \r\nany questions / problems. \r\n\r\nThank you!\r\n\r\n\r\n%SITE_NAME% team.\r\n%SITE_URL%\r\n\r\nNote: This is an automated email.', '*****@*****.**', 'Order confirmed', 'Jamit Demo')";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrjhhjhwgkh');
        }
        $sql = "INSERT INTO `email_template_translations` (`EmailID`, `lang`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`) VALUES (61, 'EN', 'Dear  %LNAME%, %FNAME%\r\n\r\nYour order on %SITE_NAME% was confirmed, thank you.\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nPosts: %QUANTITY% \r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Confirmed\r\nPayment Method: Check / Money Order\r\n--------------------------.\r\n\r\nPlease send Check / Money Order to:\r\n\tName: %PAYEE_NAME%\r\n        Address: %PAYEE_ADDRESS%\r\n        Amount: %INVOICE_AMOUNT%\r\n        Currency: %CHECK_CURRENCY%\r\n\r\n\r\nFeel free to contact %SITE_CONTACT_EMAIL% if you have \r\nany questions / problems. \r\n\r\nThank you!\r\n\r\n\r\n%SITE_NAME% team.\r\n%SITE_URL%\r\n\r\nNote: This is an automated email.', '*****@*****.**', 'Confirmed Order', 'Jamit Demo')";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrjhhjhwgkh');
        }
        $sql = "INSERT INTO `email_template_translations` (`EmailID`, `lang`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`) VALUES (62, 'EN', 'Dear  %LNAME%, %FNAME%\r\n\r\nYour order on %SITE_NAME% was confirmed, thank you.\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nPosts: %QUANTITY% \r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Confirmed\r\nPayment Method: Instant (%PAYMENT_METHOD%)\r\n\r\n--------------------------\r\n\r\nFeel free to contact %SITE_CONTACT_EMAIL% if you have \r\nany questions / problems. \r\n\r\nThank you!\r\n\r\n\r\n%SITE_NAME% team.\r\n%SITE_URL%\r\n\r\nNote: This is an automated email.', '*****@*****.**', 'Order Confirmed', 'Jamit Demo')";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrjhhjhwgkh');
        }
        $sql = "INSERT INTO `email_template_translations` (`EmailID`, `lang`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`) VALUES (63, 'EN', 'Dear  %LNAME%, %FNAME%\r\n\r\nYour order on %SITE_NAME% was confirmed, thank you.\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nPosts: %QUANTITY% \r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Confirmed\r\nPayment Method: Instant (%PAYMENT_METHOD%)\r\n\r\n--------------------------\r\n\r\nFeel free to contact %SITE_CONTACT_EMAIL% if you have \r\nany questions / problems. \r\n\r\nThank you!', '*****@*****.**', 'Order Completed', 'Jamit Demo')";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrjhhjhwgkh');
        }
    }
    if (!does_field_exist('users', 'alert_query')) {
        $sql = "ALTER TABLE users ADD  `alert_query` TEXT NOT NULL  ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrhjhwgkh');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('employers', 'alert_query')) {
        $sql = "ALTER TABLE employers ADD `alert_query` TEXT NOT NULL ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'rr4456f');
        }
        $upgrade_needed = true;
    }
    //
    if (!does_field_exist('jb_variables', 'key')) {
        $sql = "CREATE TABLE `jb_variables` (\n\t\t`key` VARCHAR( 255 ) NOT NULL ,\n\t\t`val` VARCHAR( 255 ) NOT NULL ,\n\t\tPRIMARY KEY ( `key` ) \n\t\t)";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'grrvvvg');
        }
        $upgrade_needed = true;
    }
    if ($flag) {
        $sql = "SELECT * FROM `jb_variables` WHERE `key`='HOUSEKEEP_RUNNING' ";
        $res = JB_mysql_query($sql);
        $row = mysql_fetch_array($res);
        if ($row['val'] == '') {
            $sql = "REPLACE INTO `jb_variables` (`key`, `val`) VALUES ('HOUSEKEEP_RUNNING', 'NO') ";
            if ($flag) {
                JB_mysql_query($sql);
            }
        }
    }
    if ($flag) {
        $sql = "SELECT * FROM `jb_variables` WHERE `key`='MAIL_QUEUE_RUNNING' ";
        $res = JB_mysql_query($sql);
        $row = mysql_fetch_array($res);
        if ($row['val'] == '') {
            $sql = "REPLACE INTO `jb_variables` (`key`, `val`) VALUES ('MAIL_QUEUE_RUNNING', 'NO') ";
            if ($flag) {
                JB_mysql_query($sql);
            }
        }
    }
    //
    if (!does_field_exist('jb_sessions', 'session_id')) {
        $sql = "CREATE TABLE `jb_sessions` (\n\t\t`session_id` VARCHAR( 255 ) NOT NULL ,\n\t\t`last_request_time` datetime NOT NULL default '0000-00-00 00:00:00',\n\t\t`domain` SET( 'EMPLOYER', 'CANDIDATE' ) NOT NULL ,\n        `id` INT NOT NULL,\n\t\t`remote_addr` VARCHAR( 255 ) NOT NULL ,\n\t\tPRIMARY KEY ( `session_id` ) \n\t\t)";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hwrhjhwgkh');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('jb_sessions', 'user_agent')) {
        $sql = "ALTER TABLE `jb_sessions` ADD `user_agent` varchar(255) NOT NULL ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4olfhma');
        }
        $upgrade_needed = true;
    }
    // http_referer
    if (!does_field_exist('jb_sessions', 'http_referer')) {
        $sql = "ALTER TABLE `jb_sessions` ADD `http_referer` varchar(255) NOT NULL ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hdslfhfda');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('form_lists', 'column_id')) {
        $sql = "CREATE TABLE `form_lists` (\n\t\t  `form_id` int(11) NOT NULL default '0',\n\t\t  `field_type` varchar(255) NOT NULL default '',\n\t\t  `sort_order` int(11) NOT NULL default 0,\n\t\t  `field_id` varchar(255) NOT NULL default '0',\n\t\t  `template_tag` varchar(255) NOT NULL default '',\n\t\t  `column_id` int(11) NOT NULL auto_increment,\n\t\t  `linked` set('Y','N') NOT NULL default 'N',\n\t\t  `admin` set('Y','N') NOT NULL default 'N',\n\t\t  `truncate_length` SMALLINT( 4 ) NOT NULL default '0',\n\t\t  `clean_format` set('Y','N') NOT NULL default '',\n\t\t  `is_bold` set('Y','N') NOT NULL default 'N',\n\t\t  `no_wrap` set('Y','N') NOT NULL default 'N',\n\t\t  PRIMARY KEY  (`column_id`)\n\t\t)";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4olfhma');
        }
        $sql = "INSERT INTO `form_lists` VALUES (1, 'TIME', '1', 'post_date', 'DATE', 13, 'N', 0, 'N', 'N', 'N', 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4olfhma');
        }
        $sql = "INSERT INTO `form_lists` VALUES (1, 'TEXT', '2', 'summary', 'POST_SUMMARY', 14, 'N', 0, 'N', 'N', 'N', '')";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4olfhma');
        }
        $sql = "INSERT INTO `form_lists` VALUES (1, 'TEXT', '3', '15', 'LOCATION', 15, 'N', 0, 'N', 'Y', 'Y', 'N')";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4olfhma');
        }
        $sql = "INSERT INTO `form_lists` VALUES (1, 'TEXT', '4', 'hits', 'HITS', 16, 'Y', 0, 'N', 'N', '', '')";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4olfhma');
        }
        $sql = "INSERT INTO `form_lists` VALUES (2, 'TEXT', '2', '36', 'RESUME_NAME', 5, 'Y', 0, 'N', '', '', '')";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4olfhma');
        }
        $sql = "INSERT INTO `form_lists` VALUES (2, 'TIME', '1', 'resume_date', 'DATE', 6, '', 0, 'N', '', '', '')";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4olfhma');
        }
        $sql = "INSERT INTO `form_lists` VALUES (2, 'DATE', '3', '54', 'RESUME_COL3', 7, 'N', 0, 'Y', '', '', '')";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4olfhma');
        }
        $sql = "INSERT INTO `form_lists` VALUES (2, 'TEXT', '4', '39', 'RESUME_COL4', 8, 'N', 0, 'N', 'N', 'N', 'N')";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4olfhma');
        }
        $upgrade_needed = true;
    } else {
        // fix column type bug...
        $sql = "SHOW columns from `form_lists`";
        $result = JB_mysql_query($sql);
        while ($row = mysql_fetch_row($result)) {
            if ($row[0] == 'sort_order' && $row[1] == 'varchar(255)') {
                $sql = "ALTER TABLE `form_lists` CHANGE `sort_order` `sort_order` INT( 11 ) NOT NULL";
                JB_mysql_query($sql);
            }
        }
    }
    if (!does_field_exist('form_lists', 'is_sortable')) {
        $sql = "ALTER TABLE `form_lists` ADD `is_sortable` set('Y','N') NOT NULL default 'N' ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4olfhma');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('email_templates', 'sub_template')) {
        $sql = "ALTER TABLE `email_templates` ADD `sub_template` TEXT NOT NULL ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4olfhma');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('saved_jobs', 'post_id')) {
        $sql = "CREATE TABLE `saved_jobs` (\n\t\t  `post_id` int(11) NOT NULL default '0',\n\t\t  `user_id` int(11) NOT NULL default '0',\n\t\t  `save_date` datetime NOT NULL default '0000-00-00 00:00:00',\n\t\t  PRIMARY KEY  (`post_id`,`user_id`))";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4sjwfhma');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('email_template_translations', 'sub_template')) {
        $sql = "ALTER TABLE `email_template_translations` ADD `sub_template` TEXT NOT NULL ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'fdsf');
        }
        ### populate sub_template ##
        $sql = "UPDATE `email_templates` SET `sub_template`='%DATE% : %RESUME_NAME% (%NATIONALITY%)' WHERE EmailID=5 ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4olfhma');
        }
        $sql = "UPDATE `email_template_translations` SET `sub_template`='%DATE% : %RESUME_NAME% (%NATIONALITY%)' WHERE EmailID=5 ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4olfhma');
        }
        $sql = "UPDATE `email_templates` SET `sub_template`='<font face=''arial'' size=''2''>%DATE% - %RESUME_NAME% </font>' WHERE EmailID=6 ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4olfhma');
        }
        $sql = "UPDATE `email_template_translations` SET `sub_template`='<font face=''arial'' size=''2''>%DATE% - %RESUME_NAME% </font>' WHERE EmailID=6 ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4olfhma');
        }
        $sql = "UPDATE `email_templates` SET `sub_template`='%FORMATTED_DATE% : %TITLE% (%LOCATION%)\nLink: %BASE_HTTP_PATH%index.php?post_id=%POST_ID%' WHERE EmailID=7 ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4oglfghma');
        }
        $sql = "UPDATE `email_template_translations` SET `sub_template`='%FORMATTED_DATE% : %TITLE% (%LOCATION%)\nLink: %BASE_HTTP_PATH%index.php?post_id=%POST_ID%' WHERE EmailID=7 ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4oglfghma');
        }
        $sql = "UPDATE `email_templates` SET `sub_template`='<font face=''arial'' size=''2''>%FORMATTED_DATE% - <a href=''%BASE_HTTP_PATH%index.php?post_id=%POST_ID%''>%TITLE%</a></font> (%LOCATION%) <font face=''arial'' size=''1'' color=''#808080''>%DESCRIPTION%</font>' WHERE EmailID=8 ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4wwolfhma');
        }
        $sql = "UPDATE `email_template_translations` SET `sub_template`='<font face=''arial'' size=''2''>%FORMATTED_DATE% - <a href=''%BASE_HTTP_PATH%index.php?post_id=%POST_ID%''>%TITLE%</a></font> (%LOCATION%) <font face=''arial'' size=''1'' color=''#808080''>%DESCRIPTION%</font>' WHERE EmailID=8 ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'hd4wwolfhma');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('package_invoices', 'reason')) {
        $sql = "ALTER TABLE `package_invoices` ADD `reason` VARCHAR( 128 ) NOT NULL";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'ggguufdds');
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist('subscription_invoices', 'reason')) {
        $sql = "ALTER TABLE `subscription_invoices` ADD `reason` VARCHAR( 128 ) NOT NULL ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'nhhg');
        }
        $upgrade_needed = true;
    }
    if (does_field_exist('employers', 'alert_modify_date')) {
        $sql = "ALTER TABLE `employers` DROP `alert_modify_date` ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'jhjhg5s');
        }
        $upgrade_needed = true;
    }
    if (does_field_exist('employers', 'alert_modify_date')) {
        $sql = "ALTER TABLE `employers` DROP `alert_modify_date` ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'jhjhg5s');
        }
        $upgrade_needed = true;
    }
    if (does_field_exist('users', 'alert_modify_date')) {
        $sql = "ALTER TABLE `users` DROP `alert_modify_date` ";
        if ($flag) {
            JB_mysql_query($sql) or die(mysql_error() . 'dffdcvvv');
        }
        $upgrade_needed = true;
        // amd why not modify form_lists while we are at it...
        $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 (4, 'TEXT', 1, 'login_count', 'LCOUNT', 17, 'N', 0, '', 'N', 'N', 'N', 'Y');";
        if ($flag) {
            JB_mysql_query($sql) or mysql_error() . 'dffdc1';
        }
        $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 (4, 'TEXT', 2, 'Name', 'NAME', 18, 'N', 0, '', 'N', 'N', 'N', 'Y');";
        if ($flag) {
            JB_mysql_query($sql) or mysql_error() . 'dffdc2';
        }
        $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 (4, 'TEXT', 3, 'Username', 'USERNAME', 19, 'N', 0, '', 'N', 'N', 'N', 'Y');";
        if ($flag) {
            JB_mysql_query($sql) or mysql_error() . 'dffdc3';
        }
        $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 (4, 'TEXT', 4, 'Email', 'EMAIL', 20, 'N', 0, '', 'N', 'N', 'N', 'Y');";
        if ($flag) {
            JB_mysql_query($sql) or mysql_error() . 'dffdc4';
        }
        $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 (4, 'TEXT', 5, 'CompName', 'CNAME', 21, 'N', 0, 'Y,N', 'N', 'N', 'N', 'Y');";
        if ($flag) {
            JB_mysql_query($sql) or mysql_error() . 'dffdc5';
        }
        $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 (4, 'TEXT', 6, 'posts', 'POSTS', 22, 'N', 0, '', 'N', 'N', 'N', 'N');";
        if ($flag) {
            JB_mysql_query($sql) or mysql_error() . 'dffdc6';
        }
        $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 (4, 'TEXT', 7, 'Newsletter', 'NEWS', 23, 'N', 0, '', 'N', 'N', 'N', 'N');";
        if ($flag) {
            JB_mysql_query($sql) or mysql_error() . 'dffdc7';
        }
        $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 (4, 'TEXT', 8, 'Notification1', 'ALERTS', 24, 'N', 0, '', 'N', 'N', 'N', 'N');";
        if ($flag) {
            JB_mysql_query($sql) or mysql_error() . 'dffdc8';
        }
        $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 (4, 'TIME', 9, 'SignupDate', 'DATE', 25, 'N', 0, '', 'N', 'N', 'N', 'Y');";
        if ($flag) {
            JB_mysql_query($sql) or mysql_error() . 'dffdc9';
        }
        $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 (4, 'TEXT', 10, 'IP', 'IP', 26, 'N', 0, '', 'N', 'N', 'N', 'Y');";
        if ($flag) {
            JB_mysql_query($sql) or mysql_error() . 'dffdcnn';
        }
        $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', 1, 'login_count', 'LCOUNT', 27, 'N', 0, '', 'N', 'N', 'N', 'Y');";
        if ($flag) {
            JB_mysql_query($sql) or mysql_error() . 'dffdc99';
        }
        $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', 2, 'Name', 'NAME', 28, 'N', 0, '', 'N', 'N', 'N', 'Y');";
        if ($flag) {
            JB_mysql_query($sql) or mysql_error() . 'dffdc88';
        }
        $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', 3, 'Username', 'USERNAME', 29, 'N', 0, '', 'N', 'N', 'N', 'Y');";
        if ($flag) {
            JB_mysql_query($sql) or mysql_error() . 'dffdc66';
        }
        $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', 4, 'Email', 'EMAIL', 30, 'N', 0, '', 'N', 'N', 'N', 'Y');";
        if ($flag) {
            JB_mysql_query($sql) or mysql_error() . 'dffdc77';
        }
        $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', 5, 'Newsletter', 'NEWS', 31, 'N', 0, '', 'N', 'N', 'N', 'N');";
        if ($flag) {
            JB_mysql_query($sql) or mysql_error() . 'dffdc44';
        }
        $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', 6, 'Notification1', 'ALERTS', 32, 'N', 0, '', 'N', 'N', 'N', 'N');";
        if ($flag) {
            JB_mysql_query($sql) or mysql_error() . 'dffdc55';
        }
        $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', 7, 'resume_id', 'RESUME_ID', 33, 'N', 0, '', 'N', 'N', 'N', 'N');";
        if ($flag) {
            JB_mysql_query($sql) or mysql_error() . 'dffdc44';
        }
        $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, 'TIME', 8, 'SignupDate', 'DATE', 34, 'N', 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 (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', '')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('PAYPAL_IPN_URL', '')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('PAYPAL_CANCEL_RETURN_URL', '')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('PAYPAL_PAGE_STYLE', '" . PAYPAL_PAGE_STYLE . "')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('PAYPAL_SERVER', '" . PAYPAL_SERVER . "')";
            }
            if (MULTI_PAY_BANK_ON == 'YES') {
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('BANK_ENABLED', 'Y')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('BANK_CURRENCY', '" . BANK_CURRENCY . "')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('BANK_NAME', '" . BANK_NAME . "')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('BANK_ADDRESS', '" . BANK_ADDRESS . "')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('BANK_ACCOUNT_NAME', '" . BANK_ACCOUNT_NAME . "')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('BANK_ACCOUNT_NUMBER', '" . BANK_ACCOUNT_NUMBER . "')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('BANK_BRANCH_NUMBER', '" . BANK_BRANCH_NUMBER . "')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('BANK_SWIFT', '" . BANK_SWIFT . "')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('BANK_EMAIL_CONFIRM', '" . BANK_EMAIL_CONFIRM . "')";
                JB_mysql_query($sql);
            }
            if (MULTI_PAY_CHECK_ON == 'YES') {
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('CHECK_ENABLED', 'Y')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('CHECK_CURRENCY', '" . CHECK_CURRENCY . "')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('CHECK_PAYABLE', '" . CHECK_PAYABLE . "')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('CHECK_ADDRESS', '" . CHECK_ADDRESS . "')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('CHECK_EMAIL_CONFIRM', '" . CHECK_EMAIL_CONFIRM . "')";
                JB_mysql_query($sql);
            }
            if (MULTI_PAY_NOCHEX_ON == 'YES') {
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('NOCHEX_EMAIL', '" . NOCHEX_EMAIL . "')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('NOCHEX_ENABLED', 'Y')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('NOCHEX_LOGO_URL', '" . NOCHEX_LOGO_URL . "')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('NOCHEX_CANCEL_RETURN_URL', '" . NOCHEX_CANCEL_RETURN_URL . "')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('NOCHEX_RETURN_URL', '')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('NOCHEX_APC_URL', '')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('NOCHEX_BUTTON_URL', '" . NOCHEX_BUTTON_URL . "')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('NOCHEX_CURRENCY', '" . NOCHEX_CURRENCY . "')";
                JB_mysql_query($sql);
            }
            if (MULTI_PAY_2CO_ON == 'YES') {
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('_2CO_ENABLED', 'Y')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('_2CO_SID', '" . _2CO_SID . "')";
                JB_mysql_query($sql);
                //$sql = "REPLACE INTO jb_config (`key`, val, descr) VALUES ('_2CO_PRODUCT_ID', '1', '# Your 2CO seller ID number.')";
                //JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('_2CO_DEMO', '" . _2CO_DEMO . "')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('_2CO_SECRET_WORD', '" . _2CO_SECRET_WORD . "')";
                JB_mysql_query($sql);
                $sql = "REPLACE INTO jb_config (`key`, val) VALUES ('_2CO_PAYMENT_ROUTINE', '" . _2CO_PAYMENT_ROUTINE . "')";
                JB_mysql_query($sql);
            }
        }
    }
    if (!does_field_exist("jb_txn", "transaction_id")) {
        $sql = "CREATE TABLE `jb_txn` (\n\t\t`transaction_id` int(11) NOT NULL auto_increment,\n\t\t`date` datetime NOT NULL default '0000-00-00 00:00:00',\n\t\t`invoice_id` int(11) NOT NULL default '0',\n\t\t`type` varchar(32) NOT NULL default '',\n\t\t`amount` float NOT NULL default '0',\n\t\t`currency` char(3) NOT NULL default '',\n\t\t`txn_id` varchar(128) NOT NULL default '',\n\t\t`reason` varchar(64) NOT NULL default '',\n\t\t`origin` varchar(32) NOT NULL default '',\n\t\t`product_type` char(1) NOT NULL default 'P',\n\t\tPRIMARY KEY  (`transaction_id`))";
        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 (!does_field_exist("jb_txn", "reference")) {
        $sql = "ALTER TABLE jb_txn ADD `reference` VARCHAR( 128 ) NOT NULL  default ''";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("employers", "can_view_blocked")) {
        $sql = "ALTER TABLE employers ADD `can_view_blocked` SET( 'Y', 'N' ) NOT NULL default 'N'";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("posts_table", "guid")) {
        $sql = "ALTER TABLE posts_table ADD `guid` VARCHAR(255) NOT NULL default ''";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("posts_table", "cached_summary")) {
        $sql = "ALTER TABLE posts_table ADD `cached_summary` TEXT NOT NULL ";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("posts_table", "source")) {
        $sql = "ALTER TABLE posts_table ADD `source` VARCHAR(255) NOT NULL default ''";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("lang", "fckeditor_lang")) {
        $sql = "ALTER TABLE lang ADD `fckeditor_lang` VARCHAR(10) NOT NULL default 'en.js'";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    /*
    	if (!does_field_exist("lang", "direction")) {
    		$sql ="ALTER TABLE lang ADD `direction` CHAR(2) NOT NULL default 'LR'";
    		if ($flag) JB_mysql_query($sql) or die ($sql.mysql_error());
    		$upgrade_needed = true;
    	}
    */
    //
    if (!does_field_exist("motd", "motd_type")) {
        $sql = "CREATE TABLE `motd` (\n\t\t`motd_type` CHAR( 2 ) NOT NULL ,\n\t\t`motd_lang` CHAR( 2 ) NOT NULL ,\n\t\t`motd_message` TEXT NOT NULL,\n\t\t`motd_title` TEXT NOT NULL,\n\t\t`motd_date_updated` datetime NOT NULL,\n\t\tPRIMARY KEY ( `motd_type` , `motd_lang` ) )";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("help_pages", "help_type")) {
        $sql = "CREATE TABLE `help_pages` (\n\t\t`help_type` CHAR( 2 ) NOT NULL ,\n\t\t`help_lang` CHAR( 2 ) NOT NULL ,\n\t\t`help_message` TEXT NOT NULL,\n\t\t`help_title` TEXT NOT NULL,\n\t\t`help_date_updated` datetime NOT NULL,\n\t\tPRIMARY KEY ( `help_type` , `help_lang` ) )";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("payment_log", "date")) {
        $sql = "\n\t\tCREATE TABLE `payment_log` (\n\t\t  `seq_no` int(11) NOT NULL auto_increment,\n\t\t  `date` datetime NOT NULL default '0000-00-00 00:00:00',\n\t\t  `module` varchar(128) NOT NULL default '',\n\t\t  `log_entry` text NOT NULL,\n\t\t  PRIMARY KEY  (`seq_no`)\n\t\t) ";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("memberships", "membership_id")) {
        $sql = "\n\t\tCREATE TABLE `memberships` (\n\t\t`membership_id` INT NOT NULL AUTO_INCREMENT ,\n\t\t`name` VARCHAR( 255 ) NOT NULL ,\n\t\t`price` FLOAT NOT NULL ,\n\t\t`currency_code` VARCHAR( 3 ) NOT NULL ,\n\t\t`months` MEDIUMINT NOT NULL ,\n\t\tPRIMARY KEY ( `membership_id` ),\n\t\t`type` SET( 'E', 'C' ) NOT NULL\n\t\t) ";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("membership_invoices", "membership_id")) {
        $sql = "CREATE TABLE `membership_invoices` (\n\t\t`invoice_id` INT NOT NULL AUTO_INCREMENT ,\n\t\t`invoice_date` DATETIME NOT NULL ,\n\t\t`processed_date` DATETIME NULL ,\n\t\t`status` VARCHAR( 127 ) NOT NULL ,\n\t\t`user_type` SET( 'E', 'C' ) NOT NULL ,\n\t\t`user_id` INT NOT NULL ,\n\t\t`membership_id` INT NOT NULL ,\n\t\t`months_duration` MEDIUMINT NOT NULL ,\n\t\t`amount` FLOAT NOT NULL ,\n\t\t`currency_code` VARCHAR( 3 ) NOT NULL ,\n\t\t`currency_rate` DECIMAL( 10, 4 ) NOT NULL ,\n\t\t`item_name` VARCHAR( 255 ) NOT NULL ,\n\t\t`member_date` DATETIME NOT NULL ,\n\t\t`member_end` DATETIME NOT NULL ,\n\t\t`payment_method` VARCHAR( 64 ) NOT NULL ,\n\t\t`reason` VARCHAR( 127 ) NOT NULL ,\n\t\tPRIMARY KEY ( `invoice_id` ) \n\t\t); ";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
        $sql = "ALTER TABLE `posts_table` CHANGE `post_id` `post_id` INT( 11 ) NOT NULL AUTO_INCREMENT";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
    }
    if (!does_field_exist("users", "membership_active")) {
        $sql = "ALTER TABLE users ADD `membership_active` CHAR(1) NOT NULL default 'N'";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("employers", "membership_active")) {
        $sql = "ALTER TABLE employers ADD `membership_active` CHAR(1) NOT NULL default 'N'";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
        // while at it, update the primary key on the skill matrix
        $sql = "ALTER TABLE `skill_matrix_data` DROP PRIMARY KEY , ADD PRIMARY KEY ( `field_id` , `row` , `user_id` ) ";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        // update some thing with field_init
    }
    if (!does_field_exist("posts_table", "expired")) {
        $sql = "ALTER TABLE `posts_table` ADD `expired` SET ('Y','N') NOT NULL default 'N' ;";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("resumes_table", "expired")) {
        $sql = "ALTER TABLE `resumes_table` ADD `expired` SET ('Y','N') NOT NULL default 'N' ;";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("profiles_table", "expired")) {
        $sql = "ALTER TABLE `profiles_table` ADD `expired` SET ('Y','N') NOT NULL default 'N' ;";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("employers", "expired")) {
        $sql = "ALTER TABLE `employers` ADD `expired` SET ('Y','N') NOT NULL default 'N' ;";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("users", "expired")) {
        $sql = "ALTER TABLE `users` ADD `expired` SET ('Y','N') NOT NULL default 'N' ;";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("mail_monitor_log", "log_id")) {
        $sql = "CREATE TABLE `mail_monitor_log` (\n\t\t`log_id` INT NOT NULL AUTO_INCREMENT ,\n\t\t`date` DATETIME NOT NULL ,\n\t\t`email` VARCHAR(255) NOT NULL ,\n\t\t`user_type` SET( 'E', 'C' ) NOT NULL ,\n\t\tPRIMARY KEY ( `log_id` ))";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("xml_export_elements", "has_child")) {
        $sql = "ALTER TABLE `xml_export_elements` ADD `has_child` SET( 'Y', 'N' ) DEFAULT NULL ;";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        if ($flag) {
            include_once '../include/xml_feed_functions.php';
            JB_compute_export_elements_has_child();
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("xml_export_feeds", "form_id")) {
        $sql = "DROP TABLE IF EXISTS `xml_export_feeds`";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "\n\t\tCREATE TABLE `xml_export_feeds` (\n\t\t`feed_id` int(11) NOT NULL auto_increment,\n\t\t`feed_name` varchar(255) NOT NULL default '',\n\t\t`description` text NOT NULL,\n\t\t`field_settings` text NOT NULL,\n\t\t`search_settings` text NOT NULL,\n\t\t`max_records` int(11) NOT NULL default '0',\n\t\t`publish_mode` set('PUB','PRI') NOT NULL default '',\n\t\t`schema_id` int(11) NOT NULL default '0',\n\t\t`feed_key` varchar(255) NOT NULL default '',\n\t\t`hosts_allow` text NOT NULL,\n\t\t`is_locked` set('Y','N') NOT NULL default 'N',\n\t\t`form_id` int(11) NOT NULL default '0',\n\t\tPRIMARY KEY  (`feed_id`)\n\t\t)";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_feeds` VALUES (6, 'RSS Feed (Example)', 'this is a description', 'a:5:{i:147;s:1:\"2\";s:6:\"ft_147\";s:4:\"TEXT\";i:149;s:1:\"5\";s:6:\"ft_149\";s:6:\"EDITOR\";i:151;s:9:\"post_date\";}', 'a:4:{i:6;N;i:13;N;i:5;s:0:\"\";i:14;s:0:\"\";}', 50, 'PUB', 3, '', 'localhost', 'N', 1)";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_feeds` VALUES (9, 'Simply Hired Feed (Example)', 'Simply Hired - Jobs', 'a:49:{i:44;s:1:\"2\";s:5:\"ft_44\";s:4:\"TEXT\";i:45;s:7:\"post_id\";i:46;s:0:\"\";i:52;s:7:\"summary\";i:53;s:0:\"\";i:54;s:0:\"\";i:55;s:0:\"\";i:56;s:2:\"14\";s:12:\"boolean_p_56\";s:9:\"full-time\";s:5:\"ft_56\";s:8:\"CATEGORY\";i:57;s:1:\"2\";s:12:\"boolean_p_57\";s:9:\"part-time\";s:5:\"ft_57\";s:4:\"TEXT\";i:59;s:0:\"\";i:60;s:0:\"\";i:61;s:0:\"\";i:62;s:0:\"\";i:63;s:0:\"\";i:64;s:0:\"\";i:65;s:0:\"\";i:66;s:0:\"\";i:68;s:0:\"\";i:69;s:0:\"\";i:70;s:0:\"\";i:71;s:0:\"\";i:73;s:0:\"\";i:75;s:2:\"13\";s:5:\"ft_75\";s:8:\"CATEGORY\";i:76;s:0:\"\";i:77;s:0:\"\";i:78;s:0:\"\";i:79;s:0:\"\";i:80;s:0:\"\";i:82;s:1:\"8\";s:5:\"ft_82\";s:4:\"TEXT\";i:84;s:2:\"12\";s:5:\"ft_84\";s:4:\"TEXT\";i:85;s:0:\"\";i:86;s:0:\"\";i:87;s:0:\"\";i:88;s:0:\"\";i:90;s:1:\"8\";s:5:\"ft_90\";s:4:\"TEXT\";i:91;s:0:\"\";i:92;s:0:\"\";i:93;s:0:\"\";i:127;s:1:\"6\";s:6:\"ft_127\";s:8:\"CATEGORY\";}', 'a:4:{i:6;N;i:13;N;i:5;s:0:\"\";i:14;s:0:\"\";}', 50, 'PUB', 4, '', 'localhost', 'N', 1)";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_feeds` VALUES (10, 'Indeed Jobs Feed (Example)', 'My jobs feed to indeed!', 'a:20:{i:112;s:1:\"2\";s:6:\"ft_112\";s:4:\"TEXT\";i:113;s:9:\"post_date\";i:114;s:7:\"post_id\";i:116;s:1:\"8\";s:6:\"ft_116\";s:4:\"TEXT\";i:117;s:2:\"15\";s:6:\"ft_117\";s:4:\"TEXT\";i:118;s:0:\"\";i:119;s:0:\"\";i:120;s:0:\"\";i:121;s:1:\"5\";s:6:\"ft_121\";s:6:\"EDITOR\";i:122;s:0:\"\";i:123;s:0:\"\";i:124;s:2:\"14\";s:6:\"ft_124\";s:8:\"CATEGORY\";i:125;s:1:\"6\";s:6:\"ft_125\";s:8:\"CATEGORY\";i:126;s:0:\"\";}', 'a:4:{i:6;N;i:13;N;i:5;s:0:\"\";i:14;s:0:\"\";}', 50, 'PUB', 2, '', 'localhost', 'N', 1)";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_feeds` VALUES (11, 'Google Base Feed (Example)', 'Google Base Feed', 'a:17:{i:14;s:0:\"\";i:19;s:2:\"13\";s:5:\"ft_19\";s:8:\"CATEGORY\";i:20;s:0:\"\";i:21;s:0:\"\";i:96;s:1:\"2\";s:5:\"ft_96\";s:4:\"TEXT\";i:97;s:1:\"5\";s:5:\"ft_97\";s:6:\"EDITOR\";i:98;s:1:\"6\";s:5:\"ft_98\";s:8:\"CATEGORY\";i:99;s:0:\"\";i:100;s:0:\"\";i:103;s:0:\"\";i:104;s:1:\"8\";s:6:\"ft_104\";s:4:\"TEXT\";i:106;s:0:\"\";}', 'a:4:{i:6;N;i:13;N;i:5;s:0:\"\";i:14;s:0:\"\";}', 50, 'PUB', 1, '', 'ALL', 'N', 1)";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("xml_export_schemas", "is_locked")) {
        $sql = "CREATE TABLE `xml_export_schemas` (\n\t\t  `schema_id` int(11) NOT NULL auto_increment,\n\t\t  `schema_name` varchar(255) NOT NULL default '',\n\t\t  `description` text NOT NULL,\n\t\t  `form_id` int(11) NOT NULL default '0',\n\t\t  `is_locked` set('Y','N') NOT NULL default 'N',\n\t\t  PRIMARY KEY  (`schema_id`)\n\t\t)";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
        $sql = "INSERT INTO `xml_export_schemas` VALUES (1, 'Google Base  - Jobs', 'For a full description of the attributes (elements) see: http://www.google.com/base/jobs.html', 1, 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_schemas` VALUES (2, 'Indeed.com', 'http://www.indeed.com/jsp/xmlinfo.jsp', 1, 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_schemas` VALUES (3, 'RSS', 'http://blogs.law.harvard.edu/tech/rss', 1, 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "INSERT INTO `xml_export_schemas` VALUES (4, 'SimplyHired.com', 'Simply Hired can accept incoming job feeds in either xml or delimited formats\r\nhttp://www.simplyhired.com/feed.php#feed_spec', 1, 'Y')";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
    }
    if (!does_field_exist("xml_export_feeds", "is_locked")) {
        $upgrade_needed = true;
        $sql = "ALTER TABLE `xml_export_feeds` ADD `is_locked` SET ('Y','N') NOT NULL default 'N' ;";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "ALTER TABLE `xml_export_feeds` ADD `description` text NOT NULL";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "ALTER TABLE `xml_export_feeds` ADD `field_settings` text NOT NULL";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "ALTER TABLE `xml_export_feeds` ADD `search_settings` text NOT NULL";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "ALTER TABLE `xml_export_feeds` ADD `max_records` int(11) NOT NULL default '0'";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "ALTER TABLE `xml_export_feeds` ADD `publish_mode` set('PUB','PRI') NOT NULL default ''";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "ALTER TABLE `xml_export_feeds` ADD `schema_id` int(11) NOT NULL default '0'";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "ALTER TABLE `xml_export_feeds` ADD `feed_key` varchar(255) NOT NULL default ''";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $sql = "ALTER TABLE `xml_export_feeds` ADD `hosts_allow` text NOT NULL";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
    }
    // fix up MSELECT
    $sql = "SELECT * FROM jb_variables WHERE `key`='MSELECT_FIXED2'  ";
    $result = @JB_mysql_query($sql);
    if ($row = mysql_num_rows($result) == 0) {
        // fix MSELECT
        $sql = "SELECT * from form_fields WHERE field_type='RADIO' or field_type='MSELECT' ";
        $result = JB_mysql_query($sql);
        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
            /*
            			// Uncomment if you are getting the following error:
            			// BLOB/TEXT column '22' used in key specification without a key length
            			// or similar error
            			// remove old indexes on the fields
            			/*
            			$sql = "SHOW index FROM posts_table";
            			$result = mysql_query($sql);
            			while ($row=mysql_fetch_array($result, MYSQL_ASSOC)) {
            	
            				if (strpos(strtolower($row['Key_name']), 'composite')!==false) {
            					$sql ="ALTER TABLE posts_table DROP INDEX `".$row['Key_name']."`";
            					mysql_query($sql) or die(mysql_error());
            	}
            				
            			}
            */
            $t_name = JB_get_table_name_by_id($row['form_id']);
            $sql = ' ALTER TABLE `' . $t_name . '` CHANGE `' . $row['field_id'] . '` `' . $row['field_id'] . '` TEXT NOT NULL  ';
            JB_mysql_query($sql) or die(mysql_error());
            //echo $sql."<br>";
        }
        // NOW FIX All the MSELECT records
        $sql = "SELECT * from form_fields WHERE field_type='MSELECT' ";
        $result = JB_mysql_query($sql);
        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
            $table_name = JB_get_table_name_by_id($row['form_id']);
            $id_name = JB_get_table_id_column($row['form_id']);
            $sql = "SELECT `" . $row['field_id'] . "`, {$id_name} FROM {$table_name} ";
            //echo $sql." (idname: $id_name)<br>";
            $res2 = JB_mysql_query($sql) or die(mysql_error());
            while ($row2 = mysql_fetch_array($res2)) {
                $new_val = str_replace(' ', '', $row2[$row['field_id']]);
                // remove spaces
                $new_val = preg_replace('#^,#', '', $new_val);
                $new_val = preg_replace('#,$#', '', $new_val);
                $new_arr = explode(',', $new_val);
                $sql = "UPDATE {$table_name} SET `" . $row['field_id'] . "`='" . $new_val . "' WHERE {$id_name}='" . addslashes($row2[$id_name]) . "' ";
                JB_mysql_query($sql) or die(mysql_error());
            }
        }
        //Fixed MSELECT fields
        $sql = "REPLACE INTO jb_variables (`key`, `val`) VALUES ('MSELECT_FIXED2', 'YES') ";
        JB_mysql_query($sql) or die(mysql_error());
    }
    // rename %RESUME_ALERT% to %RESUME_ALERTS%
    $sql = "SELECT * FROM jb_variables WHERE `key`='RESUME_ALERT_RENAME_FIXED'  ";
    $result = JB_mysql_query($sql);
    if ($row = mysql_num_rows($result) == 0) {
        $sql = "SELECT * from email_templates WHERE EmailText LIKE  '%RESUME_ALERT%' ";
        $result = JB_mysql_query($sql) or die(mysql_error());
        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
            $row['EmailText'] = str_replace('%RESUME_ALERT%', '%RESUME_ALERTS%', $row['EmailText']);
            $sql = "UPDATE email_templates SET EmailText = '" . addslashes($row['EmailText']) . "' WHERE EmailID='" . $row['EmailID'] . "' ";
            JB_mysql_query($sql);
        }
        $sql = "SELECT * from email_template_translations WHERE EmailText LIKE  '\\%RESUME_ALERT\\%' ";
        $result = JB_mysql_query($sql) or die(mysql_error());
        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
            $row['EmailText'] = str_replace('%RESUME_ALERT%', '%RESUME_ALERTS%', $row['EmailText']);
            $sql = "UPDATE email_templates SET EmailText = '" . addslashes($row['EmailText']) . "' WHERE EmailID='" . $row['EmailID'] . "' ";
            JB_mysql_query($sql);
        }
        $sql = "SELECT * from email_template_translations WHERE EmailText LIKE  '\\%KEYWORDS_LINE\\%' ";
        $result = JB_mysql_query($sql) or die(mysql_error());
        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
            if ($row['EmailID'] == 5 || $row['EmailID'] == 6) {
                $row['EmailText'] = str_replace('%KEYWORDS_LINE%', '%RESUME_ALERTS%', $row['EmailText']);
                $sql = "UPDATE email_templates SET EmailText = '" . addslashes($row['EmailText']) . "' WHERE EmailID='" . $row['EmailID'] . "' ";
                JB_mysql_query($sql);
            }
            if ($row['EmailID'] == 7 || $row['EmailID'] == 8) {
                $row['EmailText'] = str_replace('%KEYWORDS_LINE%', '%JOB_ALERTS%', $row['EmailText']);
                $sql = "UPDATE email_templates SET EmailText = '" . addslashes($row['EmailText']) . "' WHERE EmailID='" . $row['EmailID'] . "' ";
                JB_mysql_query($sql);
            }
        }
        //echo 'Updated email templates<br>';
        $sql = "REPLACE INTO jb_variables (`key`, `val`) VALUES ('RESUME_ALERT_RENAME_FIXED', 'YES') ";
        JB_mysql_query($sql) or die(mysql_error());
    }
    // update CATOPTION_CACHE_UPDATE
    $sql = "SELECT * FROM jb_variables WHERE `key`='CATOPTION_CACHE_UPDATE'  ";
    $result = @JB_mysql_query($sql);
    if ($row = mysql_num_rows($result) == 0) {
        if ($flag == true && does_field_exist("categories", "seo_fname")) {
            JB_cache_del_keys_for_form(1);
            JB_cache_del_keys_for_form(2);
            JB_cache_del_keys_for_form(3);
            JB_cache_del_keys_for_form(4);
            JB_cache_del_keys_for_form(5);
            JB_cache_del_keys_for_all_cats(1);
            JB_cache_del_keys_for_all_cats(2);
            JB_cache_del_keys_for_all_cats(3);
            JB_cache_del_keys_for_all_cats(4);
            JB_cache_del_keys_for_all_cats(5);
            JB_cache_del_keys_for_cat_options();
            echo "* Updated your category cache<br>";
            $sql = "REPLACE INTO jb_variables (`key`, `val`) VALUES ('CATOPTION_CACHE_UPDATE', 'YES') ";
            JB_mysql_query($sql) or die(mysql_error());
        }
    }
    // update CODESFIELD_CACHE_UPDATE
    $sql = "SELECT * FROM jb_variables WHERE `key`='CODESFIELD_CACHE_UPDATE'  ";
    $result = @JB_mysql_query($sql);
    if ($row = mysql_num_rows($result) == 0) {
        if (does_field_exist("categories", "seo_fname")) {
            // here
            $sql = "select field_id from codes group by field_id ";
            $result2 = JB_mysql_query($sql) or die(mysql_error());
            while ($row2 = mysql_fetch_array($result2, MYSQL_ASSOC)) {
                JB_cache_del_keys_for_codes($row2['field_id']);
            }
            echo "* Updated your codes cache<br>";
            $sql = "REPLACE INTO jb_variables (`key`, `val`) VALUES ('CODESFIELD_CACHE_UPDATE', 'YES') ";
            JB_mysql_query($sql) or die(mysql_error());
        }
    }
    if (!does_field_exist("xml_export_elements", "static_mod")) {
        $sql = "ALTER TABLE `xml_export_elements` ADD `static_mod` SET( 'A', 'P', 'F' ) DEFAULT 'F' NOT NULL ,\n\t\tADD `multi_fields` SMALLINT DEFAULT '1' NOT NULL ";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("xml_export_elements", "comment")) {
        $sql = "ALTER TABLE `xml_export_elements` ADD `comment` VARCHAR( 255 ) DEFAULT '' NOT NULL  ";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("posts_table", "app_type")) {
        $sql = "ALTER TABLE `posts_table` ADD `app_type` CHAR( 1 ) NOT NULL DEFAULT 'O', ADD `app_url` VARCHAR( 255 ) NOT NULL ; ";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("subscriptions", "views_quota")) {
        $sql = "ALTER TABLE `subscriptions` ADD  `views_quota` INT NOT NULL DEFAULT '-1', ADD `p_posts_quota` INT NOT NULL DEFAULT '-1', ADD `posts_quota` INT NOT NULL DEFAULT '-1' ; ";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("subscription_invoices", "views_quota")) {
        $sql = "ALTER TABLE `subscription_invoices` ADD  `views_quota` INT NOT NULL DEFAULT '-1', ADD `p_posts_quota` INT NOT NULL DEFAULT '-1', ADD `posts_quota` INT NOT NULL DEFAULT '-1' ; ";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("employers", "views_quota")) {
        $sql = "ALTER TABLE `employers` ADD  `views_quota` INT NOT NULL DEFAULT '-1', ADD `p_posts_quota` INT NOT NULL DEFAULT '-1', ADD `posts_quota` INT NOT NULL DEFAULT '-1', ADD  `views_quota_tally` INT NOT NULL DEFAULT '0', ADD `p_posts_quota_tally` INT NOT NULL DEFAULT '0', ADD `posts_quota_tally` INT NOT NULL DEFAULT '0', ADD `quota_timestamp` INT NOT NULL DEFAULT '0' ; ";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (does_field_exist("subscriptions", "subscr_date")) {
        $sql = "ALTER TABLE `subscriptions` DROP `subscr_date`, DROP `subscr_effective`, DROP `recurring`, DROP `subscr_id`;";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("short_urls", "url")) {
        $sql = "CREATE TABLE `short_urls` (\n\t\t  `url` varchar(255) NOT NULL,\n\t\t  `date` timestamp NOT NULL,\n\t\t  `hash` varchar(255) NOT NULL,\n\t\t  `expires` set('Y','N') NOT NULL,\n\t\t  `hits` bigint(20) NOT NULL,\n\t\t  PRIMARY KEY (`url`)\n\t\t)";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("mail_queue", "user_id")) {
        $sql = "ALTER TABLE `mail_queue` ADD `user_id` INT NULL DEFAULT NULL, ADD `user_type` VARCHAR( 10 ) NULL DEFAULT NULL;";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("sitemaps_urls", "url")) {
        $sql = "CREATE TABLE `sitemaps_urls` (\n\t\t\t\t`url` TEXT NOT NULL ,\n\t\t\t\t`priority` FLOAT NOT NULL ,\n\t\t\t\t`changefreq` VARCHAR( 15 ) NOT NULL\n\t\t\t\t) ";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("xml_export_feeds", "include_emp_accounts")) {
        $sql = "ALTER TABLE `xml_export_feeds` ADD `include_emp_accounts` SET( 'Y', 'N' ) NOT NULL DEFAULT 'N' ;";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    if (!does_field_exist("xml_export_feeds", "export_with_url")) {
        $sql = "ALTER TABLE `xml_export_feeds` ADD `export_with_url` SET( 'Y', 'N' ) NOT NULL DEFAULT 'Y' ;";
        if ($flag) {
            JB_mysql_query($sql) or die($sql . mysql_error());
        }
        $upgrade_needed = true;
    }
    $sql = "SELECT * FROM jb_variables WHERE `key`='CODESFIELD_CACHE_UPDATE'  ";
    $result = @JB_mysql_query($sql);
    if ($row = mysql_num_rows($result) == 0) {
    }
    $sql = "UPDATE form_fields SET field_init='' WHERE field_id=2 AND field_init=5 ";
    JB_mysql_query($sql) or die($sql . mysql_error());
    $sql = "UPDATE form_fields SET field_init='' WHERE field_id=5 AND field_init=5";
    JB_mysql_query($sql) or die($sql . mysql_error());
    if ($flag) {
        JB_fix_form_field_translations();
    }
    $sql = "ALTER TABLE `applications` CHANGE `app_id` `app_id` INT( 11 ) NOT NULL AUTO_INCREMENT ";
    if ($flag) {
        JB_mysql_query($sql) or die(mysql_error() . 'jsgd73cd');
    }
    if (1 == 1) {
        $sql = "INSERT INTO `email_templates` (`EmailID`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (330, 'A new order was placed on %SITE_NAME% by %USER%!\r\n\r\nTo manage, see here:\r\n%ADMIN_LINK%\r\n\r\n==================================\r\n\r\nOrder by: %LNAME%, %FNAME%\r\nUsername: %USER%\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nItem: %ITEM_NAME%\r\nOrder ID: #%INVOICE_CODE%\r\nPrice: %INVOICE_AMOUNT%\r\n', '*****@*****.**', 'A New order was placed on %SITE_NAME%', 'Jamit Demo', '');";
        if (!JB_template_exists(330)) {
            JB_mysql_query($sql);
        }
        $sql = "INSERT INTO `email_templates` (`EmailID`,  `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (320,  'A Resume resume was posted to / updated on %SITE_NAME%\r\n\r\nAdmin Link: \r\n%ADMIN_LINK%\r\n\r\n%RESUME_SUMMARY%\r\n\r\n\r\n', '*****@*****.**', 'A Resume was saved on %SITE_NAME%', 'Jamit Demo', '');";
        if (!JB_template_exists(320)) {
            JB_mysql_query($sql);
        }
        $sql = "INSERT INTO `email_templates` (`EmailID`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (310, 'A new Post was posted to %SITE_NAME%\r\n\r\nAdmin Link: %ADMIN_LINK%\r\n\r\nTitle:\r\n%POST_TITLE%\r\nBy:\r\n%POSTED_BY%\r\nDate:\r\n%DATE%\r\nDescription:\r\n%POST_DESCRIPTION%\r\n', '*****@*****.**', 'A new Post was posted to %SITE_NAME%', 'Jamit Job Board', '');";
        if (!JB_template_exists(310)) {
            JB_mysql_query($sql);
        }
        $sql = "INSERT INTO `email_templates` (`EmailID`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (210, 'Dear %FNAME% %LNAME%,\r\n\r\nWe would like to notify you that the following post had expired on %SITE_NAME%:\r\n\r\n%POST_DATE% - \"%POST_TITLE%\"\r\n\r\nStatistics:\r\n%VIEWS% views\r\n%APPS% Applications\r\n\r\nThis job post will no longer be visible in the job listings. You may log in to your employer''s account to view or re-post this job, or post a new job at any time.\r\n\r\nKind Regards,\r\n\r\n%SITE_NAME% team\r\n%SITE_URL%\r\n%SITE_CONTACT_EMAIL%', '*****@*****.**', 'Job post expired', 'Jamit Demo', '');";
        if (!JB_template_exists(210)) {
            JB_mysql_query($sql);
        }
        $sql = "INSERT INTO `email_templates` (`EmailID`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (220, 'Dear %FNAME% %LNAME%,\r\n\r\nThank you for posting your job to %SITE_NAME%!\r\n\r\nWe have just approved the following job to be listed on our site:\r\n\r\n%POST_DATE% - \"%POST_TITLE%\"\r\n%POST_URL%\r\n\r\n\r\nThis job post will now become visible on the job listings. You may log in to your employer''s account to view or edit this job at any time.\r\n\r\nKind Regards,\r\n\r\n%SITE_NAME% team\r\n%SITE_URL%\r\n%SITE_CONTACT_EMAIL%', '*****@*****.**', 'Your job posting was Approved!', 'Jamit Demo', '');";
        if (!JB_template_exists(220)) {
            JB_mysql_query($sql);
        }
        $sql = "INSERT INTO `email_templates` (`EmailID`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (230, 'Dear %FNAME% %LNAME%,\r\n\r\nThank you for posting your job to %SITE_NAME%.\r\n\r\nHowever, after reviewing your job post, we have decided to disapprove it.\r\n\r\nThe following job post was disapproved:\r\n\r\n%POST_DATE% - \"%POST_TITLE%\"\r\n\r\nReason for disapproval: %REASON%\r\n\r\nYou may log in to your employer''s account to edit this job so that we may review it again.\r\n\r\nKind Regards,\r\n\r\n%SITE_NAME% team\r\n%SITE_URL%\r\n%SITE_CONTACT_EMAIL%', '*****@*****.**', 'Your job posting was disapproved', 'Jamit Job Board', '');";
        if (!JB_template_exists(230)) {
            JB_mysql_query($sql);
        }
        $sql = "INSERT INTO `email_templates` (`EmailID`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (60, 'Dear  %LNAME%, %FNAME%\r\n\r\nYour order on %SITE_NAME% was confirmed, thank you.\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nItem Name: %ITEM_NAME%\r\nPosts: %QUANTITY% \r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Confirmed\r\nPayment Method: Bank Deposit\r\n--------------------------\r\n\r\nPlease deposit %INVOICE_AMOUNT% to the following account:\r\n\tBank: %BANK_NAME%\r\n\tA/C Name: %AC_NAME%\r\n\tA/C Number: %AC_NUMBER%\r\n\r\nAfter making the deposit, please send an email to \r\n%SITE_CONTACT_EMAIL% with the following \r\nOrder Number: %INVOICE_CODE% to help us process the transaction. \r\n\r\nFeel free to contact %SITE_CONTACT_EMAIL% if you have \r\nany questions / problems. \r\n\r\nThank you!\r\n\r\n\r\n%SITE_NAME% team.\r\n%SITE_URL%\r\n\r\nNote: This is an automated email.', '*****@*****.**', 'Order Confirmed', 'Hi Teacher', '');";
        if (!JB_template_exists(60)) {
            JB_mysql_query($sql);
        }
        // P. Confirmed - Bank
        $sql = "INSERT INTO `email_templates` (`EmailID`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (61, 'Dear  %LNAME%, %FNAME%\r\n\r\nYour order on %SITE_NAME% was confirmed, thank you.\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nItem Name: %ITEM_NAME%\r\nPosts: %QUANTITY% \r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Confirmed\r\nPayment Method: Check / Money Order\r\n--------------------------\r\n\r\nPlease send %INVOICE_AMOUNT% (%CHECK_CURRENCY%) to the following address:\r\n\tPayee Name: %PAYEE_NAME%\r\n\tAddress: \r\n        %PAYEE_ADDRESS%\r\n\t\r\n\r\nAfter mailing the check, please send an email to \r\n%SITE_CONTACT_EMAIL% with the following \r\nOrder Number: %INVOICE_CODE% to help us process the transaction. \r\n\r\nFeel free to contact %SITE_CONTACT_EMAIL% if you have \r\nany questions / problems. \r\n\r\nThank you!\r\n\r\n\r\n%SITE_NAME% team.\r\n%SITE_URL%\r\n\r\nNote: This is an automated email.', '*****@*****.**', 'Order Confirmed', 'Jamit Demo', '');";
        if (!JB_template_exists(61)) {
            JB_mysql_query($sql);
        }
        // P. Confirmed - Check
        $sql = "INSERT INTO `email_templates` (`EmailID`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (70, 'Dear  %LNAME%, %FNAME%\r\n\r\nYour order on %SITE_NAME% was successfully completed, thank you!\r\n\r\nWe have credited your order to your account, and you may now use your available balance to post your job advertisement(s) to %SITE_NAME%.\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nItem Name: %ITEM_NAME%\r\nPosts: %QUANTITY% \r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Completed\r\nPayment Method: %PAYMENT_METHOD%\r\n\r\n--------------------------\r\n\r\nThank you for using %SITE_NAME%! \r\n\r\nYou may view your balance and order history at any time.\r\nJust log in to your %SITE_NAME%, and go to ''Posts'' -> ''Posting Credits''.\r\n\r\n\r\n%SITE_NAME% team.\r\n%SITE_URL%\r\n\r\nNote: This is an automated email.', '*****@*****.**', 'Order completed!', 'Jamit Demo', '')";
        if (!JB_template_exists(70)) {
            JB_mysql_query($sql);
        }
        // posting credits order completed
        $sql = "INSERT INTO `email_templates` (`EmailID`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (90, 'Dear  %LNAME%, %FNAME%\r\n\r\nYour subscription payment on %SITE_NAME% was successfully completed, thank you!\r\n\r\nWe have activated your subscription, and you may now log in to your account\r\nto access the resume database.\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nSubscription Name: %ITEM_NAME%\r\nSubscription Months: %SUB_DURATION%\r\nStart Date: %SUB_START%\r\nEnd Date: %SUB_END%\r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Active\r\nPayment Method: %PAYMENT_METHOD%\r\n\r\n--------------------------\r\n\r\nThank you for using %SITE_NAME%! \r\n\r\nYou may view your subscription order history at any time.\r\nJust log in to your %SITE_NAME%, and go to ''Resumes'' -> ''Subscriptions''.\r\n\r\n\r\n%SITE_NAME% team.\r\n%SITE_URL%\r\n\r\nNote: This is an automated email.', '*****@*****.**', 'Subscription now active!', 'Jamit Demo', '')";
        if (!JB_template_exists(90)) {
            JB_mysql_query($sql);
        }
        // sub completed
        $sql = "INSERT INTO `email_templates` (`EmailID`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (80, 'Dear  %LNAME%, %FNAME%\r\n\r\nYour subscription on %SITE_NAME% was confirmed, thank you.\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nSubscription Name: %ITEM_NAME%\r\nSubscription Months: %SUB_DURATION%\r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Active\r\nPayment Method: Bank\r\n--------------------------\r\n\r\nPlease deposit %INVOICE_AMOUNT% to the following account:\r\n\tBank: %BANK_NAME%\r\n\tA/C Name: %AC_NAME%\r\n\tA/C Number: %AC_NUMBER%\r\n\r\nAfter making the deposit, please send an email to \r\n%SITE_CONTACT_EMAIL% with the following \r\nOrder Number: %INVOICE_CODE% to help us process the transaction. \r\n\r\nFeel free to contact %SITE_CONTACT_EMAIL% if you have \r\nany questions / problems. \r\n\r\nThank you!\r\n\r\n\r\n%SITE_NAME% team.\r\n%SITE_URL%\r\n', '*****@*****.**', 'Subscription order confirmed', 'Jamit Demo', '')";
        if (!JB_template_exists(80)) {
            JB_mysql_query($sql);
        }
        // sub confirmed (bank)
        $sql = "INSERT INTO `email_templates` (`EmailID`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (81, 'Dear %LNAME%, %FNAME%\r\n\r\nYour order on %SITE_NAME% was confirmed, thank you.\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nSubscription Name: %ITEM_NAME%\r\nSubscription Months: %SUB_DURATION%\r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Confirmed\r\nPayment Method: Check / Money Order\r\n--------------------------\r\n\r\nPlease send %INVOICE_AMOUNT% (%CHECK_CURRENCY%) to the following address:\r\n\tPayee Name: %PAYEE_NAME%\r\n\tAddress: \r\n        %PAYEE_ADDRESS%\r\n\t\r\n\r\nAfter mailing the check, please send an email to \r\n%SITE_CONTACT_EMAIL% with the following \r\nOrder Number: %INVOICE_CODE% to help us process the transaction. \r\n\r\nFeel free to contact %SITE_CONTACT_EMAIL% if you have \r\nany questions / problems. \r\n\r\nThank you!\r\n\r\n\r\n%SITE_NAME% team.\r\n%SITE_URL%\r\n\r\nNote: This is an automated email', '*****@*****.**', 'Subscription order confirmed', 'Jamit Demo', '')";
        if (!JB_template_exists(81)) {
            JB_mysql_query($sql);
        }
        // sub confirmed (check)
        $sql = "INSERT INTO `email_templates` (`EmailID`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (120, 'Dear  %LNAME%, %FNAME%\r\n\r\nThis email is sent to notify you that your membership to %SITE_NAME% has expired.\r\n\r\nWe thank you for your patronage during your membership time, and we hope\r\nthat we can continue to serve you as our member in the future.\r\n\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nMembership Name: %ITEM_NAME%\r\nMembership Months: %MEM_DURATION%\r\nStart Date: %MEM_START%\r\nEnd Date: %MEM_END%\r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Expired\r\nPayment Method: %PAYMENT_METHOD%\r\n\r\n--------------------------\r\n\r\nThank you for using %SITE_NAME%! \r\n\r\nYou may view your membership order history at any time.\r\nJust log in to your %SITE_NAME%, and go to ''Account'' -> ''Membership Details''.\r\n\r\n\r\n\r\n%SITE_NAME% team.\r\n%SITE_URL%\r\n\r\nNote: This is an automated email.', '*****@*****.**', 'Membership Expired', 'Jamit Demo', '')";
        if (!JB_template_exists(120)) {
            JB_mysql_query($sql);
        }
        // mem expired
        $sql = "INSERT INTO `email_templates` (`EmailID`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (100, 'Dear  %LNAME%, %FNAME%\r\n\r\nYour membership on %SITE_NAME% was confirmed, thank you.\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nMembership Item: %ITEM_NAME%\r\nMembership Months: %MEM_DURATION%\r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Confirmed\r\nPayment Method: Bank\r\n--------------------------\r\n\r\nPlease deposit %INVOICE_AMOUNT% to the following account:\r\n\tBank: %BANK_NAME%\r\n\tA/C Name: %AC_NAME%\r\n\tA/C Number: %AC_NUMBER%\r\n\r\nAfter making the deposit, please send an email to \r\n%SITE_CONTACT_EMAIL% with the following \r\nOrder Number: %INVOICE_CODE% to help us process the transaction. \r\n\r\nFeel free to contact %SITE_CONTACT_EMAIL% if you have \r\nany questions / problems. \r\n\r\nThank you!\r\n\r\n\r\n%SITE_NAME% team.\r\n%SITE_URL%\r\n', '*****@*****.**', 'Membership Order Confirmed', 'Jamit Demo', '')";
        if (!JB_template_exists(100)) {
            JB_mysql_query($sql);
        }
        // mem confirmed (BANK)
        $sql = "INSERT INTO `email_templates` (`EmailID`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (101, 'Dear %LNAME%, %FNAME%\r\n\r\nYour order on %SITE_NAME% was confirmed, thank you.\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nMembership Name: %ITEM_NAME%\r\nMembership Months: %MEM_DURATION%\r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Confirmed\r\nPayment Method: Check / Money Order\r\n--------------------------\r\n\r\nPlease send %INVOICE_AMOUNT% (%CHECK_CURRENCY%) to the following address:\r\n\tPayee Name: %PAYEE_NAME%\r\n\tAddress: \r\n        %PAYEE_ADDRESS%\r\n\t\r\n\r\nAfter mailing the check, please send an email to \r\n%SITE_CONTACT_EMAIL% with the following \r\nOrder Number: %INVOICE_CODE% to help us process the transaction. \r\n\r\nFeel free to contact %SITE_CONTACT_EMAIL% if you have \r\nany questions / problems. \r\n\r\nThank you!\r\n\r\n\r\n%SITE_NAME% team.\r\n%SITE_URL%\r\n\r\nNote: This is an automated email', '*****@*****.**', 'Membership Order Confirmed', 'Jamit Demo', '')";
        if (!JB_template_exists(101)) {
            JB_mysql_query($sql);
        }
        // member confirmed (check)
        $sql = "INSERT INTO `email_templates` (`EmailID`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (110, 'Dear  %LNAME%, %FNAME%\r\n\r\nYour membership payment on %SITE_NAME% was successfully completed, thank you!\r\n\r\nWe have activated your membership, and we welcome you as our new member. \r\nHere are your membership payment details:\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nMembership Name: %ITEM_NAME%\r\nMembership Months: %MEM_DURATION%\r\nStart Date: %MEM_START%\r\nEnd Date: %MEM_END%\r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Active\r\nPayment Method: %PAYMENT_METHOD%\r\n\r\n--------------------------\r\n\r\nThank you for using %SITE_NAME%! \r\n\r\nYou may view your membership order history at any time.\r\nJust log in to your %SITE_NAME%, and go to ''Account'' -> ''Membership Details''.\r\n\r\n\r\n%SITE_NAME% team.\r\n%SITE_URL%\r\n\r\nNote: This is an automated email.', '*****@*****.**', 'Membership Activated', 'Jamit Demo', '')";
        if (!JB_template_exists(110)) {
            JB_mysql_query($sql);
        }
        // member completed
        $sql = "INSERT INTO `email_templates` (`EmailID`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (130, 'Dear  %LNAME%, %FNAME%\r\n\r\nThis email is sent to notify you that your subscription to %SITE_NAME% has expired.\r\n\r\nWe thank you for your patronage during your subscription time, and we hope\r\nthat we can continue to serve you as our subscriber in the future.\r\n\r\n\r\n========================\r\nORDER DETAILS\r\n=========================\r\nOrder ID: #%INVOICE_CODE%\r\nSubscription Name: %ITEM_NAME%\r\nSubscription Months: %SUB_DURATION%\r\nStart Date: %SUB_START%\r\nEnd Date: %SUB_END%\r\nPrice: %INVOICE_AMOUNT%\r\nStatus: Expired\r\nPayment Method: %PAYMENT_METHOD%\r\n\r\n--------------------------\r\n\r\nThank you for using %SITE_NAME%! \r\n\r\nYou may view your subscription order history at any time.\r\nJust log in to your %SITE_NAME%, and go to ''Account'' -> ''Subscription''.\r\n\r\n\r\n\r\n%SITE_NAME% team.\r\n%SITE_URL%\r\n\r\nNote: This is an automated email.', '*****@*****.**', 'Subscription Expired', 'Jamit Demo', '')";
        if (!JB_template_exists(130)) {
            JB_mysql_query($sql);
        }
        // sub expired
        $sql = "INSERT INTO `email_templates` ( `EmailText` , `EmailFromAddress` , `EmailFromName` , `EmailSubject` , `EmailID` , `sub_template` )VALUES ('%APP_LETTER% \r\n\r\n----------------------------------- \r\nThis email was sent from %SITE_NAME% %BASE_HTTP_PATH%\r\nOnline Resume Link: \r\n%RESUME_DB_LINK%\r\n', '', '', '', '12', '');";
        if (!JB_template_exists(12)) {
            JB_mysql_query($sql);
        }
        // application
        $sql = "INSERT INTO `email_templates` (`EmailID`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (11, '%MESSAGE%\r\n\r\n\r\n\r\n\r\n------------------------\r\n%SITE_URL%\r\n\r\nThis message was sent by somebody using the \r\nweb-email service provided by %SITE_NAME%.\r\n\r\nName: %EMPLOYER_NAME%\r\nSender\\'s User ID: %USER_ID%\r\nSender IP: %SENDER_IP%\r\n', '*****@*****.**', '', 'Jamit Demo', '');";
        if (!JB_template_exists(11)) {
            JB_mysql_query($sql);
        }
        // employer to candidate
        $sql = "INSERT INTO `email_templates` (`EmailID`, `EmailText`, `EmailFromAddress`, `EmailSubject`, `EmailFromName`, `sub_template`) VALUES (44, 'Hello %EMP_NAME%\r\n\r\n%CAN_NAME% has granted you access to their online resume on %SITE_NAME%!\r\n\r\nTo view this resume, please see this link:\r\n\r\nResume link: %RESUME_DB_LINK%\r\n\r\nThanks,\r\n\r\n%SITE_NAME%\r\n%SITE_URL%\r\n-------------\r\n\r\n', '" . JB_SITE_CONTACT_EMAIL . "', '%CAN_NAME% granted you access to their resume on %SITE_NAME% ', '" . JB_SITE_NAME . "', '');";
        if (!JB_template_exists(44)) {
            JB_mysql_query($sql);
        }
        // employer to candidate
        if ($sql != '') {
            JB_format_email_translation_table();
        }
        // fix the profile tag
        $sql = "UPDATE form_fields SET template_tag = 'PROFILE_BNAME' WHERE template_tag='PROFILE_COL2' ";
        JB_mysql_query($sql);
        $sql = "UPDATE form_lists SET template_tag = 'PROFILE_BNAME' WHERE template_tag='PROFILE_COL2' ";
        JB_mysql_query($sql);
        // replace config.php
        if (mysql_affected_rows($jb_mysql_link) > 0) {
            $filename = JB_basedirpath() . 'config.php';
            $handle = fopen($filename, "r");
            $contents = fread($handle, filesize($filename));
            fclose($handle);
            $contents = str_replace('s:12:"PROFILE_COL2', 's:13:"PROFILE_BNAME', $contents);
            $handle = fopen($filename, 'w');
            fwrite($handle, $contents, strlen($contents));
            fclose($handle);
        }
        if (!does_field_exist("lang", "theme")) {
            $sql = "ALTER TABLE `lang` ADD `theme` VARCHAR(30) NULL default '" . JB_THEME . "'";
            //echo $sql." flag $flag";
            if ($flag) {
                JB_mysql_query($sql) or die($sql . mysql_error());
            }
            $upgrade_needed = true;
        }
        if (!does_field_exist("requests", "deleted")) {
            $sql = "ALTER TABLE `requests`  ADD `deleted` SET( 'Y', 'N' ) NOT NULL DEFAULT 'N' ";
            //echo $sql." flag $flag";
            if ($flag) {
                JB_mysql_query($sql) or die($sql . mysql_error());
            }
            $upgrade_needed = true;
        }
        if (!does_field_exist("xml_import_feeds", "feed_id")) {
            $sql = "CREATE TABLE `xml_import_feeds` (\n\t\t\t\t  `feed_id` int(11) NOT NULL auto_increment,\n\t\t\t\t  `feed_metadata` text NOT NULL,\n\t\t\t\t  `feed_name` varchar(255) NOT NULL,\n\t\t\t\t  `description` varchar(255) NOT NULL,\n\t\t\t\t  `date` date NOT NULL,\n\t\t\t\t  `xml_sample` text NOT NULL,\n\t\t\t\t  `feed_key` varchar(255) NOT NULL,\n\t\t\t\t  `ip_allow` text NOT NULL,\n\t\t\t\t  `feed_url` varchar(255) NOT NULL,\n\t\t\t\t  `feed_filename` varchar(255) NOT NULL,\n\t\t\t\t  `ftp_user` varchar(255) NOT NULL,\n\t\t\t\t  `ftp_pass` varchar(255) NOT NULL,\n\t\t\t\t  `ftp_filename` varchar(255) NOT NULL,\n\t\t\t\t  `ftp_host` varchar(255) NOT NULL,\n\t\t\t\t  `status` varchar(10) NOT NULL,\n\t\t\t\t  `pickup_method` varchar(5) NOT NULL,\n\t\t\t\t  `cron` set('Y','N') NOT NULL,\n\t\t\t\t  PRIMARY KEY  (`feed_id`)\n\t\t\t\t) ENGINE=MyISAM";
            if ($flag) {
                JB_mysql_query($sql) or die($sql . mysql_error());
            }
            $upgrade_needed = true;
            // change post_id to be auto-increment
            $sql = " ALTER TABLE `posts_table` CHANGE `post_id` `post_id` INT( 11 ) NOT NULL AUTO_INCREMENT  ";
            if ($flag) {
                JB_mysql_query($sql) or die($sql . mysql_error());
            }
        }
        if (!does_field_exist("package_invoices", "invoice_tax")) {
            $sql = "ALTER TABLE `package_invoices` ADD `invoice_tax` FLOAT NOT NULL DEFAULT '0';";
            if ($flag) {
                JB_mysql_query($sql) or die($sql . mysql_error());
            }
            $sql = "ALTER TABLE `subscription_invoices` ADD `invoice_tax` FLOAT NOT NULL DEFAULT '0';";
            if ($flag) {
                JB_mysql_query($sql) or die($sql . mysql_error());
            }
            $sql = "ALTER TABLE `membership_invoices` ADD `invoice_tax` FLOAT NOT NULL DEFAULT '0';";
            if ($flag) {
                JB_mysql_query($sql) or die($sql . mysql_error());
            }
            // change post_id to be auto-increment
            $sql = " ALTER TABLE `profiles_table` CHANGE `profile_id` `profile_id` INT( 11 ) NOT NULL AUTO_INCREMENT  ";
            if ($flag) {
                JB_mysql_query($sql) or die($sql . mysql_error());
            }
            // fix template tag for the logo field in profiles_table
            $sql = "UPDATE form_fields SET template_tag='IMAGE' WHERE field_id=66 AND template_tag = '' ";
            if ($flag) {
                JB_mysql_query($sql) or die($sql . mysql_error());
            }
            $upgrade_needed = true;
        }
        if (!does_field_exist('xml_export_feeds', 'include_imported')) {
            $sql = "ALTER TABLE `xml_export_feeds` ADD `include_imported` SET( 'Y', 'N' ) NOT NULL default 'N'";
            if ($flag) {
                JB_mysql_query($sql) or die($sql . mysql_error());
            }
            $upgrade_needed = true;
        }
        if (!does_field_exist("saved_resumes", "resume_id")) {
            $sql = "CREATE TABLE `saved_resumes` (\n\t\t\t\t  `resume_id` int(11) NOT NULL default '0',\n\t\t\t\t  `user_id` int(11) NOT NULL default '0',\n\t\t\t\t  `save_date` datetime NOT NULL default '0000-00-00 00:00:00',\n\t\t\t\t  PRIMARY KEY  (`resume_id`,`user_id`),\n\t\t\t\t  KEY `composite` (`user_id`,`save_date`)\n\t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
            if ($flag) {
                JB_mysql_query($sql) or die($sql . mysql_error());
            }
            $upgrade_needed = true;
        }
        if (1 == 1) {
            // check to make sure that all form fields have a template_tag, if not generate one
            $sql = "SELECT * FROM `form_fields` ";
            $result = mysql_query($sql);
            while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                if ($row['field_type'] == 'BLANK' || $row['field_type'] == 'SEPERATOR' || $row['field_type'] == 'NOTE') {
                    continue;
                }
                if (trim($row['template_tag'] == '')) {
                    // create a new name for it
                    $template_tag = strtoupper(preg_replace('/[^a-z^0-9]+/i', '_', $row['field_label']));
                    $template_tag = preg_replace('/_$/', '', $template_tag);
                    $template_tag = preg_replace('/$_/', '', $template_tag);
                    $base_template_tag = $template_tag;
                    // check to see if it exists?
                    $i = 1;
                    do {
                        $sql = "SELECT * FROM `form_fields` WHERE `form_id`='" . jb_escape_sql($row['form_id']) . "' AND `template_tag`='" . jb_escape_sql($template_tag) . "' ";
                        $result2 = mysql_query($sql);
                        if (mysql_num_rows($result2) == 0) {
                            $sql = "UPDATE `form_fields` SET `template_tag`='" . jb_escape_sql($template_tag) . "' WHERE `field_id`='" . jb_escape_sql($row['field_id']) . "' ";
                            jb_mysql_query($sql);
                            //echo "$sql<br>";
                            break;
                        } else {
                            $i++;
                            $template_tag = $base_template_tag . $i;
                            if ($i > 10) {
                                break;
                            }
                        }
                    } while (0);
                }
            }
        }
        /*
        MySQL 5 only.
        // convert categories to UTF-8
        $sql = "ALTER TABLE `categories` CHANGE `category_name` `category_name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL";
        JB_mysql_query($sql);
        // now convert data:
        $sql = "SELECT category_name, category_id FROM categories ";
        		$result = JB_mysql_query($sql);
        		while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
        			
        			$sql = "UPDATE categories SET category_name = '".jb_escape_sql(addslashes(JB_html_ent_to_utf8($row['category_name'])))."' WHERE category_id='".$row['category_id']."' ";
        			JB_mysql_query($sql);
        }
        $sql = "ALTER TABLE `cat_name_translations` CHANGE `category_name` `category_name` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ";
        JB_mysql_query($sql);
        // now convert data:
        $sql = "SELECT category_name, category_id FROM cat_name_translations ";
        		$result = JB_mysql_query($sql);
        		while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
        			
        			$sql = "UPDATE categories SET category_name = '".jb_escape_sql(addslashes(JB_html_ent_to_utf8($row['category_name'])))."' WHERE category_id='".$row['category_id']."' ";
        			JB_mysql_query($sql);
        }
        */
        // THIS CODE BLOCK SHOULD ALWAYS BE AT THE END
        // Update the cache
        if ($flag && does_field_exist("categories", "seo_fname")) {
            JB_cache_flush();
        }
        if ($upgrade_needed == false && defined('JB_VERSION')) {
            $sql = "REPLACE  INTO `jb_variables` VALUES ('JB_VERSION', '" . JB_VERSION . "')";
            JB_mysql_query($sql);
            $JBMarkup->ok_msg('- Job Board version changed to ' . JB_VERSION . '. Please log out form Admin and log in again for the version number to change.');
        }
    }
    return $upgrade_needed;
}
 function log_entry($line)
 {
     $line = $date = date("D, j M Y H:i:s O") . ' - ' . $line . "\n";
     $s = md5(JB_SITE_NAME);
     if (function_exists('JB_get_cache_dir')) {
         $cache_dir = JB_get_cache_dir();
     } else {
         $cache_dir = JB_basedirpath() . 'cache/';
     }
     $file_name = $cache_dir . 'import_log_' . $s . '.txt';
     if (file_exists($file_name)) {
         if (time() - filemtime($file_name) > time() + 60 * 60) {
             // older than 24 hrs?
             $open_mode = 'wb';
             // overwrite the file
             $line .= date("D, j M Y H:i:s O") . ' - ' . "Cleared the log\n" . $line;
         } else {
             $open_mode = 'ab';
         }
     } else {
         $open_mode = 'wb';
     }
     $fp = fopen($file_name, $open_mode);
     fputs($fp, $line);
     fclose($fp);
     if ($this->verbose) {
         echo htmlentities($line);
         flush();
         ob_flush();
     }
 }
Example #8
0
function jb_main_config_form()
{
    global $JBMarkup;
    ?>

	Options on this page affect the running of the entire website, including the paths, database setting, look-and-feel, business logic, and more.<p>
	Note: <i>Please make sure that config.php has permissions for writing when editing this form.</i><br>
	<?php 
    if (JB_DEMO_MODE != 'YES') {
        echo "<p>";
        if (is_writable("../config.php")) {
            echo "- config.php is writeable.<br>";
        } else {
            echo "- Note: config.php is not writable. Give write permissions to config.php if you want to save the changes<br>";
        }
        if (is_writable("../rss.xml")) {
            echo "- rss.xml is writeable.";
        } else {
            echo "- rss.xml is not writable! rss.xml must have write permissions.<br>";
        }
        echo '</p>';
    } else {
        $JBMarkup->ok_msg('Demo mode is enabled - configuration cannot be saved');
    }
    ?>

	<p>
	Jump to: <a href="#paths">Paths and Locations</a> | <a href="#mysql">MySQL Settings</a> | <a href="#cache">Cache Settings</a> | <a href="#cron">Cron Settings</a> | <a href="#features">Optional Features</a> | <a href="#date">Localization - Time and Date</a> | <a href="#cats">Categories</a> | <a href="#mod_rewrite">Mod Rewrite</a> | <a href="#clean">Data Cleaning</a> | <a href="#ac">Accounts and Permissions</a> | <a href="#menu">Menu Options</a> | <a href="#search">Search Options</a> | <a href="#anon">Anonymous fields and Request System</a> | <a href="#mem">Membership Fields</a> | <a href="#blocked">Blocked Fields</a> | <a href="#billing">Billing System</a> | <a href="#posts">Posts</a> | <a href="#resumes">Resumes</a> | <a href="#themes">Theme Settings</a> | <a href="#plugins">Plugin Settings</a> | <a href="#email">Email Settings</a> | <a href="#errors">Errors and Warnings</a>
	</p>

	<form method="POST" name="form1" action="edit_config.php">
		<?php 
    if (!defined('JB_CODE_ORDER_BY')) {
        define('JB_CODE_ORDER_BY', 'BY_CODE');
    }
    // BY_NAME or BY_CODE
    ?>
		<input type="hidden" name="jb_code_order_by" value="<?php 
    echo htmlentities($_REQUEST['jb_code_order_by']);
    ?>
">
	  <p>&nbsp;</p>
	  <table  cellpadding="5" cellspacing="2" class="config_form">
		<tr>
		  <td colspan="2" class="config_form_heading" >
		  Website - Board's Name &amp; Headings
		  </td>
		</tr>
		<tr>
		  <td width="20%" class="config_form_label">Site Name</td>
		  <td class="config_form_field">
		  <input type="text" name="site_name" size="29" value="<?php 
    echo jb_escape_html(JB_SITE_NAME);
    ?>
"></td>
		</tr>
		<tr>
		  <td class="config_form_label">Site Heading</td>
		  <td class="config_form_field">
		  <input type="text" name="site_heading" size="49" value="<?php 
    echo jb_escape_html(JB_SITE_HEADING);
    ?>
">(shown in the &lt;HEAD&gt; tag)</td>
		</tr>
		 <tr>
		  <td class="config_form_label">Site Description</td>
		  <td class="config_form_field">
		  <textarea  name="site_description" cols="35" rows="3"><?php 
    echo jb_escape_html(JB_SITE_DESCRIPTION);
    ?>
</textarea></td>
		</tr>
		<tr>
		  <td class="config_form_label">Site Keywords</td>
		  <td class="config_form_field">
		  <textarea  name="site_keywords" cols="35" rows="3"><?php 
    echo jb_escape_html(JB_SITE_KEYWORDS);
    ?>
</textarea></td>
		</tr>
		<tr>
		  <td class="config_form_label">Site Logo URL</td>
		  <td class="config_form_field">
		  <input type="text" name="site_logo_url" size="49" value="<?php 
    echo htmlentities(JB_SITE_LOGO_URL);
    ?>
"><br>(http://www.example.com/images/logo.gif) Note: This logo is used on the signup and login screens. To change the logo and other graphics of the site you will need to <a href="http://www.jamit.com/docs.htm">create a custom theme</a>.</td>
		</tr>
		<tr>
		  <td class="config_form_label">Site Contact Email</td>
		  <td class="config_form_field">
		  <input type="text" name="site_contact_email" size="49" value="<?php 
    echo htmlentities(JB_SITE_CONTACT_EMAIL);
    ?>
"></td>
		</tr>
		 <tr>
		 <?php 
    if (JB_ADMIN_PASSWORD == 'JB_ADMIN_PASSWORD') {
        $JB_ADMIN_PASSWORD = '******';
    } else {
        $JB_ADMIN_PASSWORD = JB_ADMIN_PASSWORD;
    }
    if (JB_DEMO_MODE == 'YES') {
        $JB_ADMIN_PASSWORD = '******';
    }
    ?>
		  <td class="config_form_label">Administrator's Password</td>
		  <td class="config_form_field">
		  <input type="password" name="admin_password" size="49" value="<?php 
    echo htmlentities($JB_ADMIN_PASSWORD);
    ?>
"></td>
		</tr>
	  </table>
	  <?php 
    $host = $_SERVER['SERVER_NAME'];
    // hostname
    $http_url = $_SERVER['PHP_SELF'];
    // eg /ojo/admin/edit_config.php
    $http_url = explode("/", $http_url);
    array_pop($http_url);
    // get rid of filename
    array_pop($http_url);
    // get rid of /admin
    $http_url = implode("/", $http_url);
    $file_path = JB_basedirpath();
    if (JB_DEMO_MODE == 'YES') {
        $file_path = '[DEMO MODE]';
    }
    ?>
	  <p>&nbsp;</p>
	  <a name="paths"></a>
	  <table cellpadding="5" cellspacing="2" class="config_form">
		<tr>
		  <td colspan="2" class="config_form_heading">
		  Paths and Locations
		  </td>
		</tr>
		<tr>
		  <td width="20%" class="config_form_label">Board's HTTP URL (address)</td>
		  <td class="config_form_field">
		  <input type="text" name="base_http_path" size="49" value="<?php 
    echo htmlentities(str_replace('https', 'http', JB_BASE_HTTP_PATH));
    ?>
"><br>Suggested: <b>http://<?php 
    echo $host . $http_url . "/";
    ?>
</b></td>
		</tr>
	   
		 <tr>
		  <td class="config_form_label">Candidate's folder name</td>
		  <td class="config_form_field">
		  <input type="text" name="candidate_folder" size="49" value="<?php 
    echo htmlentities(JB_CANDIDATE_FOLDER);
    ?>
" ><br>(eg. myjobs/ - If you change the default name, please remember to rename this directory using FTP or the command line)</td>
		</tr>
		 <tr>
		  <td class="config_form_label">Advertiser's folder name</td>
		  <td class="config_form_field">
		  <input type="text" name="employer_folder" size="49" value="<?php 
    echo htmlentities(JB_EMPLOYER_FOLDER);
    ?>
" ><br>(eg. employers/ - If you change the default name, please remember to rename this directory using FTP or the command line)</td>
		</tr>
		<tr>
		  <td class="config_form_label">Images 
		  Path</td>
		  <td class="config_form_field">
		  <input type="text" name="img_path" size="49" value="<?php 
    if (JB_DEMO_MODE == 'YES') {
        echo '[DEMO MODE]';
    } else {
        echo htmlentities(JB_IMG_PATH);
    }
    ?>
"><br>Recommended: <b><?php 
    echo $file_path . "upload_files/images/</b>";
    if (!file_exists(JB_IMG_PATH)) {
        echo "<br><span style='color:red'>Warning:</span> " . JB_IMG_PATH . " does not exist";
    } elseif (!is_writable(JB_IMG_PATH)) {
        echo "<br><span style='color:red'>Warning:</span> " . JB_IMG_PATH . " is not writable. Please give it permission to be written.";
    }
    if (!file_exists(JB_IMG_PATH . "thumbs/")) {
        echo "<br><span style='color:red'>Warning:</span> " . JB_IMG_PATH . "thumbs/" . " does not exist";
    } elseif (!is_writable(JB_IMG_PATH . "thumbs/")) {
        echo "<br><span style='color:red'>Warning:</span> " . JB_IMG_PATH . "thumbs/" . " is not writable. Please give it permission to be written.";
    }
    ?>
</td>
		</tr>
		<tr>
		  <td class="config_form_label">Images 
		  URL</td>
		  <td class="config_form_field">
		  <input type="text" name="img_http_path" size="49" value="<?php 
    echo htmlentities(str_replace('https', 'http', JB_IMG_HTTP_PATH));
    ?>
"><br>Suggested: <b>http://<?php 
    echo $host . $http_url . "/upload_files/images/";
    ?>
</b></td>
		</tr>
		<tr>
		  <td class="config_form_label">Files 
		  Path</td>
		  <td class="config_form_field">
		  <input type="text" name="file_path" size="49" value="<?php 
    if (JB_DEMO_MODE == 'YES') {
        echo '[DEMO MODE]';
    } else {
        echo htmlentities(JB_FILE_PATH);
    }
    ?>
"><br>Suggested: <b><?php 
    echo $file_path . "upload_files/docs/</b>";
    if (!file_exists(JB_FILE_PATH)) {
        echo "<br><span style='color:red'>Warning:</span> " . JB_FILE_PATH . " does not exist";
    } elseif (!is_writable(JB_FILE_PATH)) {
        echo "<br><span style='color:red'>Warning:</span> " . JB_FILE_PATH . " is not writable. Please give it permission to be written.";
    }
    ?>
</td>
		</tr>
		 <tr>
		  <td class="config_form_label">Files 
		  URL</td>
		  <td class="config_form_field">
		  <input type="text" name="file_http_path" size="49" value="<?php 
    echo htmlentities(str_replace('https', 'http', JB_FILE_HTTP_PATH));
    ?>
"><br>Suggested: <b>http://<?php 
    echo $host . $http_url . "/upload_files/docs/";
    ?>
</b></td>
		</tr>
		<tr>
		  <td class="config_form_label">Maximum width of scaled thumbnail images</td>
		  <td class="config_form_field">
		   <input type="text" size='3' name='img_max_width' value=<?php 
    echo jb_escape_html(JB_IMG_MAX_WIDTH);
    ?>
 > (in pixels)</td>
		</tr>
		<tr>
		  <td class="config_form_label" width="20%"> 
		   Keep original images?</td>
		  <td class="config_form_field">
		   <input type="radio" name="jb_keep_original_images" size="49" value="YES" <?php 
    if (JB_KEEP_ORIGINAL_IMAGES == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes - keep the originals after scailing them
			<br>
			<?php 
    if (!defined('JB_BIG_IMG_MAX_WIDTH')) {
        define('JB_BIG_IMG_MAX_WIDTH', 1000);
    }
    ?>
		  
		   Maximum width of original images: <input type="text" size='3' name='big_img_max_width' value=<?php 
    echo jb_escape_html(JB_BIG_IMG_MAX_WIDTH);
    ?>
 > (in pixels)
		   <br><input type="radio" name="jb_keep_original_images" value="NO" <?php 
    if (JB_KEEP_ORIGINAL_IMAGES != 'YES') {
        echo " checked ";
    }
    ?>
 >No - delete the originals
		  
		   </td>
		</tr>

		<td class="config_form_label" valign="top">Image Scaling Method</td>
		  <td class="config_form_field">
		  <?php 
    if (function_exists('imagecreate')) {
        ?>
 Using the GD Library to resize images in to thumbnails<?php 
    } else {
        ?>
			<span style="color:maroon">It looks like the GD Library is not installed on your system. Please ask your hosting administrator to enable the GD Library for PHP.</span>
			<?php 
    }
    ?>
	<input type="hidden" name="use_gd_library" value="YES">
		

		
		<tr>
		  <td class="config_form_label">Path & Filename to 
		  RSS Feed XML file</td>
		  <td class="config_form_field">
		  <input type="text" name="rss_feed_path" size="49" value="<?php 
    if (JB_DEMO_MODE == 'YES') {
        echo '[DEMO MODE]';
    } else {
        echo htmlentities(JB_RSS_FEED_PATH);
    }
    ?>
"><br>Suggested: <b><?php 
    echo $file_path . "rss.xml </b> ";
    if (!file_exists(JB_RSS_FEED_PATH)) {
        echo "<br><span style='color:red'>Warning:</span> " . JB_RSS_FEED_PATH . " does not exist";
    } elseif (!is_writable(JB_RSS_FEED_PATH)) {
        echo "<br><span style='color:red'>Warning:</span> " . JB_RSS_FEED_PATH . " is not writable. Please give it permission to be written.";
    }
    ?>
</td>
		</tr>
		<?php 
    if (JB_RSS_FEED_LOGO == '' || JB_RSS_FEED_LOGO == 'http://www.jamit.com.au/images/rss-logo.gif') {
        $JB_RSS_FEED_LOGO = JB_IMG_HTTP_PATH . "rss_logo.png";
    } else {
        $JB_RSS_FEED_LOGO = JB_RSS_FEED_LOGO;
    }
    ?>
		 <tr>
		  <td class="config_form_label"> 
		  RSS Feed Logo URL</td>
		  <td class="config_form_field">
		  <input type="text" name="rss_feed_logo" size="49" value="<?php 
    echo htmlentities($JB_RSS_FEED_LOGO);
    ?>
"><br>(Enter the full URL of the logo, eg. <b><?php 
    echo JB_BASE_HTTP_PATH;
    ?>
upload_files/images/rsslogo.gif</b> . The maximum width & height are: 144 wide x 400 high. The logo for the RSS feed should be placed somewhere inside the installation directory of the script)<?php 
    if (!JB_resolve_document_path(JB_RSS_FEED_LOGO)) {
        echo "<br><span style='color:red'>Warning:</span> Cannot find " . $JB_RSS_FEED_LOGO . " on the local server.";
    }
    ?>
</td>
		</tr>
<?php 
    if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
        // only for windows...
        ?>

		<tr>
		  <td class="config_form_label">File &amp; Directory Permissions</td>
		  <td class="config_form_field">
		  
		  chmod <select name="jb_new_file_chmod">
		  <option label="444" value="0444" <?php 
        if (JB_NEW_FILE_CHMOD == 0444) {
            echo ' selected="selected" ';
        }
        ?>
>600</option>
			<option label="600" value="0600" <?php 
        if (JB_NEW_FILE_CHMOD == 0600) {
            echo ' selected="selected" ';
        }
        ?>
>600</option>
			<option label="640" value="0640" <?php 
        if (JB_NEW_FILE_CHMOD == 0640) {
            echo ' selected="selected" ';
        }
        ?>
>640</option>
			<option label="644" value="0644" <?php 
        if (JB_NEW_FILE_CHMOD == 0644) {
            echo ' selected="selected" ';
        }
        ?>
>644</option>
			<option label="660" value="0660" <?php 
        if (JB_NEW_FILE_CHMOD == 0660) {
            echo ' selected="selected" ';
        }
        ?>
>660</option>
			<option label="664" value="0664" <?php 
        if (JB_NEW_FILE_CHMOD == 0664) {
            echo ' selected="selected" ';
        }
        ?>
>664</option>
			<option label="666" value="0666" <?php 
        if (JB_NEW_FILE_CHMOD == 0666) {
            echo ' selected="selected" ';
        }
        ?>
>666</option>
		  </select> for new files
		  <br>
		  
		chmod <select name="jb_new_dir_chmod">
			<option label="0555" value="0555" <?php 
        if (JB_NEW_DIR_CHMOD == 0555) {
            echo ' selected="selected" ';
        }
        ?>
>700</option>
			<option label="750" value="0750" <?php 
        if (JB_NEW_DIR_CHMOD == 0750) {
            echo ' selected="selected" ';
        }
        ?>
>750</option>
			<option label="755" value="0755" <?php 
        if (JB_NEW_DIR_CHMOD == 0755) {
            echo ' selected="selected" ';
        }
        ?>
>755</option>
			<option label="770" value="0770" <?php 
        if (JB_NEW_DIR_CHMOD == 0770) {
            echo ' selected="selected" ';
        }
        ?>
>770</option>
			<option label="775" value="0775" <?php 
        if (JB_NEW_DIR_CHMOD == 0775) {
            echo ' selected="selected" ';
        }
        ?>
>775</option>
			<option label="777" value="0777" <?php 
        if (JB_NEW_DIR_CHMOD == 0777) {
            echo ' selected="selected" ';
        }
        ?>
>777</option>
		</select>
		  for new directories<br>

		 <?php 
        //			 $new_window = "onclick=\"test_permissions_window(); return false;\"";
        ?>

		 <input <?php 
        if (JB_DEMO_MODE == 'YES') {
            echo ' disabled ';
        }
        ?>
 type="button" value="Suggest Best Permissions" onclick="suggest_permissions_window(); return false;"><br>
		 <input <?php 
        if (JB_DEMO_MODE == 'YES') {
            echo ' disabled ';
        }
        ?>
 type="button" value="Fix Permissions" onclick="fix_permissions_window(); return false;">
		
	
		<br></td></tr>

		
<?php 
    }
    ?>

		<tr>
		  <td class="config_form_label">Test file &amp; Directory Permissions</td>
		  <td class="config_form_field">
		   <input <?php 
    if (JB_DEMO_MODE == 'YES') {
        echo ' disabled ';
    }
    ?>
 type="button" value="Test Permissions" onclick="window.open('suggest_permissions.php?test=1', '', 'toolbar=no, scrollbars=yes, location=no, statusbar=no, menubar=no, resizable=1, width=400, height=300, left = 50, top = 50'); return false;">
Click to see if all the permissions are correct so that the job board can manage the files properly.
		  </td>

		
	  </table>
	  <p>&nbsp;</p>
	  <a name="mysql"></a>
	  <table cellpadding="5" cellspacing="2" class="config_form">
		<tr>
		  <td colspan="2"  class="config_form_heading">
		  Mysql Settings
		  <?php 
    if ($DB_ERROR != '') {
        ?>
<br>There is a problem with your database settings: <span style='color:red'><?php 
        echo $DB_ERROR;
        ?>
</span><?php 
    }
    ?>
</td>
		</tr>
		<tr>
		  <td width="20%" class="config_form_label">Mysql 
		  Database Username</td>
		  <td class="config_form_field">
		  <input type="text" name="jb_mysql_user" size="29" value="<?php 
    if (JB_DEMO_MODE == 'YES') {
        echo '[DEMO MODE]';
    } else {
        echo jb_escape_html(JB_MYSQL_USER);
    }
    ?>
"></td>
		</tr>
		 <tr>
		  <td class="config_form_label">Mysql 
		  Database Password</td>
		  <td class="config_form_field">
		  <input type="password" name="jb_mysql_pass" size="29" value="<?php 
    if (JB_DEMO_MODE == 'YES') {
        echo '********';
    } else {
        echo jb_escape_html(JB_MYSQL_PASS);
    }
    ?>
"></td>
		</tr>
		<tr>
		  <td class="config_form_label">Mysql 
		  Database Name</td>
		  <td class="config_form_field">
		  <input type="text" name="jb_mysql_db" size="29" value="<?php 
    if (JB_DEMO_MODE == 'YES') {
        echo '[DEMO MODE]';
    } else {
        echo jb_escape_html(JB_MYSQL_DB);
    }
    ?>
"></td>
		</tr>
		<tr>
		  <td class="config_form_label">Mysql 
		  Server Hostname</td>
		  <td class="config_form_field">
		  <input type="text" name="jb_mysql_host" size="29" value="<?php 
    if (JB_DEMO_MODE == 'YES') {
        echo '[DEMO MODE]';
    } else {
        echo jb_escape_html(JB_MYSQL_HOST);
    }
    ?>
"></td>
		</tr>
	  </table>
	   <p>&nbsp;</p>
	   <a name="cache"></a>
		<table cellpadding="5" cellspacing="2" class="config_form">
		<tr>
		  <td colspan="2" class="config_form_heading">
		  Cache Settings</td>
		</tr>
		<tr>
		  <td class="config_form_label" width="20%"> 
		   Enable Cache?</td>
		  <td class="config_form_field">

		  <input type="radio" name="jb_cache_enabled" value="YES" <?php 
    if (JB_CACHE_ENABLED == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (enabled) - If turned on, then this feature will help increase performance. Please select below what caching method to use:
		  <ul style="list-style:none">
		  <li>
		  <?php 
    if (!defined('JB_CACHE_DRIVER')) {
        define('JB_CACHE_DRIVER', 'JBCacheFiles');
    }
    $cache_objects = JB_get_cache_objects();
    foreach ($cache_objects as $obj) {
        $obj->config_radio();
    }
    ?>
		</li>
		</ul>
		<input type="radio" name="jb_cache_enabled" value="NO" <?php 
    if (JB_CACHE_ENABLED == 'NO') {
        echo " checked ";
    }
    ?>
 >No (disabled)
		   
		   
		   </td>
		</tr>
		</table>
		<p>&nbsp;</p>
		<a name="cron"></a>
		<table cellpadding="5" cellspacing="2" class="config_form">
		<tr>
		  <td colspan="2" class="config_form_heading">
		  Cron Settings. (<a href="cron.php">See here for more info about these options.</a>)</td>
		</tr>
		<?php 
    if (!defined('JB_CRON_EMULATION_ENABLED')) {
        define('JB_CRON_EMULATION_ENABLED', 'NO');
    }
    ?>
		<tr>
		  <td class="config_form_label" width="20%"> 
		   Enable Cron Emulation?</td>
		  <td class="config_form_field">
		   <input type="radio" name="cron_emulation_enabled" size="49" value="YES" <?php 
    if (JB_CRON_EMULATION_ENABLED == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (Set to 'Yes' only if your web host does not support Cron / scheduling of tasks. Cron Emulation is intended for testing purposes and not recommended for live sites. Please see <a href="cron.php">Admin-&gt;Cron Info</a> for more details about how to setup a cron job)
		   <br><input type="radio" name="cron_emulation_enabled" value="NO" <?php 
    if (JB_CRON_EMULATION_ENABLED != 'YES') {
        echo " checked ";
    }
    ?>
 >No (Turn off cron emulation. Please see <a href="cron.php">Admin-&gt;Cron Info</a> for more details about how to setup a cron job, including what to do if your hosting account does not support Cron jobs)</td>
		</tr>
		<tr>
		  <td class="config_form_label" width="20%"> 
		   Allow Cron to be executed via web?</td>
		  <td class="config_form_field">
		  <?php 
    if (!defined('JB_CRON_HTTP_ALLOW')) {
        define('JB_CRON_HTTP_ALLOW', 'YES');
    }
    ?>
			<i>Note: The following settings are ignored if Cron Emulation is enabled</i><br>
		   <input type="radio" name="cron_http_allow" size="49" value="YES" <?php 
    if (JB_CRON_HTTP_ALLOW == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (It will be possible to run the cron job by loading this page: <i><?php 
    echo JB_BASE_HTTP_PATH . 'cron/cron.php';
    ?>
</i>)
		   <br><i>Optional:</i> If 'Yes', require authentication - user: <input type="text" size="10" name="cron_http_user" value="<?php 
    if (!defined('JB_CRON_HTTP_USER')) {
        define('JB_CRON_HTTP_USER', '');
    }
    if (!defined('JB_CRON_HTTP_PASS')) {
        define('JB_CRON_HTTP_PASS', '');
    }
    echo jb_escape_html(JB_CRON_HTTP_USER);
    ?>
"> pass: <input type="password" size="10" name="cron_http_pass" value="<?php 
    echo jb_escape_html(JB_CRON_HTTP_PASS);
    ?>
"><br>
		   <?php 
    if (strlen(JB_CRON_HTTP_USER) > 0) {
        ?>
user/pass is set, please use the following URL: <b><?php 
        echo str_replace('://', '://' . JB_CRON_HTTP_USER . ':' . JB_CRON_HTTP_PASS . '@', JB_BASE_HTTP_PATH) . 'cron/cron.php';
        ?>
</b><br> <?php 
    }
    ?>
		   <input type="radio" name="cron_http_allow" value="NO" <?php 
    if (JB_CRON_HTTP_ALLOW != 'YES') {
        echo " checked ";
    }
    ?>
 >No (Do not allow.)
		   </td>
		</tr>
		<?php 
    $disabled = explode(', ', ini_get('disable_functions'));
    if (!in_array('exec', $disabled)) {
        @JB_exec("w", $out);
    }
    if (preg_match('#load average: (\\d+\\.\\d+)#', $out[0], $m)) {
        ?>
		<tr>
		  <td width="20%" class="config_form_field"> 
		   Server Load Limit for Cron</td>
		  <td class="config_form_field">
		  Do not run Cron if the server load average is over: <select name="jb_cron_limit">
		  <option value="1.0" <?php 
        if (JB_CRON_LIMIT == '1.0') {
            echo " selected ";
        }
        ?>
 >1.0</option value="1.0">
		  <option value="2.0" <?php 
        if (JB_CRON_LIMIT == '2.0') {
            echo " selected ";
        }
        ?>
 >2.0</option>
		  <option value="3.0" <?php 
        if (JB_CRON_LIMIT == '3.0') {
            echo " selected ";
        }
        ?>
 >3.0</option>
		  <option value="4.0" <?php 
        if (JB_CRON_LIMIT == '4.0') {
            echo " selected ";
        }
        ?>
 >4.0</option>
		  <option value="10.0" <?php 
        if (JB_CRON_LIMIT == '10.0') {
            echo " selected ";
        }
        ?>
 >10.0</option>
		  <option value="" <?php 
        if (JB_CRON_LIMIT == '' || !defined('JB_CRON_LIMIT')) {
            echo " selected ";
        }
        ?>
 >No Limit</option>
		  </select> (See about <a href="http://en.wikipedia.org/wiki/Load_(computing)" target="_new">Load Average</a> in Wikipedia)
		   </td>
		</tr>
		<?php 
    }
    ?>
		</table>

		<p>&nbsp;</p>
		<a name="features"></a>
	  <table cellpadding="5" cellspacing="2" class="config_form">
		<tr>
		  <td colspan="2" class="config_form_heading">
		  <p>Features - Disable / Enable Optional Features.</td>
		</tr>
		<tr>
		  <td class="config_form_label" width="20%"> 
		  Enable Map?</td>
		  <td class="config_form_field">
		  <input type="radio" name="map_disabled" size="49" value="YES" <?php 
    if (JB_MAP_DISABLED == 'YES') {
        echo " checked ";
    }
    ?>
 >Disabled (Do not show)<br>
		  <input type="radio" name="map_disabled" value="NO" <?php 
    if (JB_MAP_DISABLED != 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (Enable the original map system)<br> 
		  <input type="radio" name="map_disabled" size="49" value="GMAP" <?php 
    if (JB_MAP_DISABLED == 'GMAP') {
        echo " checked ";
    }
    ?>
 >Google Maps - This option will enable the ability to add a Google Map field in to the forms<br><br>
		   <input type="hidden" name="pin_image_file" size="49" value="<?php 
    echo htmlentities(JB_PIN_IMAGE_FILE);
    ?>
">
		   <b>Google Map Setup - Google Maps Version 3 API</b><br>
		   <?php 
    if (!defined('JB_GMAP_LOCATION')) {
        define('JB_GMAP_LOCATION', 'http://maps.google.com/maps?showlabs=1&ie=UTF8&ll=38.891033,-93.427734&spn=33.74472,73.740234&t=h&z=4');
    }
    if (!defined('JB_GMAP_ZOOM')) {
        define('JB_GMAP_ZOOM', '6');
    }
    if (!defined('JB_GMAP_LANG')) {
        define('JB_GMAP_LANG', 'en');
    }
    if (!defined('JB_GMAP_SHOW_IF_MAP_EMPTY')) {
        define('JB_GMAP_SHOW_IF_MAP_EMPTY', 'NO');
    }
    ?>
		   Default Map Location URL: <br><input style="font-size: 9px" type="text" name="gmap_location" size="160" value="<?php 
    echo htmlentities(JB_GMAP_LOCATION);
    ?>
"> (Go to <a href="http://maps.google.com/" target="_blank">http://maps.google.com</a> - move the map to a desired location, click the 'Link' top-right, copy the link and paste it here)<br>
		   
		   Default Zoom Level: <input type="text" name="gmap_zoom" size="1" value="<?php 
    echo htmlentities(JB_GMAP_ZOOM);
    ?>
"> (Please enter a number. eg. 6)<br>
		   <input type="checkbox" value="Y" <?php 
    if (JB_GMAP_SHOW_IF_MAP_EMPTY == 'YES') {
        echo ' checked ';
    }
    ?>
 name="gmap_show_if_map_empty">Show Map if no location selected<br>
		  <!-- Map Language: <input type="text" name="gmap_lang" size="1" value="<?php 
    echo htmlentities(JB_GMAP_LANG);
    ?>
"> (Eg. en, see the full list of <a target="_blank" href="http://spreadsheets.google.com/pub?key=p9pdwsai2hDMsLkXsoM05KQ&gid=1">languages suppoted by Google Maps</a>)
		  -->
		  <br>
			<input type="hidden" name="map_image_file" size="49" value="<?php 
    echo htmlentities(JB_MAP_IMAGE_FILE);
    ?>
">
			<hr>
			<i>If using the original map system: To change the default map images you must create your own theme. See include/themes/README.txt for info about how to create your own theme. The images are in the theme's images/ directory called <?php 
    echo JB_PIN_IMAGE_FILE;
    ?>
 and <?php 
    echo JB_MAP_IMAGE_FILE;
    ?>
. This feature will be phased out in the future in favor of a Google Maps plugin</i>
			<input type="hidden" name="gmap_lat" value="<?php 
    echo htmlentities(JB_GMAP_LAT);
    ?>
">
			<input type="hidden" name="gmap_lng" value="<?php 
    echo htmlentities(JB_GMAP_LNG);
    ?>
">
<?php 
    $file_name = 'posting-form.php';
    $this_theme = JB_THEME;
    if ($config = file_get_contents(jb_basedirpath() . 'config.php')) {
        preg_match('/JB_THEME\', \'(.+?)\'/i', $config, $m);
        if (isset($m[1])) {
            $this_theme = $m[1];
        }
    }
    if (file_exists(jb_basedirpath() . 'include/themes/' . $this_theme . '/' . $file_name)) {
        $path = jb_basedirpath() . 'include/themes/' . $this_theme . '/' . $file_name;
        $contents = file_get_contents($path);
    } else {
        $path = jb_basedirpath() . 'include/themes/' . JB_DEFAULT_THEME . '/' . $file_name;
        $contents = file_get_contents($path);
    }
    if (!preg_match('#\\$DynamicForm->display_form_section\\(\\$mode, 4, \\$admin\\);#i', $contents)) {
        echo '<div style="background-color:white; border:orange solid 2px; padding:5px; width:80%">- Template incompatibility detected for Google Maps. <br>Please edit <b>' . $path . '</b> and replace the following code<br>
			' . highlight_string('
			if (JB_MAP_DISABLED != \'YES\' ) {
				', true) . '
			
			<br><br>
			with this PHP code: <br><br>' . highlight_string('
			if (JB_MAP_DISABLED ==\'GMAP\') {
				echo \'<td valign="top">\';
				if ($mode == "EDIT") {
					echo "[Section 4]";
				}
				$DynamicForm->display_form_section($mode, 4, $admin);
				echo \'</td>\';
			}
			elseif (JB_MAP_DISABLED != \'YES\' ) {
				', true) . '</div><br>';
    }
    ?>
		  </td>
		</tr>
		<tr>
		  <td class="config_form_label" width="20%"> 
		   Enable 'Mouseover' Preview of images on Resume list?</td>
		  <td class="config_form_field">
		   <input type="radio" name="preview_resume_image" size="49" value="YES" <?php 
    if (JB_PREVIEW_RESUME_IMAGE == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (show them - when listing resumes, a preview thumbnail will show when mouse poniter is over a name)<br><input type="radio" name="preview_resume_image" value="NO" <?php 
    if (JB_PREVIEW_RESUME_IMAGE != 'YES') {
        echo " checked ";
    }
    ?>
 >No (disabled)</td>
		</tr>
		<tr>
		  <td class="config_form_label" width="20%"> 
		   Enable multiple languages for employers?</td>
		  <td class="config_form_field">
		  <input type="radio" name="emp_lang_enabled" size="49" value="YES" <?php 
    if (JB_EMP_LANG_ENABLED == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (Can change language)<br> <input type="radio" name="emp_lang_enabled" value="NO" <?php 
    if (JB_EMP_LANG_ENABLED != 'YES') {
        echo " checked ";
    }
    ?>
 >No (Only default language) </td>
		</tr>
		<tr>
		  <td class="config_form_label">
		   Enable multiple languages for candidates?</td>
		  <td class="config_form_field">
		  <input type="radio" name="can_lang_enabled" size="49" value="YES" <?php 
    if (JB_CAN_LANG_ENABLED == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (Can change language)<br><input type="radio" name="can_lang_enabled" value="NO" <?php 
    if (JB_CAN_LANG_ENABLED != 'YES') {
        echo " checked ";
    }
    ?>
 >No (Only default language)</td>
		</tr>
		<tr>
		  <td class="config_form_label"> 
		   Enable Job Alerts for candidates?</td>
		  <td class="config_form_field">
		  <input type="radio" name="job_alerts_enabled" size="49" value="YES" <?php 
    if (JB_JOB_ALERTS_ENABLED == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (Enabled. With an interval of <input type="text" name='job_alerts_days' value="<?php 
    echo jb_escape_html(JB_JOB_ALERTS_DAYS);
    ?>
" size="2"> day(s) between sending dates)<br>
		  &nbsp;&nbsp;&nbsp;&nbsp;- Send to users who were active within the last <input size='1' type='text'  name='job_alerts_active_days' value='<?php 
    echo jb_escape_html(JB_JOB_ALERTS_ACTIVE_DAYS);
    ?>
'> days<br>
		  &nbsp;&nbsp;&nbsp;&nbsp;- List a maximum of <input type='text' size='1'  name='job_alerts_items' value='<?php 
    echo jb_escape_html(JB_JOB_ALERTS_ITEMS);
    ?>
'> items on the email<br>
		  <input type="radio" name="job_alerts_enabled" value="NO" <?php 
    if (JB_JOB_ALERTS_ENABLED != 'YES') {
        echo " checked ";
    }
    ?>
 >No (Disabled)</td>
		</tr>
		<tr>
		  <td class="config_form_label"> 
		   Enable R&#233;sum&#233;s Alerts for employers?</td>
		  <td class="config_form_field">
		  <input type="radio" name="resume_alerts_enabled" size="49" value="YES" <?php 
    if (JB_RESUME_ALERTS_ENABLED == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (Enabled. With an interval of <input type="text" name='resume_alerts_days' value="<?php 
    echo jb_escape_html(JB_RESUME_ALERTS_DAYS);
    ?>
" size="2"> day(s) between sending dates)<br>
		  &nbsp;&nbsp;&nbsp;&nbsp;- Send to users who were active within the last <input size='1' type='text'  name='resume_alerts_active_days' value='<?php 
    echo jb_escape_html(JB_RESUME_ALERTS_ACTIVE_DAYS);
    ?>
'> days<br>
		  &nbsp;&nbsp;&nbsp;&nbsp;- List a maximum of <input type='text' size='1'  name='resume_alerts_items' value='<?php 
    echo jb_escape_html(JB_RESUME_ALERTS_ITEMS);
    ?>
'> items on the email<br>
		  <input type="checkbox" value="YES" name="jb_resume_alerts_sub_ignore" <?php 
    if (JB_RESUME_ALERTS_SUB_IGNORE == "YES") {
        echo " checked ";
    }
    ?>
 > Ignore subscription status (if not checked then send only to subscribed employers).<br>
		  <input type="radio" name="resume_alerts_enabled" value="NO" <?php 
    if (JB_RESUME_ALERTS_ENABLED != 'YES') {
        echo " checked ";
    }
    ?>
 >No (Disabled)</td>
		</tr>

		<tr>
		  <td class="config_form_label" width="20%"> 
		   Enable Online Applications?</td>
		  <td  class="config_form_field">
		  <table border=0>
		  <tr>
			<td class="config_form_field">
				<input type="radio" name="online_app_enabled" size="49" value="YES" <?php 
    if (JB_ONLINE_APP_ENABLED == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (Enabled)
			</td>
		   <td>
				<table border=0>
					<tr>
						<td class="config_form_field">
						<input type="checkbox" value="YES" name="online_app_sign_in" <?php 
    if (JB_ONLINE_APP_SIGN_IN == "YES") {
        echo " checked ";
    }
    ?>
 > Candidate needs to be logged on in do applications.
						</td>
					</tr>
					<tr>
						<td class="config_form_field">
						<input type="checkbox" value="YES" name="online_app_email_admin" <?php 
    if (JB_ONLINE_APP_EMAIL_ADMIN == "YES") {
        echo " checked ";
    }
    ?>
 > Email the Application to Administrator
						</td>
					</tr>
					<tr>
						<td class="config_form_field"><input type="checkbox" value="YES" name="online_app_email_premium" <?php 
    if (JB_ONLINE_APP_EMAIL_PREMIUM == "YES") {
        echo " checked ";
    }
    ?>
 > Email the Application to Employer, if applying to <b>Premium</b> post
						</td>
					</tr>
					<tr>
						<td class="config_form_field"><input type="checkbox" value="YES" name="online_app_email_std" <?php 
    if (JB_ONLINE_APP_EMAIL_STD == "YES") {
        echo " checked ";
    }
    ?>
 > Email the Application to Employer, if applying to <b>Standard</b> post
						</td>
					</tr>
					<tr>
						<td class="config_form_field">
						<hr>The following 3 options should only be enabled when the candidate has to log in to do applications:<br>
						<input type="checkbox" value="YES" name="online_app_reveal_premium" <?php 
    if (JB_ONLINE_APP_REVEAL_PREMIUM == "YES") {
        echo " checked ";
    }
    ?>
 > Reveal candidate's 'anonymous' fields to Employer, if applying to <b>Premium</b> post (note: If the application email is sent to employer, they will be able to see the candidates contact details regardless of this option)
						</td>
					</tr>
					<tr>
						<td class="config_form_field">
						<input type="checkbox" value="YES" name="online_app_reveal_std" <?php 
    if (JB_ONLINE_APP_REVEAL_STD == "YES") {
        echo " checked ";
    }
    ?>
 > Reveal candidate's 'anonymous' fields to Employer, if applying to <b>Standard</b> post (note: If the application email is sent to employer, they will be able to see the candidates contact details regardless of this option)
						</td>
					</tr>
					<tr>
						<td class="config_form_field">
						<input type="checkbox" value="YES" name="online_app_reveal_resume" <?php 
    if (JB_ONLINE_APP_REVEAL_RESUME == "YES") {
        echo " checked ";
    }
    ?>
 > Reveal candidate's online resume to the Employer, even if employer is not subscribed to view the resumes. (The employer will be able to access the resume through a special link received in the Application email.)
					</td>
					</tr>
					<tr>
						<td class="config_form_field">
						<hr><input type="checkbox" value="YES" name="jb_app_choice_switch" <?php 
    if (JB_APP_CHOICE_SWITCH == "YES") {
        echo " checked ";
    }
    ?>
 > Allow the employer to choose how this application is sent (Via the website / via custom URL / turn off)
						</td>
					</tr>
					</table>
				</td>
			</tr>
			</table>
				<br><input type="radio" name="online_app_enabled" value="NO" <?php 
    if (JB_ONLINE_APP_ENABLED != 'YES') {
        echo " checked ";
    }
    ?>
 >No (Disabled)
			</td>
		</tr>
		
		<tr>
		  <td class="config_form_label" width="20%"> 
		   Enable 'Tell a Friend about a Job' feature?</td>
		  <td class="config_form_field">
		   <input type="radio" name="taf_enabled" size="49" value="YES" <?php 
    if (JB_TAF_ENABLED == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (Enabled, <input type="checkbox" value="YES" name="taf_sign_in" <?php 
    if (JB_TAF_SIGN_IN == "YES") {
        echo " checked ";
    }
    ?>
 > Candidate needs to be logged on to use this feature.)<br><input type="radio" name="taf_enabled" value="NO" <?php 
    if (JB_TAF_ENABLED != 'YES') {
        echo " checked ";
    }
    ?>
 >No (Disabled)</td>
		</tr>
		<tr>
		  <td class="config_form_label" width="20%"> 
		   Enable 'Save Job' feature?</td>
		  <td class="config_form_field">
		   <input type="radio" name="save_job_enabled" size="49" value="YES" <?php 
    if (JB_SAVE_JOB_ENABLED == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (Enabled)<br><input type="radio" name="save_job_enabled" value="NO" <?php 
    if (JB_SAVE_JOB_ENABLED != 'YES') {
        echo " checked ";
    }
    ?>
 >No (Disabled)</td>
		</tr>
		<tr>
		<?php 
    if (!defined('JB_SHOW_PREMIUM_LIST')) {
        define('JB_SHOW_PREMIUM_LIST', 'YES');
    }
    ?>
		  <td class="config_form_label"  width="20%"> 
		   Enable 'Premium Posts' list at the top of the home page?</td>
		  <td class="config_form_field">
		   <input type="radio" name="jb_show_premium_list" size="49" value="YES" <?php 
    if (JB_SHOW_PREMIUM_LIST == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (Enabled) - <input type="checkbox" name="jb_dont_repeat_premium" value="YES" <?php 
    if (JB_DONT_REPEAT_PREMIUM == 'YES') {
        echo ' checked ';
    }
    ?>
> Do not repeat showing premium posts on the non-premium list<br><input type="radio" name="jb_show_premium_list" value="NO" <?php 
    if (JB_SHOW_PREMIUM_LIST != 'YES') {
        echo " checked ";
    }
    ?>
 >No (Disabled)</td>
		</tr>
		
		</table>

	  <p>&nbsp;</p>
	  <a name="date"></a>
	  <table class="config_form" cellpadding="5" cellspacing="2" >
		<tr>
		  <td colspan="2" class="config_form_heading">
		  Localization - Time and Date</td>
		</tr>
		<tr>
		  <td width="20%" class="config_form_label" >Display Date Format</td>
		  <td class="config_form_field">
		  <input type="text" name="date_format" size="49" value="<?php 
    echo htmlentities(JB_DATE_FORMAT);
    ?>
"><br>(see http://www.php.net/date for formatting info. Determines how the date is formatted when it is displayed)</td>
		</tr>
		<?php 
    if (!defined('JB_DATE_INPUT_SEQ')) {
        define('JB_DATE_INPUT_SEQ', 'YMD');
    }
    ?>
		<tr>
		  <td width="20%" class="config_form_label">Input Date Sequence</td>
		  <td class="config_form_field" >
		   <input type="text" name="date_input_seq" size="49" value="<?php 
    echo jb_escape_html(JB_DATE_INPUT_SEQ);
    ?>
"> Eg. YMD for the international date standard (ISO 8601). The sequence should always contain one D, one M and one Y only, in any order. This will determine the order in the way the date is <b>inputted</b>. (You should not use any dashes for this setting, only letters Y, M, D case-sensitive!)
		  </td>
		 </tr>
		<tr>
		  <td width="20%" class="config_form_label">GMT Difference</td>
		  <td class="config_form_field">
		  <select name="gmt_dif" value="<?php 
    echo htmlentities(JB_GMT_DIF);
    ?>
">
		  <option value="-12" <?php 
    if (JB_GMT_DIF == '-12.00') {
        echo " selected ";
    }
    ?>
 >-12:00</option>
		  <option value="-11" <?php 
    if (JB_GMT_DIF == '-11.00') {
        echo " selected ";
    }
    ?>
 >-11:00</option>
		  <option value="-10" <?php 
    if (JB_GMT_DIF == '-10.00') {
        echo " selected ";
    }
    ?>
 >-10:00</option>
		  <option value="-9" <?php 
    if (JB_GMT_DIF == '-9.00') {
        echo " selected ";
    }
    ?>
 >-9:00</option>
		  <option value="-8" <?php 
    if (JB_GMT_DIF == '-8.00') {
        echo " selected ";
    }
    ?>
 >-8:00</option>
		  <option value="-7" <?php 
    if (JB_GMT_DIF == '-7.00') {
        echo " selected ";
    }
    ?>
 >-7:00</option>
		  <option value="-6" <?php 
    if (JB_GMT_DIF == '-6.00') {
        echo " selected ";
    }
    ?>
 >-6:00</option>
		  <option value="-5" <?php 
    if (JB_GMT_DIF == '-5.00') {
        echo " selected ";
    }
    ?>
 >-5:00</option>
		  <option value="-4" <?php 
    if (JB_GMT_DIF == '-4.00') {
        echo " selected ";
    }
    ?>
 >-4:00</option>
		  <option value="-3.5" <?php 
    if (JB_GMT_DIF == '-3.5') {
        echo " selected ";
    }
    ?>
 >-3:30</option>
		  <option value="-3" <?php 
    if (JB_GMT_DIF == '-3.00') {
        echo " selected ";
    }
    ?>
 >-3:00</option>
		  <option value="-2" <?php 
    if (JB_GMT_DIF == '-2.00') {
        echo " selected ";
    }
    ?>
 >-2:00</option>
		  <option value="-1" <?php 
    if (JB_GMT_DIF == '-1.00') {
        echo " selected ";
    }
    ?>
 >-1:00</option>
		  <option value="0" <?php 
    if (JB_GMT_DIF == '0') {
        echo " selected ";
    }
    ?>
 >0:00</option>
		  <option value="1" <?php 
    if (JB_GMT_DIF == '1.00') {
        echo " selected ";
    }
    ?>
 >+1:00</option>
		  <option value="2" <?php 
    if (JB_GMT_DIF == '2.00') {
        echo " selected ";
    }
    ?>
 >+2:00</option>
		  <option value="3" <?php 
    if (JB_GMT_DIF == '3.00') {
        echo " selected ";
    }
    ?>
 >+3:00</option>
		  <option value="3.5" <?php 
    if (JB_GMT_DIF == '3.50') {
        echo " selected ";
    }
    ?>
 >+3:30</option>
		  <option value="4" <?php 
    if (JB_GMT_DIF == '4.00') {
        echo " selected ";
    }
    ?>
 >+4:00</option>
		  <option value="4.5" <?php 
    if (JB_GMT_DIF == '4.5') {
        echo " selected ";
    }
    ?>
 >+4:30</option>
		  <option value="5" <?php 
    if (JB_GMT_DIF == '5.00') {
        echo " selected ";
    }
    ?>
 >+5:00</option>
		  <option value="5.5" <?php 
    if (JB_GMT_DIF == '5.50') {
        echo " selected ";
    }
    ?>
 >+5:30</option>
		  <option value="5.75" <?php 
    if (JB_GMT_DIF == '5.75') {
        echo " selected ";
    }
    ?>
 >+5:45</option>
		  <option value="6" <?php 
    if (JB_GMT_DIF == '6.00') {
        echo " selected ";
    }
    ?>
 >+6:00</option>
		  <option value="6.5" <?php 
    if (JB_GMT_DIF == '6.5') {
        echo " selected ";
    }
    ?>
 >+6:30</option>
		  <option value="7" <?php 
    if (JB_GMT_DIF == '7.00') {
        echo " selected ";
    }
    ?>
 >+7:00</option>
		  <option value="8" <?php 
    if (JB_GMT_DIF == '8.00') {
        echo " selected ";
    }
    ?>
 >+8:00</option>
		  <option value="9" <?php 
    if (JB_GMT_DIF == '9.00') {
        echo " selected ";
    }
    ?>
 >+9:00</option>
		  <option value="9.5" <?php 
    if (JB_GMT_DIF == '9.5') {
        echo " selected ";
    }
    ?>
 >+9:30</option>
		  <option value="10" <?php 
    if (JB_GMT_DIF == '10.00') {
        echo " selected ";
    }
    ?>
 >+10:00</option>
		  <option value="11" <?php 
    if (JB_GMT_DIF == '11.00') {
        echo " selected ";
    }
    ?>
 >+11:00</option>
		  <option value="12" <?php 
    if (JB_GMT_DIF == '12.00') {
        echo " selected ";
    }
    ?>
 >+12:00</option>
		  <option value="13" <?php 
    if (JB_GMT_DIF == '13.00') {
        echo " selected ";
    }
    ?>
 >+13:00</option>

		  </select> from GMT
		  <br></td>
		</tr>
		<tr>
		<td class="config_form_heading"  colspan="2">SCW Settings (Simple Calendar Widget - pop-up calendar field type). See include/lib/scw/scw_js.php for more setting options, including CSS definitions.</td>
		</tr>
		<?php 
    if (!defined('JB_SCW_DATE_FORMAT')) {
        define('JB_SCW_DATE_FORMAT', 'YYYY-MM-DD');
    }
    if (!defined('JB_SCW_INPUT_SEQ')) {
        define('JB_SCW_INPUT_SEQ', 'YMD');
    }
    ?>
		<tr>
		  <td width="20%" class="config_form_label" >SCW Date Display Format</td>
		  <td class="config_form_field">
		   <input type="text" name="scw_date_format" size="49" value="<?php 
    echo jb_escape_html(JB_SCW_DATE_FORMAT);
    ?>
"> Eg. YYYY-MM-DD for the international standard (ISO 8601). Use double letters for zero filling, Eg. for September, MM will display as 09 and M will display as 9. 
		  </td>
		 </tr>
		
		<tr>
		  <td width="20%" class="config_form_label">SCW Date Input Sequence</td>
		  <td class="config_form_field">
		   <input type="text" name="scw_input_seq" size="49" value="<?php 
    echo jb_escape_html(JB_SCW_INPUT_SEQ);
    ?>
"> Eg. YMD for the international date standard (ISO 8601). The sequence should always contain one D, one M and one Y only, in any order.
		  </td>
		 </tr>
<?php 
    if (!defined('JB_NAME_FORMAT')) {
        define('JB_NAME_FORMAT', 'F L');
    }
    ?>
		 <tr>
		  <td width="20%" class="config_form_label">Name Display Format</td>
		  <td class="config_form_field">
		   <input type="text" name="jb_name_format" size="4" value="<?php 
    echo jb_escape_html(JB_NAME_FORMAT);
    ?>
"> Enter the name format for how the system should display names. F = First Name, L = Last Name. Eg. L, F will display the last name, followed by a comma, followed by the first name. ie. Smith, John.
		  </td>
		 </tr>

		</taBLE>
	 <p>&nbsp;</p>
	<a name="cats"></a>
	  <table class="config_form" cellpadding="5" cellspacing="2" >
		<tr>
		  <td colspan="2" class="config_form_heading">
		 Categories</td>
		</tr>
		<tr>
		  <td width="20%" class="config_form_label">Max Sub-categories to show:</td>
		  <td class="config_form_field">
		  <input type="text" name="show_subcats" size="3" value="<?php 
    echo jb_escape_html(JB_SHOW_SUBCATS);
    ?>
"> (Enter a number, eg. 5 - can be a zero)</td>
		</tr>
		<tr>
		  <td class="config_form_label">How many columns on front page</td>
		  <td class="config_form_field">
		  <input type="text" name="cat_cols_fp" size="3" value="<?php 
    echo jb_escape_html(JB_CAT_COLS_FP);
    ?>
"> (Enter a number, eg. 1)</td>
		</tr>
		<tr>
		  <td class="config_form_label">How many columns on category page</td>
		  <td class="config_form_field">
		  <input type="text" name="cat_cols" size="3" value="<?php 
    echo jb_escape_html(JB_CAT_COLS);
    ?>
"> (Enter a number, eg. 3)</td>
		</tr>
		<tr>
		  <td class="config_form_label" width="20%"> 
		   Format sub-categories into tables (on the front page)?</td>
		  <td class="config_form_field">
		   <input type="radio" name="format_sub_cats" size="49" value="YES" <?php 
    if (JB_FORMAT_SUB_CATS == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (Format sub-categories nicely into tables, using <input type="text" name="sub_category_cols" value="<?php 
    echo jb_escape_html(JB_SUB_CATEGORY_COLS);
    ?>
" size="2"> columns per row. <br><input type="radio" name="format_sub_cats" value="NO" <?php 
    if (JB_FORMAT_SUB_CATS == 'NO') {
        echo " checked ";
    }
    ?>
 >No (Keep them as compact as possible!)</td>
		</tr>

		<tr>
		  <td class="config_form_label">Cut-off (trim) category names?</td>
		  <td class="config_form_field">
		  <table>
		  <tr><td class="config_form_field">
		  <input type="radio" name="cat_name_cutoff" value="YES"  <?php 
    if (JB_CAT_NAME_CUTOFF == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes
		  </td><td class="config_form_field">
		  [Cut off the name to a maximum of <input type="text" name="cat_name_cutoff_chars" size="3" value="<?php 
    echo jb_escape_html(JB_CAT_NAME_CUTOFF_CHARS);
    ?>
" > characters]</td>
		  </tr><tr>
		  <td>
		  <input type="radio" name="cat_name_cutoff" value="NO"  <?php 
    if (JB_CAT_NAME_CUTOFF == 'NO') {
        echo " checked ";
    }
    ?>
 >No
		  </td><td></td></tr></table>
		  </td>
		</tr>
		<tr>
		  <td width="20%" class="config_form_label">Indent sub-categories, show on the selection list?</td>
		  <td class="config_form_field">
		  <input type="radio" name="indent_category_list" value="YES"  <?php 
    if (JB_INDENT_CATEGORY_LIST == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes<br>
		  <input type="radio" name="indent_category_list" value="NO"  <?php 
    if (JB_INDENT_CATEGORY_LIST == 'NO') {
        echo " checked ";
    }
    ?>
 >No<br>
		  
		  </td>
		  </tr>
		  <tr>
		  <td width="20%" class="config_form_label">Show category counters next to category names?</td>
		  <td class="config_form_field">
		  <input type="radio" name="cat_show_obj_count" value="YES"  <?php 
    if (JB_CAT_SHOW_OBJ_COUNT == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes<br>
		  <input type="radio" name="cat_show_obj_count" value="NO"  <?php 
    if (JB_CAT_SHOW_OBJ_COUNT == 'NO') {
        echo " checked ";
    }
    ?>
 >No<br>
		  
		  </td>
		  </tr>

		  <tr>
		  <td width="20%" class="config_form_label">Show RSS subscription link?</td>
		  <td class="config_form_field">
		  <input type="radio" name="jb_cat_rss_switch" value="YES"  <?php 
    if (JB_CAT_RSS_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes<br>
		  <input type="radio" name="jb_cat_rss_switch" value="NO"  <?php 
    if (JB_CAT_RSS_SWITCH == 'NO') {
        echo " checked ";
    }
    ?>
 >No<br>
		  
		  </td>
		  </tr>


		  <tr>
		  <td width="20%" class="config_form_label">Display category style - when viewing category fields on the dynamic form</td>
		  <td class="config_form_field">
		  <input type="radio" name="jb_cat_path_only_leaf" value="YES"  <?php 
    if (JB_CAT_PATH_ONLY_LEAF == 'YES') {
        echo " checked ";
    }
    ?>
 > - Only the category name, eg 'Sydney'<br>
		  <input type="radio" name="jb_cat_path_only_leaf" value="NO"  <?php 
    if (JB_CAT_PATH_ONLY_LEAF == 'NO') {
        echo " checked ";
    }
    ?>
 > - The category name and all the parent categories eg. 'Location -> Australia -> Syndey' (This is called 'Breadcrumb' navigation)<br>
		  
		  </td>
		  </tr>

		
	   </table>
	 <p>&nbsp;</p>

	<a name="mod_rewrite"></a>
	 <table class="config_form" cellpadding="5" cellspacing="2" >
	 <tr>
		<td class="config_form_heading" colspan="2">Mod_Rewrite (Advanced, see 'Extras' section in the menu for more info)<a name="mod_rewrite"></a></td>
		</tr>

		
		 <tr>
		  <td width="20%" class="config_form_label">Category URL Mod_rewrite Switch</td>
		  <td class="config_form_field">
		  <input type="radio" name="cat_mod_rewrite" value="YES"  <?php 
    if (JB_CAT_MOD_REWRITE == 'YES') {
        echo " checked ";
    }
    ?>
 >On - Please <A href='mod_rewrite.php'>see here</a> before enabling this option!<br>
		  <input type="radio" name="cat_mod_rewrite" value="NO"  <?php 
    if (JB_CAT_MOD_REWRITE == 'NO') {
        echo " checked ";
    }
    ?>
 >Off<br>
		  
		  </td>
		  </tr>
		  <tr>
		  <td class="config_form_label">Category Directory</td>
		  <td class="config_form_field">
		 <?php 
    if (!defined('JB_MOD_REWRITE_DIR')) {
        define('JB_MOD_REWRITE_DIR', 'category/');
    }
    ?>
		  
		 <input type="text" name="mod_rewrite_dir" size="30" value="<?php 
    echo jb_escape_html(JB_MOD_REWRITE_DIR);
    ?>
" >  - Default is: <b>category/</b> (Always no slashes at the front, and a forward slash at the end)
		  

		  </td>
		 <tr>
		  <td width="20%" class="config_form_label">Job Post URL Mod_rewrite Switch</td>
		  <td class="config_form_field">
		  <input type="radio" name="job_mod_rewrite" value="YES"  <?php 
    if (JB_JOB_MOD_REWRITE == 'YES') {
        echo " checked ";
    }
    ?>
 >On - Please <A href='mod_rewrite.php'>see here</a> before enabling this option!<br>
		  <input type="radio" name="job_mod_rewrite" value="NO"  <?php 
    if (JB_JOB_MOD_REWRITE == 'NO') {
        echo " checked ";
    }
    ?>
 >Off<br>
	 
		  </td>
		 
		</tr>
		 <tr>
		  <td class="config_form_label">Job Posting Directory</td>
		  <td class="config_form_field">
		 <?php 
    if (!defined('JB_MOD_REWRITE_JOB_DIR')) {
        define('JB_MOD_REWRITE_JOB_DIR', 'job/');
    }
    ?>
		  
		 <input type="text" name="mod_rewrite_job_dir" size="60" value="<?php 
    echo jb_escape_html(JB_MOD_REWRITE_JOB_DIR);
    ?>
" >  - Default is: <b>job/</b> You can use any template tag. Eg. job/%DATE%/ - where the %DATE% will be changed to the date when the job was posted. Another example would be job/%DATE%/%CLASS%/ (Always no slashes at the front, and a forward slash at the end. %CLASS% is the default classification field)
		  

		  </td>
		</tr>

		 <tr>
		  <td width="20%" class="config_form_label">Employer's Profile URL Mod_rewrite Switch</td>
		  <td class="config_form_field">
		  <input type="radio" name="pro_mod_rewrite" value="YES"  <?php 
    if (JB_PRO_MOD_REWRITE == 'YES') {
        echo " checked ";
    }
    ?>
 >On - Please <A href='mod_rewrite.php'>see here</a> before enabling this option!<br>
		  <input type="radio" name="pro_mod_rewrite" value="NO"  <?php 
    if (JB_PRO_MOD_REWRITE == 'NO') {
        echo " checked ";
    }
    ?>
 >Off<br>
	 
		  </td>
		 </tr>

		 <tr>
		  <td  class="config_form_label">Employer's Profile Directory</td>
		  <td  class="config_form_field">
		 <?php 
    if (!defined('JB_MOD_REWRITE_PRO_DIR')) {
        define('JB_MOD_REWRITE_PRO_DIR', 'profile/');
    }
    ?>
		  
		 <input type="text" name="mod_rewrite_pro_dir" size="30" value="<?php 
    echo jb_escape_html(JB_MOD_REWRITE_PRO_DIR);
    ?>
" >  - Default is: <b>profile/</b> (Always no slashes at the front, and a forward slash at the end)
		  

		  </td>
		</tr>
		 <tr>
		  <td width="20%" class="config_form_label">Job list, Page Numbers URLs Mod_rewrite Switch</td>
		  <td class="config_form_field">
		  <input type="radio" name="job_pages_mod_rewrite" value="YES"  <?php 
    if (JB_JOB_PAGES_MOD_REWRITE == 'YES') {
        echo " checked ";
    }
    ?>
 >On - Please <A href='mod_rewrite.php'>see here</a> before enabling this option!<br>
		  <input type="radio" name="job_pages_mod_rewrite" value="NO"  <?php 
    if (JB_JOB_PAGES_MOD_REWRITE == 'NO') {
        echo " checked ";
    }
    ?>
 >Off<br>
	 
		  </td>
		 </tr>
			 <tr>
		  <td class="config_form_label">Page Number URL prefix</td>
		  <td class="config_form_field">
		 <?php 
    if (!defined('JB_MOD_REWRITE_JOB_PAGES_PREFIX')) {
        define('JB_MOD_REWRITE_JOB_PAGES_PREFIX', 'page');
    }
    ?>
		  
		 <input type="text" name="mod_rewrite_job_pages_prefix" size="30" value="<?php 
    echo jb_escape_html(JB_MOD_REWRITE_JOB_PAGES_PREFIX);
    ?>
" >  - Default is: <b>page</b> (This will be show as<br> http://www.example.com/page1<br> http://www.example.com/page2<br> http://www.example.com/page3<br> etc)
		  

		  </td>
		</tr>
		<tr>
		  <td width="20%" class="config_form_label">Remove accents from URLs</td>
		  <td class="config_form_field">
		  <input type="radio" name="mod_rewrite_remove_accents" value="YES"  <?php 
    if (JB_MOD_REWRITE_REMOVE_ACCENTS == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes - This will remove accents in URLs such as à, á, â to a, a, a. Please note that for categories you may need to remove accents manually. Please go to Admin->mod_rewrite to configure your category URLs<br>
		  <input type="radio" name="mod_rewrite_remove_accents" value="NO"  <?php 
    if (JB_MOD_REWRITE_REMOVE_ACCENTS == 'NO') {
        echo " checked ";
    }
    ?>
 >No<br>
		  
		  </td>
		  </tr>
	   </table>

	<p>&nbsp;</p>
<a name="clean"></a>
	  <table class="config_form" cellpadding="5" cellspacing="2" >
		<tr>
		  <td colspan="2" class="config_form_heading">
		  Data Cleaning
		  </td>
		</tr>
	   <tr>
		  <td class="config_form_label" width="20%"> 
		   Strip unwanted HTML tags from Text-Editor and HTML-Editor fields?</td>
		  <td class="config_form_field">
		   <input type="radio" name="strip_html" size="49" value="YES" <?php 
    if (JB_STRIP_HTML == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (This will strip dangerous attributes such as javascript, and leave only the good data. Note, since v3.6, this setting is always set to Yes.)<br><input type="radio" disabled name="strip_html" value="NO" <?php 
    if (JB_STRIP_HTML != 'YES') {
        echo " checked ";
    }
    ?>
 >No</td>
		</tr>
		<tr>
		  <td class="config_form_label" width="20%"> 
		   Break long words?</td>
		  <td class="config_form_field">
		  <?php 
    if (!defined('JB_BREAK_LONG_WORDS')) {
        define('JB_BREAK_LONG_WORDS', 'YES');
    }
    if (!defined('JB_LNG_MAX')) {
        define('JB_LNG_MAX', '80');
    }
    ?>
		   <input type="radio" name="break_long_words" size="49" value="YES" <?php 
    if (JB_BREAK_LONG_WORDS == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes - and maximum word length is <input type='text' name='lng_max' value='<?php 
    echo jb_escape_html(JB_LNG_MAX);
    ?>
' size="2" > characters. (This will add a space between words that are longer than the limit - to make sure that users do not enter input which destroys the layout of the site. eg. consecutive ===='s).<br><input type="radio" name="break_long_words" value="NO" <?php 
    if (JB_BREAK_LONG_WORDS != 'YES') {
        echo " checked ";
    }
    ?>
 >No</td>
		</tr>
	  <tr>
		  <td class="config_form_label" width="20%"> 
		   Strip characters that aren't valid in ISO-8859-1?</td>
		  <td class="config_form_field">
		   <input type="radio" name="strip_latin1" size="49" value="YES" <?php 
    if (JB_STRIP_LATIN1 == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (Enabled. Choose this option if you expect your data to output in the standard HTML character encoding)<br><input type="radio" name="strip_latin1" value="NO" <?php 
    if (JB_STRIP_LATIN1 != 'YES') {
        echo " checked ";
    }
    ?>
 >No (Disabled)</td>
		</tr>
		<tr>
		  <td class="config_form_label" width="20%"> 
		   Trim white-space from strings?</td>
		  <td class="config_form_field">
		   <input type="radio" name="clean_strings" size="49" value="YES" <?php 
    if (JB_CLEAN_STRINGS == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (Enabled. This will trim any un-needed white-space from inputed data)<br><input type="radio" name="clean_strings" value="NO" <?php 
    if (JB_CLEAN_STRINGS != 'YES') {
        echo " checked ";
    }
    ?>
 >No (Disabled)</td>
		</tr>
	   <tr>
		  <td class="config_form_label" width="20%"> 
		   Enable Profanity word Filter?</td>
		  <td class="config_form_field">
		  
		  <input type="radio" name="bad_word_filter" size="49" value="YES" <?php 
    if (JB_BAD_WORD_FILTER == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (Enabled. You can setup your profanity word list below)<br><input type="radio" name="bad_word_filter" value="NO" <?php 
    if (JB_BAD_WORD_FILTER != 'YES') {
        echo " checked ";
    }
    ?>
 >No (Disabled) <br>
		  Enter the bad words that you would like to filter, seperated by commas:<br>
		  <textarea name='bad_words' rows="4" cols="50"><?php 
    echo JB_BAD_WORDS;
    ?>
</textarea>
		  </td>
		</tr>
		
		<tr>
		  <td class="config_form_label" width="20%"> 
		   File Uploads - Allowed extensions:</td>
		  <td class="config_form_field">
		  <br>
		  Enter the file types that you would like to allow, seperated by commas:<br>
		  <textarea name='allowed_ext' rows="4" cols="50"><?php 
    if (JB_ALLOWED_EXT == 'JB_ALLOWED_EXT') {
        $JB_ALLOWED_EXT = 'doc, docx, pdf, wps, hwp, txt, rtf, wri, zip, rar, jpeg, jpg, gif, bmp';
    } else {
        $JB_ALLOWED_EXT = JB_ALLOWED_EXT;
    }
    echo $JB_ALLOWED_EXT;
    ?>
</textarea><br>
		  eg: doc, docx, pdf, wps, hwp, txt, rtf, wri, zip, rar, jpeg, jpg, gif, bmp
		  
		  </td>
		</tr>
		<tr>
		  <td class="config_form_label" width="20%">
		   Image Uploads - Allowed extensions:</td>
		  <td class="config_form_field">
		  <br>
		  Enter the image types that you would like to allow, seperated by commas:<br>
		  <textarea name='allowed_img' rows="4" cols="50"><?php 
    if (JB_ALLOWED_IMG == 'JB_ALLOWED_IMG') {
        $JB_ALLOWED_IMG = 'jpg, jpeg, gif, png, bmp';
    } else {
        $JB_ALLOWED_IMG = JB_ALLOWED_IMG;
    }
    echo $JB_ALLOWED_IMG;
    ?>
</textarea><br>
		  eg: jpg, jpeg, gif, png, bmp
		  
		  </td>
		</tr>
		<tr>
		  <td class="config_form_label" width="20%"> 
		   File Uploads - Maximum Size:</td>
		  <td class="config_form_field">
			<input type="text" value="<?php 
    if (JB_MAX_UPLOAD_BYTES == 'JB_MAX_UPLOAD_BYTES') {
        $JB_MAX_UPLOAD_BYTES = '1048576';
    } else {
        $JB_MAX_UPLOAD_BYTES = JB_MAX_UPLOAD_BYTES;
    }
    echo jb_escape_html($JB_MAX_UPLOAD_BYTES);
    ?>
" name="max_upload_bytes"> (Enter the max size in bytes. 1048576 bytes = 1MB)
		  
		  </td>
	   </table>
		<p>&nbsp;</p>
		<a name="ac"></a>
	  <table class="config_form" cellpadding="5" cellspacing="2" >
		<tr>
		  <td colspan="2" valign="top" class="config_form_heading">
		  Accounts &amp; Permissions</td>
		</tr>
		<tr>
		  <td width="20%" valign="top" class="config_form_label">
		  Candidate's accounts need to be Activated?</td>
		  <td  valign="top" class="config_form_field">
		  
		  
		  <input disabled type="radio" name="ca_needs_activation" value="SELF" <?php 
    if (JB_CA_NEEDS_ACTIVATION == 'SELF') {
        echo " checked ";
    }
    ?>
 ><!--Yes - self (NYI)--><br>
		  <input type="radio" name="ca_needs_activation" value="MANUAL" <?php 
    if (JB_CA_NEEDS_ACTIVATION == 'MANUAL') {
        echo " checked ";
    }
    ?>
 >Yes - manually<br>
		  <input type="radio" name="ca_needs_activation" value="AUTO" <?php 
    if (JB_CA_NEEDS_ACTIVATION == 'AUTO') {
        echo " checked ";
    }
    ?>
 >No</td>
		</tr>
		<tr>
		  <td  valign="top" class="config_form_label">
		  Employer accounts need to be activated?</td>
		  <td  valign="top" class="config_form_field">
		  
		  
		  <input type="radio" name="em_needs_activation" value="MANUAL" <?php 
    if (JB_EM_NEEDS_ACTIVATION == 'MANUAL') {
        echo " checked ";
    }
    ?>
 >Yes - Employers need to be manually activated before they can log in<br>
		  <input type="radio"  name="em_needs_activation" value="NO_RESUME" <?php 
    if (JB_EM_NEEDS_ACTIVATION == 'NO_RESUME') {
        echo " checked ";
    }
    ?>
 >Yes - Employers need to be manually activated before they can view resumes for free (If subscriptions are disabled)<br>
		  <input type="radio"  name="em_needs_activation" value="FIRST_POST" <?php 
    if (JB_EM_NEEDS_ACTIVATION == 'FIRST_POST') {
        echo " checked ";
    }
    ?>
 >No - Activate automatically, but need to post an ad before viewing resumes (If subscriptions are disabled)<br>
		  <input type="radio" name="em_needs_activation" value="AUTO" <?php 
    if (JB_EM_NEEDS_ACTIVATION == 'AUTO') {
        echo " checked ";
    }
    ?>
>No - all accounts are active by default<br>
		  
		  
		  
		  </td>
		</tr>
		
		<tr>
		  <td  valign="top" class="config_form_label">
		  Impose a limit on how many free Standard posts an employer can have at one time?</td>
		  <td  valign="top" class="config_form_field">
		  
		  
		  <input type="radio" name="free_post_limit" value="YES"  <?php 
    if (JB_FREE_POST_LIMIT == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes, with a maximum of
		  <input type="text" name="free_post_limit_max" size="3" value="<?php 
    echo jb_escape_html(JB_FREE_POST_LIMIT_MAX);
    ?>
"> posts. (Works only if billing is disabled for standard posts)<br>
		  <input type="radio" name="free_post_limit" value="NO"  <?php 
    if (JB_FREE_POST_LIMIT == 'NO') {
        echo " checked ";
    }
    ?>
 >No, unlimited</td>
		</tr>
		<tr>
		  <td class="config_form_label">Employers begin with how many free credit points for Premium posts?</td>
		  <td class="config_form_field">
		  <input type="text" name="begin_premium_credits" size="3" value="<?php 
    echo jb_escape_html(JB_BEGIN_PREMIUM_CREDITS);
    ?>
"> (Enter a number, eg. 5)</td>
		</tr>
		<tr>
		  <td class="config_form_label">Employers begin with how many free credit points for Standard posts?</td>
		  <td class="config_form_field">
		  <input type="text" name="begin_standard_credits" size="3" value="<?php 
    echo jb_escape_html(JB_BEGIN_STANDARD_CREDITS);
    ?>
"> (Enter a number, eg. 5)</td>
		</tr>
		 <tr>
		  <td  valign="top" class="config_form_label">
		  Allow the Admin to login to employer's and user's accounts using the admin password?</td>
		  <td  valign="top" class="config_form_field">
		  
		  
			  <input type="radio" name="allow_admin_login" value="YES"  <?php 
    if (JB_ALLOW_ADMIN_LOGIN == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes<br>
		  <input type="radio" name="allow_admin_login" value="NO"  <?php 
    if (JB_ALLOW_ADMIN_LOGIN == 'NO') {
        echo " checked ";
    }
    ?>
 >No</td>
		</tr>
		
	  </table>
	  <p>&nbsp;</p>
	  <a name="menu"></a>
	  <table class="config_form" cellpadding="5" cellspacing="2" >
		<tr>
		  <td colspan="2" class="config_form_heading">
		  Menu Options</td>
		</tr>
	   <?php 
    if (!defined('JB_CANDIDATE_MENU_TYPE')) {
        define('JB_CANDIDATE_MENU_TYPE', 'JS');
    }
    if (!defined('JB_EMPLOYER_MENU_TYPE')) {
        define('JB_EMPLOYER_MENU_TYPE', 'JS');
    }
    ?>
		<tr>   
		  <td width="20%" class="config_form_label">Candidate's Menu</td>
		  <td class="config_form_field">
		  <input type="radio" name="candidate_menu_type" value="JS"  <?php 
    if (JB_CANDIDATE_MENU_TYPE == 'JS') {
        echo " checked ";
    }
    ?>
 >Javascript Menu. (Pull-down menus)<br>
		  <br>
		  <input type="radio" name="candidate_menu_type" value="TXT"  <?php 
    if (JB_CANDIDATE_MENU_TYPE == 'TXT') {
        echo " checked ";
    }
    ?>
 >Text Based Menu. (Tabs)
		  
		  </td>
		</tr>

		<tr>   
		  <td width="20%" class="config_form_label">Employer's Menu</td>
		  <td class="config_form_field">
		  <input type="radio" name="employer_menu_type" value="JS"  <?php 
    if (JB_EMPLOYER_MENU_TYPE == 'JS') {
        echo " checked ";
    }
    ?>
 >Javascript Menu. (Pull-down menus)<br>
		  <br>
		  <input type="radio" name="employer_menu_type" value="TXT"  <?php 
    if (JB_EMPLOYER_MENU_TYPE == 'TXT') {
        echo " checked ";
    }
    ?>
 >Text Based Menu. (Tabs)
		  
		  </td>
		</tr>
		
		 </table>

		 <p>&nbsp;</p>
	  <a name="search"></a>
	  <table class="config_form" cellpadding="5" cellspacing="2" >
		<tr>
		  <td colspan="2" class="config_form_heading">
		  Search Form Options</td>
		</tr>
	   <?php 
    if (!defined('JB_SEARCH_FORM_LAYOUT')) {
        define('JB_SEARCH_FORM_LAYOUT', 'T');
    }
    ?>
		<tr>   
		  <td width="20%" class="config_form_label">Search Form Layout</td>
		  <td class="config_form_field">
		  <input type="radio" name="search_form_layout" value="T"  <?php 
    if (JB_SEARCH_FORM_LAYOUT == 'T') {
        echo " checked ";
    }
    ?>
 >Classic. (Table layout)<br>
		  <br>
		  <input type="radio" name="search_form_layout" value="TL"  <?php 
    if (JB_SEARCH_FORM_LAYOUT == 'TL') {
        echo " checked ";
    }
    ?>
 >Compact. (Tableless layout. For customizations, please see comments inside include/themes/default/JBSearchFormTLMarkup.php)
		  
		  </td>
		</tr>

		
		
		</table>

		 <p>&nbsp;</p>
		 <a name="anon"></a>
		 <table class="config_form" cellpadding="5" cellspacing="2" >
		<tr>
		  <td colspan="2" class="config_form_heading">
		  Anonymous fields and Request System</td>
		</tr>
	   
		   <tr>
		   
		  <td width="20%" class="config_form_label">Enable Resume's 'anonymous fields' and Request System</td>
		  <td class="config_form_field">
		 
		  <input type="radio" name="resume_request_switch" value="YES"  <?php 
    if (JB_RESUME_REQUEST_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes, mask anonymous fields. Employers will be able to send a request to the candidate, which the Candidate will Grant or Deny. If granted, Employer will be able to see the anonymous fields. IMPORTANT: You will need to specify which fields are "Anonymous", go to Admin->Resume Form, click the 'Edit Fields' tab, and then click on the fields which you want to make 'Anonymous'<br>
		  &nbsp;&nbsp;&nbsp; <input type="checkbox" value="YES" <?php 
    if (JB_NEED_SUBSCR_FOR_REQUEST == 'YES') {
        echo " checked ";
    }
    ?>
  name="need_subscr_for_request">Limit request sending - Subscribed Employers only.<br>
		  <input type="radio" name="resume_request_switch" value="NO"  <?php 
    if (JB_RESUME_REQUEST_SWITCH == 'NO') {
        echo " checked ";
    }
    ?>
 >No, do not mask anonymous fields. Candidates cannot set their resume to 'anonymous'
		  
		  </td>
		</tr>
		
		 </table>
		 <p>&nbsp;</p>
		 <a name="mem"></a>
		 <table class="config_form" cellpadding="5" cellspacing="2">
		<tr>
		  <td colspan="2" class="config_form_heading">
		  Membership fields</td>
		</tr>
	   
		   <tr>
		   
		  <td width="20%" class="config_form_label">Enable 'Members Only' fields</td>
		  <td class="config_form_field">
		 
		  <input type="radio" name="member_field_switch" value="YES"  <?php 
    if (JB_MEMBER_FIELD_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes. Only signed-in users will be able to view fields that are marked "Member's Only" on the job posting form. If membership billing is enabled, they will need to have an active membership to view these fields. (Note: Search Engines cannot index these fields if this option is enabled.) IMPORTANT: You will need to specify which fields are "Members Only", go to Admin->Posting Form, click the 'Edit Fields' tab, and then click on the fields which you want to make 'Members Only'<br>
		  &nbsp;&nbsp;&nbsp; <br>
		  <input type="radio" name="member_field_switch" value="NO"  <?php 
    if (JB_MEMBER_FIELD_SWITCH == 'NO') {
        echo " checked ";
    }
    ?>
 >No.
		  
		  </td>
		</tr>

		<tr><?php 
    ?>
		  <td width="20%" class="config_form_label"> Ignore 'Members Only' fields for Premium Posts?</td>
		  <td class="config_form_field">
		  <input type="radio" name="jb_member_field_ignore_premium" value="YES"  <?php 
    if (JB_MEMBER_FIELD_IGNORE_PREMIUM == 'YES') {
        echo " checked ";
    }
    ?>
 > Yes.<br>
		  <input type="radio" name="jb_member_field_ignore_premium" value="NO"  <?php 
    if (JB_MEMBER_FIELD_IGNORE_PREMIUM == 'NO') {
        echo " checked ";
    }
    ?>
 > No. If 'Members Only' fields are enabled, then they will also be enabled for premium posts too (default)<br>
		 </td>
		 </tr>
		
		 </table>
		 <p>&nbsp;</p>
		 <a name="blocked"></a>
	  <table class="config_form" cellpadding="5" cellspacing="2" >
		<tr>
		  <td colspan="2" class="config_form_heading">
		 Blocked Fields</td>
		</tr>
	   
		   <tr>
		  <td width="20%" class="config_form_label">Enable Blocked Fields System</td>
		  <td class="config_form_field">
		  
		  <input type="radio" name="field_block_switch" value="YES"  <?php 
    if (JB_FIELD_BLOCK_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes, fields that are blockable will be marked as 'blocked' to non-subscribers and not blocked to Subscribers (depending on subscription status) on the resume form. Important: If this option is set to Yes, please go to <a href="resumeform.php">Admin->Resume Form</a>, click 'Edit Fields' tab, and click on the fields that you would like blocked for non-subsribers. If you do not make any fields subject to blocking then everyone will be able to see the resumes in full. This feature works only if resume subscription billing is enabled.<br>
		  <br>
		  <input type="radio" name="field_block_switch" value="NO"  <?php 
    if (JB_FIELD_BLOCK_SWITCH == 'NO') {
        echo " checked ";
    }
    ?>
 >No, Turn off this feature.
		  
		  <div style="margin-left: 25px;">
		  <table>
		  <tr>
		  <td class="config_form_label" width="20%"> 
		   Allow Employers to directly reply to resumes via the site?</td>
		  <td class="config_form_field">
		   <input type="radio" name="resume_reply_enabled" size="49" value="YES" <?php 
    if (JB_RESUME_REPLY_ENABLED == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (Allow)<br><input type="radio" name="resume_reply_enabled" value="NO" <?php 
    if (JB_RESUME_REPLY_ENABLED != 'YES') {
        echo " checked ";
    }
    ?>
 >No (Disabled)</td>
		</tr>
		

		  </table>
		  </div>

		  </td>
		</tr>
		<tr><?php 
    if (!defined('JB_FIELD_BLOCK_APP_SWITCH')) {
        define('JB_FIELD_BLOCK_APP_SWITCH', 'NO');
    }
    ?>
		  <td width="20%" class="config_form_label">Block fields on the employer's Application list?</td>
		  <td class="config_form_field">
		  <input type="radio" name="field_block_app_switch" value="YES"  <?php 
    if (JB_FIELD_BLOCK_APP_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
 > Yes - only employers subscribed to the resume database will be able to see blocked fields on the application list.<br>
		  <input type="radio" name="field_block_app_switch" value="NO"  <?php 
    if (JB_FIELD_BLOCK_APP_SWITCH == 'NO') {
        echo " checked ";
    }
    ?>
 > No - Do not block the fields on the application list - so that non-subscribed employers can see the applications that they received. (default)<br>
		 </td>
		 </tr>

		 </table>
		  <p>&nbsp;</p>
		  <a name="billing"></a>
	  <table class="config_form" cellpadding="5" cellspacing="2" >
		<tr>
		  <td colspan="2" class="config_form_heading">
		  Billing System - Enable / Disable
		  </td>
		</tr>
		<tr>
		  <td width="20%" class="config_form_label">Resume Database - Enable 
		   subscription billing?</td>
		  <td class="config_form_field">
		  <input type="radio" name="subscription_fee_enabled" value="YES"  <?php 
    if (JB_SUBSCRIPTION_FEE_ENABLED == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes<br>
		  <input type="radio" name="subscription_fee_enabled" value="NO"  <?php 
    if (JB_SUBSCRIPTION_FEE_ENABLED == 'NO') {
        echo " checked ";
    }
    ?>
 >No (Allow employers to browse resumes for free)<br>Note: You can configure your prices from the 'Price Admin' menu on the left.</td>
		</tr>
		<tr>
		  <td class="config_form_label">Standard Posts - Enable 
		  Billing?</td>
		  <td class="config_form_field">
		  <input type="radio" name="posting_fee_enabled" value="YES"  <?php 
    if (JB_POSTING_FEE_ENABLED == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes<br>
		  <input type="radio" name="posting_fee_enabled" value="NO"  <?php 
    if (JB_POSTING_FEE_ENABLED == 'NO') {
        echo " checked ";
    }
    ?>
 >No (Allow all employers to post for free)<br>Note: You can configure your prices from the 'Price Admin' menu on the left.<br>
		  <input onclick="if (this.checked) document.form1.premium_posting_fee_enabled[1].checked=true;" type="checkbox" name="premium_auto_upgrade" value="YES"  <?php 
    if (JB_PREMIUM_AUTO_UPGRADE == 'YES') {
        echo " checked ";
    }
    ?>
 >Automatically upgrade all standard posts to premium. Note: Premium Posting gets disabled when this option is checked)
		  </td>
		</tr>
		<tr>
		  <td class="config_form_label">Premium Posts - Enable 
		  Billing?</td>
		  <td class="config_form_field">
		  <input type="radio" name="premium_posting_fee_enabled" value="YES"  <?php 
    if (JB_PREMIUM_POSTING_FEE_ENABLED == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes<br>
		  <input type="radio" name="premium_posting_fee_enabled" value="NO"  <?php 
    if (JB_PREMIUM_POSTING_FEE_ENABLED == 'NO') {
        echo " checked ";
    }
    ?>
 >No (Disable all posting premium posting features)<br>Note: You can configure your prices from the 'Price Admin' menu on the left.</td>
		</tr>
		<tr>
		  <td class="config_form_label">Enable 
		  Billing for Candidate's Membership?</td>
		  <td  class="config_form_field">
		  <input type="radio" name="candidate_membership_enabled" value="YES"  <?php 
    if (JB_CANDIDATE_MEMBERSHIP_ENABLED == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes<br>
		  <input type="radio" name="candidate_membership_enabled" value="NO"  <?php 
    if (JB_CANDIDATE_MEMBERSHIP_ENABLED == 'NO') {
        echo " checked ";
    }
    ?>
 >No (Do not charge candidates a signup fee / membership)<br>Note: You can configure your prices from the 'Price Admin' menu on the left.</td>
		</tr>
		<tr>
		  <td class="config_form_label">Enable 
		  Billing for Employer's Membership?</td>
		  <td class="config_form_field">
		  <input type="radio" name="employer_membership_enabled" value="YES"  <?php 
    if (JB_EMPLOYER_MEMBERSHIP_ENABLED == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes<br>
		  <input type="radio" name="employer_membership_enabled" value="NO"  <?php 
    if (JB_EMPLOYER_MEMBERSHIP_ENABLED == 'NO') {
        echo " checked ";
    }
    ?>
 >No (Do not charge employers a signup fee / membership fee)<br>Note: You can configure your prices from the 'Price Admin' menu on the left.</td>
		</tr>
		<tr>
		  <td class="config_form_label">Invoice I.D. to start from:</td>
		  <td class="config_form_field">
		  <input type="text" name="invoice_id_start" size="5" value="<?php 
    if (!defined('')) {
        define('JB_INVOICE_ID_START', 100);
    }
    echo JB_INVOICE_ID_START;
    ?>
" > (Serial identification number assigned to each invoice. Enter a number to start with, eg 100)</td>
		</tr>
		<tr>
		  <td class="config_form_label">Default Payment Method</td>
		  <td class="config_form_field">
		  <select name='jb_default_pay_meth'>
		  <?php 
    $dir = dirname(__FILE__);
    $dir = explode(DIRECTORY_SEPARATOR, $dir);
    $blank = array_pop($dir);
    $dir = implode('/', $dir);
    include $dir . '/payment/payment_manager.php';
    foreach ($_PAYMENT_OBJECTS as $key => $val) {
        if (JB_DEFAULT_PAY_METH == $key) {
            $sel = ' selected ';
        } else {
            $sel = '';
        }
        echo '<option ' . $sel . ' value="' . $key . '">' . $_PAYMENT_OBJECTS[$key]->name . '</option>';
    }
    ?>
		  </select>
		 
		 </td>
		</tr>
	</table>


	 <p>&nbsp;</p>
	
	<p>&nbsp;</p>
	<a name="posts"></a>
	  <table class="config_form" cellpadding="5" cellspacing="2">
		<tr>
		  <td colspan="2" class="config_form_heading">
		  Posts</td>
		</tr>
		<tr>
		  <td width="20%" class="config_form_label">Posts 
		  need approval?</td>
		  <td  class="config_form_field">
		  <input type="radio" name="posts_need_approval" value="YES"  <?php 
    if (JB_POSTS_NEED_APPROVAL == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes<br>
		  <input type="radio" name="posts_need_approval" value="NO"  <?php 
    if (JB_POSTS_NEED_APPROVAL == 'NO') {
        echo " checked ";
    }
    ?>
 >No<br>
		  <input type="radio" name="posts_need_approval" value="NOT_SUBSCRIBERS"  <?php 
    if (JB_POSTS_NEED_APPROVAL == 'NOT_SUBSCRIBERS') {
        echo " checked ";
    }
    ?>
 >No for subscribed employers / paid posts
		  </td>
		</tr>
		<tr>
		  <td class="config_form_label">Number 
		  of jobs displayed per page</td>
		  <td class="config_form_field">
		  <input type="text" name="posts_per_page" size="10" value="<?php 
    echo jb_escape_html(JB_POSTS_PER_PAGE);
    ?>
" ></td>
		</tr>

		<?php 
    if (!defined('JB_POSTS_PER_RSS')) {
        define('JB_POSTS_PER_RSS', JB_POSTS_PER_PAGE);
    }
    ?>

		<tr>
		  <td class="config_form_label">Number 
		  of jobs included in the RSS feed</td>
		  <td class="config_form_field">
		  <input type="text" name="posts_per_rss" size="10" value="<?php 
    echo jb_escape_html(JB_POSTS_PER_RSS);
    ?>
" ></td>
		</tr>
	  
		<tr>
		  <td class="config_form_label">How 
		  many days until expired?</td>
		  <td class="config_form_field">
		  <input type="text" name="posts_display_days" size="10" value="<?php 
    echo jb_escape_html(JB_POSTS_DISPLAY_DAYS);
    ?>
" > days</td>
		</tr>

		<tr>
		<td class="config_form_heading" colspan="2">Job Post Summary - <span style="font-weight: normal;">'Job Title' column on the job list <br>Note: Please ensure to have a 'description summary' column in your Job List. You can edit the columns in Admin->Posting Form, 'Job List' tab. It should be there by default.</span>
</td>
		</tr>

		<tr>
		  <td class="config_form_label">Show Description Preview in Posts List headings?</td>
		  <td class="config_form_field">
		  <table>
		  <tr><td>
		  <input type="radio" name="posts_show_description" value="YES"  <?php 
    if (JB_POSTS_SHOW_DESCRIPTION == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes
		  </td><td class="config_form_field">
		  [Cut off after <input type="text" name="posts_description_chars" size="3" value="<?php 
    echo jb_escape_html(JB_POSTS_DESCRIPTION_CHARS);
    ?>
" > characters]</td>
		  </tr><tr>
		  <td>
		  <input type="radio" name="posts_show_description" value="NO"  <?php 
    if (JB_POSTS_SHOW_DESCRIPTION == 'NO') {
        echo " checked ";
    }
    ?>
 >No
		  </td><td></td></tr></table>
		  </td>
		</tr>

		<tr>
		  <td class="config_form_label">Show 'Posted By' in Post List heading?</td>
		  <td class="config_form_field">
		  <input type="radio" name="posts_show_posted_by" value="YES"  <?php 
    if (JB_POSTS_SHOW_POSTED_BY == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (<input type="checkbox" value="YES" name="posts_show_posted_by_br" <?php 
    if (JB_POSTS_SHOW_POSTED_BY_BR == "YES") {
        echo " checked ";
    }
    ?>
 > Insert on a seperate line.)<br>
		  <input type="radio" name="posts_show_posted_by" value="NO"  <?php 
    if (JB_POSTS_SHOW_POSTED_BY == 'NO') {
        echo " checked ";
    }
    ?>
 >No</td>
		</tr>
		<tr>

		  <td class="config_form_label">Show Category in Posts List headings?</td>
		  <td class="config_form_field">
		  <input type="radio" name="posts_show_job_type" value="YES"  <?php 
    if (JB_POSTS_SHOW_JOB_TYPE == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (<input type="checkbox" value="YES" name="posts_show_job_type_br" <?php 
    if (JB_POSTS_SHOW_JOB_TYPE_BR == "YES") {
        echo " checked ";
    }
    ?>
 > Insert on a seperate line.)<br>
		  <input type="radio" name="posts_show_job_type" value="NO"  <?php 
    if (JB_POSTS_SHOW_JOB_TYPE == 'NO') {
        echo " checked ";
    }
    ?>
 >No</td>
		</tr>
		<tr>
		  <td class="config_form_label">Show the Day, and how many days elapsed (Group posts by day)?</td>
		  <td class="config_form_field">
		  <input type="radio" name="posts_show_days_elapsed" value="YES"  <?php 
    if (JB_POSTS_SHOW_DAYS_ELAPSED == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes<br>
		  <input type="radio" name="posts_show_days_elapsed" value="NO"  <?php 
    if (JB_POSTS_SHOW_DAYS_ELAPSED == 'NO') {
        echo " checked ";
    }
    ?>
 >No</td>
		</tr>
		
		
		<tr>
		<td class="config_form_heading" colspan="2"><b>Premium Posts</b></td>
		</tr>
	<?php 
    if (!defined('JB_P_POSTS_DISPLAY_DAYS')) {
        define('JB_P_POSTS_DISPLAY_DAYS', JB_POSTS_DISPLAY_DAYS);
    }
    ?>
		 <tr>
		  <td class="config_form_label">How 
		  many days until expired?</td>
		  <td class="config_form_field">
		  Expire premium posts after <input type="text" name="p_posts_display_days" size="5" value="<?php 
    echo jb_escape_html(JB_P_POSTS_DISPLAY_DAYS);
    ?>
" > days</td>
		</tr>

		  <tr>
		  <td class="config_form_label">Premium Posts per page</td>
		  <td class="config_form_field">
		 
		 
		  <input type="radio" name="premium_posts_limit" value="YES"  <?php 
    if (JB_PREMIUM_POSTS_LIMIT == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes, show <input type="text" name="premium_posts_per_page" size="5" value="<?php 
    echo JB_PREMIUM_POSTS_PER_PAGE;
    ?>
" > Premium posts per page
		  <br>
		  <input type="radio" name="premium_posts_limit" value="NO"  <?php 
    if (JB_PREMIUM_POSTS_LIMIT == 'NO') {
        echo " checked ";
    }
    ?>
 >Unlimited

		  </td>
		</tr>
		 <tr>
		  <td class="config_form_label">Group Premium posts by day of week?</td>
		  <td class="config_form_field">
		 
		 
		  <input type="radio" name="p_posts_show_days_elapsed" value="YES"  <?php 
    if (JB_P_POSTS_SHOW_DAYS_ELAPSED == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes
		  <br>
		  <input type="radio" name="p_posts_show_days_elapsed" value="NO"  <?php 
    if (JB_P_POSTS_SHOW_DAYS_ELAPSED == 'NO') {
        echo " checked ";
    }
    ?>
 >No

		  </td>
		</tr>
		 <tr>
		  <td class="config_form_label">Display number of views column for premium posts only</td>
		  <td class="config_form_field">
		 
		 
		  <input type="radio" name="show_premium_hits" value="YES"  <?php 
    if (JB_SHOW_PREMIUM_HITS == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes - ...adds a 'views' column on top any list settings (Posting Form / Edit List)
		  <br>
		  <input type="radio" name="show_premium_hits" value="NO"  <?php 
    if (JB_SHOW_PREMIUM_HITS == 'NO') {
        echo " checked ";
    }
    ?>
 >No

		  </td>
		</tr>

		<tr>
		<td class="config_form_heading" colspan="2"><b>Post Manager (Employer Section)</b></td>
		</tr>
		  <tr>
		  <td class="config_form_label">Show Posts per page</td>
		  <td class="config_form_field">
		 <?php 
    if (!defined('JB_MANAGER_POSTS_PER_PAGE')) {
        define('JB_MANAGER_POSTS_PER_PAGE', 20);
    }
    ?>
		  
		 <input type="text" name="manager_posts_per_page" size="5" value="<?php 
    echo htmlentities(JB_MANAGER_POSTS_PER_PAGE);
    ?>
" > Posts per page
		  

		  </td>
		</tr>


		<tr>
		<td class="config_form_heading" colspan="2"><b>Posting From (Employer Section)</b></td>
		</tr>
		  <tr>
		  <td class="config_form_label">Form Height</td>
		  <td class="config_form_field">
		 <?php 
    if (!defined('JB_POSTING_FORM_HEIGHT')) {
        define('JB_POSTING_FORM_HEIGHT', 1600);
    }
    ?>
		  
		 <input type="text" name="posting_form_height" size="5" value="<?php 
    echo htmlentities(JB_POSTING_FORM_HEIGHT);
    ?>
" > Height of the posting form (in pixels)
		  

		  </td>
		</tr>

		
		
	  </table>
	  <p>&nbsp;</p>
	  <a name="resumes"></a>
	   <table class="config_form" cellpadding="5" cellspacing="2" >
		<tr>
		  <td colspan="2" class="config_form_heading">
		  Resumes</td>
		</tr>
		<tr>
		  <td width="20%" class="config_form_label">Resumes 
		  need approval?</td>
		  <td class="config_form_field">
		  <input type="radio" name="resumes_need_approval" value="YES"  <?php 
    if (JB_RESUMES_NEED_APPROVAL == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes<br>
		  <input type="radio" name="resumes_need_approval" value="NO"  <?php 
    if (JB_RESUMES_NEED_APPROVAL == 'NO') {
        echo " checked ";
    }
    ?>
 >No<br>
		  
		  </td>
		  </tr>
		  <tr>
		  <td class="config_form_label">Resumes Per page</td>
		  <td class="config_form_field">
		 <?php 
    if (!defined('JB_RESUMES_PER_PAGE')) {
        define('JB_RESUMES_PER_PAGE', 30);
    }
    ?>
		  
		 Show <input type="text" name="resumes_per_page" size="5" value="<?php 
    echo jb_escape_html(JB_RESUMES_PER_PAGE);
    ?>
" > resumes per page
		  

		  </td>
		</tr>
		 </table>

	  <p>&nbsp;</p>
	  <a name="themes"></a>
	  <table class="config_form" cellpadding="5" cellspacing="2" >
		<tr >
		  <td colspan="2" class="config_form_heading">
		  Theme Settings</td>
		</tr>
		 <tr>
		  <td width="20%" class="config_form_label">Select theme</td>
		  <td class="config_form_field">
		  <select name='jb_theme'>
			<option value=''>[Select]</option>
			<?php 
    JB_theme_option_list(JB_THEME);
    ?>
		  </select> (The theme selected here will be for <b><?php 
    echo $AVAILABLE_LANGS[$_SESSION['LANG']];
    ?>
</b>. NEW! Now you can select a separate theme for each language! Go To <a href="language.php">Admin->Language</a>.
		  </td>
		</tr>
		<?php 
    if (!defined(JB_LIST_HOVER_COLOR)) {
        define('JB_LIST_HOVER_COLOR', '#FEFEED');
    }
    if (!defined(JB_LIST_BG_COLOR)) {
        define('JB_LIST_BG_COLOR', '#FFFFFF');
    }
    ?>
		 <tr>
		  <td width="20%" class="config_form_label">Mouseover effect: Background color</td>
		  <td class="config_form_field">
		  Background color:
		  <input type="text" name="jb_list_bg_color" size="7" value="<?php 
    echo jb_escape_html(JB_LIST_BG_COLOR);
    ?>
">(eg. #FFFFFF)<br>
		  
		  mouse-over color:
		  <input type="text" name="jb_list_hover_color" size="7" value="<?php 
    echo jb_escape_html(JB_LIST_HOVER_COLOR);
    ?>
">(eg. #FEFEED)<br></td>
		</tr>
		
	</table>
	 <p>&nbsp;</p>
	 <a name="plugins"></a>
	  <table class="config_form" cellpadding="5" cellspacing="2" >
		<tr >
		  <td colspan="2" class="config_form_heading">
		  Plugin Settings</td>
		</tr>
		<tr>
		  <td width="20%" class="config_form_label">Enable Plugins?</td>
		  <td class="config_form_field">
		  <input type="radio" name="jb_plugin_switch" value="YES" <?php 
    if (JB_PLUGIN_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes<br>
		  <input type="radio" name="jb_plugin_switch" value="NO" <?php 
    if (JB_PLUGIN_SWITCH == 'NO') {
        echo " checked ";
    }
    ?>
 >No<br>
		  
		  </td>
		  </tr>
	</table>
	<input type="hidden" name='jb_enabled_plugins' value="<?php 
    echo htmlentities(JB_ENABLED_PLUGINS);
    ?>
">
	<input type="hidden" name='jb_plugin_config' value="<?php 
    echo htmlentities(JB_PLUGIN_CONFIG);
    ?>
">
	  <p>Important - <span class="is_required_mark">*</span> indicates a mandatory field if you are using SMTP. See here for common  SMTP problems: <a href="http://www.jamit.com.au/support/index.php?_m=knowledgebase&_a=view&parentcategoryid=6&pcid=1&nav=0,1" target="_blank">[Knowledge Base]</a></p>
	  <a name="email"></a>
	  <table class="config_form" cellpadding="5" cellspacing="2" >
		<tr>
		  <td  colspan="2" width="360" class="config_form_heading">
		  Email Settings</td>
		</tr>
		<tr>
		  <td class="config_form_label">Use SMTP for sending email</td>
		  <td class="config_form_field">
		 <input type="radio" name="use_mail_function" value="NO"  <?php 
    if (JB_USE_MAIL_FUNCTION == 'NO') {
        echo " checked ";
    }
    ?>
 >Yes - use SMTP<br>
		  <input type="radio" name="use_mail_function" value="YES"  <?php 
    if (JB_USE_MAIL_FUNCTION == 'YES') {
        echo " checked ";
    }
    ?>
 >No - Email will be sent through the PHP mail() function. You do not need to fill in your SMTP settings.
		 </td>
		</tr>
		 <tr>
		  <td width="20%" class="config_form_label">Hostname (of your HTTP server)</td>
		  <td class="config_form_field">
		  <input type="text" name="email_hostname" size="33" value="<?php 
    echo jb_escape_html(JB_EMAIL_HOSTNAME);
    ?>
"><span class="is_required_mark">*</span><br>(Most likely this is: <b><?php 
    echo $host;
    ?>
</b>)</td>
		</tr>
		 <tr>
		  <td class="config_form_label">SMTP Server address</td>
		  <td class="config_form_field">
		  <input type="text" name="email_smtp_server" size="33" value="<?php 
    echo jb_escape_html(JB_EMAIL_SMTP_SERVER);
    ?>
"><span class="is_required_mark">*</span><br>Eg. mail.example.com</td>
		</tr>
		<tr>
		  <td class="config_form_label">POP3 Server address</td>
		  <td class="config_form_field">
		  <input type="text" name="email_pop_server" size="33" value="<?php 
    echo jb_escape_html(JB_EMAIL_POP_SERVER);
    ?>
"><span class="is_required_mark">*</span><br>Eg. mail.example.com - usually the same as SMTP server</td>
		</tr>
		 <tr>
		  <td class="config_form_label">SMTP/POP3 Username</td>
		  <td class="config_form_field">
		  <input type="text" name="email_smtp_user" size="33" value="<?php 
    echo jb_escape_html(JB_EMAIL_SMTP_USER);
    ?>
"><span class="is_required_mark">*</span></td>
		</tr>
		 <tr>
		  <td class="config_form_label">SMTP/POP3 Password</td>
		  <td class="config_form_field">
		  <input type="password" name="email_smtp_pass"  size="33" value="<?php 
    echo jb_escape_html(JB_EMAIL_SMTP_PASS);
    ?>
"><span class="is_required_mark">*</span></td>
		</tr>
		<tr>
		  <td class="config_form_label">SMTP Authentication Hostname</td>
		  <td class="config_form_field">
		  <input type="text" name="email_smtp_auth_host" size="33" value="<?php 
    echo jb_escape_html(JB_EMAIL_SMTP_AUTH_HOST);
    ?>
"><span class="is_required_mark">*</span>(This is usually the same as your SMTP Server address)</td>
		</tr>
		<tr>
		  <td class="config_form_label">SMTP Port</td>
		  <td class="config_form_field">
		  <input type="text" name="email_smtp_port" size="33" value="<?php 
    if (!defined('JB_EMAIL_SMTP_PORT')) {
        define('JB_EMAIL_SMTP_PORT', 25);
    }
    echo jb_escape_html(JB_EMAIL_SMTP_PORT);
    ?>
"><span class="is_required_mark">*</span>(Usually it's 25)</td>
		</tr>
		<tr>
		  <td class="config_form_label">POP3 Port</td>
		  <td class="config_form_field">
		  <input type="text" name="pop3_port" size="33" value="<?php 
    echo jb_escape_html(JB_POP3_PORT);
    ?>
">(Leave blank to default to 110)</td>
		</tr>
		<tr>
		  <td class="config_form_label">My SMTP server uses the POP-before-SMTP mechanism</td>
		  <td class="config_form_field">
		 <input type="radio" name="email_pop_before_smtp" value="YES"  <?php 
    if (JB_EMAIL_POP_BEFORE_SMTP == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes<br>
		  <input type="radio" name="email_pop_before_smtp" value="NO"  <?php 
    if (JB_EMAIL_POP_BEFORE_SMTP == 'NO') {
        echo " checked ";
    }
    ?>
 >No - Default setting, correct 99% of cases
		 </td>
		</tr>

		<tr>
		  <td class="config_form_label">Use SSL?</td>
		  <td class="config_form_field">
		 <input type="radio" name="jb_email_smtp_ssl" value="YES"  <?php 
    if (JB_EMAIL_SMTP_SSL == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes - SSL may be needed for some servers, for example GMail. Requires OpenSSL extension enabled in PHP<br>
		  <input type="radio" name="jb_email_smtp_ssl" value="NO"  <?php 
    if (JB_EMAIL_SMTP_SSL != 'YES') {
        echo " checked ";
    }
    ?>
 >No - Default setting, correct 99% of cases
		 </td>
		</tr>

		
		<tr>
		
		<?php 
    $new_window = "onclick=\"test_email_window(); return false;\"";
    ?>
			<td class="config_form_field" colspan="2"><input type="button" style="font-size: 11px;" <?php 
    echo $new_window;
    ?>
 value="Test POP Connection..."></td>
		</tr>
		<tr>
		  <td class="config_form_label">Include a Signiture in Emails?</td>
		  <td class="config_form_field">
		  
		  
		  <input type="radio" name="email_sig_switch" value="YES"  <?php 
    if (JB_EMAIL_SIG_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes (This will include a link to this site, at the bottom of the email)<br>
		  <input type="radio" name="email_sig_switch" value="NO"  <?php 
    if (JB_EMAIL_SIG_SWITCH == 'NO') {
        echo " checked ";
    }
    ?>
 >No
		  </td>
		</tr>

		
		<tr>
		  <td class="config_form_label">Send these emails to Admin</td>
		  <td class="config_form_field">
		  
		  
		  <table>

			<tr>
				<td class="config_form_field">
				<input type="checkbox" name="email_admin_receipt_switch" value="YES" <?php 
    if (JB_EMAIL_ADMIN_RECEIPT_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
> Application Receipts
				</td>
				<td class="config_form_field">
				<input type="checkbox" name="email_employer_signup_switch" value="YES" <?php 
    if (JB_EMAIL_EMPLOYER_SIGNUP_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
> New Employer Sign Up
				</td>
				<td class="config_form_field">
				<input type="checkbox" name="jb_email_candidate_signup_switch" value="YES" <?php 
    if (JB_EMAIL_CANDIDATE_SIGNUP_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
> New Candidate Sign Up
				</td>
				<td>
				</td>
			</tr>

			<tr>
				<td class="config_form_field">
				<input type="checkbox" name="email_new_post_switch" value="YES" <?php 
    if (JB_EMAIL_NEW_POST_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
> New Job is Posted
				</td>
				<td class="config_form_field">
				<input type="checkbox" name="jb_email_admin_resupdate_switch" value="YES" <?php 
    if (JB_EMAIL_ADMIN_RESUPDATE_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
> A resume is posted / updated
				</td>
				<td class="config_form_field">
				<input type="checkbox" name="jb_email_admin_neword_switch" value="YES" <?php 
    if (JB_EMAIL_ADMIN_NEWORD_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
>  A new order is placed
				</td>
				<td>
				</td>
			</tr>

		  </table>
		  
		  
		  </td>
		</tr>



		<tr>
		  <td class="config_form_label">Send these emails to customers (Employers/Candidates)</td>
		  <td class="config_form_field">
		  
		  
		  <table>

			<tr>
				<td class="config_form_field">
				<input type="checkbox" name="email_order_completed_switch" value="YES" <?php 
    if (JB_EMAIL_ORDER_COMPLETED_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
> Order is Completed
				</td>
				<td class="config_form_field">
				<input type="checkbox" name="email_member_exp_switch" value="YES" <?php 
    if (JB_EMAIL_MEMBER_EXP_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
> Membership had expired
				</td>
				<td>
				
				</td>
				<td>
				</td>
			</tr>

			

		  </table>

		  <tr>
		  <td class="config_form_label">Send these emails to Employers</td>
		  <td class="config_form_field">
		  
		  
		  <table>

			<tr>
				<td class="config_form_field">
				<input type="checkbox" name="email_subscr_exp_switch" value="YES" <?php 
    if (JB_EMAIL_SUBSCR_EXP_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
> Subscription to view resumes had expired
				</td>
				<td class="config_form_field">
				<input type="checkbox" name="jb_email_post_exp_switch" value="YES" <?php 
    if (JB_EMAIL_POST_EXP_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
> Job post had expired
				</td>
				<td class="config_form_field">
				<input type="checkbox" name="jb_email_post_appr_switch" value="YES" <?php 
    if (JB_EMAIL_POST_APPR_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
> Job post was approved
				</td>
				<td>
				</td>
			</tr>


			<tr>
				<td class="config_form_field">
				<input type="checkbox" name="jb_email_post_appr_switch" value="YES" <?php 
    if (JB_EMAIL_POST_APPR_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
> Job post had been approved?
				</td>
				<td class="config_form_field">
				<input type="checkbox" name="jb_email_post_disapp_switch" value="YES" <?php 
    if (JB_EMAIL_POST_DISAPP_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
> job post had been disapproved?
				</td>
				<td class="config_form_field">
				<input type="checkbox" name="jb_email_emp_signup" value="YES" <?php 
    if (JB_EMAIL_EMP_SIGNUP == 'YES') {
        echo " checked ";
    }
    ?>
> Signup Confirmation
				</td>
				<td>
				</td>
			</tr>

		  </table>
		  
		  </td>
		</tr>


		 <tr>
		  <td class="config_form_label">Send these emails to Candidates</td>
		  <td class="config_form_field">
		  
		  
		  <table>

			<tr>
				<td>
				<input type="checkbox" name="email_candidate_receipt_switch" value="YES" <?php 
    if (JB_EMAIL_CANDIDATE_RECEIPT_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
> Application Receipts
				</td>
				<td>
				<input type="checkbox" name="jb_email_can_signup" value="YES" <?php 
    if (JB_EMAIL_CAN_SIGNUP == 'YES') {
        echo " checked ";
    }
    ?>
> Signup Confirmation
				</td>
				<td>
				&nbsp;
				</td>
				<td>
				</td>
			</tr>


		

			

		  </table>
		  
		  
		  </td>
		</tr>


		<tr>
		  <td class="config_form_label">Shorten URLs</td>
		  <td class="config_form_field">
		  <input type="radio" name="email_url_shorten" value="YES"  <?php 
    if (EMAIL_URL_SHORTEN == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes - This will shoren all URLs in all outgoing emails. Eg, http://www.test.com/employers/alerts.php?key=ad4adfah5c537 will be reduced to something like http://www.test.com/su.php?ref=9a510f3a - This prevents the URLs from being split into multiple lines, as some email systems are limited to only 80 characters. A trade-off is that a little more CPU + RAM is required when sending out emails<br>
		  &nbsp;&nbsp;&nbsp;Expire short URLs after x days. 
		  <input type="radio" name="email_url_shorten" value="NO"  <?php 
    if (EMAIL_URL_SHORTEN == 'NO') {
        echo " checked ";
    }
    ?>
 >No<br>
		  </td>
		</tr>
		 <tr>
		  <td  class="config_form_label">Email Debug Mode</td>
		  <td  class="config_form_field">
		  <input type="radio" name="email_debug_switch" value="YES"  <?php 
    if (JB_EMAIL_DEBUG_SWITCH == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes - This will show detailed messages when sending email so you can trouble shoot email problems. Set to No when live.<br>
		  <input type="radio" name="email_debug_switch" value="NO"  <?php 
    if (JB_EMAIL_DEBUG_SWITCH == 'NO') {
        echo " checked ";
    }
    ?>
 >No<br>
		  </td>
		</tr>
		 </tr>
		 <tr>
		  <td class="config_form_label">Replace @ sign when displaying email addresses? (This helps prevent spammers from harvesting email addresses)</td>
		  <td  class="config_form_field">
		  <input type="radio" name="email_at_replace" value="YES"  <?php 
    if (JB_EMAIL_AT_REPLACE == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes - replace @ with <IMG SRC="<?php 
    echo JB_THEME_URL;
    ?>
images/at.gif" WIDTH="13" HEIGHT="9" BORDER="0" ALT=""> (an image) <br>
		  <input type="radio" name="email_at_replace" value="YES_2"  <?php 
    if (JB_EMAIL_AT_REPLACE == 'YES_2') {
        echo " checked ";
    }
    ?>
 >Yes - replace @ with <b>&amp;#<?php 
    echo ord('@');
    ?>
</b>; (HTML encoded @ sign. Works well for copy & paste, but could not be as safe as the above option) <br>
		  <input type="radio" name="email_at_replace" value="NO"  <?php 
    if (JB_EMAIL_AT_REPLACE == 'NO') {
        echo " checked ";
    }
    ?>
 >No<br>
		  </td>
		</tr>
		 <tr>
		  <td class="config_form_label">Outgoing email queue</td>
		  <td class="config_form_field">
		  All emails are placed on a queue before they are sent. This is useful for a number of reasons: 1. It does not bog down your server if you are sending a lot of email because email sending is throttled. 2. If your server has a limit for how many emails it can send per hour, you can tweak the settings below so that the job board stays inside this limit. 3. You can review each email that was sent, emails can be kept for your records for the specified amount of days. (Note: If you want to avoid throttling and send all at once, you can set the 'send x emails per batch' setting to a very high number - this is not recommended for most users. Also, sometimes a temporary error can occur because the server had reached the a limit or for another reason. In that case, the job board will try to resend the email x amount of times before giving up.)<br>
		  Send <input type="text" name="emails_per_batch" size="3" value="<?php 
    echo jb_escape_html(JB_EMAILS_PER_BATCH);
    ?>
">emails per batch (enter a number > 0. Please keep this setting conservative - sending too many emails per batch can slow down the server and cause stability problems. If your cron is set to run every 5 minutes, 40 emails per batch would be 480 emails per hour.)<br>
		  On error, retry <input type="text" name="emails_max_retry" size="3" value="<?php 
    echo jb_escape_html(JB_EMAILS_MAX_RETRY);
    ?>
"> times before giving up. (recommened: 5)<br>
		  On error, wait at least <input type="text" name="emails_error_wait" size="3" value="<?php 
    echo jb_escape_html(JB_EMAILS_ERROR_WAIT);
    ?>
">minutes before retry. (10 minutes recommended)<br>
		  Keep sent emails for <input type="text" name="emails_days_keep" size="3" value="<?php 
    if (JB_EMAILS_DAYS_KEEP == 'JB_EMAILS_DAYS_KEEP') {
        define(JB_EMAILS_DAYS_KEEP, '0');
    }
    echo jb_escape_html(JB_EMAILS_DAYS_KEEP);
    ?>
">days. (0 = keep forever)<br> 
		  </td>
		</tr>
		</table>
		<p>&nbsp;</p>
		<a name="errors"></a>
		<table class="config_form" cellpadding="5" cellspacing="2">
		<tr>
		  <td colspan="2" class="config_form_heading">
		  Errors and Warnings</td>
		</tr>
		<tr>
		  <td class="config_form_label" width="20%"> 
		   Use a custom error handler?</td>
		  <td class="config_form_field">
		   <input type="radio" name="jb_set_custom_error" size="49" value="YES" <?php 
    if (JB_SET_CUSTOM_ERROR == 'YES') {
        echo " checked ";
    }
    ?>
 >Yes - Error messages will never be displayed to the screen, and will be logged in to a custom file instead (see 'System Info' form the menu to view the contents of this file)
		   <br><input type="radio" name="jb_set_custom_error" value="NO" <?php 
    if (JB_SET_CUSTOM_ERROR != 'YES') {
        echo " checked ";
    }
    ?>
 >No (Use the default setting for your server)</td>
		</tr>
		</table>
		
	  <p>
	  <input type="submit" value="Save Configuration" name="save"></p>
	</form>

<?php 
}
function JBXML_generate_xml_feed($feed_id)
{
    if (!is_numeric($feed_id)) {
        return;
    }
    $offset = 0;
    if (isset($_REQUEST['offset'])) {
        $offset = (int) $_REQUEST['offset'];
    }
    $sql = "SELECT * from xml_export_feeds WHERE feed_id='" . jb_escape_sql($feed_id) . "' ";
    $result = JB_mysql_query($sql);
    $feed_row = mysql_fetch_array($result, MYSQL_ASSOC);
    if ($feed_row['publish_mode'] == 'PRI') {
        // private mode
        if ($feed_row['feed_key'] != $_REQUEST['k']) {
            die('Invalid Key. Please contact ' . JB_SITE_CONTACT_EMAIL);
        }
    }
    $hosts = array();
    $hosts = explode(',', $feed_row['hosts_allow']);
    $allowed = false;
    if (sizeof($hosts) > 0) {
        foreach ($hosts as $host) {
            if (strtoupper($host) == 'ALL') {
                // all hosts
                $allowed = true;
            }
            if (strtolower($host) == 'localhost' && $_SERVER['REMOTE_ADDR'] == '127.0.0.1') {
                $allowed = true;
            }
            if ($host == $_SERVER['REMOTE_ADDR']) {
                $allowed = true;
            }
        }
        if (!$allowed) {
            die('Access is restricted form your IP. Please contact ' . JB_SITE_CONTACT_EMAIL);
        }
    }
    $feed_row['field_settings'] = unserialize($feed_row['field_settings']);
    $feed_row['search_settings'] = unserialize($feed_row['search_settings']);
    // build the search query up...
    if (is_array($feed_row['search_settings'])) {
        foreach ($feed_row['search_settings'] as $key => $val) {
            $_SEARCH_INPUT[$key] = $val;
        }
        $_SEARCH_INPUT['action'] = 'search';
        global $post_tag_to_search;
        global $tag_to_search;
        $where_sql = JB_generate_search_sql($feed_row['form_id'], $_SEARCH_INPUT);
    }
    if ($feed_row['max_records'] > 0) {
        $limit = "LIMIT {$offset}, " . jb_escape_sql($feed_row['max_records']);
    }
    switch ($feed_row['form_id']) {
        case 1:
            if ($feed_row['include_imported'] == 'Y') {
                if ($where_sql) {
                    $where_sql = ' AND ' . $where_sql;
                }
                $sql = "SELECT * FROM posts_table WHERE `expired`='N' AND `approved`='Y' {$where_sql} ORDER BY `post_date` DESC {$limit} ";
            } else {
                $sql = "SELECT * FROM posts_table WHERE `expired`='N' AND `approved`='Y' AND `guid`='' {$where_sql} ORDER BY `post_date` DESC {$limit} ";
            }
            break;
        case 2:
            break;
        case 3:
            break;
        case 4:
            break;
        case 5:
            break;
    }
    $records = JB_mysql_query($sql);
    // Gzip compress the output, if supported by PHP & the browser
    //if (function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) {
    //ob_start("ob_gzhandler");
    //} else {
    //ob_start();
    //}
    header('Content-type: application/xml; charset=UTF-8');
    if ($_REQUEST['d'] != '') {
        // download?
        header('Content-Disposition: attachment; filename="feed-' . htmlentities($feed_id) . '.xml"');
    }
    // check to see if we have this feed in the cache
    if (function_exists('JB_get_cache_dir')) {
        $cache_dir = JB_get_cache_dir();
    } else {
        $cache_dir = JB_basedirpath() . 'cache/';
    }
    if (is_dir($cache_dir)) {
        if ($dh = opendir($cache_dir)) {
            while (($file = readdir($dh)) !== false) {
                if (filetype($cache_dir . $file) == 'file' && strpos($file, '.xml') !== false) {
                    $stats = stat($cache_dir . $file);
                    if ($stats['mtime'] + 3600 < time()) {
                        // has 1 hour elapsed? (3600 sec)
                        unlink($cache_dir . $file);
                    }
                }
            }
            closedir($dh);
        }
    }
    $do_update = false;
    $filename = $cache_dir . 'feed_' . md5($feed_row['feed_id'] . $feed_row['feed_key'] . $offset) . ".xml";
    if (!file_exists($filename)) {
        $do_update = true;
    }
    $do_update = true;
    if ($do_update) {
        // Generate the XML feed & cache the result.
        echo '<?xml version="1.0" encoding="UTF-8" ?>';
        $fh = fopen($filename, "wb");
        if (flock($fh, LOCK_EX)) {
            // do an exclusive lock
            ftruncate($fh, 0);
            // truncate file
            JBXM_xml_feed_gen_engine($feed_row, '', $records, $data, false, $fh);
            flock($fh, LOCK_UN);
            // release the lock
        } else {
            echo "<error>Couldn't get the lock!</error>";
        }
        fclose($fh);
    } else {
        // Return the cached xml feed
        $fh = fopen($filename, 'rb');
        $contents = fread($fh, filesize($filename));
        fclose($fh);
        echo $contents;
    }
    ob_end_flush();
}
Example #10
0
<?php

###########################################################################
# Copyright Jamit Software 2012, http://www.jamit.com
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
###########################################################################
require "../config.php";
require dirname(__FILE__) . "/admin_common.php";
$PAYMENT_PATH = JB_basedirpath() . '/payment/';
include $PAYMENT_PATH . 'payment_manager.php';
JB_admin_header('Admin -> Payment Modules');
if (!JB_list_avalable_payments()) {
    echo '<font color="maroon"><b>Reminder: Please ensure that at least one payment method is enabled so that the traffic light icon goes green! :)</b></font>';
}
JB_admin_footer();
Example #11
0
<?php

###########################################################################
# Copyright Jamit Software 2012, http://www.jamit.com
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
###########################################################################
require "../config.php";
require dirname(__FILE__) . "/admin_common.php";
require_once JB_basedirpath() . "include/resumes.inc.php";
JB_admin_header('Admin -> Language');
$ListMarkup =& JB_get_ListMarkupObject('JBCanListMarkup');
$CandidateForm =& JB_get_DynamicFormObject(5);
?>
<b>[CANDIDATES]</b> <span style="background-color: <?php 
if ($_REQUEST['show'] != '') {
    echo '#F2F2F2';
} else {
    echo "#FFFFCC";
}
?>
; border-style:outset; padding:5px; "><a href="candidates.php">List Candidates</a></span>
<span style="background-color: <?php 
if ($_REQUEST['show'] == 'NA') {
    echo '#FFFFCC';
} else {
    echo "#F2F2F2";
}
?>
; border-style:outset; padding: 5px;"><a href="candidates.php?show=NA">Non-Validated Candidates</a></span>
Example #12
0
function JB_GoogleCheckoutAPIcall($function_name, &$args)
{
    global $_PAYMENT_OBJECTS;
    global $label;
    if (strtolower(GOOGLE_CHECKOUT_CART_MODE) == "sandbox") {
        $server_url = "https://sandbox.google.com/checkout/";
    } else {
        $server_url = "https://checkout.google.com/";
    }
    //$this->schema_url = "http://checkout.google.com/schema/2";
    $base_url = $server_url . "api/checkout/v2/";
    $request_url = $base_url . "request/Merchant/" . GOOGLE_CHECKOUT_MERCHANT_ID;
    $report_url = $base_url . "reports/Merchant/" . GOOGLE_CHECKOUT_MERCHANT_ID;
    $merchant_checkout = $base_url . "merchantCheckout/Merchant/" . GOOGLE_CHECKOUT_MERCHANT_ID;
    switch ($function_name) {
        case 'hello':
            // this is a way to ping the Google server.
            $url = $request_url;
            $req .= '<hello xmlns="http://checkout.google.com/schema/2"/>';
            // The response should look like:
            // <bye xmlns="http://checkout.google.com/schema/2" serial-number="c567262a-dd13-4084-b8d3-6ccfbbc69d03" />
            break;
        case 'checkout-shopping-cart':
            // Post a new order to google. This will result with a link to the payment URL
            // Args: item_name, item_desc, currency, unit_price, item_id, invoice_id
            //  OPTIMISTIC
            if ($args['user_type'] == 'E') {
                $continue_shopping_url = JB_BASE_HTTP_PATH . JB_EMPLOYER_FOLDER . 'thanks.php?m=' . $_PAYMENT_OBJECTS['GoogleCheckout']->className . '&order_id=' . $args['product_type'] . $args['merchant-item-id'];
                $edit_cart_url = JB_BASE_HTTP_PATH . JB_EMPLOYER_FOLDER;
                // employers have 4 product types
                switch ($args['product_type']) {
                    case 'P':
                        $edit_cart_url .= 'credits.php';
                        break;
                    case 'M':
                        $edit_cart_url .= 'membership.php';
                        break;
                    case 'S':
                        $edit_cart_url .= 'subscriptions.php';
                        break;
                    default:
                        $edit_cart_url .= 'credits.php';
                        break;
                }
            } else {
                // Candidates only have 'memberships product' type
                $continue_shopping_url = JB_BASE_HTTP_PATH . JB_CANDIDATE_FOLDER . 'thanks.php?m=' . $_PAYMENT_OBJECTS['GoogleCheckout']->className . '&order_id=' . $args['product_type'] . $args['merchant-item-id'];
                $edit_cart_url = JB_BASE_HTTP_PATH . JB_CANDIDATE_FOLDER;
                $edit_cart_url .= 'membership.php';
            }
            $args['digital-content-description'] = str_replace('%RETURN_URL%', $continue_shopping_url, $args['digital-content-description']);
            $url = $merchant_checkout;
            //.'/diagnose';
            $req .= '<?xml version="1.0" encoding="UTF-8"?>
			
			<checkout-shopping-cart xmlns="http://checkout.google.com/schema/2">  
			<shopping-cart>
				<items>
					<item>
						<item-name>' . htmlspecialchars($args['item-name']) . '</item-name>
						<item-description>' . htmlspecialchars($args['item-description']) . '</item-description>
						<unit-price currency="' . htmlspecialchars(GOOGLE_CHECKOUT_CURRENCY) . '">' . htmlspecialchars($args['unit-price']) . '</unit-price>

						<merchant-item-id>' . htmlspecialchars($args['merchant-item-id']) . '</merchant-item-id>
						<merchant-private-item-data>
							<user_type>' . $args['user_type'] . '</user_type>
							<user_id>' . $args['user_id'] . '</user_id>
							<product_type>' . $args['product_type'] . '</product_type>
						</merchant-private-item-data> 
						<digital-content>
							<display-disposition>PESSIMISTIC</display-disposition>
							<description>' . htmlspecialchars($args['digital-content-description']) . '</description>
							<email-delivery>false</email-delivery>
						</digital-content>
						
						<quantity>1</quantity>
						
					</item>
				</items>
			</shopping-cart>
			<checkout-flow-support>
				<merchant-checkout-flow-support>
					<continue-shopping-url>' . htmlspecialchars($continue_shopping_url) . '</continue-shopping-url>
					<edit-cart-url>' . htmlspecialchars($edit_cart_url) . '</edit-cart-url>
				</merchant-checkout-flow-support>
			</checkout-flow-support>
			</checkout-shopping-cart>';
            /*
            
            			A typical response is:
            
            			<checkout-redirect xmlns="http://checkout.google.com/schema/2" serial-number="6e6ed5d3-fdb9-4f49-8d9f-9e8b190ece55">
            				<redirect-url>https://sandbox.google.com/checkout/view/buy?o=shoppingcart&amp;shoppingcart=110689039015614</redirect-url>
            			</checkout-redirect>
            
            			Send the user to redirect-url
            */
            break;
        case 'notification-history-request':
            $url = $report_url;
            /*
            Notification types:
            authorization-amount
            			charge-amount
            			chargeback-amount
            			new-order
            			order-state-change
            			refund-amount
            			risk-information
            */
            $req = '<?xml version="1.0" encoding="UTF-8"?>
					<notification-history-request xmlns="http://checkout.google.com/schema/2">
					<serial-number>' . $args['serial-number'] . '</serial-number>
					</notification-history-request>';
            if (isset($args['google-order-number'])) {
                $req = '<?xml version="1.0" encoding="UTF-8"?>
					<notification-history-request xmlns="http://checkout.google.com/schema/2">
						<order-numbers>
							<google-order-number>' . $args['google-order-number'] . '</google-order-number>
						</order-numbers>
						<notification-types>
							<notification-type>' . $args['notification-type'] . '</notification-type>
						</notification-types>
					</notification-history-request>';
            }
            break;
        case 'charge-and-ship-order':
            $url = $request_url;
            $req = '<?xml version="1.0" encoding="UTF-8"?>
					<charge-and-ship-order xmlns="http://checkout.google.com/schema/2" google-order-number="' . $args['google-order-number'] . '">
					</charge-and-ship-order>';
    }
    $headers = array();
    $headers[] = "Authorization: Basic " . base64_encode(GOOGLE_CHECKOUT_MERCHANT_ID . ':' . GOOGLE_CHECKOUT_MERCHANT_KEY);
    $headers[] = "Content-Type: application/xml; charset=UTF-8";
    $headers[] = "Accept: application/xml; charset=UTF-8";
    $headers[] = "User-Agent: Jamit Job Board";
    $session = curl_init($url);
    curl_setopt($session, CURLOPT_POST, true);
    curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($session, CURLOPT_POSTFIELDS, $req);
    curl_setopt($session, CURLOPT_HEADER, true);
    curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($session, CURLOPT_COOKIESESSION, TRUE);
    $hash = substr(md5(JB_ADMIN_PASSWORD . GOOGLE_CHECKOUT_MERCHANT_KEY), 0, 10);
    curl_setopt($session, CURLOPT_COOKIEFILE, JB_basedirpath() . 'cache/' . $hash . 'cookiefile.txt');
    curl_setopt($session, CURLOPT_COOKIEJAR, JB_basedirpath() . 'cache/' . $hash . 'jarfile.txt');
    //if(!empty($this->certPath) && file_exists($this->certPath)) {
    //	curl_setopt($session, CURLOPT_SSL_VERIFYPEER, true);
    //	curl_setopt($session, CURLOPT_CAINFO, $this->certPath);
    //}
    //else {
    //	curl_setopt($session, CURLOPT_SSL_VERIFYPEER, false);
    //}
    curl_setopt($session, CURLOPT_SSL_VERIFYPEER, false);
    //if(is_array($this->proxy) && count($this->proxy)) {
    //	curl_setopt($session, CURLOPT_PROXY,
    //				$this->proxy['host'] . ":" . $this->proxy['port']);
    //}
    if ($timeout != false) {
        curl_setopt($session, CURLOPT_TIMEOUT, $timeout);
    }
    // Do the POST and then close the session
    $response = curl_exec($session);
    curl_close($session);
    $pos = strpos($response, "\r\n\r\n");
    $response = substr($response, $pos);
    //jb_googc_log_entry("Request:".$req);
    //jb_googc_log_entry("Response:".$response);
    $xml = new SimpleXMLElement(trim($response));
    return $xml;
}
Example #13
0
$sub_menu2 = array(0 => array('label' => $label["employer_menu_view_profile"], 'link' => 'profile.php', 'image' => ''), 1 => array('label' => $label["employer_menu_edit_profile"], 'link' => 'edit.php', 'image' => ''));
$sub_menu3 = array(0 => array('label' => $label["employer_menu_browse_resumes"], 'link' => 'search.php', 'image' => ''), 4 => array('label' => $label["employer_menu_saved_resumes"], 'link' => 'saved.php', 'image' => ''), 1 => array('label' => $label["employer_menu_resume_alerts"], 'link' => 'alerts.php', 'image' => '', 'condition1' => 'JB_RESUME_ALERTS_ENABLED', 'cond' => 'OR'), 2 => array('label' => $label["employer_menu_subscr"], 'link' => 'subscriptions.php', 'image' => '', 'condition1' => 'JB_SUBSCRIPTION_FEE_ENABLED', 'cond' => 'OR'), 3 => array('label' => '', 'link' => 'request.php', 'image' => '', 'condition1' => '', 'cond' => 'OR'));
$sub_menu4 = array(0 => array('label' => $label["employer_menu_job_post_manager"], 'link' => 'manager.php', 'image' => JB_THEME_URL . 'images/manager.gif'), 1 => array('label' => $label["employer_menu_post_a_new_job"], 'link' => 'post.php', 'image' => JB_THEME_URL . 'images/postit.gif'), 2 => array('label' => $label["employer_menu_prm_post"], 'link' => 'post.php?type=premium', 'image' => JB_THEME_URL . 'images/premiumpostit.gif', 'condition1' => 'JB_PREMIUM_POSTING_FEE_ENABLED', 'cond' => 'OR'), 3 => array('label' => $label["employer_menu_credits"], 'link' => 'credits.php', 'image' => JB_THEME_URL . 'images/coins.gif', 'condition1' => 'JB_POSTING_FEE_ENABLED', 'condition2' => 'JB_PREMIUM_POSTING_FEE_ENABLED', 'cond' => 'OR'));
$sub_menu5 = array(0 => array('label' => $label["employer_menu_app_man"], 'link' => 'apps.php', 'image' => ''));
$sub_menu6 = array(0 => array('label' => $label["employer_menu_contents_and_index"], 'link' => 'help.php', 'image' => ''));
/// Menu Buttons
// Need to include the JB_THEME_URL.'images/vf1x20.gif pic to keep buttons aligned..
$jb_menu[0]['button'] = array('label' => $label["employer_menu_account"], 'link' => 'index.php', 'image' => JB_THEME_URL . 'images/vf1x20.gif');
$jb_menu[0]['sub'] = $sub_menu1;
$jb_menu[1]['button'] = array('label' => $label["employer_menu_profile"], 'link' => 'profile.php', 'image' => JB_THEME_URL . 'images/vf1x20.gif');
$jb_menu[1]['sub'] = $sub_menu2;
$jb_menu[2]['button'] = array('label' => $label["employer_menu_resumes"], 'link' => 'search.php', 'image' => JB_THEME_URL . 'images/vf1x20.gif');
$jb_menu[2]['sub'] = $sub_menu3;
$jb_menu[3]['button'] = array('label' => $label["employer_menu_posts"], 'link' => 'manager.php', 'image' => JB_THEME_URL . 'images/postit-small.gif');
// postit-small.gif
$jb_menu[3]['sub'] = $sub_menu4;
$jb_menu[4]['button'] = array('label' => $label["employer_menu_app_man"], 'link' => 'apps.php', 'image' => JB_THEME_URL . 'images/vf1x20.gif');
$jb_menu[4]['sub'] = $sub_menu5;
$jb_menu[5]['button'] = array('label' => $label["employer_menu_help"], 'link' => 'help.php', 'image' => JB_THEME_URL . 'images/vf1x20.gif');
$jb_menu[5]['sub'] = $sub_menu6;
JBPLUG_do_callback('employer_menu_init', $jb_menu);
if (!defined('JB_EMPLOYER_MENU_TYPE')) {
    define('JB_EMPLOYER_MENU_TYPE', 'JS');
}
if (JB_EMPLOYER_MENU_TYPE == 'JS') {
    require JB_basedirpath() . JB_EMPLOYER_FOLDER . "js_menu.php";
} elseif (JB_EMPLOYER_MENU_TYPE == 'TXT') {
    require JB_basedirpath() . JB_EMPLOYER_FOLDER . "/text_menu.php";
} else {
    require JB_basedirpath() . JB_EMPLOYER_FOLDER . "/js_menu.php";
}
 function editor_field()
 {
     global $FCK_LANG_FILES, $JBMarkup;
     $lang = str_replace('.js', '', $FCK_LANG_FILES[$_SESSION['LANG']]);
     if ($this->field_row['FCOMMENT'] != '') {
         echo $this->field_row['FCOMMENT'] . "<br>";
     }
     // See include/lib/ckeditor/config.js for configuration options
     require_once JB_basedirpath() . "include/lib/ckeditor/ckeditor.php";
     $CKEditor = new CKEditor();
     $CKEditor->initialized = true;
     $CKEditor->basePath = jb_get_CK_js_base(true);
     $config = array('toolbar' => 'Basic', 'docType' => $JBMarkup->doc_type, 'width' => '99%', 'height' => $this->field_row['field_height'] * 15, 'language' => $lang);
     $events['instanceReady'] = 'function (ev) { ev.editor.dataProcessor.writer.selfClosingEnd = \'>\'; }';
     // turn off XHTML generation
     $val = $this->get_data_value($this->field_row['field_id']);
     $CKEditor->editor($this->field_row['field_id'], $val, $config, $events);
 }
Example #15
0
function JB_do_cron_job()
{
    if (is_numeric(JB_CRON_LIMIT)) {
        // check load averge. Do not do cron if load avg is larger than the limit
        JB_exec("w", $out);
        preg_match('#load average: (\\d+\\.\\d+)#', $out[0], $m);
        $load_av = $m[1];
        if ($load_av > JB_CRON_LIMIT) {
            return false;
        }
    }
    $unix_time = time();
    $dir = JB_basedirpath();
    // process the email queue
    JB_process_mail_queue(JB_EMAILS_PER_BATCH);
    // scan inbox
    if (!function_exists('JB_monitor_mail_box')) {
        require_once $dir . "include/mail_monitor_functions.php";
    }
    JB_load_monitor_constants();
    if (MON_ENABLED == 'YES') {
        JB_monitor_mail_box();
    }
    // get the time of last HOURLY run
    $sql = "SELECT * FROM `jb_variables` where `key` = 'LAST_HOURLY_RUN' ";
    $result = @JB_mysql_query($sql) or $DB_ERROR = mysql_error();
    $t_row = @mysql_fetch_array($result, MYSQL_ASSOC);
    JBPLUG_do_callback('do_cron_job', $A = false);
    // queue email alerts
    if ($unix_time > $t_row['val'] + 3600) {
        // did 1 hour elapse since last run? 3600
        if (JB_JOB_ALERTS_ENABLED == 'YES') {
            // need to init jobs tag_to_field
            define('JB_JOB_ALERTS_DO_SEND', true);
            require $dir . 'admin/jobalerts.php';
        }
        if (JB_RESUME_ALERTS_ENABLED == 'YES') {
            // need to init resume tag_to_field
            define('JB_RESUME_ALERTS_DO_SEND', true);
            require $dir . 'admin/resumealerts.php';
        }
        JB_update_employer_subscriptions();
        JB_update_memberships();
        // update timestamp
        $sql = "REPLACE INTO jb_variables (`key`, `val`) VALUES ('LAST_HOURLY_RUN', '{$unix_time}')  ";
        $result = @JB_mysql_query($sql) or $DB_ERROR = mysql_error();
        if (!function_exists('JB_search_category_tree_for_posts')) {
            require_once $dir . "include/posts.inc.php";
        }
        JB_expire_posts('PREMIUM');
        JB_expire_posts('STANDARD');
        JB_cache_del_keys_for_all_cats(1);
        JB_cache_del_keys_for_all_cats(2);
        JB_cache_del_keys_for_all_cats(3);
        JB_cache_del_keys_for_all_cats(4);
        JB_cache_del_keys_for_all_cats(5);
        //
        JB_update_post_count();
        JB_update_resume_count();
        JB_update_profile_count();
        JB_update_employer_count();
        JB_update_user_count();
        if (EMAIL_URL_SHORTEN == 'YES') {
            JB_expire_short_URLs();
        }
        // run the import tool
        JB_process_xml_import();
        JBPLUG_do_callback('do_cron_hourly', $A = false);
    }
}
Example #16
0
function JB_get_rss_dir()
{
    static $dir;
    if (isset($dir)) {
        return $dir;
    }
    $dir = JB_basedirpath();
    JBPLUG_do_callback('get_rss_dir', $dir);
    return $dir;
}
Example #17
0
function fck_lang_file_options($sel_val = '')
{
    if (isset($_REQUEST['fckeditor_lang'])) {
        $sel_val = $_REQUEST['fckeditor_lang'];
    }
    $dh = opendir(JB_basedirpath() . "include/lib/ckeditor/lang");
    while (($file = readdir($dh)) !== false) {
        $arr = explode('.', $file);
        $ext = array_pop($arr);
        $lang = array_pop($arr);
        if ($_REQUEST['fckeditor_lang'] == $lang) {
            $sel = " selected ";
        } else {
            $sel = "";
        }
        if ($ext == 'js') {
            echo "<option value='{$lang}' {$sel}>{$file}</option>\n";
        }
    }
    closedir($dh);
}
Example #18
0
function JB_send_email($mail_row)
{
    $to_name = JB_html_ent_to_utf8($mail_row['to_name']);
    $to_address = $mail_row['to_address'];
    $from_name = JB_html_ent_to_utf8($mail_row['from_name']);
    $from_address = $mail_row['from_address'];
    $subject = JB_html_ent_to_utf8($mail_row['subject']);
    $message = JB_html_ent_to_utf8($mail_row['message']);
    $html_message = JB_html_ent_to_utf8($mail_row['html_message']);
    if (JB_USE_MAIL_FUNCTION == 'YES') {
        $email_message = new email_message_class();
        if (JB_EMAIL_DEBUG_SWITCH == 'YES') {
            echo 'Email Debug: Using the mail() function...<br>';
        }
    } else {
        // use SMTP
        $dir = JB_basedirpath();
        if (!class_exists("sasl_client_class")) {
            require_once $dir . "include/lib/mail/sasl/sasl.php";
        }
        $email_message = new smtp_message_class();
        $email_message->localhost = JB_EMAIL_HOSTNAME;
        $email_message->smtp_host = JB_EMAIL_SMTP_SERVER;
        $email_message->smtp_direct_delivery = 0;
        $email_message->smtp_exclude_address = "";
        $email_message->smtp_user = JB_EMAIL_SMTP_USER;
        $email_message->smtp_realm = "";
        $email_message->smtp_password = JB_EMAIL_SMTP_PASS;
        if (defined('JB_EMAIL_SMTP_PORT')) {
            if (!is_numeric(JB_EMAIL_SMTP_PORT)) {
                $email_message->smtp_port = 25;
            } else {
                $email_message->smtp_port = JB_EMAIL_SMTP_PORT;
            }
        }
        $email_message->authentication_mechanism = 'USER';
        // SASL authentication
        if (JB_EMAIL_SMTP_SSL == 'YES') {
            $email_message->smtp_ssl = 1;
        } else {
            $email_message->smtp_ssl = 0;
        }
        if (JB_EMAIL_POP_BEFORE_SMTP == 'YES') {
            $email_message->smtp_pop3_auth_host = JB_EMAIL_SMTP_AUTH_HOST;
        } else {
            $email_message->smtp_pop3_auth_host = "";
        }
        if (JB_EMAIL_DEBUG_SWITCH == 'YES') {
            $email_message->smtp_debug = 1;
        } else {
            $email_message->smtp_debug = 0;
        }
        $email_message->smtp_html_debug = 0;
        if (JB_EMAIL_DEBUG_SWITCH == 'YES') {
            echo 'Email Debug: using SMTP server...<br>';
        }
    }
    $reply_address = $mail_row['from_address'];
    $error_delivery_name = JB_SITE_NAME;
    $error_delivery_address = JB_SITE_CONTACT_EMAIL;
    JBPLUG_do_callback('set_error_delivery_name', $error_delivery_name);
    // added in 3.6
    JBPLUG_do_callback('set_error_delivery_address', $error_delivery_address);
    // added in 3.6
    $email_message->default_charset = 'UTF-8';
    $email_message->SetEncodedEmailHeader("To", $to_address, $to_name);
    $email_message->SetEncodedEmailHeader("From", $from_address, $from_name);
    $email_message->SetEncodedEmailHeader("Reply-To", $reply_address, $reply_name);
    /*
    	Set the Return-Path header to define the envelope sender address to which bounced messages are delivered.
    	If you are using Windows, you need to use the smtp_message_class to set the return-path address.
    */
    // Cannot set in safe-mode or under Windows...
    if (function_exists("ini_get") && !ini_get("safe_mode") && strpos(strtoupper(PHP_OS), 'WIN') === false) {
        $email_message->SetHeader("Return-Path", $error_delivery_address);
    }
    if (strpos(strtoupper(PHP_OS), 'WIN') !== false) {
        // windows
        ini_set('sendmail_from', JB_SITE_CONTACT_EMAIL);
    }
    //}
    if ($mail_row['template_id'] == 5 || $mail_row['template_id'] == 6 || $mail_row['template_id'] == 7 || $mail_row['template_id'] == 8 || $mail_row['template_id'] == 30) {
        // job alerts, resume alerts, newsletter are bulk mails
        $email_message->SetHeader("Precedence", 'bulk');
    }
    $email_message->SetEncodedEmailHeader("Errors-To", $error_delivery_address, $error_delivery_name);
    $email_message->SetEncodedHeader("Subject", $subject);
    if ($html_message == '') {
        // ONLY TEXT
        $email_message->AddQuotedPrintableTextPart($email_message->WrapText($message));
    } else {
        $email_message->CreateQuotedPrintableHTMLPart($html_message, "", $html_part);
        //$text_message="This is an HTML message. Please use an HTML capable mail program to read this message.";
        $email_message->CreateQuotedPrintableTextPart($email_message->WrapText($message), "", $text_part);
        $alternative_parts = array($text_part, $html_part);
        $email_message->AddAlternativeMultipart($alternative_parts);
    }
    if ($mail_row['attachments'] == 'Y') {
        JB_add_mail_attachments($email_message, $mail_row);
    }
    JBPLUG_do_callback('set_mail_message', $email_message);
    // plugins can do additional operations on the $email_message, added in 3.6
    $error = $email_message->Send();
    if (strcmp($error, "")) {
        $now = gmdate("Y-m-d H:i:s");
        $sql = "UPDATE mail_queue SET status='error', retry_count=retry_count+1,  error_msg='" . jb_escape_sql(addslashes($error)) . "', `date_stamp`='{$now}' WHERE mail_id=" . jb_escape_sql($mail_row['mail_id']);
        JB_mysql_query($sql) or JB_q_mail_error(mysql_error() . $sql);
    } else {
        // note: on some servers (ie GoDaddy, connection to server can be
        // lost, so re-connect by pinging
        jb_mysql_ping();
        $now = gmdate("Y-m-d H:i:s");
        $sql = "UPDATE mail_queue SET status='sent', `date_stamp`='{$now}' WHERE mail_id='" . jb_escape_sql($mail_row['mail_id']) . "'";
        JB_mysql_query($sql, $jb_mysql_link) or JB_q_mail_error(mysql_error() . $sql);
    }
}
Example #19
0
function JB_finalize_post_updates()
{
    JB_update_post_count();
    // update the total, eg. number of approved posts, number of expired posts, premium approved, expired & waiting
    // refresh the category cache
    JB_cache_del_keys_for_all_cats(1);
    // refresh the rss feed
    require_once JB_basedirpath() . "rss.php";
    JBPLUG_do_callback('finalize_post_updates', $A = false);
}
Example #20
0
<?php

###########################################################################
# Copyright Jamit Software 2012, http://www.jamit.com
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
###########################################################################
require_once JB_basedirpath() . 'include/js_menu_functions.php';
// $menu is defined in employer-menu.php or candidate-menu.php template files
$active_button = JB_show_menu($jb_menu);
Example #21
0
 function SASLAuthenticate($mechanisms, $credentials, &$authenticated, &$mechanism)
 {
     $authenticated = 0;
     if (!function_exists("class_exists") || !class_exists("sasl_client_class")) {
         $this->error = "sasl was loaded...";
         //return(0);
         $dir = JB_basedirpath();
         if (!class_exists("sasl_client_class")) {
             require $dir . "include/lib/mail/sasl/sasl.php";
         }
     }
     $sasl = new sasl_client_class();
     $sasl->SetCredential("user", $credentials["user"]);
     $sasl->SetCredential("password", $credentials["password"]);
     if (isset($credentials["realm"])) {
         $sasl->SetCredential("realm", $credentials["realm"]);
     }
     if (isset($credentials["workstation"])) {
         $sasl->SetCredential("workstation", $credentials["workstation"]);
     }
     if (isset($credentials["mode"])) {
         $sasl->SetCredential("mode", $credentials["mode"]);
     }
     do {
         $status = $sasl->Start($mechanisms, $message, $interactions);
     } while ($status == SASL_INTERACT);
     switch ($status) {
         case SASL_CONTINUE:
             break;
         case SASL_NOMECH:
             if (strlen($this->authentication_mechanism)) {
                 $this->error = "authenticated mechanism " . $this->authentication_mechanism . " may not be used: " . $sasl->error;
                 return 0;
             }
             break;
         default:
             $this->error = "Could not start the SASL authentication client: " . $sasl->error;
             return 0;
     }
     if (strlen($mechanism = $sasl->mechanism)) {
         if ($this->PutLine("AUTH " . $sasl->mechanism . (isset($message) ? " " . base64_encode($message) : "")) == 0) {
             $this->error = "Could not send the AUTH command";
             return 0;
         }
         if (!$this->VerifyResultLines(array("235", "334"), $responses)) {
             return 0;
         }
         switch ($this->result_code) {
             case "235":
                 $response = "";
                 $authenticated = 1;
                 break;
             case "334":
                 $response = base64_decode($responses[0]);
                 break;
             default:
                 $this->error = "Authentication error: " . $responses[0];
                 return 0;
         }
         for (; !$authenticated;) {
             do {
                 $status = $sasl->Step($response, $message, $interactions);
             } while ($status == SASL_INTERACT);
             switch ($status) {
                 case SASL_CONTINUE:
                     if ($this->PutLine(base64_encode($message)) == 0) {
                         $this->error = "Could not send the authentication step message";
                         return 0;
                     }
                     if (!$this->VerifyResultLines(array("235", "334"), $responses)) {
                         return 0;
                     }
                     switch ($this->result_code) {
                         case "235":
                             $response = "";
                             $authenticated = 1;
                             break;
                         case "334":
                             $response = base64_decode($responses[0]);
                             break;
                         default:
                             $this->error = "Authentication error: " . $responses[0];
                             return 0;
                     }
                     break;
                 default:
                     $this->error = "Could not process the SASL authentication step: " . $sasl->error;
                     return 0;
             }
         }
     }
     return 1;
 }
Example #22
0
    if ($data['display'] == 'NO') {
        echo " checked ";
    }
    ?>
 name="display"> No<br>-->
	<input type="hidden" name="type" value="<?php 
    echo jb_escape_html($_REQUEST['type']);
    ?>
">
	Help Title: <input type="text" name="title" value="<?php 
    echo JB_escape_html($data['title']);
    ?>
" size="50"><br>
	Help Message: <br>
	<?php 
    require_once JB_basedirpath() . "include/lib/ckeditor/ckeditor.php";
    $CKEditor = new CKEditor();
    $CKEditor->initialized = false;
    $CKEditor->basePath = jb_get_CK_js_base(true);
    $config = array('toolbar' => 'Basic', 'docType' => $JBMarkup->doc_type, 'width' => 40 * 15, 'height' => 25 * 15, 'language' => 'en');
    $events['instanceReady'] = 'function (ev) { ev.editor.dataProcessor.writer.selfClosingEnd = \'>\'; }';
    // turn off XHTML generation
    $CKEditor->editor('message', $data['message'], $config, $events);
    ?>
	<br>
	<input name='save' type="submit" value="Save">
	</form>


	<?php 
}
Example #23
0
     //echo "- config.php is writeable.<br>";
 } else {
     echo "<p><font color='maroon'>- config.php is not writable. Give write permissions to config.php if you want to save any changes</p></font>";
 }
 if (is_writable("../rss.xml")) {
     //echo "- rss.xml is writeable.";
 } else {
     echo "<p><font color='maroon'>- rss.xml is not writable! rss.xml must have write permissions.</font></p>";
 }
 if (file_exists(JB_basedirpath() . "admin/install.php")) {
     echo "<p><font color='maroon'>- Please delete install.php from the admin/ directory once the installation is complete.</font><p>";
 }
 if (strpos(ini_get('disable_functions'), 'fsockopen') !== false) {
     echo "<p><font color='maroon'>- Error! It appears that the fsockopen() function is disabled on this server. This means that some of the payment modules will not work, including PayPal, as they need fsockopen() to communicate with outside hosts for authentication purposes. </font><p>";
 }
 include JB_basedirpath() . '/payment/payment_manager.php';
 if (isset($_PAYMENT_OBJECTS['authorizeNet']) && $_PAYMENT_OBJECTS['authorizeNet']->is_enabled()) {
     if (!defined('AUTHNET_MD5_HASH')) {
         echo "<p><font color='maroon'>- Important: It looks like you have Authorize.net enabled but not yet fully configured. (The latest version requires you to review your Authorize.net settings in Admin->Payment Modules.) </font><p>";
     }
 }
 $sql = "select val from jb_variables WHERE `key`='LAST_HOURLY_RUN'";
 $result = jb_mysql_query($sql);
 $row = mysql_fetch_array($result, MYSQL_ASSOC);
 $last_run_time = $row['val'];
 if ($last_run_time + 24 * 60 * 60 < time()) {
     echo "<p><font color='maroon'>- The system is reporting that the last time the <a href='cron.php'>Cron job</a> was run was on " . date('r', $last_run_time) . "... Please see the <a href='cron.php'>Cron Info</a> for more infromation about setting up a cron job, or enable Cron Emulation in <a href='edit_config.php' >Main Config</a>. Ignore this message if you had set up your Cron job in the last hour - this message will go away after a successful cron run.</font></p>";
 }
 // check if the directory was protected...
 if (!isset($_SERVER['PHP_AUTH_USER'])) {
     echo "<p><font color='maroon'>- The system is recommending that you should password protect your admin/ directory using the features in your web hosting account (or using .htaccess). The admin/ directory is already password protected, but this is limited to php files. By password protecting the entire admin/ directory, you will restrict access to all of files in this directory.</font></p>";
Example #24
0
 function get_extra_markup($where)
 {
     static $DATE_CAL_HEADER_SET;
     static $EDITOR_HEADER_SET;
     static $GMAP_HEADER_SET;
     global $label, $JBMarkup;
     foreach ($this->tag_to_field_id as $field) {
         switch ($field['field_type']) {
             case 'DATE_CAL':
                 if ($where == 'header' && $this->is_edit_mode()) {
                     if (!isset($DATE_CAL_HEADER_SET)) {
                         $extra_str .= $JBMarkup->get_stript_include_tag(jb_get_SCW_js_src());
                         $DATE_CAL_HEADER_SET = true;
                     }
                 }
                 break;
             case 'EDITOR':
                 if ($where == 'header' && $this->is_edit_mode()) {
                     if (!isset($EDITOR_HEADER_SET)) {
                         $DFM = $this->get_DynamicFormMarkup();
                         $extra_str .= $DFM->get_editor_field_header();
                         $EDITOR_HEADER_SET = true;
                     }
                 }
                 break;
             case 'GMAP':
                 $lat = $this->get_value($field['field_id'] . '_lat');
                 $lng = $this->get_value($field['field_id'] . '_lng');
                 $zoom = $this->get_value($field['field_id']);
                 if (!$zoom) {
                     $zoom = JB_GMAP_ZOOM;
                 }
                 // Only add extra markup if there is map data.
                 if (is_numeric($lat) && is_numeric($lng) && $lat != 0) {
                     require_once JB_basedirpath() . 'include/classes/JBGoogleMap.php';
                     $GMAP = JBGoogleMap::get_instance();
                     if ($where == 'header') {
                         $GMAP->add_map($field['field_id'], array('lat' => $lat, 'lng' => $lng), $zoom);
                         $GMAP->add_marker($field['field_id'], $lat, $lng, 'A', '', false);
                         $args = array('gmap' => $GMAP, 'Form' => $this, 'field' => $field);
                         JBPlug_do_callback('gmap_add_map_after', $args);
                         // plugin authors can manipulate the map here, eg. add more markers, etc.
                         if (!isset($GMAP_HEADER_SET)) {
                             $extra_str .= $GMAP->get_header_js();
                             $GMAP_HEADER_SET = true;
                         }
                         $extra_str .= $GMAP->get_map_js($field['field_id']);
                     }
                     if ($where == 'onload_function') {
                         $extra_str .= $GMAP->get_onload_js($field['field_id']);
                     }
                 }
                 break;
             default:
                 JBPlug_do_callback('before_body_end_markup', $extra_str, $field, $where);
                 break;
         }
     }
     return $extra_str;
 }