Jump to content

multiple select doesn't display correctly -- pls. help!


pcmategen5

Recommended Posts

hello guys!
pls. i need your help... i'm not good in php-- i'm just trying to learn it...

when viewing the php page in a browser, the multiple select list form is not displaying correctly.  Notice the job category.

this is how it look like (image 1):
[img]http://i71.photobucket.com/albums/i133/typeinternationalph/multiplelist.jpg[/img]

it should look like this (image 2):
[img]http://i71.photobucket.com/albums/i133/typeinternationalph/correct.jpg[/img]


this is the php code of the "image 1":
[quote]<tr>
<td valign=top align=right>
Job Category: <br>
</td>

<td valign=top><?=job_categories("", "JobCategory[]", "multiple size=5");?></td>[/quote]

this is the php code of the categories (separate file):
[quote]function job_categories($c, $menu_name, $menu_type) {

if(!empty($c))
{
$sc = explode("|", $c);
}

$categories = array("Accounting/Auditing", "Administrative and Support Services", "Advertising/Public Relations", "Agriculture/Forestry/Fishing", "Architectural Services", "Arts, Entertainment, and Media", "Banking", "Biotechnology and Pharmaceutical", "Community, Social Services, and Nonprofit", "Computers, Hardware", "Computers, Software", "Construction, Mining and Trades", "Consulting Services", "Customer Service and Call Center", "Education, Training, and Library", "Employment Placement Agencies", "Engineering", "Executive Management", "Finance/Economics", "Financial Services", "Government and Policy", "Healthcare, Other", "Healthcare, Practitioner, and Technician", "Hospitality, Tourism", "Human Resources", "Information Technology", "Installation, Maintenance and Repair", "Insurance", "Internet/E-Commerce", "Law Enforcement and Security", "Legal", "Manufacturing and Production", "Marketing", "Military", "Other", "Personal Care and Services", "Real Estate", "Restaurant and Food Service", "Retail/Wholesale", "Sales", "Science", "Sports/Recreation", "Telecommunications", "Transportation and Warehousing");

$select = "<SELECT NAME=\"$menu_name\" $menu_type>\n\t";

while(list(,$v) = each($categories))
{
if(!empty($sc))
{
if(in_array($v, $sc))
{
$select .= "<option value=\"$v\" selected>$v</option>\n\t";
}
else
{
$select .= "<option value=\"$v\">$v</option>\n\t";
}
}
else
{
$select .= "<option value=\"$v\">$v</option>\n\t";
}
}

$select .= "</select>";

return $select;
}[/quote]

do you think there's a problem with the code? or it's the host provider? the site is hosted in www.awardspace.com

any help is highly appreciated... thanks! :)
Link to comment
Share on other sites

this is the PostJob.php and whenever access this page the form above (image 1 from my original post) shows.

[quote]<?

include_once "accesscontrol.php";

$q1 = "select plan, JS_number, JP_number, CompanyCountry from job_employer_info where ename = \"$_SESSION[ename]\" ";
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);


