dealer_chk.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. if(empty($_SESSION['s_cd_dealerid'])){
  3. $url = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
  4. ?>
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  8. <script language="JavaScript">
  9. alert("본페이지는 로그인후 이용가능합니다.");
  10. location.replace("/member/login_dealer.php?url=<?=$url?>");
  11. </script>
  12. </head>
  13. </html>
  14. <?
  15. die();
  16. }
  17. if(!empty($_SESSION[s_cd_dealerid])) {
  18. $table_name = "dealer_master a";
  19. $_whereis = " cd_dealerid = '". $_SESSION[s_cd_dealerid] . "' ";
  20. $member_info = $dbCon->selectDAO("*, ifnull((select ds_status from dealer_master where cd_dealer = a.cd_dealer_p), '') ds_status_p", $table_name, $_whereis);
  21. if (!empty($member_info['cd_dealer'])) {
  22. // if($_SERVER['REMOTE_ADDR'] == '220.86.24.199') {
  23. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/encrypt.php';
  24. $enc_passwd = "upro_contract";
  25. if(strpos($_SERVER['PHP_SELF'], "/m/") === false) {
  26. $contract_url = "/member/contact.php";
  27. }else {
  28. $contract_url = "/m/member/contact.php";
  29. }
  30. //2021-07-16 계약서 확인하여 동의 하지 않으면 동의 페이지로 이동
  31. if($member_info['ds_info_contract'] != "Y" || $member_info['ds_info_privacy'] != "Y" || $member_info['ds_info_service'] != "Y") {
  32. $contract = array();
  33. $contract['cd_dealer'] = $member_info['cd_dealer'];
  34. $contract['cd_dealerid'] = $member_info['cd_dealerid'];
  35. $enc_data = upro_encrypt(json_encode($contract), $enc_passwd);
  36. ?>
  37. <html>
  38. <head>
  39. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  40. <script language="JavaScript">
  41. location.replace("<?=$contract_url?>?mode=dealer&login_data=<?=base64_encode($enc_data)?>");
  42. </script>
  43. </head>
  44. </html>
  45. <?
  46. exit;
  47. }
  48. // }
  49. }
  50. }
  51. ?>