sell_step5.php 5.5 KB

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