if(!empty($a1[plan]))
{
$a11 = $a1[JP_number];

$q2 = "select * from job_employer_info where ename = \"$_SESSION[ename]\" ";
$r2 = mysql_query($q2) or die(mysql_error());
$a2 = mysql_fetch_array($r2);

if($a11 > 0)
{

if(isset($submit) && $submit == 'Post this job')
{
if (is_array($JobCategory))
{
$JobStr = implode("|" , $JobCategory);
}

$qc = "select job_id from job_post order by job_id desc";
$rc = mysql_query($qc) or die(mysql_error());
$ac = mysql_fetch_array($rc);
$job_id = $ac[0] + 1;

$position = strip_tags($position);
$description = strip_tags($description);

$EXday = date('d', mktime(0,0,0,0, date(d) + $_POST[exdays1], 0));
$EXmonth = date('m', mktime(0,0,0, date(m), date(d) + $_POST[exdays1], 0));
$EXyear = date('Y', mktime(0,0,0,date(m) ,date(d) + $_POST[exdays1], date(Y)));

$q3 = "insert into job_post set
job_id = \"$job_id\",
ename = \"$_SESSION[ename]\",
CompanyCountry = \"$_POST[CompanyCountry]\",
Company = \"$a2[CompanyName]\",
position = \"$position\",
JobCategory = \"$JobStr\",
description = \"$description\", 
j_target = \"$j_target\",
salary = \"$salary\",
s_period = \"$s_period\",
EXmonth = \"$EXmonth\",
EXday = \"$EXday\",
EXyear = \"$EXyear\"  ";
$r3 = mysql_query($q3) or die(mysql_error());

$a11 = $a11 - 1;
$q4 = "update job_employer_info set JP_number = JP_number - '1' where ename = \"$_SESSION[ename]\" ";
$r4 = mysql_query($q4) or die(mysql_error());

if($j_target == '1')
{
$clname = 'Student (High School)';
}
elseif($j_target == '2')
{
$clname = 'Student (undergraduate/graduate)';
}
elseif($j_target == '3')
{
$clname = 'Entry Level (less than 2 years of experience)';
}
elseif($j_target == '4')
{
$clname = 'Mid Career (2+ years of experience)';
}
elseif($j_target == '5')
{
$clname = 'Management (Manager/Director of Staff)';
}
elseif($j_target == '6')
{
$clname = 'Executive (SVP, EVP, VP)';
}
elseif($j_target == '7')
{
$clname = 'Senior Executive (President, CEO)';
}


$to = $a2[CompanyEmail];
$subject = "Your Job post at $_SERVER[HTTP_HOST]";
$message = "This is an automate sent copy of your Job post.\n\n Details:\n Job ID# $job_id \n Position: $position \n Category: $JobStr \n Description: $description \n Target: $clname \n Salary: $salary/$s_period \n Expire date: $EXmonth/$EXday/$EXyear\n\n\n To edit or delete this job, click here: http://$_SERVER[HTTP_HOST]$dir/employers/DeleteJob.php ";
$from = "From: $_SERVER[HTTP_HOST] <$aset[ContactEmail]>";

mail($to, $subject, $message, $from);

echo "<br><br><center><span class=BlackLink>The job offer was posted successfully!<br><br><a href=\"JobInfo.php?id=$job_id\" class=BlackLink>preview</a> | \n\t <a href=\"EditJob.php?job_ed=$job_id\" class=BlackLink>edit</a> | \n\t<a href=\"PostJob.php\" class=BlackLink>continue</a></span><br><br><br> </center>";


include_once("../footer.php");
exit();
}
else
{

//echo "</table>";
?>

<SCRIPT LANGUAGE="JavaScript">

function checkFields() {
missinginfo = "";

if (document.form.position.value == "") {
missinginfo += "\n    -  Position";
}
if (document.form.description.value == "") {
missinginfo += "\n    -  Description";
}
if (document.form.salary.value == "") {
missinginfo += "\n    -  Salary";
}


if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in your:\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}
</script>


<table align=center width=460 class=BlackText>

<tr><td colspan=2 align=center class=HeaderClass>Use this form to post a new job offer:</td></tr>
<form method=post name=form onSubmit="return checkFields();">
<tr><td align=right>Position:</td>

<td>
<input type=text name=position>
</td>
</tr>

<tr>
<td align=right>Job location:</td>
<td><?=select_country($a2[CompanyCountry], "CompanyCountry");?></td>
</tr>

<tr>
<td valign=top align=right>
Job Category: <br>
</td>

<td valign=top><?=job_categories("", "JobCategory[]", "multiple size=5");?></td>

<tr><td valign=top align=right>Description:</td>
<td><textarea rows=6 cols=35 name=description></textarea></td>
</tr>

<tr>
<td align=right>Target: </td>

<td>
<select name="j_target">
<option value=""> </option>
<OPTION VALUE="1">Student (High School)</OPTION>
<OPTION VALUE="2">Student (undergraduate/graduate)</OPTION>
<OPTION VALUE="3">Entry Level (less than 2 years of experience)</OPTION>
<OPTION VALUE="4">Mid Career (2+ years of experience)</OPTION>
<OPTION VALUE="5">Management (Manager/Director of Staff)</OPTION>
<OPTION VALUE="6">Executive (SVP, EVP, VP)</OPTION>
<OPTION VALUE="7">Senior Executive (President, CEO)</OPTION>
</select>
</td>
</tr>

<tr><td align=right>Salary: </td>
<td>
<input type=text name=salary size=11>
<select name=s_period>
<option value=Yearly> Yearly </option>
<option value=Monthly>Monthly </option>
</select>
</td></tr>

<tr>
<td align=right>
This offer expire after:
</td>

<td>
<select name=exdays1>
<option value=30> 30 </option>
<option value=60> 60 </option>
<option value=90> 90 </option>
</select>
days.
</td>
</tr>


<tr>
<td></td>
<td>
<input type=submit name=submit value="Post this job">
</td>
</tr>

</table>
</form>
<?
}
}
else
{
include "pay1.php";
}
}
else
{
include "pay1.php";
}

