Пример #1
0
    $result = jb_mysql_query($sql);
    $not_approved = @array_pop(@mysql_fetch_array($result, MYSQL_ASSOC));
    $sql = "SELECT count(*) FROM `resumes_table`";
    $result = jb_mysql_query($sql);
    $resume = @array_pop(mysql_fetch_array($result, MYSQL_ASSOC));
    $sql = "SELECT count(*) FROM `subscription_invoices` where status='Confirmed' ";
    $result = jb_mysql_query($sql);
    $subscr = @array_pop(mysql_fetch_array($result, MYSQL_ASSOC));
    $sql = "SELECT count(*) FROM `package_invoices` where status='Confirmed'";
    $result = jb_mysql_query($sql);
    $packages = @array_pop(mysql_fetch_array($result, MYSQL_ASSOC));
    ?>

	<p align="left"><h3>Main Summary</h3></p>
	<font size='1'>Current Local Time: <?php 
    echo JB_get_local_time(gmdate("Y-m-d H:i:s"));
    ?>
</font>
	<table  width="80%" border="0" cellpadding="5" style="border-collapse: collapse" >
	<tr>
	<td style="border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px;" bgcolor="#FFFFCC"><?php 
    echo $users;
    ?>
</td>
	<td style="border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px;" bgcolor="#FFFFCC">
	<a href="candidates.php">Candidate 
	Accounts</a> (<?php 
    echo $users_online;
    ?>
 Currently Online<?php 
    if ($employers > 0) {
Пример #2
0
        ?>
</a><?php 
        echo '<small>(u:' . JB_escape_html($row2['Username']) . ')</small>';
        ?>
</font></td>
	
			<td><font face="Arial" size="2"><?php 
        echo $row['item_name'];
        ?>
</font></td>
			<td><font face="Arial" size="1"><?php 
        echo JB_get_local_time($row['S_DATE']);
        ?>
</font></td>
			<td><font face="Arial" size="1"><?php 
        echo JB_get_local_time($row['subscr_end']);
        echo " ({$days_elapsed} / {$days} days)";
        ?>
</font></td>
			<td><font face="Arial" size="2"><?php 
        echo $row['status'];
        if ($row['status'] == 'Completed') {
            $time = strtotime($row['invoice_date'] . " +0000");
            $time = $time + 60 * 60 * 24;
            // plus 1 day
            preg_match("#(\\d+)-(\\d+)-(\\d+)#", $row['invoice_date'], $m);
            echo '<sup><a href="transactions.php?from_day=' . $m[3] . '&from_month=' . $m[2] . '&from_year=' . $m[1] . '&to_day=' . gmdate('d', $time) . '&to_month=' . gmdate('m', $time) . '&to_year=' . gmdate('Y', $time) . '">?<a></sup>';
        }
        ?>
			<?php 
        if ($row['status'] == 'in_cart') {
Пример #3
0
function JB_display_post_list(&$posts, $lm)
{
    global $JobListAttributes;
    global $list_mode;
    $list_mode = $lm;
    global $post_count;
    global $post_id;
    global $label;
    global $column_list;
    // - this is initialized in lists.inc.php using the JB_echo_list_head_data() function
    global $column_info;
    // - same as above
    $PLM =& JB_get_PostListMarkupObject();
    // load the ListMarkup Class
    $PLM->set_list_mode($lm);
    if (func_num_args() > 2) {
        // what kind of posts to show
        $show = func_get_arg(2);
        $_REQUEST['show'] = $show;
    }
    $PLM->set_show($show);
    $JobListAttributes = new JobListAttributes($list_mode, $show);
    $JobListAttributes->set_list_mode($lm);
    if ($list_mode == 'ADMIN') {
        $admin = true;
    }
    if ($list_mode == "BY_CATEGORY_ADMIN") {
        $list_mode = "ADMIN";
    }
    if ($list_mode == 'ADMIN' || $list_mode == 'SAVED' || $list_mode == 'EMPLOYER') {
        $PLM->open_form($JobListAttributes);
    }
    if ($list_mode == 'PREMIUM') {
        if (JB_PREMIUM_POSTS_LIMIT == 'YES') {
            $pp_page = JB_PREMIUM_POSTS_PER_PAGE;
        } else {
            $pp_page = 200;
        }
    } elseif ($list_mode == 'EMPLOYER') {
        if (defined('JB_MANAGER_POSTS_PER_PAGE')) {
            $pp_page = JB_MANAGER_POSTS_PER_PAGE;
        } else {
            $pp_page = 20;
        }
    } else {
        $pp_page = JB_POSTS_PER_PAGE;
    }
    if ($list_mode != 'PREMIUM') {
        JB_nav_pages($result, $q_string, $pp_page);
    }
    $css_id = $PLM->get_list_css_id();
    $PLM->list_start($css_id);
    ################
    # Generate output for the head <tr> row of the table
    # Dynamic columns are generated by Jb_echo_list_head_data() in lists.inc.php and
    # placed in the $head_data variable
    # The $head_data is cached, otherwise if conditions are used
    # to generate the output for the <td> parts
    $COLSPAN = '';
    // How many columns? (the hits column does not count here...)
    ob_start();
    // buffer the output, so that we can calculate the colspan.
    $COLSPAN = JB_echo_list_head_data(1, $admin);
    $list_head_data = ob_get_contents();
    ob_end_clean();
    JBPLUG_do_callback('job_list_set_colspan', $COLSPAN);
    // set the colspan value
    $PLM->set_colspan($COLSPAN);
    if ($list_mode == 'SAVED') {
        $PLM->saved_list_controls();
    } elseif ($list_mode == 'ADMIN') {
        $PLM->admin_list_controls();
    } elseif ($list_mode == 'EMPLOYER') {
        $PLM->employer_list_controls();
    }
    JBPLUG_do_callback('job_list_controls', $PLM);
    // plugins can render any undefined list controls
    #######################################
    # Open the list heading section
    $PLM->list_head_open();
    if ($list_mode == 'ADMIN') {
        $PLM->list_head_admin_action();
        JBPLUG_do_callback('job_list_head_admin_action', $A = false);
        // plugin for addition action column
    } elseif ($list_mode == 'EMPLOYER') {
        $PLM->list_head_employer_action();
    } elseif ($list_mode == 'SAVED') {
        $PLM->list_head_saved_action();
    }
    JBPLUG_do_callback('joblist_list_head_action', $PLM);
    ########################################################################
    echo $list_head_data;
    // output the header columns that were buffered before.
    ########################################################################
    if ($list_mode == 'EMPLOYER') {
        // Here we make sure that the 'views' and 'applications' columns
        // appear in manager.php, regardless how the list is configured.
        $PLM->list_head_employer_extras();
        JBPLUG_do_callback('job_list_head_employer_extra_col', $A = false);
        // plugin for the additional columns seen by the employer's Application manager
    }
    if ($list_mode == 'PREMIUM' && JB_SHOW_PREMIUM_HITS == 'YES') {
        $PLM->list_head_premium_extras();
    }
    ######################################
    # Close the list heading section
    $PLM->list_head_close();
    $i = 0;
    $current_day = JB_get_local_time(gmdate("r"));
    // local time form GMT
    # Output the data rows
    JBPLUG_do_callback('job_list_pre_fill', $i, $list_mode);
    //A plugin can list its own records before, and adjust the $i
    // init a week ago from first post
    while (($row = mysql_fetch_array($posts, MYSQL_ASSOC)) && $i < $pp_page) {
        $PLM->set_values($row);
        JBPLUG_do_callback('job_list_set_data', $row, $i, $list_mode);
        // A plugin can modify the prams
        $i++;
        $post_id = $row['post_id'];
        $POST_MODE = $row['post_mode'];
        $class_name = $PLM->get_item_class_name($POST_MODE);
        $class_postfix = $PLM->get_item_class_postfix($POST_MODE);
        //$DATE_TIME = JB_get_local_time($row['post_date']." GMT");
        # display day of week
        if ($list_mode == 'ALL' && JB_POSTS_SHOW_DAYS_ELAPSED == "YES" || $list_mode == 'PREMIUM' && JB_P_POSTS_SHOW_DAYS_ELAPSED == "YES") {
            $DATE_TIME = JB_get_local_time($row['post_date'] . " GMT");
            # display day of week
            if ($list_mode == 'ALL' && JB_POSTS_SHOW_DAYS_ELAPSED == "YES" || $list_mode == 'PREMIUM' && JB_P_POSTS_SHOW_DAYS_ELAPSED == "YES") {
                $day_and_week = JB_get_day_and_week($row['post_date']);
                if ($day_and_week !== $prev_day_and_week) {
                    // new day?
                    if ($day_and_week != '') {
                        $PLM->list_day_of_week($day_and_week, $class_postfix);
                    }
                }
                $prev_day_and_week = $day_and_week;
            }
        }
        ########################################
        # Open the list data items
        $PLM->list_item_open($POST_MODE, $class_name);
        # Action cells
        # Here the action buttons are displayed, eg. 'Delete', 'Approve', checkboxes to select, etc
        if ($list_mode == 'ADMIN') {
            $PLM->list_data_admin_action($class_postfix, $row['post_mode']);
            JBPLUG_do_callback('job_list_data_admin_action', $A = false);
            // plugin for the additional controls for the Admin
        } elseif ($list_mode == 'SAVED') {
            $PLM->list_data_saved_action();
        } elseif ($list_mode == 'EMPLOYER') {
            // EMPLOYER MODE ONLY!
            $PLM->list_data_employer_action($class_postfix, $row['post_mode']);
            JBPLUG_do_callback('job_list_data_employer_buttons', $A = false);
            // plugin for the additional controls for the Admin
        }
        JBPLUG_do_callback('joblist_list_data_user_action', $A = false);
        ########################################################################
        JB_echo_job_list_data($admin);
        // display the data cells
        ########################################################################
        if ($list_mode == 'EMPLOYER') {
            // displayed on manager.php
            $app_count = $row['applications'];
            // change the app_count in to a link
            if ($app_count > 0) {
                $app_count = $PLM->get_emp_app_link('app.php?post_id=' . $row['post_id'], $app_count);
            }
            $PLM->list_data_employer_extras($app_count);
            JBPLUG_do_callback('job_list_data_employer_extra_col', $A = false);
            // plugin for the additional fields seen by the employer's Application manager
        }
        if ($list_mode == 'PREMIUM' && JB_SHOW_PREMIUM_HITS == 'YES') {
            $PLM->list_data_premium_extras();
        }
        $PLM->list_item_close();
    }
    ############ end while()
    JBPLUG_do_callback('job_list_back_fill', $i, $list_mode);
    // A plugin can list its own records after
    $PLM->list_end();
    if ($list_mode == 'ADMIN' || $list_mode == 'SAVED' || $list_mode == 'EMPLOYER') {
        $PLM->close_form();
    }
    if ($list_mode == 'PREMIUM') {
        if (JB_PREMIUM_POSTS_LIMIT == 'YES') {
            JB_nav_pages($result, $q_string, $pp_page);
        }
    } else {
        JB_nav_pages($result, $q_string, $pp_page);
    }
}
Пример #4
0
 echo $label["emp_app_title"];
 $ALM->list_head_cell_close();
 $ALM->list_head_cell_open();
 echo $label["emp_app_name"];
 $ALM->list_head_cell_close();
 $ALM->list_head_cell_open();
 echo $label["emp_app_email"];
 $ALM->list_head_cell_close();
 $ALM->list_head_close();
 while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
     $ALM->set_values($row);
     $i++;
     $ALM->list_item_open('standard');
     $ALM->list_data_employer_action();
     $ALM->list_cell_open();
     echo JB_get_formatted_date(JB_get_local_time($row['app_date']));
     $ALM->list_cell_close();
     $ALM->list_cell_open();
     echo $ALM->get_open_link('apps.php?post_id=' . $row['post_id'], $extra_attr);
     echo JB_escape_html($row['data1']);
     echo $ALM->get_close_link();
     $ALM->list_cell_close();
     $ALM->list_cell_open();
     $sql2 = "SELECT * FROM users where ID='" . jb_escape_sql($row['user_id']) . "'";
     $result2 = JB_mysql_query($sql2) or die(mysql_error());
     $candidate_row = mysql_fetch_array($result2);
     $sql3 = "SELECT * FROM resumes_table where user_id='" . jb_escape_sql($row['user_id']) . "'";
     $result3 = JB_mysql_query($sql3) or die(mysql_error());
     $resume_row = mysql_fetch_array($result3);
     $sql4 = "SELECT * FROM posts_table where post_id='" . jb_escape_sql($row['post_id']) . "'";
     $result4 = JB_mysql_query($sql4) or die(mysql_error());
Пример #5
0
				<td><b><font size="2">Status</b></font></td>
				<td><b><font size="2">Err</b></font></td>
				<td><b><font size="2">Retry</b></font></td>
				<td><b><font size="2">Action</b></font></td>
			</tr>

<?php 
$i = 0;
while (($row = mysql_fetch_array($result, MYSQL_ASSOC)) && $i < $records_per_page) {
    $i++;
    $new_window = "onclick=\"window.open('show_email.php?mail_id=" . $row['mail_id'] . "', '', 'toolbar=no,scrollbars=yes,location=no,statusbar=no,menubar=yes,resizable=1,width=600,height=600,left = 50,top = 50');return false;\"";
    ?>

	<tr bgColor="#ffffff">
		<td><font size="1"><?php 
    echo JB_escape_html(JB_get_local_time($row['mail_date']));
    ?>
</font></td>
		<td><font size="1"><?php 
    echo JB_escape_html($row['template_id']);
    ?>
</font></td>
		<td><font size="1"><?php 
    echo JB_escape_html($row['to_address']);
    ?>
</font></td>
		<td><font size="1"><?php 
    echo JB_escape_html($row['to_name']);
    ?>
</font></td>
		<td><font size="1"><?php 
Пример #6
0
                    break;
                case "Failed":
                    $show_balance = "...";
                    break;
                case "Denied":
                    $show_balance = "...";
                    break;
                default:
                    $show_balance = "...";
            }
            ?>

<tr onmouseover="old_bg=this.getAttribute('bgcolor');this.setAttribute('bgcolor', '#FBFDDB', 0);" onmouseout="this.setAttribute('bgcolor', old_bg, 0);" bgColor="#ffffff">

<td><font face="Arial" size="2"><?php 
            echo JB_get_local_time($row['invoice_date']);
            ?>
</font></td>
<td><font face="Arial" size="2"><a href="#" onclick="
   window.open('invoice.php?invoice_id=<?php 
            echo $row['invoice_id'];
            ?>
&product_type=P', '', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=560,left = 50,top = 50');return false;"> 
   <?php 
            echo "P" . $row['invoice_id'];
            ?>
</a></font></td>
  <td ><font face="Arial" size="2"><a href="employers.php?action=edit&user_id=<?php 
            echo $row['employer_id'];
            ?>
"><?php 
Пример #7
0
}
?>
 </td>
		 </tr>
		 <tr>
		   <td class="dynamic_form_field">Expires</td>
		   <td class="dynamic_form_value" valign="top">
		   
		   <?php 
if ($invoice_row['months_duration'] == '0') {
} elseif (strtotime($invoice_row['member_end']) >= time() + 5) {
    ?>
		   in <?php 
    $t_start = strtotime(JB_get_local_time($invoice_row['member_date']));
    $t_end = strtotime(JB_get_local_time($invoice_row['member_end']));
    $t_now = strtotime(JB_get_local_time(gmdate('Y-m-d H:i:s')));
    $elapsed = $t_now - $t_start;
    $diff = $t_end - $t_start - $elapsed;
    $days = floor($diff / 86400);
    echo $days;
    ?>
 days <input <?php 
    echo $disabled;
    ?>
 type="button" value="+ 1 Month" onclick="if (!confirmLink(this, 'Add 1 month to this membership, are you sure? (Any other changes will be lost)')) return false;window.location='<?php 
    echo htmlentities($_SERVER['PHP_SELF']);
    ?>
?invoice_id=<?php 
    echo $invoice_row['invoice_id'];
    ?>
&add_month=1'"> 
Пример #8
0
function JB_expire_subscription(&$invoice_row, $send_email = true)
{
    $now = gmdate("Y-m-d H:i:s");
    $sql = "UPDATE subscription_invoices SET `status`='Expired', subscr_end='{$now}' WHERE invoice_id='" . JB_escape_sql($invoice_row['invoice_id']) . "' ";
    @JB_mysql_query($sql) or JB_mail_error(mysql_error() . $sql);
    $sql = "UPDATE `employers` SET `can_view_blocked`='N', `subscription_can_view_resume`='N', `subscription_can_post`='N', `subscription_can_premium_post`='N', views_quota=0, posts_quota=0, p_posts_quota=0, quota_timestamp=0 WHERE ID='" . JB_escape_sql($invoice_row['employer_id']) . "' ";
    @JB_mysql_query($sql) or JB_mail_error(mysql_error() . $sql);
    if (JB_EMAIL_SUBSCR_EXP_SWITCH == 'YES' && $send_email) {
        $sql = "Select * from employers WHERE ID='" . JB_escape_sql($invoice_row['employer_id']) . "'";
        $result = JB_mysql_query($sql) or JB_mail_error(mysql_error() . $sql);
        $e_row = mysql_fetch_array($result, MYSQL_ASSOC);
        //$invoice_row = JB_get_subscription_invoice_row ($row['invoice_id']); // reload invoice
        $template_r = JB_get_email_template(130, $e_row['lang']);
        $template = mysql_fetch_array($template_r);
        $msg = $template['EmailText'];
        $from = $template['EmailFromAddress'];
        $from_name = $template['EmailFromName'];
        $subject = $template['EmailSubject'];
        $msg = str_replace("%FNAME%", $e_row['FirstName'], $msg);
        $msg = str_replace("%LNAME%", $e_row['LastName'], $msg);
        $msg = str_replace("%SITE_NAME%", JB_SITE_NAME, $msg);
        $msg = str_replace("%INVOICE_CODE%", "S" . $invoice_row['invoice_id'], $msg);
        $msg = str_replace("%ITEM_NAME%", $invoice_row['item_name'], $msg);
        $msg = str_replace("%SUB_START%", JB_get_formatted_time(JB_get_local_time($invoice_row['subscr_date'])), $msg);
        $msg = str_replace("%SUB_END%", JB_get_formatted_time(JB_get_local_time($invoice_row['subscr_end'])), $msg);
        $msg = str_replace("%SUB_DURATION%", $invoice_row['months_duration'], $msg);
        $msg = str_replace("%INVOICE_AMOUNT%", JB_convert_to_default_currency_formatted($invoice_row['currency_code'], $invoice_row['amount']), $msg);
        $msg = str_replace("%PAYMENT_METHOD%", $invoice_row['payment_method'], $msg);
        $msg = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $msg);
        $msg = str_replace("%SITE_URL%", JB_BASE_HTTP_PATH, $msg);
        $to = $e_row['Email'];
        $to_name = jb_get_formatted_name($e_row['FirstName'], $e_row['LastName']);
        $email_id = JB_queue_mail($to, $to_name, $from, $from_name, $subject, $msg, '', 130);
        JB_process_mail_queue(1, $email_id);
    }
}
Пример #9
0
    function data_cell($field_id)
    {
        switch ($field_id) {
            case 'employer_id':
                $emp_name = JB_get_employer_company_name($this->get_data_value('employer_id'));
                ?>
				<a href="search.php?show_emp=<?php 
                echo $this->get_data_value('employer_id');
                ?>
"><?php 
                echo $this->escape($emp_name);
                ?>
</a>
				<?php 
                break;
            case 'request_date':
                echo JB_trim_date(JB_get_local_time($this->get_data_value('request_date')));
                break;
        }
    }
Пример #10
0
function JB_get_list_template_value($field, $val, $admin, $form_id = 1)
{
    $LM =& JB_get_ListMarkupObject($form_id);
    $Form =& JB_get_DynamicFormObject($form_id);
    // it is assumed that this function is called in 'view' mode
    // the viewer id and type is unknown so null is passed
    if ($Form->process_field_restrictions($field, null, null, $admin)) {
        // Its a restricted field, eg anonymous, blocked or member's only
        return $Form->get_value($field['field_id']);
    }
    switch ($field['field_type']) {
        case 'TIME':
            // convert timestamp to local time zone
            // using the raw value stored in the record
            if ($val != '0000-00-00 00:00:00') {
                $val = JB_get_local_time($Form->get_value($field['field_id']) . ' GMT');
            }
            break;
        case 'EDITOR':
            $val = strip_tags($val);
            $val = jb_escape_html($val);
            if (!$admin) {
                $val = JB_email_at_replace($val);
            }
            break;
        case 'IMAGE':
            if (JB_image_thumb_file_exists($Form->get_value($field['field_id']))) {
                $val = $LM->get_img_html($Form->get_value($field['field_id']));
            }
            break;
        case "CURRENCY":
            if ($val > 0) {
                $val = JB_escape_html(JB_format_currency($Form->get_value($field['field_id']), JB_get_default_currency()));
            } else {
                $val = '';
            }
            break;
        case "CATEGORY":
            $val = jb_escape_html(JB_getCatName($Form->get_value($field['field_id'])));
            break;
        case "RADIO":
            $val = jb_escape_html(JB_getCodeDescription($field['field_id'], $Form->get_value($field['field_id'])));
            break;
        case "SELECT":
            $val = jb_escape_html(JB_getCodeDescription($field['field_id'], $Form->get_value($field['field_id'])));
            break;
        case "MSELECT":
        case "CHECK":
            $vals = explode(",", $Form->get_value($field['field_id']));
            $comma = '';
            $str = '';
            if (sizeof($vals) > 0) {
                foreach ($vals as $v) {
                    $str .= $comma . jb_escape_html(JB_getCodeDescription($field['field_id'], $v));
                    $comma = ", ";
                }
            }
            $val = $str;
            break;
        case "DATE":
        case "DATE_CAL":
            if ($val != '0000-00-00 00:00:00') {
                $val = JB_get_local_time($Form->get_value($field['field_id']) . " GMT");
                $val = JB_get_formatted_date($val);
            } else {
                $val = '';
            }
            break;
        case "SKILL_MATRIX":
            $sql = "SELECT name FROM skill_matrix_data where object_id='" . JB_escape_sql($Form->get_value('resume_id')) . "' ";
            $result = JB_mysql_query($sql) or die(mysql_error());
            $val = '';
            $comma = '';
            while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                $val .= $comma . $row['name'];
                $comma = ", ";
            }
            break;
        default:
            // plugins can alter the data in the cell to be
            // be presented on the list in a custom manner
            $args = array('val' => &$val, 'has_changed' => false, 'field' => &$field, 'form_id' => $form_id, 'data' => $Form->get_values());
            JBPLUG_do_callback('get_list_template_value', $args);
            // This hook was added in 3.6, allows plugins to modify the cell data based on $field, eg. $field['field_type'], the plugin should set 'has_changed' to true if the data in 'val' was changed.
            if ($args['has_changed']) {
                // has it changed?
                return $val;
            }
            // if not modified by plugin
            $val = jb_escape_html($val);
            if (!$admin) {
                $val = JB_email_at_replace($val);
            }
    }
    return $val;
}
Пример #11
0
        ?>
</b></td><td><?php 
        echo JB_escape_html($email_letter);
        ?>
</td></tr>

		</table>

		<?php 
        $success = 1;
    }
}
if ($success != 1) {
    if ($email_subject == '') {
        $email_subject = $label['em_email_subject'];
        $DATE = JB_get_local_time(date('r'));
        $DATE = JB_get_formatted_date($DATE);
        $email_subject = str_replace("%DATE%", $DATE, $email_subject);
        $email_subject = str_replace("%TITLE%", $TITLE, $email_subject);
        $email_subject = str_replace("%SITE_NAME%", JB_SITE_NAME, $email_subject);
    }
    if ($_REQUEST['step'] != '') {
        // seed the form with pre-popluated data.
        $c_email = $CANDIDATE_EMAIL;
        //$user_row[Email];
        $c_name = $CANDIDATE_NAME;
        if ($c_name == '') {
            $c_name = jb_get_formatted_name($user_row['FirstName'], $user_row['LastName']);
        }
    }
    JB_template_employer_email_form($post_id, $c_name, $c_email, $email_subject, $email_letter);
Пример #12
0
	<td><b><font face="Arial" size="2">Referer [sic]</font></b></td>
         
  </tr>

  <?php 
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    ?>

	   <tr onmouseover="old_bg=this.getAttribute('bgcolor');this.setAttribute('bgcolor', '#FBFDDB', 0);" onmouseout="this.setAttribute('bgcolor', old_bg, 0);" bgColor="#ffffff">

<td><font face="Arial" size="2"><?php 
    echo JB_escape_html($row['session_id']);
    ?>
</font></td>
<td><font face="Arial" size="2"><?php 
    echo JB_get_local_time($row['last_request_time']);
    ?>
</font></td>
<td><font face="Arial" size="2"><?php 
    echo $row['domain'];
    ?>
</font></td>
<td><font face="Arial" size="2"><?php 
    echo $row['id'];
    ?>
</font></td>
<td><font face="Arial" size="2"><?php 
    echo JB_escape_html($row['remote_addr']);
    ?>
</font></td>
<td><font face="Arial" size="2"><?php 
Пример #13
0
        ?>
</font></td>
	
			<td><font face="Arial" size="2"><?php 
        echo $row['item_name'];
        ?>
</font></td>
			<td><font face="Arial" size="1"><?php 
        echo JB_get_local_time($row['S_DATE']);
        ?>
</font></td>
			<td><font face="Arial" size="1"><?php 
        if ($row['months_duration'] == 0) {
            echo 'Never';
        } else {
            echo JB_get_local_time($row['member_end']);
            echo " ({$days} days)";
        }
        ?>
</font></td>
			<td><font face="Arial" size="2"><?php 
        echo $row['status'];
        if ($row['status'] == 'Completed') {
            $time = strtotime($row['invoice_date'] . " +0000");
            $time = $time + 60 * 60 * 24;
            // plus 1 day
            preg_match("#(\\d+)-(\\d+)-(\\d+)#", $row['invoice_date'], $m);
            echo '<sup><a href="transactions.php?from_day=' . $m[3] . '&from_month=' . $m[2] . '&from_year=' . $m[1] . '&to_day=' . gmdate('d', $time) . '&to_month=' . gmdate('m', $time) . '&to_year=' . gmdate('Y', $time) . '">?<a></sup>';
        }
        ?>
			<?php 
Пример #14
0
function JB_complete_membership_invoice($invoice_id, $payment_method)
{
    global $label;
    $now = gmdate("Y-m-d H:i:s");
    // qwerty
    if ($payment_method == '') {
        $payment_method = $invoice_row['payment_method'];
    }
    $invoice_row = JB_get_membership_invoice_row($invoice_id);
    if ($payment_method == '') {
        $payment_method = $invoice_row['payment_method'];
    }
    if ($invoice_row['status'] == 'Confirmed' || $invoice_row['status'] == 'Pending') {
        if ($invoice_row['reason'] != 'jb_credit_advanced') {
            // bank and check modules have the option to advance membership before payment is received. If the credit was given in advance, then this invoice would have a jb_payment_deferred status
            JB_start_membership($invoice_row);
        }
        $sql = "UPDATE membership_invoices SET `status`='Completed', `payment_method`='" . jb_escape_sql($payment_method) . "', `processed_date`='{$now}' WHERE invoice_id='" . jb_escape_sql($invoice_id) . "'";
        $result = JB_mysql_query($sql) or JB_mail_error("[{$sql}]" . mysql_error());
        if (JB_EMAIL_ORDER_COMPLETED_SWITCH == 'YES') {
            // send conformation.
            // get the user's record to send to
            if ($invoice_row['user_type'] == 'C') {
                // user's membership?
                $sql = "Select * from users WHERE ID='" . jb_escape_sql($invoice_row['user_id']) . "'";
            } else {
                $sql = "Select * from employers WHERE ID='" . jb_escape_sql($invoice_row['user_id']) . "'";
            }
            $result = JB_mysql_query($sql) or die(mysql_error());
            $e_row = mysql_fetch_array($result, MYSQL_ASSOC);
            $invoice_row = JB_get_membership_invoice_row($invoice_id);
            // reload invoice
            $template_r = JB_get_email_template(110, $e_row['lang']);
            $template = mysql_fetch_array($template_r);
            $msg = $template['EmailText'];
            $from = $template['EmailFromAddress'];
            $from_name = $template['EmailFromName'];
            $subject = $template['EmailSubject'];
            $msg = str_replace("%FNAME%", $e_row['FirstName'], $msg);
            $msg = str_replace("%LNAME%", $e_row['LastName'], $msg);
            $msg = str_replace("%SITE_NAME%", JB_SITE_NAME, $msg);
            $msg = str_replace("%INVOICE_CODE%", "M" . $invoice_row['invoice_id'], $msg);
            $msg = str_replace("%ITEM_NAME%", $invoice_row['item_name'], $msg);
            $msg = str_replace("%MEM_START%", JB_get_formatted_time(JB_get_local_time($invoice_row['member_date'])), $msg);
            if ($invoice_row['months_duration'] == '0') {
                $invoice_row['member_end'] = $label['member_not_expire'];
                $invoice_row['months_duration'] = $label['member_not_expire'];
            }
            $msg = str_replace("%MEM_END%", JB_get_formatted_time($invoice_row['member_end']), $msg);
            $msg = str_replace("%MEM_DURATION%", $invoice_row['months_duration'], $msg);
            $msg = str_replace("%INVOICE_AMOUNT%", JB_convert_to_default_currency_formatted($invoice_row['currency_code'], $invoice_row['amount']), $msg);
            $msg = str_replace("%PAYMENT_METHOD%", $payment_method, $msg);
            $msg = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $msg);
            $msg = str_replace("%SITE_URL%", JB_BASE_HTTP_PATH, $msg);
            preg_match('#%INVOICE_TAX=\\[(.+?)\\]%#', $msg, $m);
            $tax_rate = $m[1];
            $invoice_tax = $invoice_row['amount'] - $invoice_row['amount'] / (1.0 + $tax_rate);
            $invoice_tax = JB_convert_to_default_currency_formatted($invoice_row['currency_code'], $invoice_tax);
            $msg = str_replace($m[0], $invoice_tax, $msg);
            $to = $e_row['Email'];
            $to_name = JB_get_formatted_name($e_row['FirstName'], $e_row['LastName']);
            $email_id = JB_queue_mail($to, $to_name, $from, $from_name, $subject, $msg, '', 110);
            JB_process_mail_queue(1, $email_id);
        }
    }
}
Пример #15
0
 function get_template_value($tmpl, $admin = false, $raw = false)
 {
     $val = '';
     $field_id = $this->tag_to_field_id[$tmpl]['field_id'];
     if (!isset($this->data[$field_id])) {
         $this->data[$field_id] = '';
     }
     if ($raw) {
         // return without any post-processing
         return $this->data[$field_id];
     }
     /* Hook here for your plugin to bypass this function
      * Tip: Your plugin can use $this object like this: 
      * $obj = JB_get_DynamicFormObject($form_id)
      * $field_id = $this->tag_to_field_id[$tmpl]['field_id'];
      * ...
      */
     $val = false;
     JBPLUG_do_callback('get_template_value', $val, $this->form_id, $tmpl, $admin);
     if ($val !== false) {
         return $val;
     }
     if ($this->process_field_restrictions($tmpl, $this->viewer_id, $this->viewer_type, $admin)) {
         // Its a restricted field, eg anonymous, blocked or member's only
         return $this->data[$field_id];
     }
     // it is assumed that this function is called in 'view' mode
     /*if (JB_process_field_restrictions($this->data, $this->tag_to_field_id[$tmpl], 'view', $admin)) {
     			// Its a restricted field, eg anonymous, blocked or member's only
     			return $this->data[$field_id]; 
     		} */
     switch ($this->tag_to_field_id[$tmpl]['field_type']) {
         case "URL":
             $val = $this->data[$field_id];
             if (strlen($val) > 0) {
                 if (strpos($val, 'http://') === false && strpos($val, 'https://') === false) {
                     $val = 'http://' . $val;
                 }
                 $val = JB_escape_html($val);
                 // no html allowed in this field
             }
             break;
         case "IMAGE":
             if (!JB_image_thumb_file_exists($this->data[$field_id])) {
                 $val = $label['employer_resume_list_no_image'];
             } else {
                 $val = $this->data[$field_id];
             }
             break;
         case "NUMERIC":
         case "INTEGER":
             $val = jb_escape_html($this->data[$field_id]);
             // no html allowed in this field
             break;
         case "CURRENCY":
             if ($val > 0) {
                 $val = JB_escape_html(JB_format_currency($this->data[$field_id], JB_get_default_currency()));
             } else {
                 $val = '';
             }
             break;
         case "CATEGORY":
             $val = jb_escape_html(JB_getCatName($this->data[$field_id]));
             break;
         case "RADIO":
             $val = jb_escape_html(JB_getCodeDescription($field_id, $this->data[$field_id]));
             break;
         case "SELECT":
             $val = jb_escape_html(JB_getCodeDescription($field_id, $this->data[$field_id]));
             break;
         case "MSELECT":
         case "CHECK":
             $vals = explode(",", $this->data[$field_id]);
             $comma = '';
             $str = '';
             if (sizeof($vals) > 0) {
                 foreach ($vals as $v) {
                     $str .= $comma . jb_escape_html(JB_getCodeDescription($field_id, $v));
                     $comma = ", ";
                 }
             }
             $val = $str;
             break;
         case "TIME":
             if ($this->data[$field_id] != '0000-00-00 00:00:00') {
                 // convert the time to a local time zone
                 $val = JB_get_local_time($this->data[$field_id] . " GMT");
             }
             break;
         case "DATE":
         case "DATE_CAL":
             if ($this->data[$field_id] != '0000-00-00 00:00:00') {
                 $val = JB_get_local_time($this->data[$field_id] . " GMT");
                 $val = JB_get_formatted_date($val);
             } else {
                 $val = '';
             }
             break;
         case "SKILL_MATRIX":
             $sql = "SELECT name FROM skill_matrix_data where object_id='" . JB_escape_sql($this->data['resume_id']) . "' ";
             $result = JB_mysql_query($sql) or die(mysql_error());
             $val = '';
             $comma = '';
             while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                 $val .= $comma . $row['name'];
                 $comma = ", ";
             }
             break;
         case "TIME":
             // time is used for post_date, resume_date, signup_date, profile_date, etc..
             $val = JB_get_local_time($this->data[$field_id] . " GMT");
             // the time is always stored as GMT
             break;
         case 'TEXTAREA':
         case "TEXT":
             $val = JB_escape_html($this->data[$field_id]);
             // no html allowed in this field
             break;
         case "EDITOR":
             // HTML is allowed for this field
             //assuming that input was sanitized and only allowed HTML is included
             $val = $this->data[$field_id];
             break;
         case 'GMAP':
             $val = 'lat:' . $this->data[$field_id . '_lat'] . '/lng:' . $this->data[$field_id . '_lng'];
             break;
         default:
             $val = false;
             // A plugin can filter the $val value to be returned
             JBPLUG_do_callback('get_template_value_filter', $val, $this->tag_to_field_id[$tmpl]['field_type']);
             if ($val !== false) {
                 return $val;
             } else {
                 // $val is empty which means that it wasn't set by a plugin
                 // escape HTML just in case.
                 $val = JB_escape_html($this->data[$field_id]);
                 // no html allowed in this field
             }
             break;
     }
     if ($field_id == '') {
         //echo '<b>Configuration error: Failed to bind the "'.$tmpl.'" Template Tag. (not defined)</b> <br> ';
     }
     return $val;
 }