本文整理汇总了PHP中JB_get_DynamicFormObject函数的典型用法代码示例。如果您正苦于以下问题:PHP JB_get_DynamicFormObject函数的具体用法?PHP JB_get_DynamicFormObject怎么用?PHP JB_get_DynamicFormObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了JB_get_DynamicFormObject函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_template_value
function get_template_value($template_tag, $admin = false)
{
if (is_numeric($this->form_id)) {
// get form the dynamic form
// php5: JB_get_DynamicFormObject($this->form_id)->get_template_value($template_tag, $admin);
$obj = JB_get_DynamicFormObject($this->form_id);
return $obj->get_template_value($template_tag, $admin);
}
}
示例2: JB_expire_post
function JB_expire_post($post_id)
{
$post_id = (int) $post_id;
$sql = "UPDATE posts_table SET expired='Y' where post_id='" . jb_escape_sql($post_id) . "' ";
JB_mysql_query($sql) or $DB_ERROR = mysql_error();
JBPLUG_do_callback('expire_post', $post_id);
// col val is post_id
if (JB_EMAIL_POST_EXP_SWITCH == 'YES') {
// Send Expiration email
$Form = JB_get_DynamicFormObject(1);
$Form->load($post_id);
$TITLE = $Form->get_raw_template_value("TITLE");
$DATE = JB_get_formatted_date($Form->get_template_value("DATE"));
$POSTED_BY_ID = $Form->get_value('user_id');
// get the employer
$sql = "SELECT * FROM employers WHERE ID='" . jb_escape_sql($POSTED_BY_ID) . "' ";
$emp_result = jb_mysql_query($sql);
$emp_row = mysql_fetch_array($emp_result);
// get the email template
$template_result = JB_get_email_template(210, $emp_row['lang']);
$t_row = mysql_fetch_array($template_result);
$to_address = $emp_row['Email'];
$to_name = JB_get_formatted_name($emp_row['FirstName'], $emp_row['LastName']);
$subject = $t_row['EmailSubject'];
$message = $t_row['EmailText'];
$from_name = $t_row['EmailFromName'];
$from_address = $t_row['EmailFromAddress'];
$message = str_replace("%LNAME%", $emp_row['LastName'], $message);
$message = str_replace("%FNAME%", $emp_row['FirstName'], $message);
$message = str_replace("%SITE_NAME%", JB_SITE_NAME, $message);
$message = str_replace("%SITE_URL%", JB_BASE_HTTP_PATH, $message);
$message = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $message);
$message = str_replace("%POST_TITLE%", $TITLE, $message);
$message = str_replace("%POST_DATE%", $DATE, $message);
$message = str_replace("%VIEWS%", $Form->get_value('hits'), $message);
$message = str_replace("%APPS%", $Form->get_value('applications'), $message);
$message = strip_tags($message);
// plugin can change the recipient
JBPLUG_do_callback('expire_post_set_recipient_email', $to_address);
JBPLUG_do_callback('expire_post_set_recipient_name', $to_name);
// Place the email on the queue!
JB_queue_mail($to_address, $to_name, $from_address, $from_name, $subject, $message, '', 210);
}
}
示例3: echo_tt_options
function echo_tt_options($value, $type = '')
{
$PForm = JB_get_DynamicFormObject(1);
$post_tag_to_search = $PForm->get_tag_to_search();
require_once jb_basedirpath() . "include/posts.inc.php";
foreach ($post_tag_to_search as $key => $tag) {
if ($key != '') {
$sel = "";
if (is_array($value)) {
// multiple selected
if (in_array($key, $value)) {
$sel = ' selected ';
}
} else {
if ($key == $value) {
$sel = ' selected ';
}
}
if ($type != '') {
// echo only for the $type
if ($tag[$key]['field_type'] == $type) {
echo '<option ' . $sel . ' value="' . $key . '">' . JB_truncate_html_str($tag['field_label'], 50, $foo) . '</option>' . "\n";
$output = true;
}
} else {
// echo all
echo '<option ' . $sel . ' value="' . $key . '">' . JB_truncate_html_str($tag['field_label'], 50, $foo) . '</option>' . "\n";
$output = true;
}
}
}
if ($output == false) {
echo '<option>[There are no ' . $type . ' fields to select]</option>';
}
}
示例4: JB_process_login
<?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";
include 'login_functions.php';
JB_process_login();
include "../include/profiles.inc.php";
JB_template_employers_header();
JB_render_box_top(99, $label['employer_vprofile_title']);
$ProfileForm =& JB_get_DynamicFormObject(3);
$row = $ProfileForm->load(false, $_SESSION['JB_ID']);
if ($row['profile_id'] != '') {
// can we display the profile?
$ProfileForm->load(false, $_SESSION["JB_ID"]);
$ProfileForm->display_form('view', false);
} else {
/*
The employer does not yet have a profile, show a note
and a link to the edit profile page.
*/
?>
<h3><?php
echo $label["employer_vprofile_noprof"];
?>
</h3>
示例5: JB_process_login
<?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";
include 'login_functions.php';
require_once '../include/candidates.inc.php';
JB_process_login();
$CandidateForm =& JB_get_DynamicFormObject(5);
$CandidateForm->set_mode('edit');
JB_template_candidates_header();
if ($_REQUEST['load_defaults'] == true) {
$_REQUEST['user_id'] = $_SESSION['JB_ID'];
$data = $CandidateForm->load($_SESSION['JB_ID']);
$_REQUEST = array_merge($_REQUEST, $data);
}
JB_render_box_top(80, $label["seeker_ac_intro"]);
echo $label["seeker_ac_note"];
if ($_REQUEST['form'] != "") {
// saving
$admin = false;
$errors = $CandidateForm->validate();
if ($_REQUEST['user_id'] != $_SESSION['JB_ID'] || $errors) {
$JBMarkup->error_msg($label['employer_save_error']);
echo "<p>";
echo $CandidateForm->get_error_msg();
echo "</p>";
示例6: output
function output($admin = false)
{
$mode = 'view';
$DynamicForm =& JB_get_DynamicFormObject(2);
$DynamicForm->display_form($mode, $admin);
}
示例7: config_form
//.........这里部分代码省略.........
</td>
</tr>
<tr>
<td width="20%" bgcolor="#e6f2ea">
<b>Search Field(s) for Location</b></td>
<td bgcolor="#e6f2ea">
<select name="l_tag[]" multiple size="5" >
<!--<option value="">[Select]</option>-->
<?php
echo $this->echo_tt_options($this->config['l_tag']);
?>
</select> (The selected search parameters will be combined and used as the location for the search query sent to Indeed. If not selected or no location is searched, then it will default to the Main Location. Hold down the Ctrl key to select/unselect multiple items)
</td>
</tr>
<td colspan="2" bgcolor="#e6f2ea">
<table width="100%" border="0" cellSpacing="1" cellPadding="3" bgColor="#d9d9d9" >
<tr bgcolor="#e6f2ea">
<h4>Source to Local field mappings</h4>
<td width="10%" valign="top">
<b>Local Fields</b> - Fields your job posting form. Fields marked with * are required.
</td>
<td valign="top">
<b>Source Fields</b> - These fields are the original fields that are coming in from the feed
</td>
</tr>
<?php
require_once "../include/posts.inc.php";
$PForm =& JB_get_DynamicFormObject(1, 'global');
$params = array('pub' => $this->config['id']);
$in_fields = $this->api_call('get_field_list', $params);
sort($in_fields);
$sql = "SELECT *, t1.field_label AS FLABEL FROM form_field_translations as t1, form_fields as t2 WHERE t2.form_id=1 AND t2.field_id=t1.field_id AND field_type!='BLANK' AND field_type != 'SEPERATOR' AND lang='" . JB_escape_sql($_SESSION['LANG']) . "' order by section asc, field_sort asc ";
$result = jb_mysql_query($sql);
while ($field = mysql_fetch_array($result, MYSQL_ASSOC)) {
if ($field['template_tag'] == 'EMAIL') {
continue;
}
?>
<tr bgcolor="e6f2ea">
<td width="10%" nowrap valign="top">
<span style="font-weight: bold; font-size: 10pt"><?php
echo $field['field_label'];
if ($field['is_required'] == 'Y') {
echo '<span style="color:red; font-size:18pt">*</span>';
}
?>
</span> <?php
echo $field['field_type'] . ' (#' . $field['field_id'];
?>
)
</td>
<td >
<---<select <?php
if ($this->config['map'][$field['field_id']]) {
?>
示例8: jb_get_raw_template_value
$EmailMessage = $e_row['EmailText'];
$from = $e_row['EmailFromAddress'];
$from_name = $e_row['EmailFromName'];
$subject = $e_row['EmailSubject'];
$resume_alert_line = $e_row['sub_template'];
################################################################################
# Build resume list for each user.
# Text email
# Use jb_get_raw_template_value()
# and then call strip_tags()
###
if ($resume_alert_line != '') {
// the new way of building the resume lines
$resume_alert_list_text = '';
mysql_data_seek($result2, 0);
$RForm =& JB_get_DynamicFormObject(2);
$RForm->set_viewer($user_row['ID']);
while ($resume_row = mysql_fetch_array($result2, MYSQL_ASSOC)) {
$RForm->set_values($resume_row);
//
$temp_text = $resume_alert_line;
// copy the template
//$val = substr(md5 ($resume_row['resume_id'].$user_row['Password'].$user_row['ID']), 0,10);
$resume_db_link = JB_BASE_HTTP_PATH . JB_EMPLOYER_FOLDER . "search.php?resume_id=" . $resume_row['resume_id'];
//."&id=".$user_row['ID']."&key=$val";
$temp_text = str_replace('%RESUME_DB_LINK%', $resume_db_link, $temp_text);
// load in legacy values
$DATE = $RForm->get_template_value('DATE');
$FORMATTED_DATE = JB_get_formatted_date($DATE);
$temp_text = str_replace("%FORMATTED_DATE%", $FORMATTED_DATE, $temp_text);
$temp_text = str_replace("%DATE%", $FORMATTED_DATE, $temp_text);
示例9: JB_insert_resume_data
function JB_insert_resume_data()
{
if (func_num_args() > 0) {
$admin = func_get_arg(0);
// admin mode.
}
$list_on_web = 'Y';
$_REQUEST['anon'] = jb_alpha_numeric($_REQUEST['anon']);
$status = "ACT";
$approved = 'Y';
if ($admin == true) {
$sql = "select user_id from `resumes_table` WHERE resume_id='" . jb_escape_sql($_REQUEST['resume_id']) . "'";
$result = JB_mysql_query($sql) or die(mysql_error());
$row = @mysql_fetch_array($result, MYSQL_ASSOC);
$user_id = $row['user_id'];
} else {
$user_id = (int) $_SESSION['JB_ID'];
}
if (JB_RESUMES_NEED_APPROVAL == 'YES' && !$admin) {
$approved = 'N';
}
if ($_REQUEST['resume_id'] == false) {
$assign = array('list_on_web' => 'Y', 'resume_date' => gmdate("Y-m-d H:i:s"), 'user_id' => $user_id, 'approved' => $approved, 'anon' => jb_alpha_numeric($_REQUEST['anon']), 'status' => 'ACT', 'expired' => 'N');
$sql = "REPLACE INTO `resumes_table` ( " . JB_get_sql_insert_fields(2, $assign) . ") VALUES (" . JB_get_sql_insert_values(2, "resumes_table", "resume_id", $resume_id, $user_id, $assign) . ") ";
// JB_get_sql_insert_values() escapes the sql values
$action = "Inserted new resume.";
} else {
$resume_id = (int) $_REQUEST['resume_id'];
$now = gmdate("Y-m-d H:i:s");
$assign = array('resume_date' => gmdate("Y-m-d H:i:s"), 'anon' => jb_alpha_numeric($_REQUEST['anon']), 'approved' => $approved);
$sql = "UPDATE `resumes_table` SET " . JB_get_sql_update_values(2, "resumes_table", "resume_id", $_REQUEST['resume_id'], $user_id, $assign) . " WHERE resume_id='" . jb_escape_sql($resume_id) . "' and user_id='" . jb_escape_sql($user_id) . "' ";
// JB_get_sql_update_values() // escapes the sql values
//$action = "Updated existing resume";
}
JB_mysql_query($sql) or die("[{$sql}]" . mysql_error());
if ($resume_id == false) {
$resume_id = JB_mysql_insert_id();
}
$RForm =& JB_get_DynamicFormObject(2);
$data = $RForm->load($resume_id);
$data['resume_id'] = $resume_id;
JB_build_resume_count(0);
JBPLUG_do_callback('insert_resume_data', $data);
if (JB_EMAIL_ADMIN_RESUPDATE_SWITCH == 'YES') {
// send notification email to Admin
$resume_tag_to_field_id =& $RForm->get_tag_to_field_id();
$RESUME_SUMMARY = $action . "\r\n";
$sql = "SELECT * from form_lists WHERE form_id=2 ORDER BY sort_order ";
$result = JB_mysql_query($sql);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$label = $field_field_label = $resume_tag_to_field_id[$row['template_tag']]['field_label'];
$RESUME_SUMMARY .= $label . " - " . $RForm->get_raw_template_value($row['template_tag'], $admin) . "\r\n";
}
// get the email template
$template_result = JB_get_email_template(320, 'EN');
$t_row = mysql_fetch_array($template_result);
$to_address = JB_SITE_CONTACT_EMAIL;
$to_name = JB_SITE_NAME;
$subject = $t_row['EmailSubject'];
$message = $t_row['EmailText'];
$from_name = $t_row['EmailFromName'];
$from_address = $t_row['EmailFromAddress'];
$subject = str_replace("%SITE_NAME%", JB_SITE_NAME, $subject);
$message = str_replace("%RESUME_SUMMARY%", $RESUME_SUMMARY, $message);
$message = str_replace("%ADMIN_LINK%", JB_BASE_HTTP_PATH . "admin/ra.php?resume_id=" . $resume_id . "&key=" . md5($resume_id . JB_ADMIN_PASSWORD), $message);
$message = str_replace("%SITE_NAME%", JB_SITE_NAME, $message);
$message = strip_tags($message);
JB_queue_mail($to_address, $to_name, $from_address, $from_name, $subject, $message, '', 320);
}
return $resume_id;
}
示例10: JB_get_employer_name
function JB_get_employer_name($user_id)
{
if (!is_numeric($user_id)) {
return false;
}
global $JBMarkup;
static $b_name;
// cache it
if (isset($b_name[$user_id])) {
return $b_name[$user_id];
}
// return cached value
// perhaps the employer profile form was already loaded with the data?
// In that case lets see if we can get the employer name form there...
$ProfileForm =& JB_get_DynamicFormObject(3);
if ($ProfileForm->get_value('user_id') == $user_id) {
// already loaded
$row['65'] = $ProfileForm->get_template_value('PROFILE_BNAME');
$row['CompName'] = $ProfileForm->get_value('CompName');
$row['FirstName'] = $ProfileForm->get_value('FirstName');
$row['LastName'] = $ProfileForm->get_value('LastName');
} else {
$row = $ProfileForm->load(false, $user_id);
// get be employer id
}
if (is_array($row)) {
if (strlen(trim($row['65'])) > 0) {
$b_name[$user_id] = $row['65'];
} elseif (strlen(trim($row['CompName'])) > 0) {
$b_name[$user_id] = $row['CompName'];
} else {
$b_name[$user_id] = JB_get_formatted_name($row['FirstName'], $row['LastName']);
//
}
}
return $b_name[$user_id];
}
示例11: JBXM_get_static_data
function JBXM_get_static_data($form_id, &$data, $val, &$feed_row)
{
if (!preg_match('/%[a-z_]+%/i', $val)) {
return $val;
// is not a variable
}
$val = str_replace('%SITE_NAME%', JB_SITE_NAME, $val);
$val = str_replace('%SITE_DESCRIPTION%', JB_SITE_DESCRIPTION, $val);
$val = str_replace('%SITE_CONTACT_EMAIL%', JB_SITE_CONTACT_EMAIL, $val);
$val = str_replace('%BASE_HTTP_PATH%', JB_BASE_HTTP_PATH, $val);
$val = str_replace('%RSS_FEED_LOGO%', JB_RSS_FEED_LOGO, $val);
$val = str_replace('%FEED_DATE%', date('r'), $val);
if (file_exists(JB_RSS_FEED_LOGO)) {
$img_size = getimagesize(JB_RSS_FEED_LOGO);
}
$val = str_replace('%RSS_FEED_LOGO%', JB_RSS_FEED_LOGO, $val);
$val = str_replace('%RSS_LOGO_HEIGHT%', $img_size[1], $val);
$val = str_replace('%RSS_LOGO_WIDTH%', $img_size[0], $val);
$val = str_replace('%DEFAULT_LANG%', $_SESSION['LANG'], $val);
// These depend on the different record types
// %EXPIRE_DATE%
// %DATE%
// %LINK%
switch ($form_id) {
case '1':
// job posts
$post_time = strtotime($data['post_date'] . " GMT ");
//$link = JB_BASE_HTTP_PATH.'index.php?post_id='.$data['post_id'];
//$link = JB_job_post_url($data['post_id'], '', '', '', '', '', JB_BASE_HTTP_PATH);
$PForm = JB_get_DynamicFormObject(1);
$PForm->set_values($data);
$link = JBXM_xmlentities(JB_job_post_url($data['post_id'], null, JB_BASE_HTTP_PATH . 'index.php'));
$val = str_replace('%LINK%', $link, $val);
$val = str_replace('%DATE%', date('Y-m-d', $post_time), $val);
$val = str_replace('%DATE_RFC%', date('r', $post_time), $val);
$val = str_replace('%DATE_TROVIT%', date('d/m/Y', $post_time), $val);
# elapsed = now - post_date
# expires = post_date + DISPLAY DAYS
if ($data['post_mode'] == 'premium') {
$display_dur = JB_P_POSTS_DISPLAY_DAYS * 24 * 60 * 60;
} else {
$display_dur = JB_POSTS_DISPLAY_DAYS * 24 * 60 * 60;
}
$expire_time = $post_time + $display_dur;
$val = str_replace('%EXPIRE_DATE%', date('Y-m-d', $expire_time), $val);
$val = str_replace('%RECORD_ID%', $data['post_id'], $val);
$val = str_replace('%USER_ID%', $data['user_id'], $val);
break;
case '2':
// resumes
break;
}
return $val;
}
示例12: JB_get_tag_to_field_id
function JB_get_tag_to_field_id($form_id)
{
//global $tag_to_search; post_tag_to_field_id
global $post_tag_to_field_id;
// for compatibility with older plugins
$DynamicForm =& JB_get_DynamicFormObject($form_id);
$post_tag_to_field_id = $DynamicForm->get_tag_to_field_id();
return $post_tag_to_field_id;
}
示例13: JB_get_DynamicFormObject
$ord = $_REQUEST['ord'];
$offset = (int) $_REQUEST['offset'];
$app_id = (int) $_REQUEST['app_id'];
$resume_id = (int) $_REQUEST['resume_id'];
if ($_REQUEST['show'] != '') {
$show = $_REQUEST['show'];
$_SESSION['resume_show'] = $show;
}
if ($_REQUEST['show'] == '') {
$_REQUEST['show'] = $_SESSION['resume_show'];
}
$show = $_REQUEST['show'];
if ($show == '') {
$show = 'ALL';
}
$ResumeForm =& JB_get_DynamicFormObject(2);
$ResumeForm->set_mode('edit');
JB_admin_header('Admin -> Resumes');
?>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000; "></div>
<b>[CANDIDATES - RESUMES]</b> <span style="background-color: #F2F2F2; border-style:outset; padding:5px; "><a href="candidates.php">List Candidates</a></span>
<span style="background-color: <?php
if ($_REQUEST['show'] == 'ALL') {
echo "#FFFFCC";
} else {
echo "#F2F2F2";
}
?>
; border-style:outset; padding: 5px;"><a href="resumes.php?show=ALL">View Resumes</a></span>
<?php
示例14: dirname
###########################################################################
# 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 '../include/category.inc.php';
require_once '../include/posts.inc.php';
if (!isset($_REQUEST['mode'])) {
$_REQUEST['mode'] = 'VIEW';
}
$mode = $_REQUEST['mode'];
$PostingForm =& JB_get_DynamicFormObject(1);
$PostingForm->set_mode($mode);
JB_admin_header('Admin -> Posting Form');
?>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000; "></div>
<b>[Posting Form]</b><span style="background-color: <?php
if ($_REQUEST['mode'] != 'EDIT') {
echo "#FFFFCC";
}
?>
; border-style:outset; padding: 5px;"><a href="postform.php?mode=VIEW">View Form</a></span> <span style="background-color: <?php
if ($_REQUEST['mode'] == 'EDIT' && $_REQUEST['NEW_FIELD'] == '') {
echo "#FFFFCC";
}
?>
; border-style:outset; padding: 5px;"><a href="postform.php?mode=EDIT">Edit Fields</a></span> <span style="background-color: <?php
示例15: JB_template_application_form
function JB_template_application_form($post_id, $app_name, $app_email, $app_subject, $app_letter, $att1, $att2, $att3)
{
global $label, $error, $JBMarkup;
// Need to access the job posting data? It has already been loaded
// in to memory. Here is an example forhow to do it:
// $DynamicForm = &JB_get_DynamicFormObject(1);
// print_r($DynamicForm->get_values());
JBPLUG_do_callback('app_form_before', $A = false);
$member_ignore_premium = false;
if (JB_MEMBER_FIELD_SWITCH == 'YES') {
if (JB_MEMBER_FIELD_IGNORE_PREMIUM == 'YES') {
// ignore membership only field and allow applications
$PForm =& JB_get_DynamicFormObject(1);
if ($PForm->get_value('post_mode') == 'premium') {
$member_ignore_premium = true;
}
}
}
// if membership fields are blocked, and if membership billing for candidates is YES
// and membership not acive
// (The membership fields are blocked when JB_MEMBER_FIELD_SWITCH=='YES')
//
if (!$member_ignore_premium && JB_ONLINE_APP_SIGN_IN == 'YES' && JB_CANDIDATE_MEMBERSHIP_ENABLED == 'YES' && !JB_is_candidate_membership_active($_SESSION['JB_ID'])) {
$label['app_member_only'] = str_replace('%MEMBERSHIP_URL%', JB_BASE_HTTP_PATH . JB_CANDIDATE_FOLDER . 'membership.php', $label['app_member_only']);
$JBMarkup->ok_msg($label['app_member_only']);
} else {
$app_name = stripslashes($app_name);
$app_email = stripslashes($app_email);
$app_subject = stripslashes($app_subject);
$app_letter = stripslashes($app_letter);
if (file_exists(JB_THEME_PATH . 'application-form.php')) {
require JB_THEME_PATH . 'application-form.php';
} else {
require JB_DEFAULT_THEME_PATH . 'application-form.php';
}
}
JBPLUG_do_callback('app_form_after', $A = false);
}