sell_step5.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. include $_SERVER['DOCUMENT_ROOT'].'/common/sa_chk_m.php';
  4. $HEADER_LOC = 'main';
  5. $nav_title = "차량판매하기 > STEP5";
  6. $mode = "Step5";
  7. $uniqid = $_SESSION['s_uniqid'];
  8. $s_staff_car_update_ing = $_SESSION['s_staff_car_update_ing'];
  9. $s_staff_cd_car = $_SESSION['s_staff_cd_car'];
  10. // Auth -> Step 단계에 따른 정상적인 요청 체크
  11. // if($mode != "Step2") {
  12. // AlertBack("지정되지 않은 요청입니다.");
  13. // }
  14. // $s_cd_sale = $_SESSION['s_cd_sale'];
  15. $sql ="SELECT *
  16. FROM car_master a
  17. WHERE cd_car = '$s_staff_cd_car' ";
  18. $col = mysql_fetch_array(mysql_query($sql, $connect));
  19. if (empty($col['cd_car'])){
  20. AlertBack("게시물을 가져오지 못하였습니다.", "");
  21. }
  22. //차량 옵션에서 사용됨
  23. $nm_cont = $col['nm_cont'];
  24. $nm_cont_detail = $col['nm_cont_detail'];
  25. ?>
  26. <?php include("include/header.php") ?>
  27. <main class="pb123">
  28. <section>
  29. <div class="sub--top--visual">
  30. <div class="contents--inner">
  31. <h2>차량 판매하기</h2>
  32. <p>이차조아에서는 사고 이력 조회 후 최고가 내차를 판매할 수 있습니다.</p>
  33. </div>
  34. </div>
  35. </section>
  36. <section class="mt35">
  37. <form id="frmForm" name="frmForm" method="post" action="proc.php" enctype="multipart/form-data">
  38. <input type="hidden" name="mode" id="mode" value="<?=$mode?>"/>
  39. <div class="options--wrapper">
  40. <h2>차량 설명하기</h2>
  41. <div class="editor--wrapper">
  42. <div class="editor--inner" style='width:100%;'>
  43. <textarea id="nm_desc" name="nm_desc" style='width:100%;height:600px;border:1px solid #c9c9c9'><?=$col['nm_desc']?></textarea>
  44. </div>
  45. </div>
  46. </div>
  47. </form>
  48. </section>
  49. <div class="btn--wrapper car--btn--wrapper floating--btn">
  50. <button type="button" class="next--btn" id="btn_write">다음(등록 완료)<i class="next--ic"></i></button>
  51. </div>
  52. <!-- loading -->
  53. <div class="loading_wrap hide">
  54. <?php include("../../include/loading_dim.html") ?>
  55. </div>
  56. <!-- // loading -->
  57. </main>
  58. <div class="modal--wrap" style="display: none" id="layout_finish">
  59. <div class="modal--content ty2" style="max-width:280px;">
  60. <div class="inner--contents">
  61. <div class="evt--thumb"></div>
  62. <h2>등록 완료</h2>
  63. <p>차량 등록이 완료되었습니다.</p>
  64. </div>
  65. <div class="modal--btn--wrap">
  66. <button type="button" id="btn_cancel">취소</button>
  67. <button type="button" class="on" id="btn_confirm">완료</button>
  68. </div>
  69. </div>
  70. </div>
  71. <script language="javascript" type="text/javascript">
  72. function go_main() {
  73. link("/m/sa/main.php");
  74. }
  75. $(document).ready(function() {
  76. $("#btn_confirm").on("click", function() {
  77. go_main();
  78. });
  79. $("#btn_cancel").on("click", function() {
  80. go_main();
  81. });
  82. $("#btn_write").on("click",function(){
  83. var custom_opts = {
  84. title : '',
  85. btn_close_show : false,
  86. }
  87. custom_opts.title = '정보를 등록하시겠습니까?';
  88. custom_modal_confirm(custom_opts, function(confirm) {
  89. if(confirm) {
  90. custom_modal_confirm_close();
  91. $("#btn_write").hide();
  92. var data = $("#frmForm").serialize();
  93. $.ajax({
  94. url : 'sell_proc.php',
  95. type: 'POST',
  96. dataType : 'json',
  97. data: data,
  98. success: function(res) {
  99. $("#btn_write").show();
  100. custom_modal_confirm_close();
  101. //세션 종료시 로그인 페이지로 이동
  102. if(res.CODE != "0000") {
  103. custom_opts.title = res.MSG;
  104. if(res.CODE == "4444") {
  105. alert(res.MSG);
  106. window.location.href = res.DATAS.URL;
  107. }
  108. custom_modal_alert(custom_opts);
  109. return false;
  110. }
  111. $("#layout_finish").show();
  112. // link("sell_step3.php?mode=Step3");
  113. },
  114. error:function(request,status,error){
  115. $("#btn_write").show();
  116. custom_modal_confirm_close();
  117. alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
  118. }
  119. });
  120. }else {
  121. $("#btn_write").show();
  122. return false;
  123. }
  124. });
  125. //
  126. // var c = confirm("처리하시겠습니까?");
  127. //
  128. // if(c){
  129. // lockLayer('loading');
  130. //
  131. // $("#btn_write").hide();
  132. // var data = $("#frmForm").serialize();
  133. //
  134. // $.ajax({
  135. // url : 'proc.php',
  136. // type: 'POST',
  137. // dataType : 'json',
  138. // data: data,
  139. // success: function(res) {
  140. // //차량정보 가져오기 시 페이지 제어
  141. // unlockLayer('loading');
  142. //
  143. // $("#btn_write").show();
  144. //
  145. // alert(res.MSG);
  146. // if(res.CODE != "0000") {
  147. // //세션이 없어지면 내차 팔기 초기 화면으로 이동
  148. // if(res.CODE == "8888") {
  149. // window.location.replace(res.DATAS.URL);
  150. // return false;
  151. // }
  152. // return false;
  153. // }
  154. // window.location.href = res.DATAS.URL;
  155. // return false;
  156. // },
  157. // error:function(request,status,error){
  158. // unlockLayer('loading');
  159. // $("#btn_write").show();
  160. //
  161. // alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
  162. // }
  163. // });
  164. // }else{
  165. // //차량정보 가져오기 시 페이지 제어
  166. // unlockLayer('loading');
  167. //
  168. // $("#btn_write").show();
  169. // return false;
  170. // }
  171. });
  172. $("#btn_prev").on("click", function() {
  173. link("sell_step4.php");
  174. });
  175. });
  176. </script>
  177. <?php include("include/bottom.php") ?>