include_once("../footer.php");
?>
[/quote]

this is jobseeker_registration.php , just like the PostJob.php it uses multiple select form list. this is the link --> [url=http://pinoyjobsite.awardspace.com/jobseekers/jobseeker_registration.php]http://pinoyjobsite.awardspace.com/jobseekers/jobseeker_registration.php[/url] notice the preferred industry, it is not showing correctly.

[quote]<?
include_once "../conn.php";



if(isset($s1))
{
if(!empty($job_category))
{
$pc = implode("|", $job_category);
}

    $query = "insert into job_seeker_info set
uname = \"$uname\",
upass = \"$upass\",
title = \"$title\",
fname = \"$fname\",
lname = \"$lname\",
bmonth = \"$month\",
bday = \"$day\",
byear = \"$year\",
maritalstatus = \"$maritalstatus\",
sex = '$sex',
income = \"$income\",
country = \"$country\",
zip = \"$zip\",
address = \"$address\",
street = '$street',
city = '$city',
state = '$state',
fax = '$fax',
phone = \"$phone\",
phone2 = \"$phone2\",
job_seeker_email = \"$job_seeker_email\",
job_category = \"$pc\",
careerlevel = \"$careerlevel\",
target_company = \"$target_company\",
nationality = '$nationality' ";

$result = mysql_query($query);

if(mysql_error())
{
$error = "<br><span class=TNA>Duplicate username: <span class=BlackLink>$uname</span></span>";
unset($uname);
}
else
{
//get the user info
$q3 = "select * from job_seeker_info where uname = '$uname' ";
$r3 = mysql_query($q3) or die(mysql_error());
$a3 = mysql_fetch_array($r3);

//send an email
$to = $a3[job_seeker_email];
$subject = "Your registration at $_SERVER[HTTP_HOST]";
$message_body = "Hello $a3[fname],\nhere is login information for $_SERVER[HTTP_HOST]\n\nUsername: $a3[uname]\nPassword: $a3[upass]\n\nKeep this information in a secure place.\n\nThanks for your registration.\nWe believe you will find a job at \n http://$_SERVER[HTTP_HOST]";

$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "From: $_SERVER[HTTP_HOST] <$aset[ContactEmail]>\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: PHP/" . phpversion()."\n";

mail($to, $subject, $message_body, $headers);

$_SESSION[uname] = $uname;

header("location:thanks.php");
exit();
}
}

include_once "../main.php";

?>


<br>

<script>
function CheckReg1() {

var d = document.f1;

if(d.title.value=="")
{
alert('Select your title, please!');
d.title.focus();
return false;
}

if(d.fname.value=="")
{
alert('Enter your first name, please!');
d.fname.focus();
return false;
}

if(d.lname.value=="")
{
alert('Enter your last name, please!');
d.lname.focus();
return false;
}

if(d.nationality.value=="")
{
alert('Enter your nationality, please!');
d.nationality.focus();
return false;
}

if(d.month.value=="" || d.day.value=="" || d.year.value=="")
{
alert('Enter your birth date, please!');

if(d.month.value=="")
{
d.month.focus();
}
else if(d.day.value=="")
{
d.day.focus();
}
else if(d.year.value=="")
{
d.year.focus();
}

return false;
}

if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(d.job_seeker_email.value))
{
alert("Invalid E-mail Address! Please re-enter.");
d.job_seeker_email.value="";
d.job_seeker_email.focus();
return false;
}

if(d.careerlevel.value=="")
{
alert('Select your career level, please!');
d.careerlevel.focus();
return false;
}

if(d.uname.value=="")
{
alert('Enter your login name, please!');
d.uname.focus();
return false;
}

if(d.upass.value=="")
{
alert('Enter your password, please!');
d.upass.focus();
return false;
}

if(d.cpass.value=="")
{
alert('Confirm your password, please!');
d.cpass.focus();
return false;
}

if(d.upass.value != "" && d.cpass.value != "" && d.upass.value != d.cpass.value)
{
alert('Enter and confirm your password again!');
d.upass.value="";
d.cpass.value="";
d.upass.focus();
return false;
}

}
</script>

