Hello, I have content Type Jobs with button apply like this :

 global $user 
<div class="col-md-9 rec-left">
 if($zebra=="odd") $class="air"; 
else $class="air-1";

<div class=<?php echo "".$class."">
<li class="ic-on"><?php print ($fields['field_imagejob']->content);</li>
<li class="wb-dis"><h4><?php  print ($fields['title']->content);</h4><h5>
  print ($fields['field_time']->content);</h5></li>
<li class="dr-co"><p>  print ($fields['field_companyname']->content);</p></li>
<li class="sa-pn"><p><i class="bung"> </i>
 print ($fields['field_address']->content);</p></li>
<li class="dolla"><p><?php  print ($fields['field_cost']->content);</p></li>
<?php if($user->uid){
<li class="b-tn"><div class="apply_btn"><form action="#"><input type="submit" value="Apply Now"></form></div></li> 
 }
else{ 
<li class="b-tn"><div class="apply_btn"><form action="#"><input type="submit" value="Register/Apply"></form></div></li> 
 }
</div>
</div>


and User with file field (Upload_CV).

I want when the user is not logged on and clicks the button register and apply, I redirected to the registration page to upload a CV then with ajax or any CV s' sent to the email address of Jobs directly and for example displays him "your resume was sent" then redirect to the home page, otherwise (if connected) same thing without the registration page.

Thank you for your help !

Comments

dotmundo’s picture

I do not understand why you did not chose to use Form API to code the form and the buttons?

Jaypan’s picture

As you are not using the Form API, this isn't a Drupal question.