function HTMLformURIdefinition() { //ALTA if ($_POST['uri_value'] != '' and $_POST['uri_code'] != '' and $_POST['uri_type_id'] == '') { $arrayValues = array("uri_value" => $_POST['uri_value'], "uri_code" => $_POST['uri_code']); $task = abm_URIdefinition("A", $arrayValues); if ($task[cant] > 0) { echo "<script>javascript:alert('" . ucfirst(LABEL_saved) . "');</script>"; } } //MOD if ($_POST['doAdminU'] == 'modURIdefinition') { $arrayValues = array("uri_value" => $_POST['uri_value'], "uri_code" => $_POST['uri_code']); $task = abm_URIdefinition("M", $arrayValues, $_POST['uri_type_id']); if ($task[cant] > 0) { echo "<script>javascript:alert('" . ucfirst(LABEL_saved) . "');</script>"; } $_POST['uri_value'] = ''; $_POST['uri_code'] = ''; } //BAJA if ($_POST['doAdminU'] == 'deleteURIdefinition') { $task = abm_URIdefinition("B", array(), $_POST['uri_type_id']); } $sql = SQLURIdefinition(); $rows .= '<form id="moreURI" name="moreURI" method="POST" action="admin.php?vocabulario_id=list#moreuri">'; $rows .= '<input type="hidden" name="doAdminU" id="doAdminU" value=""> '; $rows .= '<input type="hidden" name="uri_type_id" id="uri_type_id"> '; $rows .= '<div class="table-responsive"> '; $rows .= '<h3>' . ucfirst(LABEL_URItypeEditor) . ' </h3>'; $rows .= '<table class="table table-striped table-bordered table-condensed table-hover" summary="' . ucfirst(LABEL_URItypeEditor) . '">'; $rows .= '<thead>'; $rows .= '<tr>'; $rows .= '<th>' . ucfirst(LABEL_URItypeLabel) . ':</th>'; $rows .= '<th>' . ucfirst(LABEL_URItypeCode) . '</th>'; $rows .= '<th></th>'; $rows .= '</tr>'; $rows .= '<tr>'; $rows .= '<th class="izq"><input type="text" name="uri_value" id="uri_value"/></td>'; $rows .= '<th class="izq"><input type="text" name="uri_code" size="10" id="uri_code"/></td>'; $rows .= '<th><a onclick="enviaURI()" href="#"><strong>' . ucfirst(LABEL_Enviar) . '</strong></a></td>'; $rows .= '</tr>'; $rows .= ' </thead>'; $rows .= ' <tbody>'; while ($array = $sql->FetchRow()) { $i = ++$i; $rows .= '<tr>'; $rows .= ' <td class="izq"><a title="' . $array["uri_value"] . '" href="javascript:recargaeditURI(\'' . $array["uri_value"] . '\',\'' . $array["uri_code"] . '\',\'' . $array["uri_type_id"] . '\')">' . $array["uri_value"] . '</a></td>'; $rows .= '<td>' . $array["uri_code"] . '</td>'; $rows .= $array["uri_cant"] > 0 ? '<td>' . $array["uri_cant"] . '</td>' : '<td><a onclick=preparaborradoURI(\'' . $array["uri_type_id"] . '\') title="' . ucfirst(borrar) . '" href="#moreURI")><strong>' . ucfirst(LABEL_URItypeDelete) . '</strong></a></td>'; $rows .= '</tr>'; } $rows .= ' </tbody>'; $rows .= '<tfoot>'; $rows .= '<tr><td colspan="4">' . $i . '</th></tr>'; $rows .= '</tfoot>'; $rows .= '</table> </div>'; $rows .= '</form>'; return $rows; }
function HTMLformURI4term($ARRAYtermino) { //SEND_KEY to prevent duplicated session_start(); $_SESSION['SEND_KEY'] = md5(uniqid(rand(), true)); $SQLURIdefinition = SQLURIdefinition(); if (SQLcount($SQLURIdefinition) > 0) { while ($ARRAYURIdefinition = $SQLURIdefinition->FetchRow()) { $arraySelectURItype[] = $ARRAYURIdefinition["uri_type_id"] . '#' . $ARRAYURIdefinition["uri_value"]; } $rows .= '<div class="container" id="bodyText">'; $rows .= '<a class="topOfPage" href="index.php?tema=' . $ARRAYtermino["idTema"] . '" title="' . LABEL_Anterior . '">' . LABEL_Anterior . '</a>'; $rows .= '<form class="" role="form" name="altaURI" id="altaURI" action="index.php" method="post">'; $rows .= ' <div class="row"> <div class="col-sm-12"> <legend>' . ucfirst(LABEL_URIEditor) . ' <a href="index.php?tema=' . $ARRAYtermino["idTema"] . '">' . $ARRAYtermino["titTema"] . '</a></legend> </div> <!-- panel --> <div class="col-lg-7"> <div class="panel panel-default"> <div class="panel-body form-horizontal"> <div class="form-group"> <label for="uri_type_id" class="col-sm-3 control-label accesskey="u">' . ucfirst(LABEL_URItype) . '</label> <div class="col-sm-9"> <select class="form-control" id="uri_type_id" name="uri_type_id"> ' . doSelectForm($arraySelectURItype, "") . ' </select> </div> </div> <div class="form-group"> <label for="uri" class="col-sm-3 control-label">' . ucfirst(LABEL_URI2termURL) . '</label> <div class="col-sm-9"> <input type="text" class="form-control" type="url" required autofocus id="uri" name="uri"/> </div> </div> </div> <div class="form-group"> <div class="col-sm-12 text-right"> <button type="submit" class="btn btn-primary" value="' . LABEL_Enviar . '"/>' . ucfirst(LABEL_Enviar) . '</button> <button type="button" class="btn btn" name="cancelar" type="button" onClick="location.href=\'index.php?tema=' . $ARRAYtermino["idTema"] . '\'" value="' . ucfirst(LABEL_Cancelar) . '"/>' . ucfirst(LABEL_Cancelar) . '</button> </div> </div> </div> </div> </div> <!-- / panel -->'; $rows .= '<input type="hidden" name="ks" id="ks" value="' . $_SESSION["SEND_KEY"] . '"/>'; $rows .= '<input type="hidden" name="tema_id" value="' . $ARRAYtermino["idTema"] . '" />'; $rows .= '<input type="hidden" name="taskURI" value="addURI" />'; $rows .= '</form>'; } $rows .= '</div>'; return $rows; }