-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoitview.php
executable file
·97 lines (93 loc) · 3.85 KB
/
doitview.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
include 'doitheader.php';
include 'doitserver.php';
?>
<div class="row">
<form class="col s12">
<div class="row">
<ul class="collapsible" data-collapsible="accordion">
<li>
<div class="collapsible-header">
<?php
$query = "SELECT title FROM doit_task WHERE status=0";
$result = mysqli_query($dbc,$query);
$row = mysqli_num_rows($result);
echo "<span class='badge'>".$row."</span>";
?>
<!--<span class="badge">4</span>-->
<i class="mdi mdi-calendar-multiple prefix"></i>Progress</div>
<div class="collapsible-body">
<!... write dynamic starts here......!>
<ul class="collection">
<?php
$query = "SELECT * FROM doit_task WHERE status=0";
$result = mysqli_query($dbc,$query);
while( $row=mysqli_fetch_array($result) ) {
$addedDate = $row['date'];
$deadline = $row['remain'];
$adate = strtotime($addedDate);
$ddate = strtotime($deadline);
$secs = $ddate-$adate;
$days = $secs/86400;
$indays = ceil($days);
echo "<li class='collection-item'>";
echo "<span class='collection-header'>";
echo "<span>".$row['title']." :</span>";
echo "<span>".$row['description']." :</span>";
//echo "<span>".$row['date']." :</span>";
echo "<span>".$indays." :</span>";
echo "</span></li>";
//echo "<span>"." : ".$indays."</span></li>";
//<p><span class='content'>".$row['description']."</span></p>
}
/*
<ul class="collection">
<li class="collection-item">
<span>Title</span>
<p>descriptin</p>
</li>
</ul> */
?>
</ul>
<!--
<p><input type="checkbox" id="test5" />
<label for="test5">Red</label>
</p>
<p><input type="checkbox" id="test6" />
<label for="test6">Yellow</label>
</p>-->
<!...... ends ............!>
</div>
</li>
<li>
<div class="collapsible-header">
<?php
$query = "SELECT title FROM doit_task WHERE status=1";
$result = mysqli_query($dbc,$query);
$row = mysqli_num_rows($result);
echo "<span class='badge'>".$row."</span>";
?>
<!--<span class="badge">1</span>-->
<i class="mdi mdi-calendar-check prefix"></i>Done</div>
<div class="collapsible-body">
<?php
$query = "SELECT title FROM doit_task WHERE status=1";
$result = mysqli_query($dbc,$query);
$num=0;
while( $row=mysqli_fetch_array($result) ) {
echo "<p><input type='checkbox' id='done.$num' checked='checked'/>";
echo "<label for='done.$num'>".$row['title']."</label></p>";
$num++;
}
?>
<!--
<p>
<input type="checkbox" id="test7" checked="checked" />
<label for="test7">Yellow</label>
</p> -->
</div>
</li>
</ul>
</div>
</form>
</div>