Jobline 1 1 1 > Jobline.common.php.txt

Questions? Need Help? Want to share? » PHP Forum
Script Name:
Jobline 1 1 1

Download:
jobline-1-1-1.zip

Category:
Classified Ads

Archive Content:

Jobline 1 1 1

Jobline 1 1 1 > Language

Jobline 1 1 1

Jobline 1 1 1 > Templates

Jobline 1 1 1 > Templates > Simple

Jobline 1 1 1 > Templates

Jobline 1 1 1 > Templates > Default

Jobline 1 1 1

Jobline.common.php.txt:

<?php
 /**
  * Jobline Component for Mambo 4.5
  *
  * Copyright (C) 2004 Olle Johansson
  * Distributed under the terms of the GNU General Public License
  * This software may be used without warrany provided and
  *  copyright statements are left intact.
  *
  * Site Name: Mambo 4.5
  * File Name: jobline.common.php
  * Developer: Olle Johansson - Olle <at> Johansson <dot> com
  * Date: 6 Aug 2004
  *  Version #: 1.0
  * Comments:
 **/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

function getStateArray() {
 $usstates = array();
 $usstates['AK'] = "Alaska";
 $usstates['AL'] = "Alabama";
 $usstates['AR'] = "Arkansas";
 $usstates['AZ'] = "Arizona";
 $usstates['CA'] = "California";
 $usstates['CO'] = "Colorado";
 $usstates['CT'] = "Connecticut";
 $usstates['DE'] = "Delaware";
 $usstates['DC'] = "District of Columbia";
 $usstates['FL'] = "Florida";
 $usstates['GA'] = "Georgia";
 $usstates['HI'] = "Hawaii";
 $usstates['IA'] = "Iowa";
 $usstates['ID'] = "Idaho";
 $usstates['IL'] = "Illinois";
 $usstates['IN'] = "Indiana";
 $usstates['KS'] = "Kansas";
 $usstates['KY'] = "Kentucky";
 $usstates['LA'] = "Louisiana";
 $usstates['MA'] = "Massachusetts";
 $usstates['MD'] = "Maryland";
 $usstates['ME'] = "Maine";
 $usstates['MI'] = "Michigan";
 $usstates['MN'] = "Minnesota";
 $usstates['MO'] = "Missouri";
 $usstates['MS'] = "Mississippi";
 $usstates['MT'] = "Montana";
 $usstates['NC'] = "North Carolina";
 $usstates['ND'] = "North Dakota";
 $usstates['NE'] = "Nebraska";
 $usstates['NH'] = "New Hampshire";
 $usstates['NJ'] = "New Jersey";
 $usstates['NM'] = "New Mexico";
 $usstates['NV'] = "Nevada";
 $usstates['NY'] = "New York";
 $usstates['OH'] = "Ohio";
 $usstates['OK'] = "Oklahoma";
 $usstates['OR'] = "Oregon";
 $usstates['PA'] = "Pennsylvania";
 $usstates['RI'] = "Rhode Island";
 $usstates['SC'] = "South Carolina";
 $usstates['SD'] = "South Dakota";
 $usstates['TN'] = "Tennessee";
 $usstates['TX'] = "Texas";
 $usstates['UT'] = "Utah";
 $usstates['VT'] = "Vermont";
 $usstates['VA'] = "Virginia";
 $usstates['WA'] = "Washington";
 $usstates['WI'] = "Wisconsin";
 $usstates['WV'] = "West Virginia";
 $usstates['WY'] = "Wyoming";

 return $usstates;
}

function getUSState( $stateabbr ) {
 $usstates = getStateArray();
 if ( isset( $usstates[$stateabbr] ) ) {
  return $usstates[$stateabbr];
 } else {
  return false;
 }
}

