Exemple #1
0
                  <tr>
                    <td width="1%" nowrap>Job Title</td>
                    <td><select name="jobtitle" id="jobtitle" class="textfield" value="<?php 
if (isset($jobdetails)) {
    echo $jobdetails['jobtitle'];
}
?>
">
                      <?php 
if (isset($jobdetails)) {
    $selected = trim($jobdetails['jobtitle']);
} else {
    $selected = '';
}
$jobarray = array();
$originalarray = get_all_jobs();
foreach ($originalarray as $jobs) {
    array_push($jobarray, array('job' => $jobs));
}
echo get_select_options($jobarray, 'job', 'job', $selected);
?>
                                        </select></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td><input name="saveandnew" type="submit" id="saveandnew" value="Save &amp; New"  class="button"/>
                      <input name="save" type="submit" id="save" value="Save"  class="button"/></td>
Exemple #2
0
function list_jobs_action($uid)
{
    // needed to set the tab active
    $extras_active = true;
    $jobs_active = true;
    if (user_is_admin($uid)) {
        if (isset($_POST['price'])) {
            $job_added = get_job_by_id($_POST['id']);
            // job exists
            if ($job_added) {
                update_job($_POST['id'], $_POST['delivery'], $_POST['price']);
            } else {
                add_job($_POST['uid'], $_POST['timestamp'], $_POST['file'], $_POST['duration'], $_POST['filament'], $_POST['delivery'], $_POST['price']);
            }
        }
        // get all the uids
        $uids = get_all_uids();
        // get all the printig jobs
        $jobs = get_all_jobs();
        require 'templates/jobs.php';
    } else {
        require 'templates/login.php';
    }
}