/**
  * \brief get the job list for the specified operation
  * \param $type operation type, the job list is different 
  *        according to the type of the operation
  * \return job list as array of <option> elements
  **/
 function JobListOption($type)
 {
     $job_list_option = "";
     $job_array = array();
     if (empty($type)) {
         return '';
     } else {
         if ('status' == $type || 'verbose' == $type || 'priority' == $type) {
             /* you can select scheduler besides jobs for 'status' and 'verbose',
                for 'priority', only jobs to select */
             if ('priority' != $type) {
                 $job_list_option .= "<option value='0'>scheduler</option>";
             }
             $job_array = GetRunnableJobList();
         }
     }
     /* get job list from the table jobqueque */
     if ('pause' == $type) {
         $job_array = GetJobList("tart");
     }
     if ('restart' == $type) {
         $job_array = GetJobList("Paused");
     }
     for ($i = 0; $i < sizeof($job_array); $i++) {
         $job_id = $job_array[$i];
         $job_list_option .= "<option value='{$job_id}'>{$job_id}</option>";
     }
     return $job_list_option;
 }
 /**
  * @brief get the job list for the specified operation
  * @param string $type operation type
  * @return array job list of option elements
  **/
 function jobListOption($type)
 {
     if (empty($type)) {
         return array();
     }
     $job_array = array();
     if ('status' == $type || 'verbose' == $type || 'priority' == $type) {
         $job_array = GetRunnableJobList();
         if ('priority' != $type) {
             $job_array[0] = "scheduler";
         }
     }
     if ('pause' == $type) {
         $job_array = GetJobList("Started");
     }
     if ('restart' == $type) {
         $job_array = GetJobList("Paused");
     }
     return $job_array;
 }