function createCSVFileToDownload($form_dataAr = array()) { if (!isset($form_dataAr['user_fc']) || empty($form_dataAr['user_fc'])) { $fiscal_code = translateFN("L'utente non ha fornito il codice fiscale"); } else { $fiscal_code = $form_dataAr['user_fc']; } $scoresAr = array(0 => '0 - ' . EguidanceSession::textForScore(0), 1 => '1 - ' . EguidanceSession::textForScore(1), 2 => '2 - ' . EguidanceSession::textForScore(2), 3 => '3 - ' . EguidanceSession::textForScore(3)); $typeAr = array(1 => EguidanceSession::textLabelForField('sl_1'), 2 => EguidanceSession::textLabelForField('sl_2'), 3 => EguidanceSession::textLabelForField('sl_3'), 4 => EguidanceSession::textLabelForField('sl_4'), 5 => EguidanceSession::textLabelForField('sl_5'), 6 => EguidanceSession::textLabelForField('sl_6'), 7 => EguidanceSession::textLabelForField('sl_7')); $t_of_guidance = (int) $form_dataAr['type_of_guidance']; $type_of_guidance = $typeAr[$t_of_guidance]; /* * CSA total */ $user_fullname = $form_dataAr['user_fullname']; $user_country = $form_dataAr['user_country']; $service_duration = $form_dataAr['service_duration']; $ud_1 = $form_dataAr['ud_1']; $ud_2 = $form_dataAr['ud_2']; $ud_3 = $form_dataAr['ud_3']; //$csa_total = (int)$form_dataAr['csa_1_score'] + (int)$form_dataAr['csa_2_score'] + (int)$form_dataAr['csa_3_score']; $csa_comments = $form_dataAr['ud_comments']; $pcitems1 = (int) $form_dataAr['pc_1']; $pcitems2 = (int) $form_dataAr['pc_2']; $pcitems3 = (int) $form_dataAr['pc_3']; $pcitems4 = (int) $form_dataAr['pc_4']; $pcitems5 = (int) $form_dataAr['pc_5']; $pcitems6 = (int) $form_dataAr['pc_6']; $pcitems_total = $pcitems1 + $pcitems2 + $pcitems3 + $pcitems4 + $pcitems5 + $pcitems6; $pcitems_comments = $form_dataAr['pc_comments']; $ba1 = (int) $form_dataAr['ba_1']; $ba2 = (int) $form_dataAr['ba_2']; $ba3 = (int) $form_dataAr['ba_3']; $ba4 = (int) $form_dataAr['ba_4']; $ba_total = $ba1 + $ba2 + $ba3 + $ba4; $ba_comments = $form_dataAr['ba_comments']; $t1 = (int) $form_dataAr['t_1']; $t2 = (int) $form_dataAr['t_2']; $t3 = (int) $form_dataAr['t_3']; $t4 = (int) $form_dataAr['t_4']; $t_total = $t1 + $t2 + $t3 + $t4; $t_comments = $form_dataAr['t_comments']; $pe1 = (int) $form_dataAr['pe_1']; $pe2 = (int) $form_dataAr['pe_2']; $pe3 = (int) $form_dataAr['pe_3']; $pe_total = $pe1 + $pe2 + $pe3; $pe_comments = $form_dataAr['pe_comments']; $ci1 = (int) $form_dataAr['ci_1']; $ci2 = (int) $form_dataAr['ci_2']; $ci3 = (int) $form_dataAr['ci_3']; $ci4 = (int) $form_dataAr['ci_4']; $ci_total = $ci1 + $ci2 + $ci3 + $ci4; $ci_comments = $form_dataAr['ci_comments']; $m1 = (int) $form_dataAr['m_1']; $m2 = (int) $form_dataAr['m_2']; $m_total = $m1 + $m2; $m_comments = $form_dataAr['m_comments']; $oc_comments = $form_dataAr['other_comments']; $dataAr = array(array(translateFN("Numero di codice fiscale/passaporto"), translateFN("Tipologia di intervento di orientamento a distanza")), array($fiscal_code, $type_of_guidance), array(translateFN("Nome e cognome dell'utente")), array($user_fullname), array(translateFN("Nazionalità dell'utente")), array($user_country), array(translateFN("Durata totale del vostro percorso di orientamento")), array($service_duration), array(translateFN('Caratteristiche utente'), translateFN('Monitoraggio del percorso di e-guidance')), array('', translateFN('Prima sessione di orientamento a distanza'), translateFN('Sessioni di orientamento a distanza successive alla prima'), translateFN('Ultima sessione di orientamento a distanza')), array(EguidanceSession::textLabelForField('area_pc')), array(EguidanceSession::textLabelForField('ud_1'), $ud_1), array(EguidanceSession::textLabelForField('ud_2'), $ud_2), array(EguidanceSession::textLabelForField('ud_3'), $ud_3), array(EguidanceSession::textLabelForField('ud_comments'), $csa_comments), array(EguidanceSession::textLabelForField('pc_title')), array(EguidanceSession::textLabelForField('pc_1'), $scoresAr[$pcitems1]), array(EguidanceSession::textLabelForField('pc_2'), $scoresAr[$pcitems2]), array(EguidanceSession::textLabelForField('pc_3'), $scoresAr[$pcitems3]), array(EguidanceSession::textLabelForField('pc_4'), $scoresAr[$pcitems4]), array(EguidanceSession::textLabelForField('pc_5'), $scoresAr[$pcitems5]), array(EguidanceSession::textLabelForField('pc_6'), $scoresAr[$pcitems6]), array(translateFN('Totale'), $pcitems_total), array(EguidanceSession::textLabelForField('pc_comments'), $pcitems_comments), array(EguidanceSession::textLabelForField('area_pp')), array(EguidanceSession::textLabelForField('ba_title')), array(EguidanceSession::textLabelForField('ba_1'), $scoresAr[$ba1]), array(EguidanceSession::textLabelForField('ba_2'), $scoresAr[$ba2]), array(EguidanceSession::textLabelForField('ba_3'), $scoresAr[$ba3]), array(EguidanceSession::textLabelForField('ba_4'), $scoresAr[$ba4]), array(translateFN('Totale'), $ba_total), array(EguidanceSession::textLabelForField('ba_comments'), $ba_comments), array(EguidanceSession::textLabelForField('t_title')), array(EguidanceSession::textLabelForField('t_1'), $scoresAr[$t1]), array(EguidanceSession::textLabelForField('t_2'), $scoresAr[$t2]), array(EguidanceSession::textLabelForField('t_3'), $scoresAr[$t3]), array(EguidanceSession::textLabelForField('t_4'), $scoresAr[$t4]), array(translateFN('Totale'), $t_total), array(EguidanceSession::textLabelForField('t_comments'), $t_comments), array(EguidanceSession::textLabelForField('pe_title')), array(EguidanceSession::textLabelForField('pe_1'), $scoresAr[$pe1]), array(EguidanceSession::textLabelForField('pe_2'), $scoresAr[$pe2]), array(EguidanceSession::textLabelForField('pe_3'), $scoresAr[$pe3]), array(translateFN('Totale'), $pe_total), array(EguidanceSession::textLabelForField('pe_comments'), $pe_comments), array(EguidanceSession::textLabelForField('ci_title')), array(EguidanceSession::textLabelForField('ci_1'), $scoresAr[$ci1]), array(EguidanceSession::textLabelForField('ci_2'), $scoresAr[$ci2]), array(EguidanceSession::textLabelForField('ci_3'), $scoresAr[$ci3]), array(EguidanceSession::textLabelForField('ci_4'), $scoresAr[$ci4]), array(translateFN('Totale'), $ci_total), array(EguidanceSession::textLabelForField('ci_comments'), $ci_comments), array(EguidanceSession::textLabelForField('m_title')), array(EguidanceSession::textLabelForField('m_1'), $scoresAr[$m1]), array(EguidanceSession::textLabelForField('m_2'), $scoresAr[$m2]), array(translateFN('Totale'), $m_total), array(EguidanceSession::textLabelForField('m_comments'), $m_comments), array(EguidanceSession::textLabelForField('other_comments'), $oc_comments)); $file_content = createCSVFileContent($dataAr); header("Cache-Control: public"); header("Content-Description: File Transfer"); header("Content-Disposition: attachment; filename=outputform.csv"); header("Content-type: application/csv; charset=UTF-8"); echo $file_content; exit; }
} else { $service_data = new CText(''); } } /* * Eguidance sessions data to display */ $eguidance_sessionsAr = $dh->get_eguidance_sessions($id_course_instance); if (AMA_DataHandler::isError($eguidance_sessionsAr) || count($eguidance_sessionsAr) == 0) { $eguidance_data = new CText(''); } else { $thead_data = array(translateFN('Eguidance sessions conducted'), '', '', ''); $tbody_data = array(); foreach ($eguidance_sessionsAr as $eguidance_sessionAr) { $eguidance_date = ts2dFN($eguidance_sessionAr['data_ora']); $eguidance_type = EguidanceSession::textForEguidanceType($eguidance_sessionAr['tipo_eguidance']); $href = 'eguidance_tutor_form.php?event_token=' . $eguidance_sessionAr['event_token'] . $href_suffix; $eguidance_form = CDOMElement::create('a', "href:{$href}"); $eguidance_form->addChild(new CText('edit')); $href = 'user_service_detail.php?op=csv&event_token=' . $eguidance_sessionAr['event_token']; $download_csv = CDOMElement::create('a', "href:{$href}"); $download_csv->addChild(new CText('download csv')); $tbody_data[] = array($eguidance_date, $eguidance_type, $eguidance_form, $download_csv); } $eguidance_data = BaseHtmlLib::tableElement('', $thead_data, $tbody_data); } /* * Future appointments with this user * * * Potremmo avere una classe
public static function getEguidanceTutorForm(ADALoggableUser $tutoredUserObj, $service_infoAr = array(), $form_dataAr = array(), $fill_textareas = FALSE) { $form = CDOMElement::create('form', 'id:eguidance_tutor_form, name: eguidance_tutor_form, action:eguidance_tutor_form.php, method:post'); $area_personal_conditions = CDOMElement::create('div'); $area_personal_conditions->addChild(new CText(EguidanceSession::textLabelForField('area_pc'))); $form->addChild($area_personal_conditions); /* * Fiscal code */ $user_fiscal_code = $tutoredUserObj->getFiscalCode(); if (!is_null($user_fiscal_code)) { $hidden_fc = CDOMElement::create('hidden', 'id:user_fc, name:user_fc'); $hidden_fc->setAttribute('value', $user_fiscal_code); $form->addChild($hidden_fc); $ufc = $user_fiscal_code; } else { $ufc = translateFN("L'utente non ha fornito il codice fiscale"); } if (isset($form_dataAr['is_popup'])) { $hidden_popup = CDOMElement::create('hidden', 'id:is_popup, name:is_popup'); $hidden_popup->setAttribute('value', '1'); $form->addChild($hidden_popup); } /* * Hidden user data */ $user_fullname = $tutoredUserObj->nome . ' ' . $tutoredUserObj->cognome; $user_country = $tutoredUserObj->getCountry(); $user_birthdate = $tutoredUserObj->getBirthDate(); $user_birthcity = $tutoredUserObj->getBirthCity(); $user_birthprovince = $tutoredUserObj->getBirthProvince(); $user_gender = $tutoredUserObj->getGender(); $user_foreign_culture = 'FOREIGN CULTURE'; if (($id = DataValidator::is_uinteger($form_dataAr['id'])) !== FALSE) { $hidden_id_eguidance_session = CDOMElement::create('hidden', 'id:id_eguidance_session, name:id_eguidance_session'); $hidden_id_eguidance_session->setAttribute('value', $id); $form->addChild($hidden_id_eguidance_session); } $hidden_id_utente = CDOMElement::create('hidden', 'id:id_utente, name:id_utente'); $hidden_id_utente->setAttribute('value', $tutoredUserObj->getId()); $hidden_id_istanza_corso = CDOMElement::create('hidden', 'id:id_istanza_corso, name:id_istanza_corso'); $hidden_id_istanza_corso->setAttribute('value', $service_infoAr['id_istanza_corso']); $hidden_event_token = CDOMElement::create('hidden', 'id:event_token, name:event_token'); $hidden_event_token->setAttribute('value', $service_infoAr['event_token']); $hidden_user_fullname = CDOMElement::create('hidden', 'id:user_fullname, name: user_fullname'); $hidden_user_fullname->setAttribute('value', $user_fullname); $hidden_user_country = CDOMElement::create('hidden', 'id:user_country, name:user_country'); $hidden_user_country->setAttribute('value', $user_country); $hidden_service_duration = CDOMElement::create('hidden', 'id:service_duration, name:service_duration'); $hidden_service_duration->setAttribute('value', 10); $hidden_user_birthdate = CDOMElement::create('hidden', 'id:ud_1, name:ud_1'); $hidden_user_birthdate->setAttribute('value', $user_birthdate); $hidden_user_gender = CDOMElement::create('hidden', 'id:ud_2, name:ud_2'); $hidden_user_gender->setAttribute('value', $user_gender); $hidden_user_foreign_culture = CDOMElement::create('hidden', 'id:ud_3, name:ud_3'); $hidden_user_foreign_culture->setAttribute('value', $user_foreign_culture); $hidden_user_birthcity = CDOMElement::create('hidden', 'id:ud_4, name:ud_4'); $hidden_user_birthcity->setAttribute('value', $user_birthcity); $hidden_user_birthprovince = CDOMElement::create('hidden', 'id:ud_5, name:ud_5'); $hidden_user_birthprovince->setAttribute('value', $user_birthprovince); $form->addChild($hidden_id_utente); $form->addChild($hidden_id_istanza_corso); $form->addChild($hidden_event_token); $form->addChild($hidden_user_fullname); $form->addChild($hidden_user_country); $form->addChild($hidden_service_duration); $form->addChild($hidden_user_birthdate); $form->addChild($hidden_user_birthcity); $form->addChild($hidden_user_birthprovince); $form->addChild($hidden_user_gender); $form->addChild($hidden_user_foreign_culture); // $ufc_thead = array(translateFN("Dati utente"),''); // $ufc_tbody = array( // array(translateFN("Codice fiscale dell'utente"), $user_fiscal_code), // array(translateFN("Nome e cognome dell'utente"), $user_ns), // array(translateFN("Nazionalità dell'utente"), $user_country) // ); // $ufc_table = BaseHtmlLib::tableElement('', $ufc_thead, $ufc_tbody); $ufc_table = self::getEguidanceSessionUserDataTable($tutoredUserObj); $form->addChild($ufc_table); /* * Type of e-guidance action */ if (is_array($service_infoAr) && isset($service_infoAr[3])) { $service_level = $service_infoAr[3]; } if ($service_level == 2) { $typeAr = array(1 => EguidanceSession::textLabelForField('sl_1'), 2 => EguidanceSession::textLabelForField('sl_2')); } else { if ($service_level == 3) { $typeAr = array(3 => EguidanceSession::textLabelForField('sl_3'), 4 => EguidanceSession::textLabelForField('sl_4')); } else { if ($service_level == 4) { $typeAr = array(5 => EguidanceSession::textLabelForField('sl_5'), 6 => EguidanceSession::textLabelForField('sl_6'), 7 => EguidanceSession::textLabelForField('sl_7')); } else { $typeAr = array(); } } } //FIXME: qui passo $form_dataAr['tipo_eguidance'], ma dovrei passare $form_dataAr['type_of_guidance'] $toe_thead = array(EguidanceSession::textLabelForField('toe_title')); $toe_tbody = array(array(BaseHtmlLib::selectElement2('id:type_of_guidance, name:type_of_guidance', $typeAr, $form_dataAr['tipo_eguidance']))); $toe_table = BaseHtmlLib::tableElement('', $toe_thead, $toe_tbody); $form->addChild($toe_table); $scoresAr = EguidanceSession::scoresArray(); //$textarea_default_text = translateFN('Inserire i vostri commenti'); /* * User's features */ // Critical socio anagraphic data $ud_1_select = BaseHtmlLib::selectElement2('id:ud_1, name:ud_1', $scoresAr, $form_dataAr['ud_1']); $ud_2_select = BaseHtmlLib::selectElement2('id:ud_2, name:ud_2', $scoresAr, $form_dataAr['ud_2']); $ud_3_select = BaseHtmlLib::selectElement2('id:ud_3, name:ud_3', $scoresAr, $form_dataAr['ud_3']); $ud_4_select = BaseHtmlLib::selectElement2('id:ud_4, name:ud_4', $scoresAr, $form_dataAr['ud_4']); $ud_5_select = BaseHtmlLib::selectElement2('id:ud_5, name:ud_5', $scoresAr, $form_dataAr['ud_5']); $csa_thead = array(EguidanceSession::textLabelForField('ud_title'), ''); $csa_tbody = array(array(EguidanceSession::textLabelForField('ud_1'), $ud_1_select), array(EguidanceSession::textLabelForField('ud_4'), $ud_4_select), array(EguidanceSession::textLabelForField('ud_5'), $ud_5_select), array(EguidanceSession::textLabelForField('ud_2'), $ud_2_select), array(EguidanceSession::textLabelForField('ud_3'), $ud_3_select)); $csa_table = BaseHtmlLib::tableElement('', $csa_thead, $csa_tbody); $form->addChild($csa_table); $label = EguidanceSession::textLabelForField('ud_comments'); $form->addChild(self::displayTextAreaForTutorComments('ud_comments', $label, $form_dataAr, $fill_textareas)); // Personal critical items $pcitems_1_select = BaseHtmlLib::selectElement2('id:pc_1, name:pc_1', $scoresAr, $form_dataAr['pc_1']); $pcitems_2_select = BaseHtmlLib::selectElement2('id:pc_2, name:pc_2', $scoresAr, $form_dataAr['pc_2']); $pcitems_3_select = BaseHtmlLib::selectElement2('id:pc_3, name:pc_3', $scoresAr, $form_dataAr['pc_3']); $pcitems_4_select = BaseHtmlLib::selectElement2('id:pc_4, name:pc_4', $scoresAr, $form_dataAr['pc_4']); $pcitems_5_select = BaseHtmlLib::selectElement2('id:pc_5, name:pc_5', $scoresAr, $form_dataAr['pc_5']); $pcitems_6_select = BaseHtmlLib::selectElement2('id:pc_6, name:pc_6', $scoresAr, $form_dataAr['pc_6']); $pcitems_thead = array(EguidanceSession::textLabelForField('pc_title'), translateFN('Select a score')); $pcitems_tbody = array(array(EguidanceSession::textLabelForField('pc_1'), $pcitems_1_select), array(EguidanceSession::textLabelForField('pc_2'), $pcitems_2_select), array(EguidanceSession::textLabelForField('pc_3'), $pcitems_3_select), array(EguidanceSession::textLabelForField('pc_4'), $pcitems_4_select), array(EguidanceSession::textLabelForField('pc_5'), $pcitems_5_select), array(EguidanceSession::textLabelForField('pc_6'), $pcitems_6_select)); $pcitems_table = BaseHtmlLib::tableElement('', $pcitems_thead, $pcitems_tbody); $form->addChild($pcitems_table); $label = EguidanceSession::textLabelForField('pc_comments'); $form->addChild(self::displayTextAreaForTutorComments('pc_comments', $label, $form_dataAr, $fill_textareas)); $area_of_the_job = CDOMElement::create('div'); $area_of_the_job->addChild(new CText(EguidanceSession::textLabelForField('area_pp'))); $form->addChild($area_of_the_job); /* * Bonds/availability */ $ba_1_select = BaseHtmlLib::selectElement2('id:ba_1, name:ba_1', $scoresAr, $form_dataAr['ba_1']); $ba_2_select = BaseHtmlLib::selectElement2('id:ba_2, name:ba_2', $scoresAr, $form_dataAr['ba_2']); $ba_3_select = BaseHtmlLib::selectElement2('id:ba_3, name:ba_3', $scoresAr, $form_dataAr['ba_3']); $ba_4_select = BaseHtmlLib::selectElement2('id:ba_4, name:ba_4', $scoresAr, $form_dataAr['ba_4']); $ba_thead = array(EguidanceSession::textLabelForField('ba_title'), translateFN('Select a score')); $ba_tbody = array(array(EguidanceSession::textLabelForField('ba_1'), $ba_1_select), array(EguidanceSession::textLabelForField('ba_2'), $ba_2_select), array(EguidanceSession::textLabelForField('ba_3'), $ba_3_select), array(EguidanceSession::textLabelForField('ba_4'), $ba_4_select)); $ba_table = BaseHtmlLib::tableElement('', $ba_thead, $ba_tbody); $form->addChild($ba_table); $label = EguidanceSession::textLabelForField('ba_comments'); $form->addChild(self::displayTextAreaForTutorComments('ba_comments', $label, $form_dataAr, $fill_textareas)); /* * Training */ $t_1_select = BaseHtmlLib::selectElement2('id:t_1, name:t_1', $scoresAr, $form_dataAr['t_1']); $t_2_select = BaseHtmlLib::selectElement2('id:t_2, name:t_2', $scoresAr, $form_dataAr['t_2']); $t_3_select = BaseHtmlLib::selectElement2('id:t_3, name:t_3', $scoresAr, $form_dataAr['t_3']); $t_4_select = BaseHtmlLib::selectElement2('id:t_4, name:t_4', $scoresAr, $form_dataAr['t_4']); $t_thead = array(EguidanceSession::textLabelForField('t_title'), translateFN('Select a score')); $t_tbody = array(array(EguidanceSession::textLabelForField('t_1'), $t_1_select), array(EguidanceSession::textLabelForField('t_2'), $t_2_select), array(EguidanceSession::textLabelForField('t_3'), $t_3_select), array(EguidanceSession::textLabelForField('t_4'), $t_4_select)); $t_table = BaseHtmlLib::tableElement('', $t_thead, $t_tbody); $form->addChild($t_table); $label = EguidanceSession::textLabelForField('t_comments'); $form->addChild(self::displayTextAreaForTutorComments('t_comments', $label, $form_dataAr, $fill_textareas)); /* * Professional experiences */ $pe_1_select = BaseHtmlLib::selectElement2('id:pe_1, name:pe_1', $scoresAr, $form_dataAr['pe_1']); $pe_2_select = BaseHtmlLib::selectElement2('id:pe_2, name:pe_2', $scoresAr, $form_dataAr['pe_2']); $pe_3_select = BaseHtmlLib::selectElement2('id:pe_3, name:pe_3', $scoresAr, $form_dataAr['pe_3']); $pe_thead = array(EguidanceSession::textLabelForField('pe_title'), translateFN('Select a score')); $pe_tbody = array(array(EguidanceSession::textLabelForField('pe_1'), $pe_1_select), array(EguidanceSession::textLabelForField('pe_2'), $pe_2_select), array(EguidanceSession::textLabelForField('pe_3'), $pe_3_select)); $pe_table = BaseHtmlLib::tableElement('', $pe_thead, $pe_tbody); $form->addChild($pe_table); $label = EguidanceSession::textLabelForField('pe_comments'); $form->addChild(self::displayTextAreaForTutorComments('pe_comments', $label, $form_dataAr, $fill_textareas)); /* * Critical issues ... */ $ci_1_select = BaseHtmlLib::selectElement2('id:ci_1, name:ci_1', $scoresAr, $form_dataAr['ci_1']); $ci_2_select = BaseHtmlLib::selectElement2('id:ci_2, name:ci_2', $scoresAr, $form_dataAr['ci_2']); $ci_3_select = BaseHtmlLib::selectElement2('id:ci_3, name:ci_3', $scoresAr, $form_dataAr['ci_3']); $ci_4_select = BaseHtmlLib::selectElement2('id:ci_4, name:ci_4', $scoresAr, $form_dataAr['ci_4']); $ci_thead = array(EguidanceSession::textLabelForField('ci_title'), translateFN('Select a score')); $ci_tbody = array(array(EguidanceSession::textLabelForField('ci_1'), $ci_1_select), array(EguidanceSession::textLabelForField('ci_2'), $ci_2_select), array(EguidanceSession::textLabelForField('ci_3'), $ci_3_select), array(EguidanceSession::textLabelForField('ci_4'), $ci_4_select)); $ci_table = BaseHtmlLib::tableElement('', $ci_thead, $ci_tbody); $form->addChild($ci_table); $label = EguidanceSession::textLabelForField('ci_comments'); $form->addChild(self::displayTextAreaForTutorComments('ci_comments', $label, $form_dataAr, $fill_textareas)); /* * Motivazione + Other particular comments */ $m_1_select = BaseHtmlLib::selectElement2('id:m_1, name:m_1', $scoresAr, $form_dataAr['m_1']); $m_2_select = BaseHtmlLib::selectElement2('id:m_2, name:m_2', $scoresAr, $form_dataAr['m_2']); $m_thead = array(EguidanceSession::textLabelForField('m_title'), translateFN('Select a score')); $m_tbody = array(array(EguidanceSession::textLabelForField('m_1'), $m_1_select), array(EguidanceSession::textLabelForField('m_2'), $m_2_select)); $m_table = BaseHtmlLib::tableElement('', $m_thead, $m_tbody); $form->addChild($m_table); $label = EguidanceSession::textLabelForField('m_comments'); $form->addChild(self::displayTextAreaForTutorComments('m_comments', $label, $form_dataAr, $fill_textareas)); $label = EguidanceSession::textLabelForField('other_comments'); $form->addChild(self::displayTextAreaForTutorComments('other_comments', $label, $form_dataAr, $fill_textareas)); /* * Form buttons */ $buttons = CDOMElement::create('div', 'id:buttons, name:buttons'); $submit = CDOMElement::create('submit', 'id:submit, name:submit'); $submit->setAttribute('value', translateFN('Save')); // $reset = CDOMElement::create('reset'); $buttons->addChild($submit); // $buttons->addChild($reset); $form->addChild($buttons); return $form; }