Created
March 26, 2015 14:44
-
-
Save perseoq/7f18f0028238fda742b8 to your computer and use it in GitHub Desktop.
Agrega artículos de la CPEUM a la Base de Datos XML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SimpleXMLExtended extends SimpleXMLElement { | |
public function addCDATA($cData) { | |
$node = dom_import_simplexml($this); | |
$node->formatOutput = true; | |
$no = $node->ownerDocument; | |
$node->appendChild($no->createCDATASection($cData)); | |
} | |
} | |
$get_num = $_POST['numero']; | |
$get_tit = $_POST['titulos']; | |
$get_cap = $_POST['capitulos']; | |
$get_secc = $_POST['secciones']; | |
$get_atrib = $_POST['editor1']; | |
$dicc = new SimpleXMLExtended('datagrid.xml', null, true); | |
$nodo = $dicc->addChild('articulo'); | |
$path = $nodo->addChild('atributo'); | |
$path->addCDATA(html_entity_decode($get_atrib)); | |
$nodo->addChild('numero',$get_num); | |
$nodo->addChild('titulo',$get_tit); | |
$nodo->addChild('capitulo',$get_cap); | |
$nodo->addChild('seccion',$get_secc); | |
$dicc->asXML('datagrid.xml'); | |
header('location: index.php'); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="ckeditor/ckeditor.js"></script> | |
<link rel="stylesheet" type="text/css" href="rubish.css"> | |
<title>XML Database Node Adder (XML-DBNA)</title> | |
</head> | |
<body> | |
<div class="title"> | |
<center> | |
<h2>Constitución Política de los Estados Unidos Mexicanos</h2> | |
<br/> | |
</center> | |
</div> | |
<div class="mainbox"> | |
<form action="grb.php" method="POST" > | |
<input type="text" placeholder="# de Artículo" name="numero" id="numero" class="txt1" /> | |
<select name="titulos" class="titulos" id="titulos"> | |
<option>TITULO PRIMERO</option> | |
<option>TITULO SEGUNDO</option> | |
<option>TITULO TERCERO</option> | |
<option>TITULO CUARTO</option> | |
<option>TITULO QUINTO</option> | |
<option>TITULO SEXTO</option> | |
<option>TITULO SEPTIMO</option> | |
<option>TITULO OCTAVO</option> | |
<option>TITULO NOVENO</option> | |
</select> | |
<select name="capitulos" class="capitulos" id="capitulos"> | |
<option>Capitulo I - De las garantías individuales</option> | |
<option>Capitulo II - De los mexicanos</option> | |
<option>Capitulo III - De los extranjeros</option> | |
<option>Capitulo IV - De los ciudadanos mexicanos</option> | |
<option>Capitulo I - De la soberania nacional y de la froma de gobierno</option> | |
<option>Capitulo II - De las partes integrantes de la federación y del territorio nacional</option> | |
<option>Capitulo I - De la división de poderes</option> | |
<option>Capitulo II - Del poder legislativo</option> | |
<option>Capitulo III - Del poder Ejecutivo</option> | |
<option>Capitulo IV - Del poder Judicial</option> | |
<option>De las responsabilidades de los servidores públicos</option> | |
<option>De los estados de la federación y del Distrito Federal</option> | |
<option>Del trabajo y de la previsón social</option> | |
<option>Prevenciones Generales</option> | |
<option>De las formas de la constitución</option> | |
<option>De la inviolabilidad de la cosntitución</option> | |
<option>Artículos transitorios</option> | |
</select> | |
<select name="secciones" class="secciones" id="secciones"> | |
<option>No aplica</option> | |
<option>Sección I - De la elección e instalación del congreso</option> | |
<option>Sección II - De la iniciativa y la formación de las leyes</option> | |
<option>Sección III - De las facultades del congreso</option> | |
<option>Sección IV - De la comisión permanente</option> | |
<option>Sección V - De la fiscalización superior de la federación</option> | |
</select> | |
<textarea class="ckeditor" id="texta" name="editor1"></textarea><br/> | |
<input type="submit" value="Agregar nodo a la base de datos " class="btn1"> | |
</form></div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
} | |
.title{ | |
margin: 0px auto; | |
width: 750px; | |
} | |
.mainbox{ | |
margin: 0px auto; | |
width: 750px; | |
} | |
.txt1{ | |
width: 100%; | |
} | |
.titulos{ | |
width: 100%; | |
font-size: 20pt; | |
} | |
.capitulos, .secciones{ | |
font-size: 20pt; | |
width: 100%; | |
} | |
.ckeditor, .btn1{ | |
width: 100%; | |
} | |
.txt1, .btn1{ | |
font-size: 20pt; | |
} | |
h2{ | |
font-size: 22pt; | |
font-family: sans-serif; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment