Ejemplo n.º 1
0
 function JBDynamicForm($form_id)
 {
     if (!is_numeric($form_id)) {
         die('JBDynamicForm class - invalid form id passed');
     }
     $this->form_id = $form_id;
     static $markup_appended = array();
     // Who is viewing this form?
     if (isset($_SESSION['JB_ID'])) {
         $this->viewer_id = $_SESSION['JB_ID'];
     }
     if (isset($_SESSION['JB_ID'])) {
         $this->viewer_type = $_SESSION['JB_Domain'];
     }
     switch ($form_id) {
         case 1:
             if (!function_exists('JB_post_tag_to_field_id_init')) {
                 require_once JB_basedirpath() . 'include/posts.inc.php';
             }
             $this->tag_to_field_id = JB_post_tag_to_field_id_init();
             break;
         case 2:
             if (!function_exists('JB_resume_tag_to_field_id_init')) {
                 require_once JB_basedirpath() . 'include/resumes.inc.php';
             }
             $this->tag_to_field_id = JB_resume_tag_to_field_id_init();
             break;
         case 3:
             if (!function_exists('JB_profile_tag_to_field_id_init')) {
                 require_once JB_basedirpath() . 'include/profiles.inc.php';
             }
             $this->tag_to_field_id = JB_profile_tag_to_field_id_init();
             break;
         case 4:
             if (!function_exists('JB_tag_to_field_id_init_emp')) {
                 require_once JB_basedirpath() . 'include/employers.inc.php';
             }
             $this->tag_to_field_id = JB_tag_to_field_id_init_emp();
             break;
         case 5:
             if (!function_exists('JB_tag_to_field_id_init_candidate')) {
                 require_once JB_basedirpath() . 'include/candidates.inc.php';
             }
             $this->tag_to_field_id = JB_tag_to_field_id_init_candidate();
             break;
         default:
             // can be used for adding other forms types by plugins
             JBPLUG_do_callback('custom_tag_to_field_id', $this->tag_to_field_id);
             break;
     }
     if (!isset($markup_appended[$form_id])) {
         $this->append_extra_markup();
         $markup_appended[$form_id] = true;
     }
 }
Ejemplo n.º 2
0
<h3>Automation Instructions:</h3><br>
This feature is set to run automatically every hour. Please <a href='cron.php'>see here</a> for more details.<br>

<br>Run Manually form Web:<input type="button" value="Queue Emails" onclick="window.location='<?php 
    echo htmlentities($_SERVER['PHP_SELF']);
    ?>
?send_action=send&amp;from_admin=1' " >
<p>
<?php 
    if (!isset($_REQUEST['send_action'])) {
        return;
    } else {
        $DO_SEND = "YES";
    }
}
$tag_to_field_id = JB_post_tag_to_field_id_init();
if (JB_JOB_ALERTS_ACTIVE_DAYS == 'JB_JOB_ALERTS_ACTIVE_DAYS') {
    $JB_JOB_ALERTS_ACTIVE_DAYS = 1;
} else {
    $JB_JOB_ALERTS_ACTIVE_DAYS = JB_JOB_ALERTS_ACTIVE_DAYS;
}
$now = gmdate("Y-m-d H:i:s");
$sql = "SELECT alert_email, Email, FirstName, LastName, alert_keywords, alert_query, Password, ID, alert_last_run, lang  FROM `users` WHERE `Notification1`='1' AND `Validated`=1 AND DATE_SUB('{$now}', INTERVAL '" . jb_escape_sql(JB_JOB_ALERTS_DAYS) . "' DAY) > alert_last_run AND last_request_time > DATE_SUB('{$now}', INTERVAL '" . jb_escape_sql($JB_JOB_ALERTS_ACTIVE_DAYS) . "' DAY) ";
//$sql = "SELECT * FROM `users` limit 1"; // for testing
//$VERBOSE='YES';
$result = JB_mysql_query($sql) or die(mysql_error());
$no_rows = mysql_num_rows($result);
if ($VERBOSE == 'YES') {
    echo "Email Debug:{$no_rows} users to email";
}
$count = 0;