Example #1
0
<?php

if (count($_POST) > 0) {
    $user = NoteData::getById($_POST["id"]);
    $user->title = $_POST["title"];
    $category_id = "NULL";
    if ($_POST["category_id"] != "") {
        $category_id = $_POST["category_id"];
    }
    $user->category_id = $category_id;
    $project_id = "NULL";
    if ($_POST["project_id"] != "") {
        $project_id = $_POST["project_id"];
    }
    $user->project_id = $project_id;
    $user->description = htmlspecialchars($_POST["description"]);
    $user->update();
    print "<script>window.location='index.php?view=notes';</script>";
}
Example #2
0
<?php

$user = NoteData::getById($_GET["id"]);
$user->del();
print "<script>window.location='index.php?view=reservations';</script>";
Example #3
0
<?php

$reservation = NoteData::getById($_GET["id"]);
$pacients = ProjectData::getAll();
$medics = CategoryData::getAll();
?>
  <script src="res/tinymce/tinymce.min.js"></script>
  <script>tinymce.init({ selector:'textarea' });</script>
<div class="row">
	<div class="col-md-10">
	<h4>Editar Nota</h4>
	<br>
<form class="form-horizontal" role="form" method="post" action="./?action=updatenote">
  <div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Titulo</label>
    <div class="col-lg-10">
      <input type="text" name="title" value="<?php 
echo $reservation->title;
?>
" required class="form-control" id="inputEmail1" placeholder="Titulo">
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Descripcion</label>
    <div class="col-lg-10">
    <textarea class="form-control" rows="15" name="description" placeholder="Descripcion"><?php 
echo $reservation->description;
?>
</textarea>
    </div>
  </div>
Example #4
0
    }
    if ($_GET["project_id"] != "") {
        if ($_GET["q"] != "") {
            $sql .= " and ";
        }
        $sql .= " project_id = " . $_GET["project_id"];
    }
    if ($_GET["category_id"] != "") {
        if ($_GET["q"] != "" || $_GET["project_id"] != "") {
            $sql .= " and ";
        }
        $sql .= " category_id = " . $_GET["category_id"];
    }
    $users = NoteData::getBySQL($sql);
} else {
    $users = NoteData::getAll();
}
if (count($users) > 0) {
    // si hay usuarios
    ?>
			<table class="table table-bordered table-hover">
			<thead>
			<th>Titulo</th>
			<th>Proyecto</th>
			<th>Categoria</th>
			<th>Creacion</th>
			<th></th>
			</thead>
			<?php 
    foreach ($users as $user) {
        $project = null;
Example #5
0
<?php

$r = new NoteData();
$r->title = $_POST["title"];
$r->description = htmlspecialchars($_POST["description"]);
$category_id = "NULL";
if ($_POST["category_id"] != "") {
    $category_id = $_POST["category_id"];
}
$r->category_id = $category_id;
$project_id = "NULL";
if ($_POST["project_id"] != "") {
    $project_id = $_POST["project_id"];
}
$r->project_id = $project_id;
$r->user_id = $_SESSION["user_id"];
$r->add();
Core::redir("./index.php?view=notes");