-
Notifications
You must be signed in to change notification settings - Fork 2
/
photos.php
72 lines (54 loc) · 2.19 KB
/
photos.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
require('app.php');
if(!PupilAuth::isLoggedIn()) {
header( 'Location: index.php' ) ;
exit;
}
require('templates/header.php');
?>
<div class="ui segment">
<h1>Manage your photos</h1>
</div>
<div class="ui segment">
<h1>First school photo</h1>
<img class="ui medium rounded image" src="/photo_get.php?type=school_photo&rollnumber=<?=$User->rollnumber?>"/>
</div>
<div class="ui segment">
<h1>Current Photo</h1>
<?php
if($User->currentphoto != "") {
?>
<img class="ui medium rounded image" src="/photo_get.php?type=current&rollnumber=<?=$User->rollnumber?>"/>
<?php
}
?>
<form action="photo_upload.php" method="post" enctype="multipart/form-data" class="ui form">
<div class="field">
<label>Choose an image to upload. Max 1mb in size, image will be cropped automatically to the center to make it fit. If it doesn't crop right, try cropping the photo yourself and reuploading it.</label>
<input type="file" name="photo" size="25" />
</div>
<input type="hidden" name="photo_type" value="current"/>
<input class="ui button" type="submit" name="submit" value="Upload" />
</form>
</div>
<div class="ui segment">
<h1>Baby Photo</h1>
<?php
if($User->babyphoto != "") {
?>
<img class="ui medium rounded image" src="/photo_get.php?type=baby&rollnumber=<?=$User->rollnumber?>"/>
<?php
}
?>
<form action="photo_upload.php" method="post" enctype="multipart/form-data" class="ui form">
<div class="field">
<label>Choose an image to upload. Max 1mb in size, image will be cropped automatically to the center to make it fit. If it doesn't crop right, try cropping the photo yourself and reuploading it.</label>
<input type="file" name="photo" size="25" />
</div>
<input type="hidden" name="photo_type" value="baby"/>
<input class="ui button" type="submit" name="submit" value="Upload" />
</form>
</div>
<?php
require('templates/footer.php');
?>