views.php 1.37 KB
Newer Older
1
2
3
<?php

class Views {
4
5

    public static function printHtmlBegin() {
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
		echo '<body>';
		echo '<h1>Inscriptions Api</h1>';
    }

16
    public static function printUser($utclogin, $surname, $firstname) {
17
18
		echo '<p><i>'.$firstname.' '. $surname.'</i> (<b>'.$utclogin.'</b>)</p>';
    }
19
20

    public static function printSubList($list, $utclogin) {
21
22
23
24
25
        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
				echo '</p>';
			}
		}
		else {
			echo '<h2>Aucune inscription</h2>';
		}
	}
34
35

	public static function printApiList($list, $utclogin) {
36
		if ($list) {
37
			echo '<h2>Liste des Api</h2>';
38
39
40
			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
				echo '</p>';
			}
		}
		else {
			echo '<h2>Aucune Api</h2>';
		}
	}
49
}