forked from students-alumni-cell-iitkgp/sac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile_pic.php
65 lines (58 loc) · 1.69 KB
/
profile_pic.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
<?php
error_reporting(0);
$name = $row['name'];
$url = $row['url'];
?>
<div class="row">
<div class="col s12 m7">
<div class="card ">
<div class="card-image" >
<?php
if(!empty($url) && file_exists($url))
{
echo '<img src="'.$url.'">';
}
else
{
echo '<img src="upload/addprofilepic.png">';
}
?>
</div>
</div>
<?php
if(empty($row['url']))
{
echo '<a class="btn-floating halfway-fab waves-effect waves-light red btn modal-trigger right" href="#modal_pic"><i class="material-icons">add</i></a>';
}
else
{
echo '<a class="btn-floating halfway-fab waves-effect waves-light red btn modal-trigger right" href="#modal_pic"><i class="material-icons">edit</i></a>';
}
?>
</div>
</div>
<!-- Modal Structure -->
<div id="modal_pic" class="modal">
<div class="modal-content">
<form action="profile_pic_action.php" enctype="multipart/form-data" method="post">
<div class="file-field input-field">
<div class="btn">
<span>Browse your image</span>
<input type="file" name="filetoupload" id="fileToUpload">
</div>
<div class="file-path-wrapper">
<input class="file-path validate" type="text" required="required">
</div>
</div>
<center>
<button type="submit" name="submit" class="btn btn-success btn-lg btn-block" style="width:25%">Upload</button>
</center>
</form>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
// the "href" attribute of the modal trigger must specify the modal ID that wants to be triggered
$('.modal').modal();
});
</script>