model_sub0608.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. include $_SERVER['DOCUMENT_ROOT'].ADMIN_PATH.'common/auth_chk.php';
  4. $list_url = "model_sub.php";
  5. $mp = "12"; //set top nav
  6. $PageNo =$_REQUEST['pageno'];
  7. if (empty($PageNo)) {$PageNo=1;}else{$PageNo=$PageNo;}
  8. $PageSize=10; //목록개수설정
  9. $pagestartpoint=($PageNo-1)*$PageSize;
  10. $sql = "where mst.ds_delind='N'";
  11. $orderby = "order by mst.cd_model desc ";
  12. /*$ds_cate = $_REQUEST[ds_cate];
  13. if(!$ds_cate) $ds_cate='A0';
  14. $sql = $sql. " and cd_model in(select cd_model from car_model where ds_cate ='$ds_cate')";
  15. */
  16. $cd_category = $_REQUEST[cd_category];
  17. $cd_brand = $_REQUEST[cd_brand];
  18. if($cd_brand){
  19. $sql = $sql. " and mst.cd_model in (select cd_model from car_model where cd_brand = '$cd_brand') ";
  20. }
  21. if($searchword != ""){
  22. if($searchtype=="" || $searchtype==null){
  23. $sql = $sql. " and (mst.nm_model_sub like '$searchword%')";
  24. }else{
  25. $sql = $sql. " and $searchtype like '$searchword%'";
  26. }
  27. }
  28. $totalrows = @mysql_result(mysql_query("select count(*) from car_model_sub mst $sql"),0,0);
  29. ?>
  30. <? include("../inc/inc_top.php") ?>
  31. <? include("../inc/inc_header.php") ?>
  32. <section id="contents">
  33. <form id="frmSearch" name="frmSearch" method="post">
  34. <div class="area_title">
  35. <h2>세부모델</h2>
  36. <div class="area_select">
  37. <span>
  38. <select id="cd_category" name="cd_category"></select>
  39. </span>
  40. <span>
  41. <select id="cd_brand" name="cd_brand"></select>
  42. </span>
  43. </div>
  44. </div>
  45. </form>
  46. <div class="tbl_wrap">
  47. <table class="tbl_list ty2">
  48. <colgroup>
  49. <col width="7%">
  50. <col width="20%">
  51. <col width="20%">
  52. <col width="*">
  53. <col width="13%">
  54. </colgroup>
  55. <thead>
  56. <tr>
  57. <th>번호</th>
  58. <th>제조사</th>
  59. <th>모델</th>
  60. <th>세부모델</th>
  61. <th>정보수정</th>
  62. </tr>
  63. </thead>
  64. <?
  65. if($totalrows>0) {
  66. $r = mysql_query("select T.*
  67. ,(select nm_brand from car_brand tsub where tsub.cd_brand = T.cd_brand) nm_brand
  68. ,(select nm_model from car_model tsub where tsub.cd_model = T.cd_model) nm_model
  69. ,(select nm_category from car_category tsub where tsub.cd_category = T.cd_category) nm_category
  70. from
  71. (SELECT mst.*, (select nm_model from car_model where cd_model = mst.cd_model ) as nm_model
  72. #, (select cd_category from car_model where cd_model = mst.cd_model ) as cd_category
  73. ,(select cd_brand from car_model sub where sub.cd_model = mst.cd_model ) cd_brand
  74. FROM car_model_sub mst $sql order by mst.cd_model desc LIMIT $pagestartpoint,$PageSize )
  75. T ");
  76. $i=1;
  77. while($col = mysql_fetch_array($r)) {
  78. $tmpNum =$totalrows-($PageSize*($PageNo-1));
  79. $no = ($tmpNum - $i)+1;
  80. ?>
  81. <tr>
  82. <td><?=$no?></td>
  83. <td><?=$col[nm_brand]?></td>
  84. <td><?=$col[nm_model]?></td>
  85. <td><?=$col[nm_model_sub]?></td>
  86. <td><a href="./model_sub_form.php?ds_cate=<?=$ds_cate?>&cd_model_sub=<?=$col[cd_model_sub]?>&PageNo=<?=$PageNo?>" class="rnd_s_btn">수정</a></td>
  87. </tr>
  88. <?
  89. $i++;
  90. }
  91. }else{
  92. ?>
  93. <tr>
  94. <td align="center" colspan="7" class="list03">등록된 정보가 없습니다.</td>
  95. </tr>
  96. <?
  97. }
  98. ?>
  99. </table>
  100. </div>
  101. <!-- layer popup -->
  102. <div class="layer_popup modify_popup">
  103. <div class="close">팝업닫기</div>
  104. <div class="cont2">
  105. <table class="tbl_list2" style="width:460px;">
  106. <colgroup>
  107. <col width="20%">
  108. <col width="*">
  109. </colgroup>
  110. <tr>
  111. <th>구분</th>
  112. <td>
  113. <div class="radio_chk">
  114. <span class="check_wrap"><input type="radio" name="radiobutton" id="domestic"><i></i><label for="domestic">국내</label></span>
  115. <span class="check_wrap"><input type="radio" name="radiobutton" id="overseas"><i></i><label for="overseas">해외</label></span>
  116. </div>
  117. </td>
  118. </tr>
  119. <tr>
  120. <th>제조사</th>
  121. <td>
  122. <span class="select ty2" style="width:320px;">
  123. <select>
  124. <option value="">현대</option>
  125. <option value="">기아</option>
  126. </select>
  127. </span>
  128. </td>
  129. </tr>
  130. <tr>
  131. <th>모델</th>
  132. <td>
  133. <span class="select ty2" style="width:320px;">
  134. <select>
  135. <option value="">K3</option>
  136. <option value="">K5</option>
  137. </select>
  138. </span>
  139. </td>
  140. </tr>
  141. <tr>
  142. <th>세부모델</th>
  143. <td><input type="text" class="inp_txt" style="width:320px;" value="3시리즈 (F30) (12년~현재)"></td>
  144. </tr>
  145. </table>
  146. <div class="btn_center">
  147. <a href="#" class="rnd_btn ty2 gray">수정</a>
  148. <a href="#" class="rnd_btn ty2 black">삭제</a>
  149. </div>
  150. </div>
  151. </div>
  152. <!-- // layer popup -->
  153. <div class="paging">
  154. <?
  155. $url = "./$list_url?searchtype=$searchtype&searchword=$searchword";
  156. ListPg1($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
  157. ?>
  158. </div>
  159. <div class="btn_right">
  160. <a href="#" class="rnd_btn gray" onclick="location.replace('./model_sub_form.php?ds_cate=<?=$ds_cate?>');">+ 세부모델 등록</a>
  161. </div>
  162. </section>
  163. <script language="javascript" type="text/javascript">
  164. $(document).ready(function() {
  165. setCodeSelect("listcategory","cd_category","car_category","cd_category","<?=$cd_category?>","선택하세요","");
  166. setCodeSelect("listBrandBycate","cd_brand","car_brand","cd_brand",'<?=$cd_brand?>','선택하세요','<?=$cd_category?>');
  167. $("#cd_category").change(function(){
  168. setCodeSelect("listBrandBycate","cd_brand","car_brand","cd_brand",'<?=$cd_brand?>','선택하세요',$(this).val());
  169. });
  170. $("#cd_brand").change(function(){
  171. $("#frmSearch").submit();
  172. //location.href = "./model.php?cd_brand="+$(this).val();
  173. });
  174. });
  175. </script>
  176. <? include("../inc/inc_footer.php") ?>
  177. <? include("../inc/inc_bottom.php") ?>
  178. <?
  179. mysql_close($connect);
  180. ?>