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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
|
<div class="review_detail_layout" style="position: relative;">
<?php $cnt_sql = "SELECT COUNT(*) AS cnt FROM mBoard_cus_after WHERE mark_flg = '1'"; $cnt_res = mysql_query($cnt_sql,$connect_web); while($cnt_info = mysql_fetch_array($cnt_res)) { $cnt = $cnt_info['cnt']; } ?> <p class="number_format">µî·Ï°Ç¼ö : <?php echo number_format($cnt); ?> °Ç</p> <div id="tab_btn"> <p id="btn_1" class="active">º£½ºÆ®¼ø</p> <p id="btn_2">Ãֽżø</p> </div> <div id="best"> <ul class="list_header"> <li style="width:127px" class="date">ÀÏÀÚ</th> <li style="width:217px" class="comp_name">¾÷ü¸í</th> <li style="width:218px" class="comp_type">¾÷Á¾</th> <li style="width:625px" class="review_contents">³»¿ë</th> </ul> <?php $sql = "SELECT * FROM mBoard_cus_after WHERE mark_flg = '1' ORDER BY show_top DESC, reg_date desc LIMIT 300"; $res = mysql_query($sql,$connect_web);
while($info=mysql_fetch_array($res)){ //$list_array[] = $info; $reg_date = strtotime($info['reg_date']);
if($info['show_top'] == "1") { $reg_txt = "Best Review"; } else { $reg_txt = date('Y-m-d',$reg_date); }
//»óÈ£¸í ±ÛÀÚ ¼ö ÁÙÀ̱â $sangho_leng = mb_strlen($info['smcompany'], 'euc-kr'); $sangho_leng = ceil($sangho_leng/2);
$star = ""; for($s=0; $s<$sangho_leng; $s++){ $star .= "*"; }
$sangho = mb_substr($info['smcompany'], '0', $sangho_leng, 'euc-kr').$star; ?> <table> <colgroup> <col width="128"> <col width="220"> <col width="220"> <col width="630"> </colgroup>
<!-- ¸®½ºÆ®½ÃÀÛ --> <!-- Áö±Ý±îÁöÀÇ µ¥ÀÌÅÍ ¿¬µ¿ ÇÊ¿ä, ´õº¸±â¹öư ¼öÁ¤¿Ï·á --> <tbody>
<tr class="service_detail_list service_best_list"> <td class="date"><?php echo $reg_txt;?></td> <td class="comp_name"> <!-- <?php echo $info['smcompany'];?> --><?php echo $sangho;?></td> <td class="comp_type"><?php echo $info['industry_type'];?></td> <td class="review_contents"><?php echo nl2br($info['markdetail']);?></td> </tr> </tbody> </table> <?php } ?>
<div class="test_btn" style="cursor:pointer;margin-top:64px;background-color:#424242;border-radius:12px;"><img src="./img/service_review_detail/more_btn01.png" alt="ÀÌ¿ëÈıâ´õº¸±â"></div> </div> <!-- //best -->
<div id="normal"> <ul class="list_header"> <li style="width:127px" class="date">ÀÏÀÚ</th> <li style="width:217px" class="comp_name">¾÷ü¸í</th> <li style="width:218px" class="comp_type">¾÷Á¾</th> <li style="width:625px" class="review_contents">³»¿ë</th> </ul> <?php $sql = "SELECT * FROM mBoard_cus_after WHERE mark_flg = '1' /*AND show_top <> 1*/ ORDER BY reg_date desc LIMIT 300"; $res = mysql_query($sql,$connect_web); while($info=mysql_fetch_array($res)){ //$list_array[] = $info; $reg_date = strtotime($info['reg_date']); //»óÈ£¸í ±ÛÀÚ ¼ö ÁÙÀ̱â $sangho_leng = mb_strlen($info['smcompany'], 'euc-kr'); $sangho_leng = ceil($sangho_leng/2);
$star = ""; for($s=0; $s<$sangho_leng; $s++){ $star .= "*"; }
$sangho = mb_substr($info['smcompany'], '0', $sangho_leng, 'euc-kr').$star; ?> <table> <colgroup> <col width="128"> <col width="220"> <col width="220"> <col width="630"> </colgroup> <!-- ¸®½ºÆ®½ÃÀÛ --> <!-- Áö±Ý±îÁöÀÇ µ¥ÀÌÅÍ ¿¬µ¿ ÇÊ¿ä, ´õº¸±â¹öư ¼öÁ¤¿Ï·á --> <tbody> <tr class="service_detail_list service_normal_list"> <td class="date"><?php echo date('Y-m-d',$reg_date); ?></td> <td class="comp_name"> <!-- <?php echo $info['smcompany'];?> --><?php echo $sangho;?></td> <td class="comp_type"><?php echo $info['industry_type'];?></td> <td class="review_contents"><?php echo nl2br($info['markdetail']);?></td> </tr> </tbody> </table> <?php } ?> <div class="test_btn2" style="cursor:pointer;margin-top:64px;background-color:#424242;border-radius:12px;"><img src="./img/service_review_detail/more_btn01.png" alt="ÀÌ¿ëÈıâ´õº¸±â"></div> </div> <!-- //normal --> </div><!-- //review_detail_layout --> <script> $(document).ready(function(){
$("#btn_1").click(function(){ $("#best").show(); $("#normal").hide(); $("#btn_1").addClass("active"); $("#btn_2").removeClass("active"); });
$("#btn_2").click(function(){ $("#normal").show(); $("#best").hide(); $("#btn_2").addClass("active"); $("#btn_1").removeClass("active"); });
var $list = $('.service_best_list'), $list2 = $('.service_normal_list'), $btn = $('.test_btn'), $btn2 = $('.test_btn2'), list_count = $list.length, list2_count = $list2.length, increment = 19; // $list.each(function(i){ //$(this).append('<p>list' + i + '</p>') //});
// º£½ºÆ®¸®ºä // 20º¸´Ù ³·À» ½Ã ¹öư¼û±è if( increment >= list_count ){ $btn.hide(); } // 20 ÀÌ»ó hide $list.slice(20).hide(); $btn.on('click', function(){ increment += 10; // 10 ¾¿ Áõ°¡ // ´õº¸±â ±â´É $list.show(); $list.slice(increment).hide(); // ÃÖ´ë°¹¼öÀÏ ½Ã ¹öư¼û±è if( increment > list_count ){ $btn.hide(); } });
// ÀϹݸ®ºä // 20º¸´Ù ³·À» ½Ã ¹öư¼û±è if( increment >= list2_count ){ $btn2.hide(); } // 20 ÀÌ»ó hide $list2.slice(20).hide(); $btn2.on('click', function(){ increment += 10; // 10 ¾¿ Áõ°¡ // ´õº¸±â ±â´É $list2.show(); $list2.slice(increment).hide(); // ÃÖ´ë°¹¼öÀÏ ½Ã ¹öư¼û±è if( increment > list2_count ){ $btn2.hide(); } }); }); </script> <script> $(function(){ var modals = document.getElementsByClassName("modal_win"); var openModals = document.getElementsByClassName("review_card"); var btnClose = document.getElementsByClassName("btn_close"); var funcs = [];
function Modal(num) { return function() { openModals[num].onclick = function(){ modals[num].style.display = "block"; modals[num].style.position = "fixed"; console.log(num); }; btnClose[num].onclick = function() { modals[num].style.display = "none"; modals[num].style.position = "relative"; }; }; };
for(var i = 0; i < openModals.length; i++) { funcs[i] = Modal(i); }; for(var j = 0; j < openModals.length; j++) { funcs[j](); };
window.onclick = function(event) { if (event.target.className == "modal_win") { event.target.style.display = "none"; event.target.style.position = "relative"; }; }; }); </script>
|