<form action="jobseeker_registration.php" method=post OnSubmit="return CheckReg1();" name=f1>
<table align=center width=460 cellspacing=0 class=BlackText border=0>
<caption align=center class=HeaderClass>Expart registration form<?=$error?></caption>

<tr>
<td colspan=2 bgcolor=dddddd class=BlackLink>Personal details</td>
</tr>

<tr>
<td align=right>Title <font color=red>*</font></td>
<td>
<select name="title">
<option value="Mr." <? if($title == "Mr.") { echo "selected"; } ?>>Mr.</option>
            <option value="Mrs." <? if($title == "Mrs.") { echo "selected"; } ?>>Mrs.</option>
            <option value="Miss." <? if($title == "Miss.") { echo "selected"; } ?>>Miss.</option>
            <option value="Ms." <? if($title == "Ms.") { echo "selected"; } ?>>Ms.</option>
            <option value="Dr." <? if($title == "Dr.") { echo "selected"; } ?>>Dr.</option>
        </select>
</td>
</tr>

<tr>
<td align=right>First name:<font color=red>*</font></td>
<td><input type=text name=fname size=23 value="<?=$fname?>"></td>
</tr>


<tr>
<td align=right>Last name:<font color=red>*</font></td>
<td><input type=text name=lname size=23 value="<?=$lname?>"></td>
</tr>

<tr>
<td align=right>Nationality:<font color=red>*</font></td>
<td><input type=text name=nationality value="<?=$nationality?>"></td>
</tr>

<tr>
<td align=right>Date of birth: <font color=red>*</font> </td>
<td><?=select_date("$_POST[month]/$_POST[day]/$_POST[year]");?></td>
</tr>

<tr>
<td align=right>Marital Status:</td>

<td>
<SELECT NAME="maritalstatus">
              <option value="Single" <? if($maritalstatus == "Single") { echo "selected"; } ?>>Single</option>
              <option value="Married" <? if($maritalstatus == "Married") { echo "selected"; } ?>>Married</option>
              <option value="Divorced" <? if($maritalstatus == "Divorced") { echo "selected"; } ?>>Divorced</option>
              <option value="Engaged" <? if($maritalstatus == "Engaged") { echo "selected"; } ?>>Engaged</option>
              <option value="Separated" <? if($maritalstatus == "Separated") { echo "selected"; } ?>>Separated</option>
              <option value="Widowed" <? if($maritalstatus == "Widowed") { echo "selected"; } ?>>Widowed</option>
</SELECT>
</td>
</tr>

