inc_ViewBtn.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <div class="btn--wrapper col-12 d-flex justify-content-center mt90" style="max-width:1200px; margin:0 auto; padding:0 20px;">
  2. <button type="button" class="btn btn-secondary list--btn" style="width:190px; height:65px;" id="btn_list">목록</button>
  3. <?php if($ds_status_sale == "B0" || $ds_status_sale == "C0" || $ds_status_sale == "D0") { ?>
  4. <!-- <button type="button" class="btn btn-primary ms-2" style="width:120px;" id="btn_update_car">차량 정보 수정</button> -->
  5. <?php } ?>
  6. <?php
  7. ?>
  8. <?php if($ds_status_sale == "Z0" && $ds_status_contract_step1_sale == "Y" && $ds_status_contract_step2_sale == "Y" && $ds_status_contract_step3_sale == "Y" && $ds_status_contract_step4_sale == "Y" && $ds_status_contract_step5_sale != "Y") { ?>
  9. <button type="button" class="btn btn-primary comp--btn" style="width:190px; height:65px;" id="btn_end_proc">거래 완료 처리</button>
  10. <?php } ?>
  11. </div>
  12. <script>
  13. function go_list() {
  14. var url = "<?=$list_url?>";
  15. var params = {
  16. ListPageNo : "<?=$PageNo?>",
  17. PageSort : "<?=$PageSort?>",
  18. searchtype : "<?=$searchtype?>",
  19. searchword : "<?=$searchword?>",
  20. }
  21. link(url+"?"+$.param(params));
  22. }
  23. $(function() {
  24. $("#btn_list").on("click", function() {
  25. go_list();
  26. });
  27. $("#btn_update_car").on("click", function() {
  28. var custom_opts = {
  29. title : '',
  30. btn_close_show : false,
  31. }
  32. custom_opts.title = '차량정보를 수정 하시겠습니까?\n수정 페이지로 이동합니다.';
  33. custom_modal_confirm(custom_opts, function(confirm) {
  34. if(confirm) {
  35. $("#btn_update_car").hide();
  36. var data = {
  37. mode : "updateCar"
  38. , cd_car : '<?=$cd_car?>'
  39. , cd_sale : '<?=$cd_sale?>'
  40. , nm_name : '<?=$nm_name?>'
  41. , nm_hp : '<?=$nm_hp_sale?>'
  42. , ds_area : '<?=$ds_area_sale?>'
  43. , nm_number : '<?=$nm_number?>'
  44. };
  45. $.post("sell_proc.php", data, function(res) {
  46. $("#btn_update_car").show();
  47. custom_modal_confirm_close();
  48. if(res.CODE != "0000"){
  49. custom_opts.title = "수정 세션 생성에 실패 했습니다.";
  50. custom_modal_alert(custom_opts);
  51. return false;
  52. }
  53. link("sell_step1.php");
  54. }, "json");
  55. }else {
  56. $("#btn_update_car").show();
  57. return false;
  58. }
  59. });
  60. });
  61. $("#btn_end_proc").on("click", function() {
  62. var custom_opts = {
  63. title : '',
  64. btn_close_show : false,
  65. }
  66. custom_opts.title = '거래완료 처리하시겠습니까?';
  67. custom_modal_confirm(custom_opts, function(confirm) {
  68. if(confirm) {
  69. $("#btn_end_proc").hide();
  70. var data = {
  71. mode : "TenderEndAAP"
  72. , cd_car : '<?=$cd_car?>'
  73. , cd_sale : '<?=$cd_sale?>'
  74. , nm_name : '<?=$nm_name?>'
  75. , nm_hp : '<?=$nm_hp_sale?>'
  76. , ds_area : '<?=$ds_area_sale?>'
  77. , nm_number : '<?=$nm_number?>'
  78. };
  79. $.post("sale_proc.php", data, function(res) {
  80. $("#btn_end_proc").show();
  81. custom_modal_confirm_close();
  82. if(res.CODE != "0000"){
  83. custom_opts.title = "거래완료 처리에 실패했습니다.";
  84. custom_modal_alert(custom_opts);
  85. return false;
  86. }
  87. custom_opts.title = "거래완료 처리되었습니다.";
  88. custom_modal_alert(custom_opts, function() {
  89. reload();
  90. });
  91. return false;
  92. }, "json");
  93. }else {
  94. $("#btn_end_proc").show();
  95. return false;
  96. }
  97. });
  98. });
  99. });
  100. </script>