Jamit Software Forum
Welcome, Guest. Please login or register.
March 05, 2021, 12:46:02 am

Login with username, password and session length
Search:     Advanced search
May 5th, 2010 - Jamit Software Launches the Market!
3,080 Posts in 791 Topics by 1,736,896 Members
Latest Member: Yespaschunc
* Home Help Search Login Register
+  Jamit Software Forum
|-+  Jamit Job Board Customers
| |-+  Developers
| | |-+  Trying to modify a new home page - code help please - get rid of search page
« previous next »
Pages: [1] Print
Author Topic: Trying to modify a new home page - code help please - get rid of search page  (Read 3675 times)
wilburforce
Jammers
Newbie
*
Posts: 9


« on: March 15, 2010, 07:54:36 pm »

What I would like to do is list resume's not jobs. So i have taken index-home.php and removed some code and added the employer/search page "as it shows the resume's" if you take the code below and save it as index-home.php you will see the errors on line 107, and the search box (i don't want to see) or visit test page:  http://www.darciefox.co.uk/member/

I do not want to see a search box at all but have no idea how to get rid of it, Im not a developer and have no idea what to do after three hours of trying, so any help would be appreciated.


code...

<div class="homemod2">               
      <?php
$order_by = $_REQUEST['order_by'];
$offset = $_REQUEST['offset'];
$views_stat_label = '';

$CAN_VIEW_RESUMES = false;

if (JB_SUBSCRIPTION_FEE_ENABLED=='NO') { // free resume access?

   $CAN_VIEW_RESUMES = true;
   if (JB_EM_NEEDS_ACTIVATION=='NO_RESUME') { // Must be validated to view resumes? employers who are not validated cannot view resumes
      
      $sql = "SELECT * from employers where ID='".jb_escape_sql($_SESSION['JB_ID'])."'";
      $result = JB_mysql_query($sql) or die(mysql_error());
      $row = mysql_fetch_array($result);
      if ($row['Validated']=='1') {
         $CAN_VIEW_RESUMES = true;
      } else {
         
         $CAN_VIEW_RESUMES = false;
         $NOT_VALIDATED = true;
      }

   } elseif (JB_EM_NEEDS_ACTIVATION=='FIRST_POST') { // must post a job before viewing the resumes for free?
      $sql = "SELECT post_id from posts_table where user_id='".jb_escape_sql($_SESSION['JB_ID'])."'";
      
      $result = JB_mysql_query($sql) or die(mysql_error());
      if (mysql_num_rows($result)>0) {
         $CAN_VIEW_RESUMES = true;

      } else {
         $NOT_VALIDATED = false; // not validated until they can post
         $CAN_VIEW_RESUMES = false;
         $FIRST_POST = true;

      }

   }
   

} else { // subscriptions enabled

   // check if subscription is active

   $subscr_row = jb_get_active_subscription_invoice($_SESSION['JB_ID']);

   if ($subscr_row['can_view_resumes']) { // active subscription
      
      // - V_QUOTA is the views_quota column from `employers` table
      // - If ($_REQUEST['resume_id']==true) then it means that user clicked to view the resume.

      if (($subscr_row['V_QUOTA']>-1) && ($_REQUEST['resume_id']==true)) { // is a quota imposed?

         $inc_success = JB_increment_views_tally($_SESSION['JB_ID']);
         
         if ($inc_success==false) { // inc $inc_success is false which means we are over quota
            $CAN_VIEW_RESUMES = false;
            
            $OVER_QUOTA = true;
         } else { // There is quota remaining
            $CAN_VIEW_RESUMES = true;
            $views_stat_label =  $label['employer_resume_view_stat'];
            
            $views_stat_label = str_replace("%TALLY%", $subscr_row['views_quota_tally']+1, $views_stat_label);
            $views_stat_label = str_replace("%QUOTA%", $subscr_row['V_QUOTA'], $views_stat_label);
         }
      } else { // views_quota is either -1 or not viewing the resume
         $CAN_VIEW_RESUMES = true; // no quota
      }
   } else {
      // special situations for when the user is not subscribed.
      // but is still can view resumes
      
      $CAN_VIEW_RESUMES = JB_is_privileged_user($_SESSION['JB_ID'], 'resume');
      
      if (JB_FIELD_BLOCK_SWITCH=="YES") {
         $CAN_VIEW_RESUMES = true; // Can view but some fields will be blocked
      }
      
   }


}

if ((JB_ONLINE_APP_REVEAL_RESUME=='YES') && ($key_test_passed)) {
   // allow access to only this resume, even if this user is not
   // subscribed...
   // (A special key was passed and validated which gives access)
   $CAN_VIEW_RESUMES = true;
}



