views.php 1.47 KB
Newer Older
1
2
3
4
5
<?php

class Views {
    
    public static function printHtmlBegin() : void {
6
7
8
		echo '<html>';
		echo '<head>';
		echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>';
9
10
		echo '<title>Api Sub</title>';
		echo '<link href="css/main.css" type="text/css" rel="stylesheet"/>';
11
		echo '</head>';
12
13
14
15
16
17
18
19
20
21
22
23
24
25
		echo '<body>';
		echo '<h1>Inscriptions Api</h1>';
    }

    public static function printUser(string $utclogin, string $surname, string $firstname) : void {
		echo '<p><i>'.$firstname.' '. $surname.'</i> (<b>'.$utclogin.'</b>)</p>';
    }
    
    public static function printSubList(array $list, string $utclogin) : void {
        if ($list) {
			echo '<h2>Vos inscriptions</h2>';
			foreach ($list as $row) {
				echo '<p>';
				echo ' <a href="index.php?action=unsub&api='.$row['code'].'&utclogin='.$utclogin.'">[désinscription]</a> ';
26
				echo $row['code'].'-'.$row['name'].' ('.$row['semester'].$row['year'].', du '.$row['dbegin'].' au '.$row['dend'].') [inscrit le '.$row['subdate'].']';
27
28
29
30
31
32
33
34
35
36
37
38
39
40
				echo '</p>';
			}
		}
		else {
			echo '<h2>Aucune inscription</h2>';
		}
	}
	
	public static function printApiList(array $list, string $utclogin) : void {
		if ($list) {
			echo '<h2>Liste des Api '.$semester.$year.'</h2>';
			foreach ($list as $row) {
				echo '<p>';
				echo '<a href="index.php?action=sub&api='.$row['code'].'&utclogin='.$utclogin.'">[inscription]</a> ';
41
				echo $row['code'].'-'.$row['name'];
42
43
44
45
46
47
48
49
				echo '</p>';
			}
		}
		else {
			echo '<h2>Aucune Api</h2>';
		}
	}
}