Пример #1
0
 /**
  * Modify a note saved in the database.
  *
  * @param Note $note
  * @return integer
  */
 public function editNote(Note $note)
 {
     $sql = "UPDATE note \n\t\t\tSET note = '" . replaceCharacters($note->getNote()) . "', note_text = '" . replaceCharacters($note->getNoteText()) . "' WHERE id_note = '" . $note->getIdNote() . "'";
     return DB::query($sql);
 }
Пример #2
0
    /**
     * Renderize the view.
     *
     * @return null
     */
    public function render(Note $note)
    {
        ?>
  

    <p> 
        <?php 
        echo REQUIRED_FIELDS_TEXT;
        ?>
    </p>

	<form action="<?php 
        echo $this->generateURL('note', 'edit', $note->getIdNote());
        ?>
" method="post">
    	
        <fieldset>
        
            <div class="row">

                <div class="col-md-6">  
                
                	<div>
                        <label for="note">
                            Categor&iacute;a <small>(*)</small>
                        </label>
                        <select name="note" required> 
                            <option value="">
                                Seleccionar
                            </option>
                            <?php 
        if ($note->getNote() === "Hip&oacute;tesis de Gesti&oacute;n Econ&oacute;mica y Composici&oacute;n del Precio") {
            ?>
                            <option selected>
                                Hip&oacute;tesis de Gesti&oacute;n Econ&oacute;mica y Composici&oacute;n del Precio
                            </option>
                            <option>
                                Nota del &Iacute;ndice General de la Construcci&oacute;n
                            </option>
                            <option>
                                Nota del &Iacute;ndice General de la Construcci&oacute;n (PRIVADO)
                            </option>
                            <option>
                                C&aacute;lculo del Precio de un Rubro
                            </option>
                            <?php 
        } else {
            if ($note->getNote() === "Nota del &Iacute;ndice General de la Construcci&oacute;n") {
                ?>
                            <option>
                                Hip&oacute;tesis de Gesti&oacute;n Econ&oacute;mica y Composici&oacute;n del Precio
                            </option>
                            <option selected>
                                Nota del &Iacute;ndice General de la Construcci&oacute;n
                            </option>
                            <option>
                                Nota del &Iacute;ndice General de la Construcci&oacute;n (PRIVADO)
                            </option>
                            <option>
                                C&aacute;lculo del Precio de un Rubro
                            </option>
                            <?php 
            } else {
                if ($note->getNote() === "Nota del &Iacute;ndice General de la Construcci&oacute;n (PRIVADO)") {
                    ?>
                            <option>
                                Hip&oacute;tesis de Gesti&oacute;n Econ&oacute;mica y Composici&oacute;n del Precio
                            </option>
                            <option>
                                Nota del &Iacute;ndice General de la Construcci&oacute;n
                            </option>
                            <option selected>
                                Nota del &Iacute;ndice General de la Construcci&oacute;n (PRIVADO)
                            </option>
                            <option>
                                C&aacute;lculo del Precio de un Rubro
                            </option>
                            <?php 
                } else {
                    if ($note->getNote() === "C&aacute;lculo del Precio de un Rubro") {
                        ?>
                            <option>
                                Hip&oacute;tesis de Gesti&oacute;n Econ&oacute;mica y Composici&oacute;n del Precio
                            </option>
                            <option>
                                Nota del &Iacute;ndice General de la Construcci&oacute;n
                            </option>
                            <option>
                                Nota del &Iacute;ndice General de la Construcci&oacute;n (PRIVADO)
                            </option>
                            <option selected>
                                C&aacute;lculo del Precio de un Rubro
                            </option>
                            <?php 
                    }
                }
            }
        }
        ?>
                        </select>
                    </div>

                </div>
               
                <div class="col-md-6">	

                    <div>
                        <label for="note_text">
                            Texto <small>(*)</small>
                        </label>
                        <textarea name="note_text" required><?php 
        echo $note->getNoteText();
        ?>
</textarea>
                    </div>

                    <div>
                        <input type="submit" value="Modificar" />
                    </div>
                
                </div>
            
            </div>
            
    	</fieldset>
        
    </form>

<?php 
    }