Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
cts.eemo.co.kr
/
public_html
/
src
/
web
/
view
/
qr
/
code
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/cts.eemo.co.kr/public_html/src/web/view/qr/code/selectView.php
<?php use CTS\CTS; CTS::$layout ='blank'; $type = $_REQUEST['type']; $sale_post = $_REQUEST['sale_post']; $sale_date = $_REQUEST['sale_date']; $sale_type = $_REQUEST['sale_type']; switch($type) { case 'midle': $res = \DB::query("SELECT * FROM sale where sale_post ='".$sale_post."' group by sheet_name order by sale_idx asc"); echo "<select id='midle_select' class='custom-select' data-style='btn-default' tabindex='-98'>"; echo "<option>". "=== 분양일자 선택 ===". "</option>"; foreach ( $res as $ket => $value ){ echo "<option value=".$value['sale_date'].">" . substr($value['sale_date'],0,10) . " ". $value['sheet_name']."요일" . "</option>"; } echo "</select>"; break; case 'btm': $res = \DB::query("SELECT * FROM sale where qr_use='N' and sale_date ='".$sale_date."' AND sale_type = '$sale_type' order by sale_idx asc"); echo "<table class='table table-bordered' style='vertical-align:top'> <thead class='thead-dark'> <tr class='text-center'> <th style='width:10%'>선택</th> <th>지역</th> <th>농가명</th> <th>부화장</th> <th>계군명</th> <th>수 수</th> </tr> </thead>"; echo "<tbody>"; $tmpValue = ""; foreach ( $res as $key => $value ){ echo "<tr class='text-center'>"; if($value['sale_farm'] == $tmpValue) { echo '<td>'; echo '</td>'; }else { echo "<td>"; echo "<label class='custom-control custom-radio'><input type='radio' class='select_type custom-control-input' name='select_type' value='".$value['sale_idx']."'/>" ."<span class='custom-control-label'></span>" ."</td>"; } $tmpValue = $value['sale_farm']; echo "<td>".$value['sale_location']."</td>" ."<td class='farm'>".$value['sale_farm']."</td>" ."<td>".$value['sale_hatchery']."</td>" ."<td>".$value['sale_flock']."</td>" ."<td class='flock_num'>".$value['sale_flock_num'] ."</td>" ."</tr>" ."</label>"; } echo "</tbody>"; echo "</table>"; break; } ?> <script> $(function(){ $("#midle_select").change(function() { var sale_date = $("#midle_select").val(); $("#btmList").load("selectView.php?type=btm&sale_date="+sale_date+"&sale_type="+"<?=$sale_type?>"); }); $('.select_type').click(function() { var st = $("input:radio[name=select_type]:checked").val(); $("#sale_idx").val(st); }); }); </script> <!-- 1. 선택된 Radio 버튼의 값(value) 가져오기 var st = $(":input:radio[name=search_type]:checked").val(); 2. Radio 버튼 값 설정(선택)하기 $('input:radio[name=search_type]:input[value=' + st + ']').attr("checked", true); -->