plugin->is_test_constructor()) { $forward_to = WWW_ROOT . "{$handler}/{$type}/{$assessment_id}/candidates"; } if (!isset($_FILES['candidates_file'])) { $TeKe->add_system_message(_("No file selected."), "error"); forward($forward_to); } else if (($handle = fopen($_FILES["candidates_file"]["tmp_name"], "r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { $first_name = $data[0]; $last_name = $data[1]; $email = $data[2]; $candidate_data = array( "assessment_id" => $assessment_id, "first_name" => $first_name, "last_name" => $last_name, "email" => $email ); $obj = $TeKe->plugin->loadType("candidate", 0); $obj_id = $obj->build($candidate_data); if (!$obj_id) { //$TeKe->add_system_message(_("At least one of the required parameters is empty."), 'error'); } /*$num = count($data); for ($c=0; $c < $num; $c++) { echo $data[$c] . "
\n"; }*/ } fclose($handle); } /*$obj = $TeKe->plugin->loadType("candidate", $obj_id); $obj_id = $obj->build(get_inputs()); if (!$obj_id) { $TeKe->add_system_message(_("At least one of the required parameters is empty."), 'error'); $TeKe->add_system_message(_("Not saved."), 'error'); forward(WWW_ROOT."{$handler}/{$type}/${assessment_id}/candidates"); }*/ $TeKe->add_system_message(_("Saved")); forward($forward_to); ?>