views.php 1.48 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) {
Stephane Crozat's avatar
Fix #1  
Stephane Crozat committed
17
18
19
20
21
		    echo '<p><i>'.$firstname.' '. $surname.'</i> (<b>'.$utclogin.'</b>)</p>';
    }

    private static function printApi($row) {
        return $row['normcode'].' - '.$row['name'].' (du '.$row['dbegin'].' au '.$row['dend'].')';
22
    }
23
24

    public static function printSubList($list, $utclogin) {
25
26
27
28
29
        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> ';
Stephane Crozat's avatar
Fix #1  
Stephane Crozat committed
30
31
        echo Views::printApi($row);
				echo ' ['.$row['semester'].$row['year'].', inscrit le '.$row['subdate'].']';
32
33
34
35
36
37
38
				echo '</p>';
			}
		}
		else {
			echo '<h2>Aucune inscription</h2>';
		}
	}
39
40

	public static function printApiList($list, $utclogin) {
41
		if ($list) {
42
			echo '<h2>Liste des Api</h2>';
43
44
45
			foreach ($list as $row) {
				echo '<p>';
				echo '<a href="index.php?action=sub&api='.$row['code'].'&utclogin='.$utclogin.'">[inscription]</a> ';
Stephane Crozat's avatar
Fix #1  
Stephane Crozat committed
46
				echo Views::printApi($row);
47
48
49
50
51
52
53
				echo '</p>';
			}
		}
		else {
			echo '<h2>Aucune Api</h2>';
		}
	}
Stephane Crozat's avatar
Fix #1  
Stephane Crozat committed
54
55
56



57
}