<table border="0" width="300pt" cellspacing="0" cellpadding="2" class="item_entry">
                      <tr>
                        <td class="item_entry" style="text-align:center"><?php 
echo TEXT_PROJECTS;
?>
</td>
                      </tr>
                      <tr>
                        <td class="item_entry">
                          <?php 
echo tep_draw_form('project_selection', tep_href_link(FILENAME_ADMINISTRATION_EMPLOYEES_ROLES)) . tep_create_parameters(array(), array('mPath'), 'hidden_field');
$temp_project = new project();
?>
                            <div style="overflow:auto;width:219pt">
                              <?php 
echo tep_html_select('projects_id', tep_get_partial_array($temp_project->listing, 'id', 'name'), true, tep_not_null($_POST['projects_id']) ? $_POST['projects_id'] : 'select_none', 'onChange="this.form.submit();" size="' . (sizeof($temp_project->listing) > 1 ? sizeof($temp_project->listing) < 25 ? sizeof($temp_project->listing) : 25 : 2) . '"');
?>
                            </div>
                          </form>
                        </td>
                      </tr>
                    </table>
                  </td>
                  <td style="padding:0"><?php 
echo tep_draw_separator('pixel_trans.gif', '10', '100%');
?>
</td>
                  <td style="width:100%;vertical-align:top;padding:0">
                    <table border="0" width="100%" cellspacing="0" cellpadding="0">
                      <tr>
                        <td align="center">
echo tep_draw_input_field('employees_fullname', '', 'size="1" maxlength="64" style="width: 100%"' . ($_POST['action'] == 'enter_data' ? '' : ' disabled'));
?>
            </td>
            <td class="item_entry" colspan="3">&nbsp;</td>
          </tr>
          <tr>
            <td class="item_entry">
              <?php 
echo TEXT_PROFILE;
?>
            </td>
            <td class="item_entry" style="width:200px">
              <?php 
if ($_POST['action'] == 'enter_data' || $_POST['action'] == 'delete_entry') {
    $temp_profile = new profile();
    echo tep_html_select('profiles_id', tep_get_partial_array($temp_profile->listing, 'id', 'name'), $_POST['action'] == 'enter_data', $_POST['profiles_id'], 'size="1" maxlength="32" style="width: 100%"');
} else {
    echo tep_html_select('profiles_id', array(), false);
}
?>
            </td>
            <td class="item_entry" colspan="3">&nbsp;</td>
          </tr>
          <tr>
            <td class="item_entry" colspan="5">
              <?php 
echo tep_draw_separator('pixel_trans.gif', '100%', '10');
?>
            </td>
          </tr>
          <tr>
          <?php 
if ($_POST['action'] == 'enter_data' || $_POST['action'] == 'save_data') {
    echo tep_draw_form('activity_entry', tep_href_link(FILENAME_TIMEREGISTRATION)) . tep_create_parameters(array('action' => 'save_data'), array('mPath', 'period', 'sort_order', 'selected_date', 'projects_id', 'roles_id', 'activity_id', 'error_level_history', 'previous_activity_amount', 'original_activity_amount'), 'hidden_field');
}
?>
          <tr>
            <td class="item_entry">
              <?php 
echo TEXT_ACTIVITY_AMOUNT . ' &amp; ' . TEXT_ACTIVITY_UNIT;
?>
            </td>
            <td class="item_entry">
              <?php 
echo tep_draw_input_field('activity_amount', '', 'size="1" maxlength="6" style="width: 20%"' . ($_POST['action'] == 'enter_data' || $_POST['action'] == 'save_data' ? '' : ' disabled'));
if ($_POST['action'] == 'enter_data' || $_POST['action'] == 'save_data') {
    echo tep_html_select('tariffs_id', tep_get_partial_array(tariff::get_selectable_tariffs($_SESSION['employee']->id, tep_strftime('%Y-%m-%d', $_POST['selected_date']), $_POST['roles_id']), 'tariffs_id', 'units_name'), TRUE, $_POST['tariffs_id'], 'size="1" style="width: 80%"');
} else {
    echo tep_html_select('tariffs_id', array(), FALSE, 0, 'size="1" style="width: 80%"');
}
?>
</select>
            </td>
          </tr>
          <tr>
            <td class="item_entry">
              &nbsp;
            </td>
            <td class="item_entry">
              <table border="0" cellspacing="0" cellpadding="2" width="250" class="item_entry">
                <tr>
                  <td width="50%" class="item_entry"><?php 
              <table style="border-width:0px;width:100%;border-spacing:0">
                <tr>
                  <td style="vertical-align:top;padding:0">
                    <table border="0" width="300pt" cellspacing="0" cellpadding="2" class="item_entry">
                      <tr>
                        <td class="item_entry" style="text-align:center"><?php 
echo TEXT_EMPLOYEES;
?>
</td>
                      </tr>
                      <tr>
                        <td class="item_entry">
                          <?php 