<tr>
<td align=right>Sex:</td>
<td>
<select name=sex>
<option value=""></option>
<option value="male">Male</option>
<option value="female">Female</option>
</select>
</td>
</tr>

<tr>
<td colspan=2 bgcolor=dddddd class=BlackLink>Home address</td>
</tr>

<tr>
<td align=right>Address:</td>
<td><input type=text name=address value="<?=$address?>"></td>
</tr>

<tr>
<td align=right>Street:</td>
<td><input type=text name=street value="<?=$street?>"></td>
</tr>

<tr>
<td align=right>Town/City:</td>
<td><input type=text name=city value="<?=$city?>"></td>
</tr>

<tr>
<td align=right>State/County/Province:</td>
<td><input type=text name=state value="<?=$state?>"></td>
</tr>

<tr>
<td align=right>Country:</td>
<td><?=select_country($country, "country");?></td>
</tr>

<tr>
<td align=right>Zip/Postal code:</td>
<td><input type=text name=zip size=7 value="<?=$zip?>"></td>
</tr>

<tr>
<td align=right>Telephone:</td>
<td><input type=text name=phone value="<?=$phone?>"></td>
</tr>

<tr>
<td align=right>Mobile:</td>
<td><input type=text name=phone2 value="<?=$phone2?>"></td>
</tr>

<tr>
<td align=right>Fax:</td>
<td><input type=text name=fax value="<?=$fax?>"></td>
</tr>

<tr>
<td align=right>Email:<font color=red>*</font></td>
<td><input type=text name=job_seeker_email value="<?=$job_seeker_email?>"></td>
</tr>

<tr>
<td colspan=2 bgcolor=dddddd class=BlackLink>Job requirements</td>
</tr>

<tr>
<td valign=top align=right>Prefered Industry:<font color=red>*</font></td>
<td valign=top><?=job_categories($pc, "job_category[]", "multiple size=5");?></td>
</tr>

<tr>
<td align=right>Your career level:<font color=red>*</font></td>

<td><?=career_level($_POST[careerlevel], "");?></td>
</tr>

<tr>
<td align=right>Target company:</td>

<td><?=target_company($target_company);?></td>
</tr>

<tr>
<td  align=center colspan=2>Min. Monthly Salary Requirement (approx.)<font color=red>*</font>
<select name="income">
              <option value="Under 40,000" <? if($income == "Under 40,000") { echo "selected"; } ?>>Under 40,000</option>
              <option value="40,000-60,000" <? if($income == "40,000-60,000" || empty($income)) { echo "selected"; } ?>>40,000-60,000</option>
              <option value="60,000-80,000" <? if($income == "60,000-80,000") { echo "selected"; } ?>>60,000-80,000</option>
              <option value="80,000-100,000" <? if($income == "80,000-100,000") { echo "selected"; } ?>>80,000-100,000</option>
              <option value="100,000-150,000" <? if($income == "100,000-150,000") { echo "selected"; } ?>>100,000-150,000</option>
              <option value="150,000-200,000" <? if($income == "150,000-200,000") { echo "selected"; } ?>>150,000-200,000</option>
              <option value="200,000 &and over" <? if($income == "200,000 &and over") { echo "selected"; } ?>>200,000 &and over</option>
            </select>
</td>
</tr>

<tr>
<td colspan=2 bgcolor=dddddd class=BlackLink>Login details</td>
</tr>


<tr>
<td align=right>Username:<font color=red>*</font></td>
<td><input type=text name=uname size=23 maxlength=10 value="<?=$uname?>"> max. 10 symbols</td>
</tr>

<tr>
<td align=right>Password:<font color=red>*</font></td>
<td><input type=password name=upass size=23 maxlength=10 value="<?=$upass?>"> max. 10 symbols</td>
</tr>

<tr>
<td align=right>Confirm password:<font color=red>*</font></td>
<td><input type=password name=cpass size=23 maxlength=10 value="<?=$cpass?>"></td>
</tr>

<tr>

<td align=left>
<input class=s2 type=submit name=s1 value="Register me" align=left>
</td>

