Example #1
0
 public function getProject()
 {
     return ProjectData::getById($this->project_id);
 }
<?php

$category = ProjectData::getById($_GET["id"]);
$category->del();
Core::redir("./index.php?view=projects");
<?php

$pacient = ProjectData::getById($_GET["id"]);
?>
<div class="row">
	<div class="col-md-12">
<div class="btn-group pull-right">
<!--<div class="btn-group pull-right">
  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
    <i class="fa fa-download"></i> Descargar <span class="caret"></span>
  </button>
  <ul class="dropdown-menu" role="menu">
    <li><a href="report/clients-word.php">Word 2007 (.docx)</a></li>
  </ul>
</div>
-->
</div>
		<h1>Historial de Eventos</h1>
<h4>Ministerio: <?php 
echo $pacient->name;
?>
</h4>

<br>
		<?php 
$users = EventData::getAllByProjectId($_GET["id"]);
if (count($users) > 0) {
    // si hay usuarios
    ?>
			<table class="table table-bordered table-hover">
			<thead>
<?php

$user = ProjectData::getById($_GET["id"]);
?>
<div class="row">
	<div class="col-md-12">
	<h1>Editar Ministerio</h1>
	<br>
		<form class="form-horizontal" method="post" id="addproduct" action="index.php?view=updateproject" role="form">


  <div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Nombre*</label>
    <div class="col-md-6">
      <input type="text" name="name" value="<?php 
echo $user->name;
?>
" class="form-control" id="name" placeholder="Nombre">
    </div>
  </div>

  <div class="form-group">
    <div class="col-lg-offset-2 col-lg-10">
    <input type="hidden" name="user_id" value="<?php 
echo $user->id;
?>
">
      <button type="submit" class="btn btn-primary">Actualizar Proyecto</button>
    </div>
  </div>
</form>
<?php

if (count($_POST) > 0) {
    $user = ProjectData::getById($_POST["user_id"]);
    $user->name = $_POST["name"];
    $user->update();
    print "<script>window.location='index.php?view=projects';</script>";
}