echo tep_draw_form('employee_selection', tep_href_link(FILENAME_ADMINISTRATION_TIMESHEETS)) . tep_create_parameters(array(), array('mPath'), 'hidden_field');
$temp_employee = new employee();
echo tep_html_select('employees_id', tep_get_partial_array($temp_employee->listing, 'id', 'fullname'), true, tep_not_null($_POST['employees_id']) ? $_POST['employees_id'] : 'select_none', 'onChange="this.form.submit();" size="' . (sizeof($temp_employee->listing) > 1 ? sizeof($temp_employee->listing) < 25 ? sizeof($temp_employee->listing) : 25 : 2) . '" style="width:175pt"');
?>
                          </form>
                        </td>
                      </tr>
                    </table>
                  </td>
                  <td style="padding:0"><?php 
echo tep_draw_separator('pixel_trans.gif', '10', '100%');
?>
</td>
                  <td style="width:100%;vertical-align:top;padding:0">
                    <table border="0" width="100%" cellspacing="0" cellpadding="0">
                      <tr>
                        <td><?php 
echo tep_draw_separator('pixel_trans.gif', '100%', '20');
            <td class="item_entry" style="text-align:left">
              <?php 
echo tep_draw_checkbox_field('roles_mandatory_ticket_entry', true, false, $_POST['action'] == 'enter_data' ? '' : ' disabled');
?>
            </td>
            <td class="item_entry">&nbsp;</td>
            <td class="item_entry">
              <?php 
echo TEXT_CATEGORIES;
?>
            </td>
            <td class="item_entry"  style="width:150px">
              <?php 
if ($_POST['action'] == 'enter_data' || $_POST['action'] == 'delete_entry') {
    $temp_category = new category();
    echo tep_html_select('categories_id', tep_get_partial_array($temp_category->listing, 'id', 'name'), $_POST['action'] == 'enter_data', $_POST['categories_id'], 'size="1" maxlength="20" style="width: 100%"');
} else {
    echo tep_html_select('categories_id', array(), false);
}
?>
            </td>
          </tr>
          <tr>
            <td class="item_entry" colspan="5">
              <?php 
echo tep_draw_separator('pixel_trans.gif', '100%', '10');
?>
            </td>
          </tr>
          <tr>
            <td class="item_entry" style="text-align:left">
} else {
    echo tep_html_select('roles_id', array(), false);
}
?>
            </td>
            <td class="item_entry">&nbsp;</td>
            <td class="item_entry">
              <?php 
echo TEXT_EMPLOYEES;
?>
            </td>
            <td class="item_entry" style="width:150px">
              <?php 
if ($_POST['action'] == 'enter_data' || $_POST['action'] == 'save_data' || $_POST['action'] == 'delete_entry') {
    $temp_employee = new employee();
    echo tep_html_select('employees_id', tep_get_partial_array($temp_employee->listing, 'id', 'fullname'), $_POST['action'] == 'enter_data' && !tep_not_null($_POST['employees_roles_id']), $_POST['employees_id'], 'size="1" maxlength="20" style="width: 100%"');
} else {
    echo tep_html_select('employees_id', array(), false);
}
?>
            </td>
          </tr>
          <tr>
            <td class="item_entry">
              <?php 
echo TEXT_EMPLOYEES_ROLES_START_DATE;
?>
            </td>
            <td class="item_entry">
              <?php 
echo tep_draw_input_field('employees_roles_start_date_display', '', 'size="1" maxlength="10" style="width: 100%"' . ($_POST['action'] == 'enter_data' ? '' : ' disabled'));
            <td class="item_entry" style="width:150px">
              <?php 
echo tep_draw_input_field('tariffs_amount_display', '', 'size="1" maxlength="8" style="width: 100%"' . ($_POST['action'] == 'enter_data' ? '' : ' disabled'));
?>
            </td>
            <td class="item_entry">&nbsp;</td>
            <td class="item_entry">
              <?php 
echo TEXT_UNITS;
?>
            </td>
            <td class="item_entry" style="width:150px">
              <?php 
if ($_POST['action'] == 'enter_data' || $_POST['action'] == 'delete_entry') {
    $temp_unit = new unit();
    echo tep_html_select('units_id', tep_get_partial_array($temp_unit->listing, 'id', 'name'), $_POST['action'] == 'enter_data' && !tep_not_null($_POST['tariffs_id']), $_POST['units_id'], 'size="1" maxlength="20" style="width: 100%"');
} else {
    echo tep_html_select('units_id', array(), false);
}
?>
            </td>
          </tr>
          <tr>
            <td class="item_entry">
              <?php 
echo TEXT_TARIFFS_START_DATE;
?>
            </td>
            <td class="item_entry">
              <?php 
echo tep_draw_input_field('tariffs_start_date_display', '', 'size="1" maxlength="10" style="width: 100%"' . ($_POST['action'] == 'enter_data' ? '' : ' disabled'));