<td align=right>
<input class=s2 type=reset name=reset value="Reset" align=right>
</td>
</tr>
</table>
</form>

<? include_once('../footer.php'); ?>[/quote]

this is the conn.php (where the categories are from)

[quote]<?

$db_host = "deleted";
$db_username = "deleted";
$db_password = "deleted";
$db_name = "deleted";

$script_dir = "";

//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////

//connect to the database server
$connection = mysql_connect($db_host, $db_username, $db_password) or die(mysql_error());


//select database
$db = mysql_select_db($db_name, $connection);

session_start();

if(!empty($script_dir))
{
$dir = "".$script_dir;
}

$qset = "select * from job_settings";
$rset = mysql_query($qset) or die(mysql_error());
$aset = mysql_fetch_array($rset);

$t = time();

function select_country($c, $n)
{
$s = "<select name=\"$n\">\n\t";

$countries = array('Afghanistan', 'Albania', 'American Samoa', 'Andorra', 'Antigua', 'Argentina', 'Armenia', 'Australia', 'Austria', 'Azerbaijan', 'Bahrain', 'Bangladesh', 'Barbados', 'Belarus', 'Belgium', 'Belize', 'Bolivia', 'Bosnia-Herzegovina', 'Brazil', 'Brunei Darussalam', 'Bulgaria', 'Cambodia', 'Canada', 'Chile', 'China', 'Colombia', 'Costa Rica', 'Croatia', 'Cuba', 'Cyprus', 'Czech Republic', 'Denmark', 'Ecuador', 'Egypt', 'El Salvador', 'Estonia', 'Falkland Islands', 'Fiji', 'Finland', 'France', 'French Guyana', 'Georgia', 'Germany', 'Gibraltar', 'Greece', 'Greenland', 'Grenada', 'Guatemala', 'Honduras', 'Hong Kong', 'Hungary', 'Iceland', 'India', 'Indonesia', 'Iran', 'Iraq', 'Ireland', 'Israel', 'Italy', 'Japan', 'Jordan', 'Kazakhstan', 'Kenya', 'Kuwait', 'Kyrgyzstan', 'Laos', 'Latvia', 'Lebanon', 'Libya', 'Liechtenstein', 'Lithuania', 'Luxembourg', 'Malaysia', 'Maldives', 'Malta', 'Mauritius', 'Mexico', 'Mongolia', 'Morocco', 'Nepal', 'Netherlands', 'New Zealand', 'Nicaragua', 'North Korea', 'Norway', 'Oman', 'Pakistan', 'Panama', 'Paraguay', 'Peru', 'Philippines', 'Poland', 'Portugal', 'Puerto Rico', 'Qatar', 'Romania', 'Russian Federation', 'Saudi Arabia', 'Singapore', 'Slovak Republic', 'Slovenia', 'South Africa', 'South Korea', 'Spain', 'Sri Lanka', 'Sweden', 'Switzerland', 'Syria', 'Taiwan', 'Thailand', 'Tunisia', 'Turkey', 'Turkmenistan', 'Ukraine', 'United Arab Emirates', 'United Kingdom', 'USA', 'Uruguay', 'Uzbekistan', 'Venezuela', 'Vietnam', 'Yemen', 'Yugoslavia', 'Zimbabwe');

while(list(,$v) = each($countries))
{
if(!empty($c))
{
if($c == $v)
{
$s .= "<option value=\"$v\" selected>$v</option>\n\t";
}
else
{
$s .= "<option value=\"$v\">$v</option>\n\t";
}
}
else
{
if($v == "USA")
{
$s .= "<option value=\"$v\" selected>$v</option>\n\t";
}
else
{
$s .= "<option value=\"$v\">$v</option>\n\t";
}
}
}

$s .= "</select>\n\n";

return $s;
}

