function wichReport($task)
 {
     switch ($task) {
         //advanced report
         case 'csv1':
             $sql = SQLadvancedTermReport($_GET);
             break;
             //free terms
         //free terms
         case 'csv2':
             $sql = SQLverTerminosLibres();
             break;
             //duplicated terms
         //duplicated terms
         case 'csv3':
             $sql = SQLverTerminosRepetidos();
             break;
             //polit BT terms
         //polit BT terms
         case 'csv4':
             $sql = SQLpoliBT();
             break;
             //candidate terms
         //candidate terms
         case 'csv5':
             $sql = SQLtermsXstatus($_SESSION["id_tesa"], "12");
             break;
             //rejected terms
         //rejected terms
         case 'csv6':
             $sql = SQLtermsXstatus($_SESSION["id_tesa"], "14");
             break;
             //preferred and accepted terms without hierarchical relationships
         //preferred and accepted terms without hierarchical relationships
         case 'csv7':
             $sql = SQLtermsXcantNT();
             break;
             //preferred and accepted terms with words count
         //preferred and accepted terms with words count
         case 'csv8':
             $sql = SQLtermsXcantWords($_SESSION["id_tesa"]);
             break;
             //meta terms
         //meta terms
         case 'csv9':
             $sql = SQLtermsIsMetaTerms($_SESSION["id_tesa"]);
             break;
             //Terms with related terms
         //Terms with related terms
         case 'csv10':
             $sql = SQLtermsXrelatedTerms($_SESSION["id_tesa"]);
             break;
             //Terms with non prefered terms
         //Terms with non prefered terms
         case 'csv11':
             $sql = SQLtermsXNonPreferedTerms($_SESSION["id_tesa"]);
             break;
             //Comparative report about mapped terms
         //Comparative report about mapped terms
         case 'csv12':
             $sql = SQLreportTargetTerms($_GET["tvocabs"]);
             break;
             //Preferred terms
         //Preferred terms
         case 'csv13':
             $sql = SQLreportTerminosPreferidos();
             break;
             //Terms without note o note type
         //Terms without note o note type
         case 'csv14':
             $sql = SQLreportNullNotes($_GET["note_type_null"]);
             break;
         default:
             break;
     }
     return sql2csv($sql, string2url($_SESSION["CFGTitulo"]) . '.csv', $_GET["csv_encode"]);
 }
Beispiel #2
0
function verTerminosLibres()
{
    $sql = SQLverTerminosLibres();
    $rows .= '<div><h1>' . ucfirst(LABEL_terminosLibres) . ' (' . $sql[cant] . ') </h1>';
    $rows .= '<ul>';
    if ($sql[cant] == 0) {
        $rows .= '<li>' . ucfirst(MSG_noTerminosLibres) . '<li/>';
    } else {
        while ($array = mysqli_fetch_array($sql[datos])) {
            $rows .= '<li><a title="' . $array[tema] . '" href="index.php?tema=' . $array[id] . '">' . $array[tema] . '</a><li/>';
        }
    }
    $rows .= '</ul>';
    $rows .= '</div>';
    return $rows;
}
function HTMLformVerTerminosLibres($taskterm = 'null', $freeTerms_id = array())
{
    //borrado masivo de términos libres
    if ($taskterm == 'deleteFreeTerms') {
        $task = REMTerms($freeTerms_id, 1);
    }
    $sql = SQLverTerminosLibres();
    $rows .= '<div>';
    $rows .= '<h3>' . ucfirst(LABEL_terminosLibres) . ' (' . SQLcount($sql) . ') </h3>';
    if (is_array($task)) {
        if ($task["error"] > 0) {
            $rows .= '<p class="error">' . $task["error"] . ' ' . MSG_termsNoDeleted . ' </p>';
        } else {
            $rows .= '<p class="success">' . $task["success"] . ' ' . MSG_termsDeleted . ' </p>';
        }
    }
    if (SQLcount($sql) > 0) {
        $rows .= '<div><input id="filter" type="text" class="form-control" placeholder="' . ucfirst(LABEL_type2filter) . '"></div>';
        $rows .= '<form  role="form"  id="delete_free_terms" name="delete_free_terms" action="index.php?verT=L" method="post">';
        $rows .= '<div class="table-responsive"> ';
        $rows .= '<table class="table table-striped table-bordered table-condensed table-hover">
		<thead>
		<tr>
			<th></th>
			<th>' . ucfirst(LABEL_Termino) . '</th>
			<th>' . ucfirst(LABEL_Fecha) . '</th>
		</tr>
		</thead>
		<tbody class="searchable">';
        while ($array = $sql->FetchRow()) {
            $css_class_MT = $array["isMetaTerm"] == 1 ? ' class="metaTerm" ' : '';
            $rows .= '<tr>';
            $rows .= '     	<td align="center"><input type="checkbox" name="deleteFreeTerms_id[]" id="freeTerm_' . $array["tema_id"] . '" title="' . ucfirst(MENU_BorrarT) . ' ' . $array["tema"] . ' " value="' . $array["tema_id"] . '" /></td>';
            $rows .= '     	<td><label class="check_label" value="' . $value["tema_id"] . '  title="' . $value["tema"] . ' " for="freeTerm_' . $array["tema_id"] . '"><a ' . $css_class_MT . ' title="' . $array["tema"] . '" href="index.php?tema=' . $array["tema_id"] . '" >' . $array["tema"] . '</a></label></td>';
            $rows .= '      <td>' . $array["cuando"] . '</td>';
            $rows .= '  </tr>';
        }
        $rows .= '        </tbody>		</table>';
        $rows .= '        </div>';
        $rows .= '<div class="submit_form" align="center">';
        $rows .= '<p class="warning">' . MSG__warningDeleteTerm2row . '</p>';
        $rows .= '	<input type="hidden" id="taskterm" name="taskterm" value="deleteFreeTerms"/>';
        $rows .= '  	<input  class="submit ui-corner-all" type="submit" name="boton" value="' . ucfirst(MENU_BorrarT) . '"/>';
        $rows .= '</div>';
        $rows .= '</form>';
    }
    //if cant
    $rows .= '</div>';
    return $rows;
}