Jamit Software Forum
Welcome, Guest. Please login or register.
June 19, 2018, 06:01:02 pm

Login with username, password and session length
Search:     Advanced search
May 27th, 2009 - Jamit Software Launches the forum today!
3,080 Posts in 791 Topics by 1,427,217 Members
Latest Member: flaguganda25
* Home Help Search Login Register
+  Jamit Software Forum
|-+  Jamit Job Board Customers
| |-+  Configuration
| | |-+  Adding PHP script to a save button
« previous next »
Pages: [1] Print
Author Topic: Adding PHP script to a save button  (Read 17763 times)
webprojector
Jammers
Newbie
*
Posts: 2

The Dynamic One


WWW
« on: February 09, 2012, 08:07:34 pm »

I have a question or rather yet I need help with a code snippet for a job posting

website that I am working on. I need to add a scipt to a save button that will gather

the job post id ($post_id) and submit the applicant info to the job/($post_id) so that the applicant has apply for the position.

Now I'm not a php expert more like a beginner but, here is the code to the page a need the functionality add.

<?php
/*
        Resume form: form_id = 2

        Here you can modify the resume form.
        This file is a file php mixed with PHP.
        The php code is located between  < ?php and ? > tags.
        Anything outside these tags is HTML code and can be modified as normal HTML

        The form has 3 modes possible: 'view', 'edit' and 'EDIT'
       
        view - for displaying data, the data that is stored in these fields is displayed, instead
        of the form field

        edit - the form is displayed for editing the data by the users

        EDIT - the form is displayed for editing the fileds by the Admin

        How to display data from the individual fields?

        - Each Field has a 'Template Tag' which is specified when editing the form.
        Use the JB_get_template_value($template_tag, $form_id) function to get the data from the field.
        For example, this will display the email of the resume:

        echo JB_get_template_value('EMAIL', 2);

        The resume form has 3 sections by default.
        To display a section, a call to the JB_display_form() function is made. For example, to
        print a section 1 section like this:
        JB_display_form (2, $mode, $prams, 1, $admin);

        How to make all resumes anonymous

        Replace this checkbox

        <input type="checkbox" value="Y" name="anon" ?php if($prams['anon']=='Y') { echo ' checked ';} ? >

        With:

        <input type="hidden" value="Y" name="anon"  >
       
        */
       
        // load the javascript for the SCW Date selector field (if one exists on the form)
        if (!defined('SCW_INCLUDE')) {
                ?>
                <script type='text/JavaScript' src='<?php echo JB_BASE_HTTP_PATH."scw/scw_js.php?lang=".$_SESSION['LANG']; ?>'></script>
                <?php
                define ('SCW_INCLUDE', 'Y');
        }

        if ($mode != 'view') { // editing mode, output the start of the <form> and hidden fields

                ?>             
                <form method="POST" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" name="form1" onsubmit=" form1.savebutton.disabled=true;" enctype="multipart/form-data">
                <input type="hidden" name="mode" size="" value="<?php echo $mode; ?>">
                <input type="hidden" name="resume_id" size="" value="<?php echo $prams['resume_id']; ?>">
                <input type="hidden" name="user_id" size="" value="<?php echo $prams['user_id']; ?>">
                <?php
        }

        // begin the Resume Form
        ?>
       
<?php /* NASTHON */
                if ($mode == "view") {         
                $BTN_PRINTPRE = '<a class="iconbutton"  title="' . $label['nasthon1007_button_print'] . '" href="javascript&#058;printpreview();">' . '<span style="display:inline;"><img src="'.JB_THEME_URL. 'images/icon/printer.gif" style="vertical-align:middle;" border="0">' . ' ' . $label['nasthon1007_button_print'] . '</span></a>';
                echo '<div class="printbtn" style="margin-top:10px;">' . $BTN_PRINTPRE . '</div>';
        }
?>

        <table border="0" cellSpacing="1" cellPadding="5" class="resume_data" >
        <tr><td colspan="2" >
        <?php
       
        // checkbox for job seeker when editing the resume
        if (($mode!='view') && (JB_RESUME_REQUEST_SWITCH!='NO') ) {
               
                ?>
                <input type="checkbox" value="Y" name="anon" <?php if($prams['anon']=='Y') { echo ' checked ';} ?> > <?php echo $label["resume_priv_notice"]; ?>
                <?php
        }

       
?>
        </td></tr>
        <?php 
        // check for error, and display an error message is there is an error when saving
        if (($error != '' ) && ($mode!='EDIT')) { ?>
        <tr>
                <td colspan="2"><?php  echo "<span class='error_msg_label'>".$label["resume_save_error"]."</span><br> ".$error."";  ?></td>
        </tr>
        <?php } ?>
  <tr>
    <td  valign="top" >
        <?php
                 if ($mode == "EDIT") {
                                        echo "[Section 1]";
                }
                // JB_display_form function will display the form from the database
                JB_display_form (2, $mode, $prams, 1, $admin);
        ?>

    </td>

        <?php
        // check if there are any fields in section 2
        $sql = "SELECT * FROM form_fields WHERE form_id=2 AND section=2 ";
        $result = JB_mysql_query ($sql);
        if (mysql_num_rows($result)>0) {
                // display section 2
       
        ?>
    <td valign="top"  rowspan="2">
    <?php
                if ($mode == "EDIT") {
                        echo "[Section 2]";
                }
                JB_display_form (2, $mode, $prams, 2, $admin);
        ?></td>

        <?php } ?>
  </tr>

  <tr>
    <td>
                <?php
                if ($mode == "EDIT") {
                        echo "[Section 3]";
                }
                // display section 3
                JB_display_form (2, $mode,  $prams, 3, $admin);
                ?></td>
  </tr>
  <?php
  // save button (if in edit mode)
        if ($mode=='edit') { ?>
                <tr><td colspan="2" bgcolor="#ffffff">
                <input type="hidden" name="save" id="save101" value="">
                <input class="form_submit_button" TYPE="SUBMIT"  name="savebutton" value="<?php echo $label['resume_save_button']; ?>" onClick="save101.value='1';">
                </td></tr>
                <?php } ?>             
        </table>
        <?php if ($mode != 'view') { ?>
        </form>
        <?php } ?>
       
        <?php /* NASTHON */             
                if ($mode == "view") {echo '<div class="printbtn">' . $BTN_PRINTPRE . '</div>'; }
        ?>
Logged

Changing the world one pixel at a time...
webprojector
Jammers
Newbie
*
Posts: 2

The Dynamic One


WWW
« Reply #1 on: February 09, 2012, 08:08:51 pm »

Upon clicking the submit button I would like the user/applicant to be able to apply for the job that they have viewed. To go into a little more detail this is part of an email

campaign. A 'potential user'(isn't a user yet) receives a email from the job site expressing to the 'pu' that this job would be a good match. The 'pu' clicks on the job link

from the email and reviews the job from the website. Likes the job and decides to click the apply online button. Now here is where it get interesting. The 'pu' then is given

a couple of options login as an existing user or register. They register and create usrid and pwd then click the submit. The website logs the user in with their now created

usrid and pwd, so the code has to be passing the $user_id at least. Once the website logs the user in it asks for additional info, fill it out then click the (save button).

Now from this button I would like to say:

Take this user($user_id), ($resume_id) that just signed up and apply them to this position ($post_id).
Logged

Changing the world one pixel at a time...
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.146 seconds with 17 queries.