Browse Source

Folders and files re-organisation

develop
acab.io 1 year ago
parent
commit
2adbc87e85
5 changed files with 9 additions and 10 deletions
  1. +0
    -1
      controllers/controller.inc.php
  2. +1
    -1
      controllers/controller.php
  3. +1
    -1
      index.php
  4. +2
    -2
      templates/report.html.twig
  5. +5
    -5
      templates/reports.html.twig

controller.inc.php → controllers/controller.inc.php View File

@ -1,5 +1,4 @@
<?php
require_once 'models/Reports.class.php';
/**
* https://gist.github.com/rchrd2/c94eb4701da57ce9a0ad4d2b00794131

controller.php → controllers/controller.php View File

@ -7,7 +7,7 @@ $loader = new Twig\Loader\FilesystemLoader('templates');
// On your mark Twig !
$twig = new Twig\Environment($loader);
require 'controller.inc.php';
require 'controllers/controller.inc.php';
// Checking actions and parameters
// default to Listpublic
$action = $_GET['action'] ?? 'listpublic';

+ 1
- 1
index.php View File

@ -1,2 +1,2 @@
<?php
require 'controller.php';
require 'controllers/controller.php';

+ 2
- 2
templates/report.html.twig View File

@ -4,7 +4,7 @@
{% block content %}
<h2>{{ titre }}</h2>
<form action="controller.php">
<form action="index.php">
<input type="hidden" name="action" value="update">
<input type="hidden" name="id" value="{{ report.ID }}">
@ -33,7 +33,7 @@
</button>
</form>
<hr />
<form action="controller.php">
<form action="index.php">
<input type="hidden" name="action" value="add_description">
<input type="hidden" name="report_id" value="{{report.ID}}">


+ 5
- 5
templates/reports.html.twig View File

@ -7,7 +7,7 @@
{% block content %}
<h2>Add report</h2>
<form method="GET" action="controller.php">
<form method="GET" action="index.php">
<input type="hidden" name="action" value="add">
<p>
<label for="date">Date :</label>
@ -26,7 +26,7 @@
</form>
<h2>{{ page_title }}</h2>
<p><a href="./controller.php?action=listall">Show all reports</a></p>
<p><a href="./index.php?action=listall">Show all reports</a></p>
{% for report in reports %}
@ -52,9 +52,9 @@
</div>
<div class="report-messages">
<h3>
<a href="controller.php?action=detail&id={{report.ID}}&message="><i class="far fa-edit"></i></a>
<a href="index.php?action=detail&id={{report.ID}}&message="><i class="far fa-edit"></i></a>
{{ report.TITLE }}
<a href="controller.php?action=suppr&id={{report.ID}}"><i class="fas fa-trash"></i></a>
<a href="index.php?action=suppr&id={{report.ID}}"><i class="fas fa-trash"></i></a>
</h3>
<p>{{ report.MAINDESCRIPTION }}</p>
{% if cycle(date, i) is not empty %}
@ -64,7 +64,7 @@
<span class="message-date">{{ cycle(date, i) }}</span>
</p>
<p class="txt-rendering">
{{ cycle(descriptions, i) }} <br /> <a href="controller.php?action=suppr_description&id={{ cycle(id, i) }}"><i class="fas fa-trash"></i></a>
{{ cycle(descriptions, i) }} <br /> <a href="index.php?action=suppr_description&id={{ cycle(id, i) }}"><i class="fas fa-trash"></i></a>
</p>
{% endfor %}
{% endif %}


Loading…
Cancel
Save