#########################################



if ($CAN_VIEW_RESUMES == true) { // has a subscription to view resumes, or if no subscription is allowed to view resumes

   JB_display_dynamic_search_form (2);

   // Display Category tree code
   // do we have a CATEGORY type field? (field_type)


   foreach ($resume_tag_to_field_id as $field) {

      // If it does have a CATEGORY, display the category tree and
      // break out from the loop
      if (($field['field_type']=='CATEGORY') && ($_REQUEST['action']!='search') && ($_REQUEST['resume_id']==false)) {
   
         ?>
   <?php


         $categories = JB_getCatStruct($_REQUEST['cat'], $_SESSION["LANG"], 2);
         JB_display_categories($categories, JB_CAT_COLS);
         break;
      }
   
   }



   ?>
  <?php

   echo $views_stat_label; // If views_quota is > 0 then this will print something like: 1 / 10

   ##############################################\
   $is_blocked = 'N';
   switch (JB_FIELD_BLOCK_SWITCH) {

      case 'YES':
         $subscr_block_status = JB_get_employer_view_block_status($_SESSION['JB_ID']);
         if ($key_test_passed && (JB_FIELD_BLOCK_APP_SWITCH!='YES')) { // if viewing from an email or application list
            $subscr_block_status = 'Y';
         }
         if (($subscr_block_status=='N') && (JB_SUBSCRIPTION_FEE_ENABLED=='YES')) {
            echo "<p>".$label["resume_some_fields_blocked"]."</p>";
            echo JB_get_special_offer_msg();
            $is_blocked = 'Y';
         }
         break;
      case 'NO':
         break;

   }
   $REQUEST_FEATURE == false;

   switch (JB_RESUME_REQUEST_SWITCH) {
      
      case 'YES':

         //
         if ((JB_NEED_SUBSCR_FOR_REQUEST=='YES') ) {
            $subscr_status = JB_get_employer_subscription_status($_SESSION['JB_ID']);
            if ($subscr_status=='Active') {
               $REQUEST_FEATURE = true;
            } else {
               $REQUEST_FEATURE = false;
            }
         } else {      
            $REQUEST_FEATURE = true;
         }
         
         break;
      case 'NO':
         $REQUEST_FEATURE = false;
         break;

   }

   if ($_REQUEST['action'] == 'search') {
            
         $q_string = JB_generate_q_string(2);
   }

   /*


   Display the resume


   */

   if ($_REQUEST['resume_id']!= '') {

      ?>
  <?php

      
         
      $mode = "view";
      $sql = "UPDATE `resumes_table` set hits=hits+1 where `resume_id`='".jb_escape_sql($_REQUEST['resume_id'])."'";
      JB_mysql_query($sql) or die(mysql_error().$sql);

      $prams = JB_load_resume_values ($_REQUEST['resume_id']);

      if ($prams['status']!=='ACT') {

         echo "<p class='error_msg_label'>".$label['employer_resume_desctive']."</p>";


      } else {


         if (($is_blocked=='N') && ($key=='') && (JB_FIELD_BLOCK_SWITCH=='NO') && (JB_RESUME_REPLY_ENABLED=='YES') && (($prams['anon']!='Y') || ((JB_is_request_granted($prams['user_id'], $_SESSION['JB_ID'])))) ) {
         ?>

   <input type="button" name="apply"  onclick="showDIV(document.getElementById('app_form'), true); this.disabled=true;" class="form_apply_button" value="<?php echo $label['employer_search_send_email']; ?>"><p>
         <span id="app_form">
         </span>
         <span id="app_form_blank" >
         </span>
         <span id="app_form_tmp" style="display: none">
          <iframe width="100%" height="380" frameborder=0 MARGINWIDTH=0 MARGINheight=0 VSPACE=0 HSPACE=0  src="<?php echo JB_BASE_HTTP_PATH.JB_EMPLOYER_FOLDER;?>email_iframe.php?resume_id=<?php echo $_REQUEST['resume_id']."&step=1"; ?>"></iframe>
         </span>
         
         <?php

         }
         
         if (JB_RESUME_REQUEST_SWITCH == 'YES') {
            
            if (($is_blocked=='N') && ($prams['anon']=="Y") && (JB_is_request_granted($prams['user_id'], $_SESSION['JB_ID'])==false)) {
               
              if (JB_request_was_made($prams['user_id'], $_SESSION['JB_ID'])) {
                $request_tag = "<p class='request_msg_sent_label'>".$label["resume_display_request_sent"]."</p>";
                //JB_display_info_box ($heading, $request_tag);
                echo $request_tag;
              } elseif ($REQUEST_FEATURE) {

         ?><p align="center">
               <input  type="button" onclick="window.location='request.php?user_id=<?php echo jb_escape_html($prams['user_id']);?>'" value="<?php echo $label["resume_display_request"]; ?>" >
               </p>
            <?php }

         ?>
         
         <?php
            }
         }

         // If viewing by employer, display a message if the candidate had granred
         // permission to view the resume
         if ((JB_RESUME_REQUEST_SWITCH!='NO')) {

            if (($prams['anon']=='Y')) {
               if ($_SESSION['JB_Domain']=='EMPLOYER') {
                  echo "<i>".$label["c_resume_hide"]."</i>";
               }
               if (($_SESSION['JB_ID']!='')) {
                  if (JB_is_request_granted($prams['user_id'], $_SESSION['JB_ID'])) {
                     if ($_SESSION['JB_Domain']=='EMPLOYER') {
                        // the employer is allowed to view the anonymous fields
                        echo "<Br>".$label["c_resume_hide_allowed"];

                     }
                  }
               }
            }
         
         }
         
         JB_display_resume_form (2, $mode='view', $prams, false);
      
      }

   } else {
         
      JB_list_resumes (false, $order_by, $offset);
   }


} elseif ($NOT_VALIDATED) { // cannot view resumes unless the account is validated
   ?>
   
   <center>
   <h3><?php echo $label['employer_cannot_resume_browse'];?></h3>
   <?php

   $label["employer_resume_must_activate"] = str_replace ("%SITE_NAME%", JB_SITE_NAME , $label["employer_resume_must_activate"]);

   echo '<div class="explanation_note">'.$label['employer_resume_must_activate']."</div>"; ?>
   </center>
   <p>&nbsp;</p>
   <p>&nbsp;</p>
   <p>&nbsp;</p>
   <p>&nbsp;</p>
   <p>&nbsp;</p>
   <?php

} elseif ($FIRST_POST ) {

?>

   
   <center>
   <h3><?php echo $label['employer_cannot_resume_browse'];?></h3>
   <?php

   $label["employer_resume_must_first_post"] = str_replace ("%SITE_NAME%", JB_SITE_NAME , $label["employer_resume_must_first_post"]);

   echo '<div class="explanation_note">'.$label['employer_resume_must_first_post'].'</div>'; ?>
   </center>
   <p>&nbsp;</p>
   <p>&nbsp;</p>
   <p>&nbsp;</p>
   <p>&nbsp;</p>
   <p>&nbsp;</p>

   <?php


} elseif ($OVER_QUOTA) {

   


   $t = $subscr_row['quota_timestamp'];
   // calculate timestamp for 1 month in the future
   $t_next_month = mktime(date('H', $t), date('i', $t), date('s', $t), date('n', $t)+1, date('j', $t), date('Y', $t));

   
   $str = $label['employer_resume_noquota']."<br>";

   $str = str_replace("%SITE_CONTACT%", JB_SITE_CONTACT_EMAIL, $str);
   $str = str_replace("%QUOTA%", $subscr_row['V_QUOTA'], $str);
   $str = str_replace("%FROM_DATE%", date(JB_DATE_FORMAT, $t), $str);
   $str = str_replace("%TO_DATE%",  date(JB_DATE_FORMAT, $t_next_month), $str);
   $str = str_replace("%VIEWS%", $sub_row['views_quota'], $str);

   echo '<h3>'.$label['employer_resume_noquota_head'].'</h3>';
   echo '<div class="error_msg_label">';

   echo $str;
   echo '</div>';
   echo '<p>'.$label['employer_resume_more_details'].'</p>';
   
   
   
} else {

?>
   <p>&nbsp;</p>
   <center>
   <h3><?php echo $label['employer_resume_browse'];?></h3>
   <?php

   $label["employer_resume_must_sub"] = str_replace ("%SITE_NAME%", JB_SITE_NAME , $label["employer_resume_must_sub"]);

   echo '<div class="explanation_note">'.$label['employer_resume_must_sub'].'</div>'; ?><p>
   <?php
   $offer_active_msg = JB_get_special_offer_msg();
   echo $offer_active_msg;
   ?>
   <a href="subscriptions.php"><IMG src="<?php echo JB_THEME_URL; ?>images/<?php echo $label['subscribe_now_button_img'];?>" width="187" height="41" border="0" alt=""></a>
   
   </center><p>&nbsp;</p>
   <p>&nbsp;</p>
   <p>&nbsp;</p>
   <p>&nbsp;</p>
   <p>&nbsp;</p>
   <?php

}

?>


<?php JB_template_employers_footer(); ?>
</div>
   </div> <!-- eof index-middle-inner -->
</div>



Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.029 seconds with 18 queries.