Beispiel #1
0
function people_edit_skill_inventory($user_id)
{
    global $PHP_SELF, $Language;
    $sql = "SELECT * FROM people_skill_inventory WHERE user_id='{$user_id}'";
    $result = db_query($sql);
    $title_arr = array();
    $title_arr[] = $Language->getText('people_utils', 'skill');
    $title_arr[] = $Language->getText('people_utils', 'level');
    $title_arr[] = $Language->getText('people_utils', 'experience');
    $title_arr[] = $Language->getText('people_utils', 'action');
    echo html_build_list_table_top($title_arr);
    $rows = db_numrows($result);
    if (!$result || $rows < 1) {
        echo '
			<TR><TD COLSPAN="4"><H2>' . $Language->getText('people_utils', 'no_skill_inventory_setup_up') . '</H2></TD></TR>';
        echo db_error();
    } else {
        for ($i = 0; $i < $rows; $i++) {
            echo '
			<FORM ACTION="' . $PHP_SELF . '" METHOD="POST">
			<INPUT TYPE="HIDDEN" NAME="skill_inventory_id" VALUE="' . db_result($result, $i, 'skill_inventory_id') . '">
			<TR class="' . util_get_alt_row_color($i) . '">
				<TD><FONT SIZE="-1">' . people_get_skill_name(db_result($result, $i, 'skill_id')) . '</TD>
				<TD><FONT SIZE="-1">' . people_skill_level_box('skill_level_id', db_result($result, $i, 'skill_level_id')) . '</TD>
				<TD><FONT SIZE="-1">' . people_skill_year_box('skill_year_id', db_result($result, $i, 'skill_year_id')) . '</TD>
				<TD NOWRAP><FONT SIZE="-1"><INPUT TYPE="SUBMIT" NAME="update_skill_inventory" VALUE="' . $Language->getText('people_utils', 'update') . '"> &nbsp; 
					<INPUT TYPE="SUBMIT" NAME="delete_from_skill_inventory" VALUE="' . $Language->getText('people_utils', 'delete') . '"></TD>
				</TR></FORM>';
        }
    }
    //add a new skill
    $i++;
    //for row coloring
    echo '
	<TR><TD COLSPAN="4"><H3>' . $Language->getText('people_utils', 'add_new_skill') . '</H3></TD></TR>
	<FORM ACTION="' . $PHP_SELF . '" METHOD="POST">
	<TR class="' . util_get_alt_row_color($i) . '">
		<TD><FONT SIZE="-1">' . people_skill_box('skill_id') . '</TD>
		<TD><FONT SIZE="-1">' . people_skill_level_box('skill_level_id') . '</TD>
		<TD><FONT SIZE="-1">' . people_skill_year_box('skill_year_id') . '</TD>
		<TD NOWRAP><FONT SIZE="-1"><INPUT TYPE="SUBMIT" NAME="add_to_skill_inventory" VALUE="' . $Language->getText('people_utils', 'add_skill') . '"></TD>
	</TR></FORM>';
    echo '
		</TABLE>';
}
function people_edit_job_inventory($job_id, $group_id)
{
    global $PHP_SELF;
    $sql = "SELECT * FROM people_job_inventory WHERE job_id='{$job_id}'";
    $result = db_query($sql);
    $title_arr = array();
    $title_arr[] = 'Skill';
    $title_arr[] = 'Level';
    $title_arr[] = 'Experience';
    $title_arr[] = 'Action';
    echo html_build_list_table_top($title_arr);
    $rows = db_numrows($result);
    if (!$result || $rows < 1) {
        echo '
			<TR><TD COLSPAN="4"><H2>No Skill Inventory Set Up</H2></TD></TR>';
        echo db_error();
    } else {
        for ($i = 0; $i < $rows; $i++) {
            echo '
			<FORM ACTION="' . $PHP_SELF . '" METHOD="POST">
			<INPUT TYPE="HIDDEN" NAME="job_inventory_id" VALUE="' . db_result($result, $i, 'job_inventory_id') . '">
			<INPUT TYPE="HIDDEN" NAME="job_id" VALUE="' . db_result($result, $i, 'job_id') . '">
			<INPUT TYPE="HIDDEN" NAME="group_id" VALUE="' . $group_id . '">
			<TR BGCOLOR="' . html_get_alt_row_color($i) . '">
				<TD><FONT SIZE="-1">' . people_get_skill_name(db_result($result, $i, 'skill_id')) . '</TD>
				<TD><FONT SIZE="-1">' . people_skill_level_box('skill_level_id', db_result($result, $i, 'skill_level_id')) . '</TD>
				<TD><FONT SIZE="-1">' . people_skill_year_box('skill_year_id', db_result($result, $i, 'skill_year_id')) . '</TD>
				<TD NOWRAP><FONT SIZE="-1"><INPUT TYPE="SUBMIT" NAME="update_job_inventory" VALUE="Update"> &nbsp; 
					<INPUT TYPE="SUBMIT" NAME="delete_from_job_inventory" VALUE="Delete"></TD>
				</TR></FORM>';
        }
    }
    //add a new skill
    $i++;
    //for row coloring
    echo '
	<TR><TD COLSPAN="4"><H3>Add A New Skill</H3></TD></TR>
	<FORM ACTION="' . $PHP_SELF . '" METHOD="POST">
	<INPUT TYPE="HIDDEN" NAME="job_id" VALUE="' . $job_id . '">
	<INPUT TYPE="HIDDEN" NAME="group_id" VALUE="' . $group_id . '">
	<TR BGCOLOR="' . html_get_alt_row_color($i) . '">
		<TD><FONT SIZE="-1">' . people_skill_box('skill_id') . '</TD>
		<TD><FONT SIZE="-1">' . people_skill_level_box('skill_level_id') . '</TD>
		<TD><FONT SIZE="-1">' . people_skill_year_box('skill_year_id') . '</TD>
		<TD NOWRAP><FONT SIZE="-1"><INPUT TYPE="SUBMIT" NAME="add_to_job_inventory" VALUE="Add Skill"></TD>
	</TR></FORM>';
    echo '
		</TABLE>';
}
Beispiel #3
0
function people_edit_job_inventory($job_id, $group_id)
{
    global $HTML;
    $sql = "SELECT * FROM people_job_inventory WHERE job_id='{$job_id}'";
    $result = db_query($sql);
    $title_arr = array();
    $title_arr[] = _('Skill') . utils_requiredField();
    $title_arr[] = _('Level') . utils_requiredField();
    $title_arr[] = _('Experience') . utils_requiredField();
    $title_arr[] = _('Action');
    echo $HTML->listTableTop($title_arr);
    $rows = db_numrows($result);
    if (!$result || $rows < 1) {
        echo '
			<tr><td colspan="4"><h2>' . _('No Skill Inventory Set Up') . '</h2></td></tr>';
        echo db_error();
    } else {
        for ($i = 0; $i < $rows; $i++) {
            echo '
			<tr ' . $HTML->boxGetAltRowStyle($i) . '>
			<form action="' . getStringFromServer('PHP_SELF') . '" method="post">
			<input type="hidden" name="job_inventory_id" value="' . db_result($result, $i, 'job_inventory_id') . '" />
			<input type="hidden" name="job_id" value="' . db_result($result, $i, 'job_id') . '" />
			<input type="hidden" name="group_id" value="' . $group_id . '" />
				<td width="25%">' . people_get_skill_name(db_result($result, $i, 'skill_id')) . '</td>
				<td width="25%">' . people_skill_level_box('skill_level_id', db_result($result, $i, 'skill_level_id')) . '</td>
				<td width="25%">' . people_skill_year_box('skill_year_id', db_result($result, $i, 'skill_year_id')) . '</td>
				<td width="25%" nowrap="nowrap"><input type="submit" name="update_job_inventory" value="' . _('Update') . '" /> &nbsp;
					<input type="submit" name="delete_from_job_inventory" value="' . _('Delete') . '" /></td>
				</form></tr>';
        }
    }
    //add a new skill
    $i++;
    //for row coloring
    echo '
	<tr><td colspan="4"><h3>' . _('Add a new skill') . '</h3></td></tr>
	<tr ' . $HTML->boxGetAltRowStyle($i) . '>
	<form action="' . getStringFromServer('PHP_SELF') . '" method="post">
	<input type="hidden" name="job_id" value="' . $job_id . '" />
	<input type="hidden" name="group_id" value="' . $group_id . '" />
		<td width="25%">' . people_skill_box('skill_id') . '</td>
		<td width="25%">' . people_skill_level_box('skill_level_id') . '</td>
		<td width="25%">' . people_skill_year_box('skill_year_id') . '</td>
		<td width="25%" nowrap="nowrap"><input type="submit" name="add_to_job_inventory" value="' . _('Add Skill') . '" /></td>
	</form></tr>';
    echo $HTML->listTableBottom();
}