/record.php
PHP | 196 lines | 148 code | 25 blank | 23 comment | 8 complexity | b38ed4ec75d7c2aa41542c00d7704141 MD5 | raw file
- <?php
- function get_Content($_url){
- // 핸들 생성
- $cURL = curl_init();
- // 대상 URL 설정
- curl_setopt($cURL, CURLOPT_URL,$_url);
- curl_setopt($cURL, CURLOPT_HEADER,0);
- //1->DIRECT RETURN 0->RESULT RETURN
- curl_setopt($cURL, CURLOPT_RETURNTRANSFER,1);
- curl_setopt($cURL, CURLOPT_SSL_VERIFYPEER, FALSE);
- // cURL 실행
- $data = curl_exec($cURL);
- // 핸들 닫기
- curl_close($cURL);
-
- return $data;
- }
-
- function get_Pay($_url,$m_tid,$m_mid){
- // 핸들 생성
- $cURL = curl_init();
- // 대상 URL 설정
-
-
- $postf = array('P_TID' => $m_tid, 'P_MID' => $m_mid);
-
- curl_setopt($cURL, CURLOPT_SSL_VERIFYPEER, FALSE);
- curl_setopt($cURL, CURLOPT_URL,$_url);
- curl_setopt($cURL, CURLOPT_HEADER,0);
- curl_setopt($cURL, CURLOPT_POST,1);
- curl_setopt($cURL, CURLOPT_POSTFIELDS, $postf);
- curl_setopt($cURL, CURLOPT_RETURNTRANSFER,1);
- // cURL 실행
- $data = curl_exec($cURL);
-
- // 핸들 닫기
- curl_close($cURL);
- return $data;
- }
-
- $name_kor=$_GET['name_kor'];
- $name_eng_first=$_GET['name_eng_first'];
- $name_eng_last=$_GET['name_eng_last'];
- //$email=$_GET['email'];
- //$hpnum=$_GET['hpnum'];
-
- $email=$_REQUEST['P_EMAIL'];
- $hpnum=$_REQUEST['P_MOBILE'];
-
-
- $status=$_REQUEST['P_STATUS'];
- $noti=$_REQUEST['P_NOTI'];
- $tid=$_REQUEST['P_TID'];
- ///Debug Code
-
- if($status==null)$status="00";
- if($tid==null)$tid="1234";
-
- if($tid==null)$name_kor="1234";
- if($tid==null)$tid="1234";
- if($noti==null)
- {
- $noti="<PRODUCT>";
- $noti.="<GOOD_TYPE_CD>L</GOOD_TYPE_CD>";
- $noti.="<COUNTRY_CODE>JP</COUNTRY_CODE>";
- $noti.="<CITY_CODE>TYO</CITY_CODE>";
- $noti.="<CHECKIN_DATE></CHECKIN_DATE>";
- $noti.="<CHECKOUT_DATE></CHECKOUT_DATE>";
- $noti.="<BED_TYPE></BED_TYPE>";
- $noti.="<BED_SG>1</BED_SG>";
- $noti.="<BED_DB>0</BED_DB>";
- $noti.="<BED_TW>0</BED_TW>";
- $noti.="<BED_TP>0</BED_TP>";
- $noti.="<BED_QD>0</BED_QD>";
- $noti.="<LODGE_CODE>H00098</LODGE_CODE>";
- $noti.="<LODGE_NAME><![CDATA[ SHINAGAWA PRINCE HOTEL ]]></LODGE_NAME>";
- $noti.="<COMP_CODE>B00101</COMP_CODE>";
- $noti.="<CRS>R</CRS>";
- $noti.="<RATE>14.65</RATE>";
- $noti.="<ISSUE_DATE>20120825</ISSUE_DATE>";
- $noti.="<ROOM_TYPE>132</ROOM_TYPE>";
- $noti.="<ROOM_OPTION_CODE>01</ROOM_OPTION_CODE>";
- $noti.="<TOTAL_SALE_PRICE>10180</TOTAL_SALE_PRICE>";
- $noti.="</PRODUCT>";
- }
- //Debug Code
-
- /*$name_kor="박준우";
- $name_eng_first="junwoo";
- $name_eng_last="park";
- $email="upy@naver.com";
- $hpnum="01093830596";
- */
- $pay_status=true;
- if($status=="00")
- {
-
- $resv_str="<RESERVE> ";
- $resv_str.=" <USERINFO> ";
- $resv_str.=" <NM_KOR>".$name_kor."</NM_KOR>";
- $resv_str.="<NM_ENG_FIRST>".$name_eng_first."</NM_ENG_FIRST>";
- $resv_str.=" <NM_ENG_LAST>".$name_eng_last."</NM_ENG_LAST>";
- $resv_str.=" <EMAIL>".$email."</EMAIL>";
- $resv_str.=" <HP_NUM>".$hpnum."</HP_NUM>";
- $resv_str.=" </USERINFO> ";
- $resv_str.=" <PAYMENTINFO>";
- $resv_str.=" <IOFG_CODE>"."C"."</IOFG_CODE>";
- $resv_str.=" <IO_DETAIL_CODE>".$_REQUEST['P_FN_CD1']."</IO_DETAIL_CODE>";
- $resv_str.=" <TID>".$tid."</TID>";
- $resv_str.=" <CARD_NO>"."1234123412341234"."</CARD_NO>";
- $resv_str.=" <QUOTA_YN>"."N"."</QUOTA_YN>";
- $resv_str.=" <QUOTA_TERM>"."0"."</QUOTA_TERM>";
- $resv_str.=" <NO_INTEREST_YN>"."Y"."</NO_INTEREST_YN>";
- $resv_str.=" <AGREE_NO>".$_REQUEST['P_TID']."</AGREE_NO>";
- $resv_str.=" </PAYMENTINFO>".$noti." </RESERVE>";
-
- //
-
-
-
- $url="http://dev.cjworldis.com/MobileApp/AntMobile.do?method=getReserve&reqStrXML=";
- $url.=$resv_str;
-
- $Result = get_Content($url);
-
- libxml_use_internal_errors(true);
- if(!simplexml_load_string($Result))
- {
- //It was not an XML string
- $pay_status=false;
- } else
- {
-
- //제대로 예약되었는지 한번더 체크
- //결제
- $pay = get_Pay($_REQUEST['P_REQ_URL'], $_REQUEST['P_TID'],"mjapanapp0");
-
- }
- }
-
-
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
- <script type="text/javascript" src="assets/js/function.js"></script>
- <link rel="stylesheet" href="assets/css/reset.css" />
- <link rel="stylesheet" href="assets/css/layout.css" />
- <title>호텔앤조이</title>
- </head>
- <body>
- <div id="bodyWrapper">
- <div id="header">
- <a onclick="javascript:history.back(-1)"><img id="back" src="assets/img/button.png" /></a>
- <h3><font color="#FFFFFF">예약내역</font></h3>
- <a><img id="home" src="assets/img/home.png" /></a>
- <a><img id="document" src="assets/img/document.png"></a>
- </div>
- <div class="hotelDetail container">
-
- <!--
- <span class="thumbnail"><img src="assets/img/grand.png" /></span>
- <span class="info">
- <span><h5>그랜드앰배서더서울</h5></span>
- <span>특 1급</span>
- <span>서울 중구 장충동2가 186-54</span>
- </span>
- -->
- </div>
- <div class="tabContents container">
- <ul>
- <li><span class="label">예약번호 </span><span class="input">M131372317</span></li>
- <li><span class="label">호텔명 </span><span class="input">서머셋팰리스서울</span></li>
- <li><span class="label">상품명 </span><span class="input">[초특가] 1 Bed room (내국인/룸온리)</span></li>
- <li><span class="label">체크인 </span><span class="input">2011/06/10</span></li>
- <li><span class="label">체크아웃 </span><span class="input">2011/06/11</span></li>
- <li><span class="label">결제금액 </span><span class="input">175,460원</span></li>
- <li><span class="label">예약일 </span><span class="input">2011/06/05</span></li>
- <li><span class="label">예약상황 </span><span class="input"><?if($pay_status){echo "결제완료";}else{echo "결제실패";}?></span></li>
- <li><span class="label">예약자명 </span><span class="input">조연우</span></li>
- <li><span class="label">결제방법 </span><span class="input">무통장입금(국민은행 1234567 입금)</span></li>
- <li><span class="label">요청사항 </span><span class="input">가급적 높은 층에 야경이 좋은 방으로..</span></li>
- </ul>
- <div class="container" style="font-size: 13px;"><span style="color: red;">*</span>요청사항은 호텔이 고객님의 의견을 반영할 뿐 확정은 아닙니다.</div>
- <div class="container" style="width: 100%;">
- <input type="submit" class="blueButton" value="바우처확인" style="margin-right: 1%; width: 49%;" />
- <a href="cancel.php"><input type="submit" class="grayButton" value="예약취소" /></a>
- </div>
- </div>
- </div>
- <?php// include_once('footer.php'); ?>
- </body>
- </html>