function job_categories($c, $menu_name, $menu_type) {

if(!empty($c))
{
$sc = explode("|", $c);
}

$categories = array("Accounting/Auditing", "Administrative and Support Services", "Advertising/Public Relations", "Agriculture/Forestry/Fishing", "Architectural Services", "Arts, Entertainment, and Media", "Banking", "Biotechnology and Pharmaceutical", "Community, Social Services, and Nonprofit", "Computers, Hardware", "Computers, Software", "Construction, Mining and Trades", "Consulting Services", "Customer Service and Call Center", "Education, Training, and Library", "Employment Placement Agencies", "Engineering", "Executive Management", "Finance/Economics", "Financial Services", "Government and Policy", "Healthcare, Other", "Healthcare, Practitioner, and Technician", "Hospitality, Tourism", "Human Resources", "Information Technology", "Installation, Maintenance and Repair", "Insurance", "Internet/E-Commerce", "Law Enforcement and Security", "Legal", "Manufacturing and Production", "Marketing", "Military", "Other", "Personal Care and Services", "Real Estate", "Restaurant and Food Service", "Retail/Wholesale", "Sales", "Science", "Sports/Recreation", "Telecommunications", "Transportation and Warehousing");

$select = "<SELECT NAME=\"$menu_name\" $menu_type>\n\t";

while(list(,$v) = each($categories))
{
if(!empty($sc))
{
if(in_array($v, $sc))
{
$select .= "<option value=\"$v\" selected>$v</option>\n\t";
}
else
{
$select .= "<option value=\"$v\">$v</option>\n\t";
}
}
else
{
$select .= "<option value=\"$v\">$v</option>\n\t";
}
}

$select .= "</select>";

return $select;
}


function career_level($c, $id) {

$levels = array("Student (High School)", "Student (undergraduate/graduate)", "Entry Level (less than 2 years of experience)", "Mid Career (2+ years of experience)", "Management (Manager/Director of Staff)", "Executive (SVP, EVP, VP)", "Senior Executive (President, CEO)");

if($id >= '0')
{
$level = $levels[$id];
return $level;
}
else
{
$select = "<select name=\"careerlevel\">\n\t";

while(list($k,$v) = each($levels))
{
if($c >= '0')
{
if($c == $k)
{
$select .= "<option value=\"$k\" selected>$v</option>\n\t";
}
else
{
$select .= "<option value=\"$k\">$v</option>\n\t";
}
}
else
{
$select .= "<option value=\"$k\">$v</option>\n\t";
}
}

$select .= "</select>\n\n";

return $select;
}
}

function target_company($t) {

$tarray = array("Small (up to 99 empl.)", "Medium (100 - 500 empl.)", "Large (over 500 empl.)");

$select = "<select name=\"target_company\">\n\t";

while(list($k,$v) = each($tarray))
{
if($t >= '0')
{
if($t == $k)
{
$select .= "<option value=\"$v\" selected>$v</option>\n\t";
}
else
{
$select .= "<option value=\"$v\">$v</option>\n\t";
}
}
else
{
$select .= "<option value=\"$v\">$v</option>\n\t";
}
}

$select .= "</select>\n\n";

return $select;

}