function getJobTypeString( $jobtype ) {
 $ret = "";
 switch ( $jobtype ) {
  case '0': $ret = _JL_JOBTYPE_FULLTIME; break;
  case '1': $ret = _JL_JOBTYPE_PARTTIME; break;
  case '2': $ret = _JL_JOBTYPE_INTERNSHIP; break;
 }
 return $ret;
}

function getJobStatusString( $jobstatus ) {
 $ret = "";
 switch ( $jobstatus ) {
  case '0': $ret = _JL_JOBSTATUS; break;
  case '1': $ret = _JL_JOBSTATUS_SOURCING; break;
  case '2': $ret = _JL_JOBSTATUS_INTERVIEWING; break;
  case '3': $ret = _JL_JOBSTATUS_CLOSED; break;
  case '4': $ret = _JL_JOBSTATUS_FINALISTS; break;
  case '5': $ret = _JL_JOBSTATUS_PENDING; break;
  case '6': $ret = _JL_JOBSTATUS_HOLD; break;
 }
 return $ret;
}

/**
* Send an email
* @param string email Email adress
* @param string subject Subject of the email
* @param string message The message body of the email
* @param string fromname Name of the sender of the email
* @param string fromemail Email address of the sender
* @param string replyto Email address in Reply-To header
*/
function sendEmail( $email, $subject, $message, $fromname='', $fromemail='', $replyto='') {
 if ( function_exists( "mosMail" ) ) {
  mosMail($fromemail, $fromname, $email, $subject, $message);
 } else {
  $headers = "";
  if ( trim( $fromemail ) ) {
   $headers = "From: $fromname <$fromemail>\r\n";
  }
  if ( trim( $replyto ) ) {
   $headers .= "Reply-To: <$replyto>\r\n";
  }
  $headers .= "X-Priority: 3\r\n";
  $headers .= "X-MSMail-Priority: Low\r\n";
  $headers .= "X-Mailer: Mambo Open Source 4.5\r\n";
  @mail($email, $subject, $message, $headers);
 }
}

/**
* Show an error message.
*
* @param string The error message to show.
* @param string Heading for the error message.
*/
function showError( $error, $error_header = _JL_ERROR ) {
 HTML_jobline::showError( $error, $error_header );
}

/**
* Mambo function to log searches.
*/
function mosLogSearch( $search_term ) {
 global $database;
 global $mosConfig_enable_log_searches;
 
 if (@$mosConfig_enable_log_searches) {
  $database->setQuery( "SELECT hits"
  . "\nFROM #__core_log_searches"
  . "\nWHERE LOWER(search_term)='$search_term'" );
  $hits = intval( $database->loadResult() );
  echo $database->getErrorMsg();
  if ($hits) {
   $database->setQuery( "UPDATE #__core_log_searches SET hits=(hits+1)"
   . "\nWHERE LOWER(search_term)='$search_term'" );
   $database->query();
   echo $database->getErrorMsg();
  } else {
   $database->setQuery( "INSERT INTO #__core_log_searches VALUES"
   . "\n('$search_term', '1')" );
   $database->query();
   echo $database->getErrorMsg();
  }
 }
}

/**
* Return an ORDER BY value based on the given string
*
* @param string What kind of order by statement to use
*/
function getOrdering( $sort ) {
 switch ( $sort ) {
  case "titledesc": $ordering = "c.title DESC"; break;
  case "titleasc": $ordering = "c.title ASC"; break;
  case "orderingdesc": $ordering = "c.ordering DESC"; break;
  case "orderingasc": $ordering = "c.ordering ASC"; break;
  case "jobiddesc": $ordering = "c.id DESC"; break;
  case "jobidasc": $ordering = "c.id ASC"; break;
  case "createddesc": $ordering = "c.created DESC"; break;
  case "createdasc": $ordering = "c.created ASC"; break;
  default: $ordering = "c.id DESC";
 }
 return $ordering;
}
?>

Other Classified Ads Scripts:

  • Jobline 1 1 1
WebMaster Resources Home

©RingsWorld.com