Jump to content

anyone can help with this code please?


ptityop

Recommended Posts

Hi , i have  a pb with one of my pages .... data does not go into the database... can anyone see anything wrong ? Many thanks

 

<?php

include_once "accesscontrol.php";
include_once "../configuration.inc.php";
$q1 = "select * from job_employer_info where ename = \"$ename\" ";
$r1 = mysql_query($q1) or die(mysql_error(Error5));
$a1 = mysql_fetch_array($r1);
if(!empty($a1[plan]))
{
$a11 = $a1[JP_number];

  if(isset($submit) && $submit == 'Post this job')
  {
$q2 = "select * from job_employer_info where ename = \"$ename\" ";
$r2 = mysql_query($q2) or die(mysql_error(Error1));
$a2 = mysql_fetch_array($r2);

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(Error2));
$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 = \"$ename\", 
CompanyCountry = \"$a2[CompanyCountry]\",
JobIn = \"$JobIn\", 
CompanyState = \"$a2[CompanyState]\",
Company = \"$a2[CompanyName]\", 
position = \"$position\", 
JobCategory = \"$JobStr\", 
description = \"$description\",  
j_target = \"$j_target\", 
salary = \"$salary\", 
postdate = \"$postdate\", 
s_period = \"$s_period\",
EXmonth = \"$EXmonth\",
EXday = \"$EXday\",
EXyear = \"$EXyear\"  ";
$r3 = mysql_query($q3) or die(mysql_error(Error3));

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

$to = $a2[CompanyEmail];
$subject = "Votre mission sur $mydomain";
$message = "Vous trouverez dans ce courrier une copie de votre mission.\n\n Details:\n Job ID# $job_id \n Mission: $position \n Categorie: $JobStr \n Description: $description \n Expire le: $EXmonth/$EXday/$EXyear\n\n\n Pour modifier ou effacer cette mission Cliquez ici: http://$myurl/employers/employers7.php ";
$from = "De: $contactemail";

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

echo "
<table width='100%' border='0' cellspacing='1' cellpadding='5'>
  <tr> 
    <td height='16' bgcolor='#FFCC00'><center>
        <b><font color='#000000'>$POSTJJ</font></b> 
      </center></td>
  </tr>
</table><br><br><br>
";

  }

if ($a11 < 1)
{
	echo "<center><br><br><br>$POSTJ2</center><br><br>";
	include_once "employers1.php";
}

else
{



echo "";
?>

<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>

<br>	
<table width=100%>
  <tr>
	<td colspan=2>
	<b><?=$USINGPLAN?> <font color=blue><?=$a1[plan]?></font> . <br><?=$POSTJ3?></b>
	<ul>
	<li>poster <?=$a11?> mission; </li>
	<li>voir <?=$a1[JS_number]?> profils; </li>
	</ul>		</td>
<tr>
<tr><td colspan=2> <br>
<br>
<br>
<b><font color=green><?=$TOPOST?> :</font></b><br>
<br>
</td></tr>
<td width="24%"><form action=<?=$PHP_SELF?> method=post name=form onSubmit="return checkFields();">
<tr><td><?=$POSITION?></td>

<td width="76%">
<input type=text name=position>	</td>
</tr>

<tr>
<td valign=top>
<?=$JOBCATEGORY?> <br>	</td>

<td valign=top>
<SELECT NAME="JobCategory[]" multiple size=5>
        <?php
        $title_query=mysql_query("select * from job_jobcategories");
          while ($title_result=mysql_fetch_array($title_query))
        {
        echo '<option value="'.$title_result['jobcategory'].'"';
        if (strstr($job_result['jobcategory'],$title_result['jobcategory'])) {echo "selected";}
        echo '>'.$title_result['jobcategory'].'</option>';
        }
        ?>
</SELECT><br>	</td>
<tr><td valign=top><?=$DESCR?>:</td>
<td><textarea rows=6 cols=35 name=description></textarea></td>
</tr>

<tr>
<td><?=$TARGET?>: </td>

<td>
<select name="j_target">
<option value=""> </option>
   <option>Selectionner</option>
            <option value="Bac +2">Bac +2</option>
            <option value="Bac +3">Bac +3</option>
            <option value="Bac +4">Bac +4</option>
            <option value="Bac +5">Bac +5</option>
            <option value="Autre">Autre</option>
</select></td>
</tr>

<tr><td> </td>
<td> </td>
</tr>


<tr>
<td>

<?=$WILLEXPIRE?>:	</td>

<td>
<select name=exdays1>
<option value=30> 30 </option>
<option value=60> 60 </option>
<option value=90> 90 </option>
</select>
jours
.	</td>
</tr>
<tr><td><?=$AVAILIN?>:</td>
<td>
<input type=text name=JobIn value="pays ou adresse">	</td>
</tr>
<tr>
<tr><td><?=$POSTEDON?>:</td>
<td>
<input type=text name=postdate value='<? print date("d/M/Y"); ?>'>	</td>
</tr>
<tr>
<td align=left><input type=submit name=submit value="Poster la mission" /></td>
</tr>
</table>

<?
}
}
else
{
include "employers1.php";
}

?>

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

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.