function select_date($a) {

/*
this function will return 3 drop down menus:
"day" "months" and "years"

The $a value is the seletected date in "Jan/13/2003" format

*/

//transform $a in month number and 4 digit year number
if(!empty($a))
{
$dates = explode("/", $a);
$my_date_month = $dates[0];
$my_date_day = $dates[1];
$my_date_year = $dates[2];
}

////////////////////////////////////////////////////////////
////////////// months menu - start
////////////////////////////////////////////////////////////

$m = "<select name=\"month\">\n\t<option value=\"\"></option>\n\t";

for($i = 1; $i <= 12; $i++)
{
$month = date("M", mktime(0,0,0,date($i),date(d),date(Y)));

if($my_date_month == $month)
{
$m .= "<option value=\"$month\" selected>$month</option>\n\t";
}
else
{
$m .= "<option value=\"$month\">$month</option>\n\t";
}
}

$m .= "</select>";

////////////////////////////////////////////////////////////
////////////// months menu - end
////////////////////////////////////////////////////////////

$m .= "\n\n&nbsp;\n\n";

////////////////////////////////////////////////////////////
////////////// days menu - start
////////////////////////////////////////////////////////////

$m .= "<select name=\"day\">\n\t<option value=\"\"></option>\n\t";

for($i = 1; $i <= 31; $i++)
{
if($my_date_day == $i)
{
$m .= "<option value=\"$i\" selected>$i</option>\n\t";
}
else
{
$m .= "<option value=\"$i\">$i</option>\n\t";
}
}

$m .= "</select>";

////////////////////////////////////////////////////////////
////////////// months menu - end
////////////////////////////////////////////////////////////

$m .= "\n\n&nbsp;\n\n";

////////////////////////////////////////////////////////////
////////////// years menu - start
////////////////////////////////////////////////////////////

$m .= "<select name=\"year\">\n\t<option value=\"\"></option>\n\t";

for($y = date(Y) - 18; $y >= (date(Y) - 70 );  $y--)
{
if($my_date_year == $y)
{
$m .= "<option value=\"$y\" selected>$y</option>\n\t";
}
else
{
$m .= "<option value=\"$y\">$y</option>\n\t";
}
}

$m .= "</select>";

////////////////////////////////////////////////////////////
////////////// years menu - end
////////////////////////////////////////////////////////////
return $m;

}

function select_plan($p) {

$select = "<select name=price>\n\t";
$q1 = "select * from job_prices order by PriceValue";
$r1 = mysql_query($q1) or die(mysql_error());
while($a1 = mysql_fetch_array($r1))
{
$select .= "<option value=\"$a1[PriceID]\">$a1[PriceDesc] ($a1[PriceValue])</option>\n\t";
}
$select .= "</select>";

return $select;

}


function count_info($what) {

/*
This function will count various resources. The parameters can be:
"jobseekers" - return the number of registered jobseekers
"employers" - return the number of registered employers
"resumes" - return the number of resumes
"jobs" - return the number of posted jobs
*/

if($what == "jobseekers")
{
//count the registered jobseekers
$q1 = "select count(uname) from job_seeker_info";
}
elseif($what == "employers")
{
$q1 = "select count(ename) from job_employer_info";
}
elseif($what == "resumes")
{
$q1 = "select count(uname) from job_seeker_info where rTitle != '' ";
}
elseif($what == "jobs")
{
$q1 = "select count(job_id) from job_post";
}

$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);

return $a1[0];
}

function show_counters($f) {

global $dir;

if($f == "on")
{
$jobseekers = count_info("jobseekers");
$employers = count_info("employers");
$resumes = count_info("resumes");
$jobs = count_info("jobs");

$c = "<img src=\"http://$_SERVER[HTTP_HOST]$dir/images/bullet01.gif\" width=\"11\" height=\"11\" alt=\"\" border=\"0\" hspace=\"5\" align=\"absmiddle\">Job Seekers: $jobseekers<br><img src=\"http://$_SERVER[HTTP_HOST]$dir/images/bullet01.gif\" width=\"11\" height=\"11\" alt=\"\" border=\"0\" hspace=\"5\" align=\"absmiddle\">Employers: $employers<br><img src=\"http://$_SERVER[HTTP_HOST]$dir/images/bullet01.gif\" width=\"11\" height=\"11\" alt=\"\" border=\"0\" hspace=\"5\" align=\"absmiddle\">Resumes: $resumes<br><img src=\"http://$_SERVER[HTTP_HOST]$dir/images/bullet01.gif\" width=\"11\" height=\"11\" alt=\"\" border=\"0\" hspace=\"5\" align=\"absmiddle\">Jobs: $jobs<br>\n\n";

return $c;
}
else
{
return false;
}

}


if(!empty($_GET))
{
extract($_GET);
}

if(!empty($_POST))
{
extract($_POST);
}

?>[/quote]

thanks for helping out...
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.