Example #1
0
if (!isset($_SESSION["usr"])) {
    header('Location: index.php');
}
print '<h1>' . $palabra->palabra . ' (edición)</h1>';
print '<form action="editar.php" method="post">';
switch ($_GET["amb"]) {
    case "palabra":
        print '
				<h2>Palabra:</h2>
				<textarea name="palabra">' . $palabra->palabra . '</textarea>
				<input type="checkbox" name="edit"> editar
				<input type="checkbox" name="elim"> eliminar <br>
			';
        break;
    case "dialectales":
        $handler = new WordHandler('localhost', 'khunluungramnerk', $usrDB["user"], $usrDB["passwd"]);
        $handler->conn();
        print '
				<h2>Variantes dialectales: </h2>
				<select name="new_dial_dialecto">
			';
        foreach ($handler->obtenerListaDialectos() as $dialecto) {
            print '<option value="' . $dialecto . '">' . $dialecto . '</option>';
        }
        print '
				</select>
				<textarea name="new_dial"></textarea>
				<input type="checkbox" name="crear"> crear <br><br>	
			';
        $i = 0;
        foreach ($palabra->dialectales->lista as $dialectal) {
Example #2
0
<?php

include_once "libPalabras.php";
session_start();
include_once "header.html";
include $_SERVER['DOCUMENT_ROOT'] . 'KhunluungramnerkP/loginMySQL.php';
$_SESSION["id"] = $_GET["id"];
$handler = new WordHandler('localhost', 'khunluungramnerk', $usrDB["user"], $usrDB["passwd"]);
$handler->conn();
$handler->setWordID($_GET["id"]);
$handler->getDatosPalabra();
$handler->shutdown();
$_SESSION["palabra"] = $handler->getPalabra();
$printer = new WordPrinter($_SESSION["palabra"]);
if (!isset($_GET["edicion"]) || !isset($_SESSION["usr"])) {
    $edicion = false;
} else {
    $edicion = true;
}
$printer->imprimir($edicion);
Example #3
0
<?php

include_once "libPalabras.php";
include $_SERVER['DOCUMENT_ROOT'] . 'KhunluungramnerkP/loginMySQL.php';
session_start();
if (!isset($_SESSION["usr"])) {
    header('Location: index.php');
}
$handler = new WordHandler('localhost', 'khunluungramnerk', $usrDB["user"], $usrDB["passwd"]);
$handler->conn();
$handler->setWordID($_SESSION["id"]);
$handler->getDatosPalabra();
switch ($_SESSION["amb"]->get()) {
    case "palabra":
        if (isset($_POST["edit"])) {
            $handler->editarPalabra($_POST["palabra"], null);
        } elseif (isset($_POST["elim"])) {
            $handler->eliminarPalabra();
        }
        break;
    case "dialectales":
        foreach ($_POST as $clave => $campo) {
            $str = new String($clave);
            if ($str->equals('crear')) {
                $handler->annadirDialectal($_POST["new_dial_dialecto"], $_POST["new_dial"]);
            } elseif ($str->startsWith("edit_")) {
                $str->remove_prefix("edit_");
                $num = $str->get();
                $handler->editarDialectal((int) $_POST["dial_id_" . $num], $_POST["dial_dial_" . $num], $_POST["dial_" . $num]);
            } elseif ($str->startsWith("elim_")) {
                $str->remove_prefix("elim_");
Example #4
0
 public static function setWord($StWord = NULL)
 {
     if (empty($StWord) || !is_string($StWord)) {
         return FALSE;
     }
     $ArIDWord = WordHandler::getIDWords($StWord);
     $StIN = implode(',', $ArIDWord);
     $StWhere = " W.IDWord IN ( {$StIN} ) ";
     self::ArWhereAdd($StWhere);
 }
Example #5
0
<?php 
include_once "libPalabras.php";
include $_SERVER['DOCUMENT_ROOT'] . 'KhunluungramnerkP/loginMySQL.php';
$handler = new WordHandler('localhost', 'khunluungramnerk', $usrDB["user"], $usrDB["passwd"]);
$handler->conn();
if (!isset($_SESSION["usr"])) {
    header('Location: index.php');
}
if (isset($_POST["crear"])) {
    $crearReforma = array("tipo" => "INSERT", "campos" => array("id" => $handler->getMaxTabla("id", "cte_reformas"), "acrónimo" => $_POST["acrónimo"], "nombre" => $_POST["nombre"], "descripción" => $_POST["descripción"], "fecha" => date("Y:m:d")), "tabla" => "cte_reformas");
    $handler->query($crearReforma);
} elseif (isset($_POST["ref_id"])) {
    foreach ($_POST as $clave => $campo) {
        $str = new String($clave);
        if ($str->startsWith("af_")) {
            $str->remove_prefix("af_");
            $num = $str->get();
            $handler->setWordID($_POST["pal_id_" . $num]);
            $handler->getDatosPalabra();
            $handler->reformarPalabra($_POST["pal_" . $num], $_POST["ref_id"]);
        }
    }
}
$handler->shutdown();
session_start();
header('Location: ' . $_SESSION["urlVuelta"]);
Example #6
0
<?php 
include_once "libPalabras.php";
include $_SERVER['DOCUMENT_ROOT'] . 'KhunluungramnerkP/loginMySQL.php';
print '
<head>
	<link rel="stylesheet" type="text/css" href="estilo.css">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<head>
';
print '<form action="crearNuevaPalabra.php" method="post">
	<h2>Palabra:</h2>
	<textarea name="palabra"></textarea>
';
$handler = new WordHandler('localhost', 'khunluungramnerk', $usrDB["user"], $usrDB["passwd"]);
$handler->conn();
$verPalabras = array("tipo" => "SELECT", "campos" => array("palabras.id", "palabras.palabra"), "tablas" => "palabras");
$handler->query($verPalabras);
//@TODO: Este método de cálculo de palabras habrá que modificarlo en cuanto se borre la tabla palabras
print '
	<h2>Etimología: </h2>
';
if (!isset($_GET["tipo"])) {
    print '
		<div class="menubutton">
			<a class="btn boton" href="nuevaPalabra.php?tipo=raíz&numraices=1">Por raíz</a>
		</div>
		<div class="menubutton">
			<a class="btn boton" href="nuevaPalabra.php?tipo=externa">Externa</a>
		</div>
	';
} else {
<?php

include_once "libPalabras.php";
include $_SERVER['DOCUMENT_ROOT'] . 'KhunluungramnerkP/loginMySQL.php';
$handler = new WordHandler('localhost', 'khunluungramnerk', $usrDB["user"], $usrDB["passwd"]);
$handler->conn();
var_dump($_POST);
$handler->crearPalabra($_POST);
header('Location: index.php');
Example #8
0
 public static function insertWords($StText, $IDTicket = NULL)
 {
     $StValues = '';
     $StSQL = '';
     if (!empty($StText) || !is_string($StText)) {
         self::$StText = $StText;
     }
     self::WordExplode();
     self::WordValidate();
     self::selectIDWordFromObject();
     $ArNewWord = self::$ArNewWord;
     $ArWordDB = self::$ArWordDB;
     $ArIDWord = self::$ArIDWord;
     if (empty(self::$ArWord) || !is_array(self::$ArWord)) {
         return FALSE;
     }
     if (!empty($ArNewWord) && is_array($ArNewWord)) {
         #
         # First Word
         #
         $StFirstWord = array_shift($ArNewWord);
         $StValues = "('', '{$StFirstWord}', 1)";
         #
         # IDWord - autoincrement, StWord AND 1 to count of use
         #
         foreach ((array) $ArNewWord as $StWord) {
             $StValues .= ", ('', '{$StWord}', 1 )";
         }
         #
         # If the word exists, we'll to increment her count
         #
         $StSQL = "INSERT IGNORE INTO Word VALUES {$StValues};";
         SearchHandler::$DBHandler->setQuery($StSQL);
     }
     if (!empty($ArIDWord) && is_array($ArIDWord)) {
         $StIN = implode(",", $ArIDWord);
         $StSQL = "UPDATE Word SET ItCount = ItCount+1 WHERE IDWord IN ({$StIN});";
         SearchHandler::$DBHandler->setQuery($StSQL);
     }
     #
     # Get all IDWords, including the new words this time
     #
     $ArIDWord = self::getIDWords(self::$ArWord, FALSE);
     if (!empty($IDTicket) && is_numeric($IDTicket)) {
         $ItFirstIDWord = array_shift($ArIDWord);
         $StValues = "( {$ItFirstIDWord}, {$IDTicket} )";
         foreach ((array) $ArIDWord as $IDWord) {
             $StValues .= ", ( {$IDWord}, {$IDTicket} )";
         }
         $StSQL = "REPLACE INTO WordTicket VALUES {$StValues};";
         SearchHandler::$DBHandler->setQuery($StSQL);
     }
     SearchHandler::$DBHandler->commit();
     unset($StFirstWord, $StValues, $StSQL);
 }