-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpart-task.php
executable file
·147 lines (142 loc) · 5.08 KB
/
part-task.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php #get_header(); ?>
<?php
if (!is_user_logged_in()) {
locate_template( "part-closed.php", true );
} else {
?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="content_pomodoro col-xs-12 col-sm-6 col-sm-offset-3">
<h2 class="forte"><span class="glyphicon glyphicon-paste" aria-hidden="true"></span> <?php the_title();?></h2>
<div class="table-responsive">
<table class="table table-striped table-responsive table-condensed">
<thead>
<tr>
<th><?php _e("Details", "sis-foca-js"); ?></th>
<th><?php _e("Info", "sis-foca-js"); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="glyphicon glyphicon-picture" aria-hidden="true"></span> <?php _e("Author", "sis-foca-js"); ?></td>
<td><?php echo get_avatar( get_the_author_meta( 'user_email' ), '96' ); ?></td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-user" aria-hidden="true"></span> <?php _e("Name", "sis-foca-js"); ?></td>
<td><a href="/members/<?php echo get_the_author_meta( 'user_nicename' ); ?>"><?php the_author(); ?></a></td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-map-marker" aria-hidden="true"></span> <?php _e("Location", "sis-foca-js"); ?></td>
<td><!--a href="#"--><?php echo get_post_meta(get_the_ID(), "post_location_city", true).", ".get_post_meta(get_the_ID(), "post_location_region", true).", ".get_post_meta(get_the_ID(), "post_location_country", true); ?><!--/a--></td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-tags" aria-hidden="true"></span> <?php _e("Project tags", "sis-foca-js"); ?></td>
<td><?php the_tags(); ?></td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-paperclip" aria-hidden="true"></span> <?php _e("Type", "sis-foca-js"); ?></td>
<td><?php the_category(); ?></td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-calendar" aria-hidden="true"></span> <?php _e("Pomodoro date", "sis-foca-js"); ?></td>
<td><?php the_date("l, j \d\e F \d\e Y g:i "); ?></td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-text-background" aria-hidden="true"></span> <?php _e("Notes", "sis-foca-js"); ?></td>
<td><?php the_content(); ?></td>
</tr>
<?php
global $wpdb;
$title = get_the_title();
$posts_ids = array();
$posts;
$posts = $wpdb->get_results( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type='projectimer_focus'", $title), OBJECT );
foreach ($posts as $post) {
$posts_ids[] = $post->ID;
}
?>
<tr>
<td><span class="glyphicon glyphicon-time" aria-hidden="true"></span> <?php _e("Durantion", "sis-foca-js"); ?></td>
<td><?php echo count($posts_ids)/2; ?>h</td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-ok" aria-hidden="true"></span> <?php _e("Total pomodoros", "sis-foca-js"); ?></td>
<td><?php echo count($posts_ids); ?></td>
</tr>
</tbody>
</table>
</div>
<?php endwhile; // end of the loop. ?>
</div>
<?php } ?>
<?php #get_footer();
/*
<div class="container">
<br />
<?php while ( have_posts() ) : the_post(); ?>
<div class="row">
<div class="col-sm-1 col-md-offset-1">
<?php echo get_avatar( get_the_author_meta( 'user_email' ), '60' ); ?>
</div>
<div class="col-sm-4">
<p><strong> <?php the_title(); ?></strong></p>
<p><?php get_the_author_meta('ID'); ?></p>
</div>
</div>
<div class="row" style="text-align: center;">
<div class="col-sm-4" >
<p><strong>Pomodoro</strong></p>
</div>
</div>
<div class="row">
<div class="col-sm-2" style="text-align: right;">
<p>projetos</p>
<p>tipo</p>
<p>data</p>
<p>anotações</p>
</div>
<div class="col-sm-4">
<p> <?php the_tags(''); ?> </p>
<p> <?php the_category(); ?> </p>
<p> <?php the_date("l, j \d\e F \d\e Y g:i "); ?> </p>
<p> <?php the_content(); ?> </p>
</div>
</div>
<div class="row" style="text-align: center;">
<div class="col-sm-4" >
<p><strong>Tarefa</strong></p>
</div>
</div>
<div class="row">
<div class="col-sm-2" style="text-align: right;">
<p>duração</p>
<p>pomodoros</p>
</div>
<div class="col-sm-4">
<?php
global $wpdb;
$title = get_the_title();
$posts_ids = array();
$posts;
$posts = $wpdb->get_results( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type='projectimer_focus'", $title), OBJECT );
foreach ($posts as $post) {
$posts_ids[] = $post->ID;
}
?>
<p> <?php echo count($posts_ids)/2; ?>h </p>
<p> <?php echo count($posts_ids); ?> </p>
<p> Tarefas relaciondas </p>
</div>
</div>
<!--div class="row">
<div class="col-sm-2 col-md-offset-2">
<button onclick="javascript:alert('desculpe, em construcao');">Carregar tarefa</button>
</div>
</div-->
<br />
<?php endwhile; // end of the loop. ?>
<?php #} ?>
</div>
*?>
</div>
<?php } ?>
<?php get_footer();