sell_step5.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. include $_SERVER['DOCUMENT_ROOT'].'/common/auth_chk_m.php';
  4. $nav_title = "차량 판매 > 필수 사진 정보 입력";
  5. $HEADER_LOC = 'main';
  6. $mode = "Step5";
  7. $s_cd_car = $_SESSION['s_cd_car'];
  8. $s_car_update_ing = $_SESSION['s_car_update_ing'];
  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_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("../inc/inc_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 class="mt35">
  36. <form id="frmForm" name="frmForm" method="post" action="proc.php" enctype="multipart/form-data">
  37. <input type="hidden" name="mode" id="mode" value="<?=$mode?>"/>
  38. <div class="options--wrapper">
  39. <h2>차량 설명하기</h2>
  40. <div class="editor--wrapper">
  41. <div class="editor--inner" style='width:100%;'>
  42. <textarea id="nm_desc" name="nm_desc" style='width:100%;height:600px;border:1px solid #c9c9c9'><?=$col['nm_desc']?></textarea>
  43. </div>
  44. </div>
  45. </div>
  46. </form>
  47. </section>
  48. <div class="btn--wrapper car--btn--wrapper floating--btn">
  49. <button type="button" class="next--btn" id="btn_write">다음(등록 완료)<i class="next--ic"></i></button>
  50. </div>
  51. <!-- loading -->
  52. <div class="loading_wrap hide">
  53. <?php include("../include/loading_dim.html") ?>
  54. </div>
  55. <!-- // loading -->
  56. </main>
  57. <div class="modal--wrap" style="display: none" id="layout_finish">
  58. <div class="modal--content ty2" style="max-width:280px;">
  59. <div class="inner--contents">
  60. <div class="evt--thumb"></div>
  61. <h2>등록 완료</h2>
  62. <p>차량 등록이 완료되었습니다.</p>
  63. </div>
  64. <div class="modal--btn--wrap">
  65. <button type="button" id="btn_cancel">취소</button>
  66. <button type="button" class="on" id="btn_confirm">완료</button>
  67. </div>
  68. </div>
  69. </div>
  70. <!-- 임시 패스워드 전송 -->
  71. <!-- <div class="modal fade type2" id="exampleModal2" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  72. <div class="modal-dialog modal-dialog-centered" style="max-width:400px;">
  73. <div class="modal-content">
  74. <div class="icon--wrap">
  75. <div class="thumb evt--thumb"></div>
  76. </div>
  77. <div class="modal-body modal--body">
  78. <h2 class="mt25">등록 완료</h2>
  79. <p>차량 등록이 완료되었습니다.</p>
  80. </div>
  81. <div class="modal-footer d-flex justify-content-center ty2">
  82. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
  83. <button type="button" class="ml10 btn btn-primary">확인</button>
  84. </div>
  85. </div>
  86. </div>
  87. </div> -->
  88. <script language="javascript" type="text/javascript">
  89. function go_main() {
  90. link("/m/main.php");
  91. }
  92. $(document).ready(function() {
  93. $("#btn_confirm").on("click", function() {
  94. go_main();
  95. });
  96. $("#btn_cancel").on("click", function() {
  97. go_main();
  98. });
  99. $("#btn_write").on("click",function(){
  100. var custom_opts = {
  101. title : '',
  102. btn_close_show : false,
  103. }
  104. custom_opts.title = '정보를 등록하시겠습니까?';
  105. custom_modal_confirm(custom_opts, function(confirm) {
  106. if(confirm) {
  107. custom_modal_confirm_close();
  108. $("#btn_write").hide();
  109. var data = $("#frmForm").serialize();
  110. $.ajax({
  111. url : 'proc.php',
  112. type: 'POST',
  113. dataType : 'json',
  114. data: data,
  115. success: function(res) {
  116. $("#btn_write").show();
  117. custom_modal_confirm_close();
  118. //세션 종료시 로그인 페이지로 이동
  119. if(res.CODE != "0000") {
  120. custom_opts.title = res.MSG;
  121. if(res.CODE == "4444") {
  122. alert(res.MSG);
  123. window.location.href = res.DATAS.URL;
  124. }
  125. custom_modal_alert(custom_opts);
  126. return false;
  127. }
  128. $("#layout_finish").show();
  129. // link("sell_step3.php?mode=Step3");
  130. },
  131. error:function(request,status,error){
  132. $("#btn_write").show();
  133. custom_modal_confirm_close();
  134. alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
  135. }
  136. });
  137. }else {
  138. $("#btn_write").show();
  139. return false;
  140. }
  141. });
  142. });
  143. $("#btn_prev").on("click", function() {
  144. link("sell_step4.php");
  145. });
  146. });
  147. </script>
  148. <?php include("../inc/inc_bottom.php"); ?>