-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-signatarios.php
130 lines (105 loc) · 3.65 KB
/
page-signatarios.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
<?php
/**
*
* @author Samuel Ramon [email protected]
*/
get_header();
get_template_part('title', 'page');
$instituicoes = get_signatarios('institu');
$outros = get_signatarios(false, 'institu');
//$tipos = tipos_signatarios();
global $post;
?>
<h2 class="title-signatarios"><?php echo $post->post_title ?></h2>
<?php get_search_form(); ?>
<div class="sidea">
<h4>Redes, Fóruns e Articulações <?php /*?><?php echo implode(',', $tipos['outros']) ?><?php */?></h4>
<?php if($outros): $total = 0; $j=0; ?>
<?php foreach( $outros as $o => $i ): $customs = get_post_custom_values("site", $i->ID); ?>
<?php if ( $o < 10 ){ $attr = ''; } else { $attr = "style='display:none;'"; } ?>
<?php if ( ($o%10)==0 ) { echo "<div id='unid2_{$total}' {$attr} class='page_content2'>"; $j = 1; $total++; } ?>
<p>
<?php if ($customs[0]) { echo "<a href='".addhttp($customs[0])."' target='_blank'>"; } ?>
<?php echo $i->post_title; ?>
<?php if ($customs[0]) { echo "</a>"; } ?>
</p>
<?php if ( $j==10 || $o == count($outros)-1 ) { echo "</div>"; } ?>
<?php if ( $j>0 && $j<=10 ) { $j++; } else { $j=0; } ?>
<?php endforeach; ?>
<?php if ( count($outros) > 10 ): ?>
<div id="paginacao">
<a href="#" id="voltar2">Voltar</a>
<a href="#" id="avancar2">Avançar</a>
</div>
<script type="text/javascript">
var ini = 0,
max = <?php echo $total ?>;
jQuery(document).ready(function($){
function show2( indice ) {
$('.page_content2').css('display','none');
$('#unid2_'+indice).css('display','block');
ini = indice;
}
jQuery('#voltar2').click('click', function(e){
e.preventDefault();
if ( ini > 0 ) show2(ini-1)
});
jQuery('#avancar2').live('click', function(e){
e.preventDefault();
if ( ini < (max - 1) ) show2(ini+1);
});
show2( ini );
});
</script>
<?php endif; ?>
<?php else: ?>
<p>Não encontrados</p>
<?php endif; ?>
</div>
<div class="sideb">
<h4>Organizações <?php /*?><?php echo $tipos['instituicoes'] ?><?php */?></h4>
<?php if($instituicoes): $total = 0; $j=0; ?>
<?php foreach( $instituicoes as $o => $i ): $customs = get_post_custom_values("site", $i->ID); ?>
<?php if ( $o < 10 ){ $attr = ''; } else { $attr = "style='display:none;'"; } ?>
<?php if ( ($o%10)==0 ) { echo "<div id='unid_{$total}' {$attr} class='page_content'>"; $j = 1; $total++; } ?>
<p>
<?php if ($customs[0]) { echo "<a href='".addhttp($customs[0])."' target='_blank'>"; } ?>
<?php echo $i->post_title; ?>
<?php if ($customs[0]) { echo "</a>"; } ?>
</p>
<?php if ( $j==10 || $o == count($instituicoes)-1 ) { echo "</div>"; } ?>
<?php if ( $j>0 && $j<=10 ) { $j++; } else { $j=0; } ?>
<?php endforeach; ?>
<?php if ( count($instituicoes) > 10 ): ?>
<div id="paginacao">
<a href="#" id="voltar">Voltar</a>
<a href="#" id="avancar">Avançar</a>
</div>
<script type="text/javascript">
var ini = 0,
max = <?php echo $total ?>;
jQuery(document).ready(function($){
function show( indice ) {
$('.page_content').css('display','none');
$('#unid_'+indice).css('display','block');
ini = indice;
}
jQuery('#voltar').click('click', function(e){
e.preventDefault();
if ( ini > 0 ) show(ini-1)
});
jQuery('#avancar').live('click', function(e){
e.preventDefault();
if ( ini < max - 1 ) show(ini+1);
});
show( ini );
});
</script>
<?php endif; ?>
<?php else: ?>
<p>Não encontrados</p>
<?php endif; ?>
</div>
<?php
get_footer();
?>