PageRenderTime 105ms CodeModel.GetById 49ms RepoModel.GetById 11ms app.codeStats 0ms

/lib/done.php

https://github.com/HackITtoday/ota
PHP | 1329 lines | 1238 code | 51 blank | 40 comment | 43 complexity | 8c53590c0b3259b1b417572c587a50d2 MD5 | raw file
  1. <?php
  2. //
  3. // booking prosses done
  4. //
  5. include('../inc/top.php');
  6. include('../inc/header.php');
  7. $countryArray = array(
  8. 'AD' => array(
  9. 'country_name' => 'ANDORRA',
  10. 'dial_code' => '376'
  11. ),
  12. 'AE' => array(
  13. 'country_name' => 'UNITED ARAB EMIRATES',
  14. 'dial_code' => '971'
  15. ),
  16. 'AF' => array(
  17. 'country_name' => 'AFGHANISTAN',
  18. 'dial_code' => '93'
  19. ),
  20. 'AG' => array(
  21. 'country_name' => 'ANTIGUA AND BARBUDA',
  22. 'dial_code' => '1268'
  23. ),
  24. 'AI' => array(
  25. 'country_name' => 'ANGUILLA',
  26. 'dial_code' => '1264'
  27. ),
  28. 'AL' => array(
  29. 'country_name' => 'ALBANIA',
  30. 'dial_code' => '355'
  31. ),
  32. 'AM' => array(
  33. 'country_name' => 'ARMENIA',
  34. 'dial_code' => '374'
  35. ),
  36. 'AN' => array(
  37. 'country_name' => 'NETHERLANDS ANTILLES',
  38. 'dial_code' => '599'
  39. ),
  40. 'AO' => array(
  41. 'country_name' => 'ANGOLA',
  42. 'dial_code' => '244'
  43. ),
  44. 'AQ' => array(
  45. 'country_name' => 'ANTARCTICA',
  46. 'dial_code' => '672'
  47. ),
  48. 'AR' => array(
  49. 'country_name' => 'ARGENTINA',
  50. 'dial_code' => '54'
  51. ),
  52. 'AS' => array(
  53. 'country_name' => 'AMERICAN SAMOA',
  54. 'dial_code' => '1684'
  55. ),
  56. 'AT' => array(
  57. 'country_name' => 'AUSTRIA',
  58. 'dial_code' => '43'
  59. ),
  60. 'AU' => array(
  61. 'country_name' => 'AUSTRALIA',
  62. 'dial_code' => '61'
  63. ),
  64. 'AW' => array(
  65. 'country_name' => 'ARUBA',
  66. 'dial_code' => '297'
  67. ),
  68. 'AZ' => array(
  69. 'country_name' => 'AZERBAIJAN',
  70. 'dial_code' => '994'
  71. ),
  72. 'BA' => array(
  73. 'country_name' => 'BOSNIA AND HERZEGOVINA',
  74. 'dial_code' => '387'
  75. ),
  76. 'BB' => array(
  77. 'country_name' => 'BARBADOS',
  78. 'dial_code' => '1246'
  79. ),
  80. 'BD' => array(
  81. 'country_name' => 'BANGLADESH',
  82. 'dial_code' => '880'
  83. ),
  84. 'BE' => array(
  85. 'country_name' => 'BELGIUM',
  86. 'dial_code' => '32'
  87. ),
  88. 'BF' => array(
  89. 'country_name' => 'BURKINA FASO',
  90. 'dial_code' => '226'
  91. ),
  92. 'BG' => array(
  93. 'country_name' => 'BULGARIA',
  94. 'dial_code' => '359'
  95. ),
  96. 'BH' => array(
  97. 'country_name' => 'BAHRAIN',
  98. 'dial_code' => '973'
  99. ),
  100. 'BI' => array(
  101. 'country_name' => 'BURUNDI',
  102. 'dial_code' => '257'
  103. ),
  104. 'BJ' => array(
  105. 'country_name' => 'BENIN',
  106. 'dial_code' => '229'
  107. ),
  108. 'BL' => array(
  109. 'country_name' => 'SAINT BARTHELEMY',
  110. 'dial_code' => '590'
  111. ),
  112. 'BM' => array(
  113. 'country_name' => 'BERMUDA',
  114. 'dial_code' => '1441'
  115. ),
  116. 'BN' => array(
  117. 'country_name' => 'BRUNEI DARUSSALAM',
  118. 'dial_code' => '673'
  119. ),
  120. 'BO' => array(
  121. 'country_name' => 'BOLIVIA',
  122. 'dial_code' => '591'
  123. ),
  124. 'BR' => array(
  125. 'country_name' => 'BRAZIL',
  126. 'dial_code' => '55'
  127. ),
  128. 'BS' => array(
  129. 'country_name' => 'BAHAMAS',
  130. 'dial_code' => '1242'
  131. ),
  132. 'BT' => array(
  133. 'country_name' => 'BHUTAN',
  134. 'dial_code' => '975'
  135. ),
  136. 'BW' => array(
  137. 'country_name' => 'BOTSWANA',
  138. 'dial_code' => '267'
  139. ),
  140. 'BY' => array(
  141. 'country_name' => 'BELARUS',
  142. 'dial_code' => '375'
  143. ),
  144. 'BZ' => array(
  145. 'country_name' => 'BELIZE',
  146. 'dial_code' => '501'
  147. ),
  148. 'CA' => array(
  149. 'country_name' => 'CANADA',
  150. 'dial_code' => '1'
  151. ),
  152. 'CC' => array(
  153. 'country_name' => 'COCOS (KEELING) ISLANDS',
  154. 'dial_code' => '61'
  155. ),
  156. 'CD' => array(
  157. 'country_name' => 'CONGO, THE DEMOCRATIC REPUBLIC OF THE',
  158. 'dial_code' => '243'
  159. ),
  160. 'CF' => array(
  161. 'country_name' => 'CENTRAL AFRICAN REPUBLIC',
  162. 'dial_code' => '236'
  163. ),
  164. 'CG' => array(
  165. 'country_name' => 'CONGO',
  166. 'dial_code' => '242'
  167. ),
  168. 'CH' => array(
  169. 'country_name' => 'SWITZERLAND',
  170. 'dial_code' => '41'
  171. ),
  172. 'CI' => array(
  173. 'country_name' => 'COTE D IVOIRE',
  174. 'dial_code' => '225'
  175. ),
  176. 'CK' => array(
  177. 'country_name' => 'COOK ISLANDS',
  178. 'dial_code' => '682'
  179. ),
  180. 'CL' => array(
  181. 'country_name' => 'CHILE',
  182. 'dial_code' => '56'
  183. ),
  184. 'CM' => array(
  185. 'country_name' => 'CAMEROON',
  186. 'dial_code' => '237'
  187. ),
  188. 'CN' => array(
  189. 'country_name' => 'CHINA',
  190. 'dial_code' => '86'
  191. ),
  192. 'CO' => array(
  193. 'country_name' => 'COLOMBIA',
  194. 'dial_code' => '57'
  195. ),
  196. 'CR' => array(
  197. 'country_name' => 'COSTA RICA',
  198. 'dial_code' => '506'
  199. ),
  200. 'CU' => array(
  201. 'country_name' => 'CUBA',
  202. 'dial_code' => '53'
  203. ),
  204. 'CV' => array(
  205. 'country_name' => 'CAPE VERDE',
  206. 'dial_code' => '238'
  207. ),
  208. 'CX' => array(
  209. 'country_name' => 'CHRISTMAS ISLAND',
  210. 'dial_code' => '61'
  211. ),
  212. 'CY' => array(
  213. 'country_name' => 'CYPRUS',
  214. 'dial_code' => '357'
  215. ),
  216. 'CZ' => array(
  217. 'country_name' => 'CZECH REPUBLIC',
  218. 'dial_code' => '420'
  219. ),
  220. 'DE' => array(
  221. 'country_name' => 'GERMANY',
  222. 'dial_code' => '49'
  223. ),
  224. 'DJ' => array(
  225. 'country_name' => 'DJIBOUTI',
  226. 'dial_code' => '253'
  227. ),
  228. 'DK' => array(
  229. 'country_name' => 'DENMARK',
  230. 'dial_code' => '45'
  231. ),
  232. 'DM' => array(
  233. 'country_name' => 'DOMINICA',
  234. 'dial_code' => '1767'
  235. ),
  236. 'DO' => array(
  237. 'country_name' => 'DOMINICAN REPUBLIC',
  238. 'dial_code' => '1809'
  239. ),
  240. 'DZ' => array(
  241. 'country_name' => 'ALGERIA',
  242. 'dial_code' => '213'
  243. ),
  244. 'EC' => array(
  245. 'country_name' => 'ECUADOR',
  246. 'dial_code' => '593'
  247. ),
  248. 'EE' => array(
  249. 'country_name' => 'ESTONIA',
  250. 'dial_code' => '372'
  251. ),
  252. 'EG' => array(
  253. 'country_name' => 'EGYPT',
  254. 'dial_code' => '20'
  255. ),
  256. 'ER' => array(
  257. 'country_name' => 'ERITREA',
  258. 'dial_code' => '291'
  259. ),
  260. 'ES' => array(
  261. 'country_name' => 'SPAIN',
  262. 'dial_code' => '34'
  263. ),
  264. 'ET' => array(
  265. 'country_name' => 'ETHIOPIA',
  266. 'dial_code' => '251'
  267. ),
  268. 'FI' => array(
  269. 'country_name' => 'FINLAND',
  270. 'dial_code' => '358'
  271. ),
  272. 'FJ' => array(
  273. 'country_name' => 'FIJI',
  274. 'dial_code' => '679'
  275. ),
  276. 'FK' => array(
  277. 'country_name' => 'FALKLAND ISLANDS (MALVINAS)',
  278. 'dial_code' => '500'
  279. ),
  280. 'FM' => array(
  281. 'country_name' => 'MICRONESIA, FEDERATED STATES OF',
  282. 'dial_code' => '691'
  283. ),
  284. 'FO' => array(
  285. 'country_name' => 'FAROE ISLANDS',
  286. 'dial_code' => '298'
  287. ),
  288. 'FR' => array(
  289. 'country_name' => 'FRANCE',
  290. 'dial_code' => '33'
  291. ),
  292. 'GA' => array(
  293. 'country_name' => 'GABON',
  294. 'dial_code' => '241'
  295. ),
  296. 'GB' => array(
  297. 'country_name' => 'UNITED KINGDOM',
  298. 'dial_code' => '44'
  299. ),
  300. 'GD' => array(
  301. 'country_name' => 'GRENADA',
  302. 'dial_code' => '1473'
  303. ),
  304. 'GE' => array(
  305. 'country_name' => 'GEORGIA',
  306. 'dial_code' => '995'
  307. ),
  308. 'GH' => array(
  309. 'country_name' => 'GHANA',
  310. 'dial_code' => '233'
  311. ),
  312. 'GI' => array(
  313. 'country_name' => 'GIBRALTAR',
  314. 'dial_code' => '350'
  315. ),
  316. 'GL' => array(
  317. 'country_name' => 'GREENLAND',
  318. 'dial_code' => '299'
  319. ),
  320. 'GM' => array(
  321. 'country_name' => 'GAMBIA',
  322. 'dial_code' => '220'
  323. ),
  324. 'GN' => array(
  325. 'country_name' => 'GUINEA',
  326. 'dial_code' => '224'
  327. ),
  328. 'GQ' => array(
  329. 'country_name' => 'EQUATORIAL GUINEA',
  330. 'dial_code' => '240'
  331. ),
  332. 'GR' => array(
  333. 'country_name' => 'GREECE',
  334. 'dial_code' => '30'
  335. ),
  336. 'GT' => array(
  337. 'country_name' => 'GUATEMALA',
  338. 'dial_code' => '502'
  339. ),
  340. 'GU' => array(
  341. 'country_name' => 'GUAM',
  342. 'dial_code' => '1671'
  343. ),
  344. 'GW' => array(
  345. 'country_name' => 'GUINEA-BISSAU',
  346. 'dial_code' => '245'
  347. ),
  348. 'GY' => array(
  349. 'country_name' => 'GUYANA',
  350. 'dial_code' => '592'
  351. ),
  352. 'HK' => array(
  353. 'country_name' => 'HONG KONG',
  354. 'dial_code' => '852'
  355. ),
  356. 'HN' => array(
  357. 'country_name' => 'HONDURAS',
  358. 'dial_code' => '504'
  359. ),
  360. 'HR' => array(
  361. 'country_name' => 'CROATIA',
  362. 'dial_code' => '385'
  363. ),
  364. 'HT' => array(
  365. 'country_name' => 'HAITI',
  366. 'dial_code' => '509'
  367. ),
  368. 'HU' => array(
  369. 'country_name' => 'HUNGARY',
  370. 'dial_code' => '36'
  371. ),
  372. 'ID' => array(
  373. 'country_name' => 'INDONESIA',
  374. 'dial_code' => '62'
  375. ),
  376. 'IE' => array(
  377. 'country_name' => 'IRELAND',
  378. 'dial_code' => '353'
  379. ),
  380. 'IL' => array(
  381. 'country_name' => 'ISRAEL',
  382. 'dial_code' => '972'
  383. ),
  384. 'IM' => array(
  385. 'country_name' => 'ISLE OF MAN',
  386. 'dial_code' => '44'
  387. ),
  388. 'IN' => array(
  389. 'country_name' => 'INDIA',
  390. 'dial_code' => '91'
  391. ),
  392. 'IQ' => array(
  393. 'country_name' => 'IRAQ',
  394. 'dial_code' => '964'
  395. ),
  396. 'IR' => array(
  397. 'country_name' => 'IRAN, ISLAMIC REPUBLIC OF',
  398. 'dial_code' => '98'
  399. ),
  400. 'IS' => array(
  401. 'country_name' => 'ICELAND',
  402. 'dial_code' => '354'
  403. ),
  404. 'IT' => array(
  405. 'country_name' => 'ITALY',
  406. 'dial_code' => '39'
  407. ),
  408. 'JM' => array(
  409. 'country_name' => 'JAMAICA',
  410. 'dial_code' => '1876'
  411. ),
  412. 'JO' => array(
  413. 'country_name' => 'JORDAN',
  414. 'dial_code' => '962'
  415. ),
  416. 'JP' => array(
  417. 'country_name' => 'JAPAN',
  418. 'dial_code' => '81'
  419. ),
  420. 'KE' => array(
  421. 'country_name' => 'KENYA',
  422. 'dial_code' => '254'
  423. ),
  424. 'KG' => array(
  425. 'country_name' => 'KYRGYZSTAN',
  426. 'dial_code' => '996'
  427. ),
  428. 'KH' => array(
  429. 'country_name' => 'CAMBODIA',
  430. 'dial_code' => '855'
  431. ),
  432. 'KI' => array(
  433. 'country_name' => 'KIRIBATI',
  434. 'dial_code' => '686'
  435. ),
  436. 'KM' => array(
  437. 'country_name' => 'COMOROS',
  438. 'dial_code' => '269'
  439. ),
  440. 'KN' => array(
  441. 'country_name' => 'SAINT KITTS AND NEVIS',
  442. 'dial_code' => '1869'
  443. ),
  444. 'KP' => array(
  445. 'country_name' => 'KOREA DEMOCRATIC PEOPLES REPUBLIC OF',
  446. 'dial_code' => '850'
  447. ),
  448. 'KR' => array(
  449. 'country_name' => 'KOREA REPUBLIC OF',
  450. 'dial_code' => '82'
  451. ),
  452. 'KW' => array(
  453. 'country_name' => 'KUWAIT',
  454. 'dial_code' => '965'
  455. ),
  456. 'KY' => array(
  457. 'country_name' => 'CAYMAN ISLANDS',
  458. 'dial_code' => '1345'
  459. ),
  460. 'KZ' => array(
  461. 'country_name' => 'KAZAKSTAN',
  462. 'dial_code' => '7'
  463. ),
  464. 'LA' => array(
  465. 'country_name' => 'LAO PEOPLES DEMOCRATIC REPUBLIC',
  466. 'dial_code' => '856'
  467. ),
  468. 'LB' => array(
  469. 'country_name' => 'LEBANON',
  470. 'dial_code' => '961'
  471. ),
  472. 'LC' => array(
  473. 'country_name' => 'SAINT LUCIA',
  474. 'dial_code' => '1758'
  475. ),
  476. 'LI' => array(
  477. 'country_name' => 'LIECHTENSTEIN',
  478. 'dial_code' => '423'
  479. ),
  480. 'LK' => array(
  481. 'country_name' => 'SRI LANKA',
  482. 'dial_code' => '94'
  483. ),
  484. 'LR' => array(
  485. 'country_name' => 'LIBERIA',
  486. 'dial_code' => '231'
  487. ),
  488. 'LS' => array(
  489. 'country_name' => 'LESOTHO',
  490. 'dial_code' => '266'
  491. ),
  492. 'LT' => array(
  493. 'country_name' => 'LITHUANIA',
  494. 'dial_code' => '370'
  495. ),
  496. 'LU' => array(
  497. 'country_name' => 'LUXEMBOURG',
  498. 'dial_code' => '352'
  499. ),
  500. 'LV' => array(
  501. 'country_name' => 'LATVIA',
  502. 'dial_code' => '371'
  503. ),
  504. 'LY' => array(
  505. 'country_name' => 'LIBYAN ARAB JAMAHIRIYA',
  506. 'dial_code' => '218'
  507. ),
  508. 'MA' => array(
  509. 'country_name' => 'MOROCCO',
  510. 'dial_code' => '212'
  511. ),
  512. 'MC' => array(
  513. 'country_name' => 'MONACO',
  514. 'dial_code' => '377'
  515. ),
  516. 'MD' => array(
  517. 'country_name' => 'MOLDOVA, REPUBLIC OF',
  518. 'dial_code' => '373'
  519. ),
  520. 'ME' => array(
  521. 'country_name' => 'MONTENEGRO',
  522. 'dial_code' => '382'
  523. ),
  524. 'MF' => array(
  525. 'country_name' => 'SAINT MARTIN',
  526. 'dial_code' => '1599'
  527. ),
  528. 'MG' => array(
  529. 'country_name' => 'MADAGASCAR',
  530. 'dial_code' => '261'
  531. ),
  532. 'MH' => array(
  533. 'country_name' => 'MARSHALL ISLANDS',
  534. 'dial_code' => '692'
  535. ),
  536. 'MK' => array(
  537. 'country_name' => 'MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF',
  538. 'dial_code' => '389'
  539. ),
  540. 'ML' => array(
  541. 'country_name' => 'MALI',
  542. 'dial_code' => '223'
  543. ),
  544. 'MM' => array(
  545. 'country_name' => 'MYANMAR',
  546. 'dial_code' => '95'
  547. ),
  548. 'MN' => array(
  549. 'country_name' => 'MONGOLIA',
  550. 'dial_code' => '976'
  551. ),
  552. 'MO' => array(
  553. 'country_name' => 'MACAU',
  554. 'dial_code' => '853'
  555. ),
  556. 'MP' => array(
  557. 'country_name' => 'NORTHERN MARIANA ISLANDS',
  558. 'dial_code' => '1670'
  559. ),
  560. 'MR' => array(
  561. 'country_name' => 'MAURITANIA',
  562. 'dial_code' => '222'
  563. ),
  564. 'MS' => array(
  565. 'country_name' => 'MONTSERRAT',
  566. 'dial_code' => '1664'
  567. ),
  568. 'MT' => array(
  569. 'country_name' => 'MALTA',
  570. 'dial_code' => '356'
  571. ),
  572. 'MU' => array(
  573. 'country_name' => 'MAURITIUS',
  574. 'dial_code' => '230'
  575. ),
  576. 'MV' => array(
  577. 'country_name' => 'MALDIVES',
  578. 'dial_code' => '960'
  579. ),
  580. 'MW' => array(
  581. 'country_name' => 'MALAWI',
  582. 'dial_code' => '265'
  583. ),
  584. 'MX' => array(
  585. 'country_name' => 'MEXICO',
  586. 'dial_code' => '52'
  587. ),
  588. 'MY' => array(
  589. 'country_name' => 'MALAYSIA',
  590. 'dial_code' => '60'
  591. ),
  592. 'MZ' => array(
  593. 'country_name' => 'MOZAMBIQUE',
  594. 'dial_code' => '258'
  595. ),
  596. 'NA' => array(
  597. 'country_name' => 'NAMIBIA',
  598. 'dial_code' => '264'
  599. ),
  600. 'NC' => array(
  601. 'country_name' => 'NEW CALEDONIA',
  602. 'dial_code' => '687'
  603. ),
  604. 'NE' => array(
  605. 'country_name' => 'NIGER',
  606. 'dial_code' => '227'
  607. ),
  608. 'NG' => array(
  609. 'country_name' => 'NIGERIA',
  610. 'dial_code' => '234'
  611. ),
  612. 'NI' => array(
  613. 'country_name' => 'NICARAGUA',
  614. 'dial_code' => '505'
  615. ),
  616. 'NL' => array(
  617. 'country_name' => 'NETHERLANDS',
  618. 'dial_code' => '31'
  619. ),
  620. 'NO' => array(
  621. 'country_name' => 'NORWAY',
  622. 'dial_code' => '47'
  623. ),
  624. 'NP' => array(
  625. 'country_name' => 'NEPAL',
  626. 'dial_code' => '977'
  627. ),
  628. 'NR' => array(
  629. 'country_name' => 'NAURU',
  630. 'dial_code' => '674'
  631. ),
  632. 'NU' => array(
  633. 'country_name' => 'NIUE',
  634. 'dial_code' => '683'
  635. ),
  636. 'NZ' => array(
  637. 'country_name' => 'NEW ZEALAND',
  638. 'dial_code' => '64'
  639. ),
  640. 'OM' => array(
  641. 'country_name' => 'OMAN',
  642. 'dial_code' => '968'
  643. ),
  644. 'PA' => array(
  645. 'country_name' => 'PANAMA',
  646. 'dial_code' => '507'
  647. ),
  648. 'PE' => array(
  649. 'country_name' => 'PERU',
  650. 'dial_code' => '51'
  651. ),
  652. 'PF' => array(
  653. 'country_name' => 'FRENCH POLYNESIA',
  654. 'dial_code' => '689'
  655. ),
  656. 'PG' => array(
  657. 'country_name' => 'PAPUA NEW GUINEA',
  658. 'dial_code' => '675'
  659. ),
  660. 'PH' => array(
  661. 'country_name' => 'PHILIPPINES',
  662. 'dial_code' => '63'
  663. ),
  664. 'PK' => array(
  665. 'country_name' => 'PAKISTAN',
  666. 'dial_code' => '92'
  667. ),
  668. 'PL' => array(
  669. 'country_name' => 'POLAND',
  670. 'dial_code' => '48'
  671. ),
  672. 'PM' => array(
  673. 'country_name' => 'SAINT PIERRE AND MIQUELON',
  674. 'dial_code' => '508'
  675. ),
  676. 'PN' => array(
  677. 'country_name' => 'PITCAIRN',
  678. 'dial_code' => '870'
  679. ),
  680. 'PR' => array(
  681. 'country_name' => 'PUERTO RICO',
  682. 'dial_code' => '1'
  683. ),
  684. 'PT' => array(
  685. 'country_name' => 'PORTUGAL',
  686. 'dial_code' => '351'
  687. ),
  688. 'PW' => array(
  689. 'country_name' => 'PALAU',
  690. 'dial_code' => '680'
  691. ),
  692. 'PY' => array(
  693. 'country_name' => 'PARAGUAY',
  694. 'dial_code' => '595'
  695. ),
  696. 'QA' => array(
  697. 'country_name' => 'QATAR',
  698. 'dial_code' => '974'
  699. ),
  700. 'RO' => array(
  701. 'country_name' => 'ROMANIA',
  702. 'dial_code' => '40'
  703. ),
  704. 'RS' => array(
  705. 'country_name' => 'SERBIA',
  706. 'dial_code' => '381'
  707. ),
  708. 'RU' => array(
  709. 'country_name' => 'RUSSIAN FEDERATION',
  710. 'dial_code' => '7'
  711. ),
  712. 'RW' => array(
  713. 'country_name' => 'RWANDA',
  714. 'dial_code' => '250'
  715. ),
  716. 'SA' => array(
  717. 'country_name' => 'SAUDI ARABIA',
  718. 'dial_code' => '966'
  719. ),
  720. 'SB' => array(
  721. 'country_name' => 'SOLOMON ISLANDS',
  722. 'dial_code' => '677'
  723. ),
  724. 'SC' => array(
  725. 'country_name' => 'SEYCHELLES',
  726. 'dial_code' => '248'
  727. ),
  728. 'SD' => array(
  729. 'country_name' => 'SUDAN',
  730. 'dial_code' => '249'
  731. ),
  732. 'SE' => array(
  733. 'country_name' => 'SWEDEN',
  734. 'dial_code' => '46'
  735. ),
  736. 'SG' => array(
  737. 'country_name' => 'SINGAPORE',
  738. 'dial_code' => '65'
  739. ),
  740. 'SH' => array(
  741. 'country_name' => 'SAINT HELENA',
  742. 'dial_code' => '290'
  743. ),
  744. 'SI' => array(
  745. 'country_name' => 'SLOVENIA',
  746. 'dial_code' => '386'
  747. ),
  748. 'SK' => array(
  749. 'country_name' => 'SLOVAKIA',
  750. 'dial_code' => '421'
  751. ),
  752. 'SL' => array(
  753. 'country_name' => 'SIERRA LEONE',
  754. 'dial_code' => '232'
  755. ),
  756. 'SM' => array(
  757. 'country_name' => 'SAN MARINO',
  758. 'dial_code' => '378'
  759. ),
  760. 'SN' => array(
  761. 'country_name' => 'SENEGAL',
  762. 'dial_code' => '221'
  763. ),
  764. 'SO' => array(
  765. 'country_name' => 'SOMALIA',
  766. 'dial_code' => '252'
  767. ),
  768. 'SR' => array(
  769. 'country_name' => 'SURINAME',
  770. 'dial_code' => '597'
  771. ),
  772. 'ST' => array(
  773. 'country_name' => 'SAO TOME AND PRINCIPE',
  774. 'dial_code' => '239'
  775. ),
  776. 'SV' => array(
  777. 'country_name' => 'EL SALVADOR',
  778. 'dial_code' => '503'
  779. ),
  780. 'SY' => array(
  781. 'country_name' => 'SYRIAN ARAB REPUBLIC',
  782. 'dial_code' => '963'
  783. ),
  784. 'SZ' => array(
  785. 'country_name' => 'SWAZILAND',
  786. 'dial_code' => '268'
  787. ),
  788. 'TC' => array(
  789. 'country_name' => 'TURKS AND CAICOS ISLANDS',
  790. 'dial_code' => '1649'
  791. ),
  792. 'TD' => array(
  793. 'country_name' => 'CHAD',
  794. 'dial_code' => '235'
  795. ),
  796. 'TG' => array(
  797. 'country_name' => 'TOGO',
  798. 'dial_code' => '228'
  799. ),
  800. 'TH' => array(
  801. 'country_name' => 'THAILAND',
  802. 'dial_code' => '66'
  803. ),
  804. 'TJ' => array(
  805. 'country_name' => 'TAJIKISTAN',
  806. 'dial_code' => '992'
  807. ),
  808. 'TK' => array(
  809. 'country_name' => 'TOKELAU',
  810. 'dial_code' => '690'
  811. ),
  812. 'TL' => array(
  813. 'country_name' => 'TIMOR-LESTE',
  814. 'dial_code' => '670'
  815. ),
  816. 'TM' => array(
  817. 'country_name' => 'TURKMENISTAN',
  818. 'dial_code' => '993'
  819. ),
  820. 'TN' => array(
  821. 'country_name' => 'TUNISIA',
  822. 'dial_code' => '216'
  823. ),
  824. 'TO' => array(
  825. 'country_name' => 'TONGA',
  826. 'dial_code' => '676'
  827. ),
  828. 'TR' => array(
  829. 'country_name' => 'TURKEY',
  830. 'dial_code' => '90'
  831. ),
  832. 'TT' => array(
  833. 'country_name' => 'TRINIDAD AND TOBAGO',
  834. 'dial_code' => '1868'
  835. ),
  836. 'TV' => array(
  837. 'country_name' => 'TUVALU',
  838. 'dial_code' => '688'
  839. ),
  840. 'TW' => array(
  841. 'country_name' => 'TAIWAN, PROVINCE OF CHINA',
  842. 'dial_code' => '886'
  843. ),
  844. 'TZ' => array(
  845. 'country_name' => 'TANZANIA, UNITED REPUBLIC OF',
  846. 'dial_code' => '255'
  847. ),
  848. 'UA' => array(
  849. 'country_name' => 'UKRAINE',
  850. 'dial_code' => '380'
  851. ),
  852. 'UG' => array(
  853. 'country_name' => 'UGANDA',
  854. 'dial_code' => '256'
  855. ),
  856. 'US' => array(
  857. 'country_name' => 'UNITED STATES',
  858. 'dial_code' => '1'
  859. ),
  860. 'UY' => array(
  861. 'country_name' => 'URUGUAY',
  862. 'dial_code' => '598'
  863. ),
  864. 'UZ' => array(
  865. 'country_name' => 'UZBEKISTAN',
  866. 'dial_code' => '998'
  867. ),
  868. 'VA' => array(
  869. 'country_name' => 'HOLY SEE (VATICAN CITY STATE)',
  870. 'dial_code' => '39'
  871. ),
  872. 'VC' => array(
  873. 'country_name' => 'SAINT VINCENT AND THE GRENADINES',
  874. 'dial_code' => '1784'
  875. ),
  876. 'VE' => array(
  877. 'country_name' => 'VENEZUELA',
  878. 'dial_code' => '58'
  879. ),
  880. 'VG' => array(
  881. 'country_name' => 'VIRGIN ISLANDS, BRITISH',
  882. 'dial_code' => '1284'
  883. ),
  884. 'VI' => array(
  885. 'country_name' => 'VIRGIN ISLANDS, U.S.',
  886. 'dial_code' => '1340'
  887. ),
  888. 'VN' => array(
  889. 'country_name' => 'VIET NAM',
  890. 'dial_code' => '84'
  891. ),
  892. 'VU' => array(
  893. 'country_name' => 'VANUATU',
  894. 'dial_code' => '678'
  895. ),
  896. 'WF' => array(
  897. 'country_name' => 'WALLIS AND FUTUNA',
  898. 'dial_code' => '681'
  899. ),
  900. 'WS' => array(
  901. 'country_name' => 'SAMOA',
  902. 'dial_code' => '685'
  903. ),
  904. 'XK' => array(
  905. 'country_name' => 'KOSOVO',
  906. 'dial_code' => '381'
  907. ),
  908. 'YE' => array(
  909. 'country_name' => 'YEMEN',
  910. 'dial_code' => '967'
  911. ),
  912. 'YT' => array(
  913. 'country_name' => 'MAYOTTE',
  914. 'dial_code' => '262'
  915. ),
  916. 'ZA' => array(
  917. 'country_name' => 'SOUTH AFRICA',
  918. 'dial_code' => '27'
  919. ),
  920. 'ZM' => array(
  921. 'country_name' => 'ZAMBIA',
  922. 'dial_code' => '260'
  923. ),
  924. 'ZW' => array(
  925. 'country_name' => 'ZIMBABWE',
  926. 'dial_code' => '263'
  927. )
  928. );
  929. print "<div class='bar' > " . $title . " </div>";
  930. ?>
  931. <center>
  932. <?php
  933. //connection, auth
  934. include './auth.php';
  935. //variables
  936. // $dateFrom = $_POST['date'];
  937. // $dateTo = date('Y-m-d', strtotime($_POST['date'] . ' + ' . $_POST['hdur'] .' days'));
  938. if (isset($_POST['AvailBookingToken']) && (string) $ota == "1") {
  939. $dateFrom = date('Y-m-d', strtotime($_POST['date-in']));
  940. $dateTo = date('Y-m-d', strtotime($_POST['date-out']));
  941. if (((int) $_POST['hdura']) < ((int) $_POST['hdurr']) ) $_POST['hdura'] = $_POST['hdurr'] ; // if big people < rooms then big people = rooms
  942. $hotelId = (int) $_POST['HotelID'];
  943. $people = ((int) $_POST['hdurc']) + ((int) $_POST['hdura']);
  944. $rooms = ((int) $_POST['hdurr']);
  945. //xml post structure
  946. $totalPrice = (float) $_POST['totalPrice'];
  947. $roomID = $_POST['roomID'];
  948. $ratePlanID = $_POST['ratePlanID'];
  949. $quantity = $_POST['quantity'];
  950. $totalPrice = $_POST['totalPrice'];
  951. $firstname = $_POST['firstname'];
  952. $surname = $_POST['surname'];
  953. $email = $_POST['email'];
  954. $cityName = $_POST['cityName'];
  955. $countryName = $_POST['countryName'];
  956. $ccType = $_POST['cctype'];
  957. $ccNumber = preg_replace('/\D/', '', $_POST['ccnumber']);
  958. $ccVerify = $_POST['cvc'];
  959. $ccHolderFirstName = $_POST['ccHolderFirstName'];
  960. $ccHolderLastName = $_POST['ccHolderLastName'];
  961. $ccExpMonth = $_POST['ccexp_month'];
  962. $ccExpYear = $_POST['ccexp_year'];
  963. $AvailBookingToken = $_POST['AvailBookingToken'];
  964. $number = preg_replace( '/(0|\+?\d{2})(\d{7,8})/', '$2', $_POST['phone']);
  965. $internationalPrefix = '00' . $countryArray[ strtoupper($_POST['countryName'])]['dial_code'] ;
  966. $zipCode = $_POST['zipCode'];
  967. // $_POST['pay_at'] == "Pay Now" ? $sellingMethod = "ME" : $sellingMethod = "DA" ;
  968. $_POST['sellingMethod'] == "ME" ? $sellingMethod = "ME" : $sellingMethod = "DA" ;
  969. include './template.php';
  970. // print_r( $template[1] );
  971. $xml_post_string = str_replace(Array(" "," "," "," "," "," "," ","\t","\n")," ",$template[1]); // remove whitespace from XML
  972. $xml_post_string = str_replace(Array(" "," "," ")," ",$xml_post_string ); // remove remaning whitespace from XML
  973. $xml_headers = array(
  974. "Content-type: text/xml;charset=\"utf-8\"",
  975. "Accept: text/xml",
  976. "Cache-Control: no-cache",
  977. "Pragma: no-cache",
  978. "SOAPAction: ". $soapUrlBooking ,
  979. "Content-length: ".strlen($xml_post_string),
  980. );
  981. $url = $soapUrlBooking ;
  982. // PHP cURL for https connection with auth
  983. $ch = curl_init();
  984. curl_setopt($ch, CURLOPT_URL, $url);
  985. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  986. curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); // the SOAP request
  987. //curl_setopt($ch, CURLOPT_HTTPHEADER, $xml_headers);
  988. curl_setopt($ch, CURLOPT_HEADER,true);
  989. // converting
  990. $response = curl_exec($ch);
  991. print "<!-- response from venere " . print_r($response,1) ." -->";
  992. curl_close($ch);
  993. // converting
  994. $response1 = str_replace("<soap:Body>","",$response);
  995. $response2 = str_replace("</soap:Body>","",$response1);
  996. $response_array = explode("<soap:Envelope",$response2 );
  997. $xml = simplexml_load_string("<soap:Envelope". $response_array[1]);
  998. // $xml = simplexml_load_string($response2);
  999. $array = json_decode(json_encode((array) $xml), 1);
  1000. print "<!-- xml from venere " . print_r($xml,1) ." -->";
  1001. //
  1002. // on page :
  1003. //
  1004. if ($array['XHI_HotelResRS']['@attributes']['reservationID']) {
  1005. print 'All done Thank You for Booking with Essential Hotels. Your Reservation ID is ' . $array['XHI_HotelResRS']['@attributes']['reservationID'];
  1006. $subject = 'Your stay at the '. $_POST['hotel'] .' details.';
  1007. $headers = "From: " . $email_booking_to . "\r\n";
  1008. $headers .= "Reply-To: ". $email_booking_to . "\r\n";
  1009. $headers .= "MIME-Version: 1.0\r\n";
  1010. $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
  1011. $message .= '<center><h3>I am pleased to confirm your reservation<br /></h3></center>';
  1012. $message .= '<center><h3>'. strip_tags($_POST['status']).'<br /></h3></center>';
  1013. $message .= '<center><h3>Please Check the details below and let us know if anything is incorrect<br /></h3></center>';
  1014. $message .= '<table rules="all" style="border-color:#666 ; max-width: 721px;" cellpadding="10">';
  1015. $message .= "<tr><td><strong>Name of Hotel</strong> </td><td>" . strip_tags($_POST['hotel']) . "</td></tr>";
  1016. $message .= "<tr><td><strong>Booking made under the Name</strong> </td><td>" . $array['XHI_HotelResRS']['BookingGuestDetails']['@attributes']['name'] . ' ' . $array['XHI_HotelResRS']['BookingGuestDetails']['@attributes']['surname'] . "</td></tr>";
  1017. $message .= "<tr><td><strong>Staying</strong> </td><td>" . $_POST['date-in'] . ' to the ' . $_POST['date-out'] . "</td></tr>";
  1018. $message .= "<tr><td><strong>Name of Hotel</strong> </td><td>" . strip_tags($_POST['hotel']) . "</td></tr>";
  1019. $message .= "<tr><td><strong>Booking ID</strong> </td><td>" . $array['XHI_HotelResRS']['@attributes']['reservationID'] . "</td></tr>";
  1020. $message .= "<tr><td><strong>Cost</strong> </td><td> £ " . number_format($array['XHI_HotelResRS']['BookingReservationDetails']['@attributes']['totalPrice'] , 2) . "</td></tr>";
  1021. $message .= "<tr><td><strong>Essential Rewards</strong></td><td>As a Rewards member there’s still time to be rewarded for your upcoming stay.
  1022. Please reply to this email with your membership details. If youre not already a Member, enrol today to begin earning High Street shopping vouchers.</td></tr>";
  1023. $message .= "<tr><td><strong>Payment Method</strong></td><td>Upon departure. The credit/debit card details that you have supplied have guaranteed your reservation; no payment has been deducted from this card.</td></tr>";
  1024. $message .= "<tr><td><strong>Cancellation Policy</strong></td><td>" . $array['XHI_HotelResRS']['CancellationPolicy']['Clause']. "</td></tr>";
  1025. $message .= "</table>";
  1026. $message .= '<center><h3>Thank you for booking with essentialhotels; we hope you have an enjoyable stay and would be delighted to <br />
  1027. assist with any future bookings (UK or worldwide). <br />
  1028. Kind regards <br />
  1029. Marjorie Burrington | Director of Operations<br />
  1030. Essential Hotels<br />
  1031. Willowmead House, Mill Lane, Padworth RG7 4JX<br /></h3></center>';
  1032. print $message;
  1033. $message = '<html><head><meta charset="UTF-8"></head><body>' . $message . "</body></html>";
  1034. mail($_POST['email'], $subject, $message, $headers);
  1035. } else {
  1036. print 'We cannot confirm this booking at the moment. Please contact us directly by phone or by email:<a href="tel:01189714700">0118 971 4700</a> or by <a href="nick@essential-hotels.com" >Email</a> or Online';
  1037. $subject = 'Your stay at the '. $_POST['hotel'] .' details.';
  1038. $headers = "From: " . $email_booking_to . "\r\n";
  1039. $headers .= "Reply-To: ". $email_booking_to . "\r\n";
  1040. $headers .= "MIME-Version: 1.0\r\n";
  1041. $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
  1042. $headers .= 'Bcc: nick@essential-hotels.com' . "\r\n";
  1043. $message .= '<center><h3>Contact Us Direct by Phone: <a href="tel:01189714700" >0118 971 4700</a> <br /> or replay to this email</h3></center>';
  1044. $message .= '<table rules="all" style="border-color:#666 ; max-width: 721px;" cellpadding="10">';
  1045. $message .= "<tr><td><strong>Name of Hotel</strong> </td><td>" . strip_tags($_POST['hotel']) . "</td></tr>";
  1046. $message .= "<tr><td><strong>Cost</strong> </td><td>" . $array['XHI_HotelResRS']['BookingReservationDetails']['@attributes']['totalPrice'] . "</td></tr>";
  1047. $message .= "<tr><td><strong>Essential Rewards</strong></td><td>As a Rewards member there’s still time to be rewarded for your upcoming stay.
  1048. Please reply to this email with your membership details. If youre not already a Member, enrol today to begin earning High Street shopping vouchers.</td></tr>";
  1049. $message .= "<tr><td><strong>Payment Method</strong></td><td>Upon departure. The credit/debit card details that you have supplied have guaranteed your reservation; no payment has been deducted from this card.</td></tr>";
  1050. $message .= "</table>";
  1051. $message .= '<center><h3>Thank you for booking with essentialhotels; we hope you have an enjoyable stay and would be delighted to </br>
  1052. assist with any future bookings (UK or worldwide). <br />
  1053. Kind regards <br />
  1054. Marjorie Burrington | Director of Operations<br />
  1055. Essential Hotels<br />
  1056. Willowmead House, Mill Lane, Padworth RG7 4JX<br /></h3></center>';
  1057. print $message;
  1058. $message = '<html><head><meta charset="UTF-8"></head><body>' . $message . "</body></html>";
  1059. if ($_POST['debug'] == "1") {
  1060. print_r($_POST);
  1061. } else {
  1062. mail($_POST['email'], $subject, $message, $headers);
  1063. }
  1064. }
  1065. } else {
  1066. //
  1067. // LateRooms :
  1068. //
  1069. $HotelID = $_POST['HotelID'];// => 575
  1070. $roomID = $_POST ['roomID'];// => 238446
  1071. $totalPrice = $_POST ['totalPrice'];// => £195.00
  1072. $quantity = $_POST ['quantity'];// => 1
  1073. $date_in = $_POST ['date-in'];// =>
  1074. $date_out = $_POST ['date-out'];// =>
  1075. $ota = $_POST ['ota'];// => 3
  1076. $pay_at = $_POST ['pay_at'];// =>
  1077. $AvailBookingToken = $_POST ['AvailBookingToken'];// => laterooms
  1078. $sellingMethod = $_POST ['sellingMethod'];// =>
  1079. $hotel = $_POST ['hotel'];// =>
  1080. $status = $_POST ['status'];// => Booking at the Mercure Stratford-Upon-Avon, Shakespeare Hotel staying 27 Feb 2015 for one night in the for a Total Amount of £195.00 for 1 guest
  1081. $debug = $_POST ['debug'];// => 1
  1082. $booking_key = $_POST ['booking_key'];// =>
  1083. $total_people = $_POST ['total_people'];// =>
  1084. $tour = $_POST ['tour'];// =>
  1085. $channel = $_POST ['channel'];// =>
  1086. $guest_title = $_POST ['guest_title'];// => Mr
  1087. $surname = $_POST ['surname'];// => hitchins
  1088. $email = $_POST ['email'];// => marcus@hhost.me
  1089. $phone = $_POST['phone'];// => 07541386427
  1090. $cityName = $_POST['cityName'];// => pz
  1091. $address1 = $_POST['address1'];// =>
  1092. $address2 = $_POST['address2'];// =>
  1093. $zipCode = $_POST['zipCode'];// => pz
  1094. $countryName = $_POST['countryName'];// =>1
  1095. $ccHolderFirstName = $_POST['ccHolderFirstName'];// => MARCUS
  1096. $ccHolderLastName = $_POST['ccHolderLastName'];// => HITCHINS
  1097. $ccNumber = $_POST['ccnumber'];// => 4111111111111111
  1098. $ccType = $_POST['cctype'];// =>
  1099. $ccExp_month = $_POST['ccexp_month'];// => 01
  1100. $ccExp_year = $_POST['ccexp_year'];// => 14
  1101. $ccExp = $_POST['ccexp'];// =>
  1102. $cvc = $_POST['cvc'];// => 123
  1103. $Initials = $_POST['Initials']; // => J
  1104. $nights = (int) $_POST['nights']; // => 1
  1105. include './template.php';
  1106. $xml_post_string = str_replace(Array(" "," "," "," "," "," "," ","\t","\n")," ",$template['lateroom_booking']); // remove whitespace from XML
  1107. $xml_post_string = str_replace(Array(" "," "," ")," ",$xml_post_string ); // remove remaning whitespace from XML
  1108. $xml_post_string = utf8_encode ( $xml_post_string); // to make sure it is utf8 encoded
  1109. print "<!-- xml_post_string " . print_r($xml_post_string,1) ." -->"; // this is printed for debugging purposes
  1110. $url = $laterooms_booking_url ; // get the url from the authorisation document
  1111. print "<!-- to url " . print_r($url,1) ." -->"; // // this is printed for debugging purposes
  1112. $xml_headers = array(
  1113. "content-type: application/soap+xml; charset=utf-8",
  1114. "Accept: text/xml",
  1115. "Content-length: ".strlen($xml_post_string),
  1116. "request-type: makeBooking",
  1117. );
  1118. // PHP cURL for https connection with auth
  1119. $ch = curl_init();
  1120. curl_setopt($ch, CURLOPT_URL, $url);
  1121. curl_setopt($ch, CURLOPT_POST, true);
  1122. curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); // the SOAP request
  1123. curl_setopt($ch, CURLOPT_HTTPHEADER, $xml_headers);
  1124. curl_setopt($ch, CURLOPT_HEADER,true);
  1125. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  1126. // converting
  1127. $response = curl_exec($ch);
  1128. curl_close($ch);
  1129. $response_array = explode("soap:Body>",$response );
  1130. $xml = simplexml_load_string(substr($response_array[1],0,-2));
  1131. $array = json_decode(json_encode((array) $xml), 1);
  1132. // Set varible for mail
  1133. if (isset($array['Booking']['Reference'])) {
  1134. $reservationID = $array['Booking']['Reference'];
  1135. $hotel = $array['Booking']['HotelName'];
  1136. $price = $_POST['totalPrice'];
  1137. $guest_name = $array['Booking']['Rooms']['Room']['MainGuest'];
  1138. if ($_POST['date-out'] == "" && (int) $_POST['nights'] > 0) {
  1139. $_POST['date-out'] = date('Y-m-d', strtotime($_POST['date-in'] . ' + ' . $_POST['nights'] .' days'));
  1140. if ($_POST['debug']){
  1141. print_r($_POST,1);
  1142. }
  1143. }
  1144. } else {
  1145. $reservationID = 0;
  1146. }
  1147. if ($reservationID) {
  1148. print 'All done Thank You for Booking with Essential Hotels. Your Reservation ID is ' . $reservationID ;
  1149. $subject = 'Your stay at the '. $hotel .' details.';
  1150. $headers = "From: " . $email_booking_to . "\r\n";
  1151. $headers .= "Reply-To: ". $email_booking_to . "\r\n";
  1152. $headers .= "MIME-Version: 1.0\r\n";
  1153. $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
  1154. $message .= '<center><h3>I am pleased to confirm your reservation<br /></h3></center>';
  1155. $message .= '<center><h3>'. strip_tags($_POST['status']).'<br /></h3></center>';
  1156. $message .= '<center><h3>Please Check the details below and let us know if anything is incorrect<br /></h3></center>';
  1157. $message .= '<table rules="all" style="border-color:#666 ; max-width: 721px;" cellpadding="10">';
  1158. $message .= "<tr><td><strong>Name of Hotel</strong> </td><td>" . $hotel . "</td></tr>";
  1159. $message .= "<tr><td><strong>Booking made under the Name</strong> </td><td>" . $guest_name . "</td></tr>";
  1160. $message .= "<tr><td><strong>Staying</strong> </td><td>" . $_POST['date-in'] . ' to the ' . $_POST['date-out'] . "</td></tr>";
  1161. $message .= "<tr><td><strong>Booking ID</strong> </td><td>" . $reservationID . "</td></tr>";
  1162. $message .= "<tr><td><strong>Cost</strong> </td><td> " . $price . "</td></tr>";
  1163. $message .= "<tr><td><strong>Essential Rewards</strong></td><td>As a Rewards member there’s still time to be rewarded for your upcoming stay.
  1164. Please reply to this email with your membership details. If youre not already a Member, enrol today to begin earning High Street shopping vouchers.</td></tr>";
  1165. $message .= "<tr><td><strong>Payment Method</strong></td><td>Upon departure. The credit/debit card details that you have supplied have guaranteed your reservation; no payment has been deducted from this card.</td></tr>";
  1166. $message .= "<tr><td><strong>Cancellation Policy</strong></td><td>" . $_POST['Clause']. "</td></tr>";
  1167. $message .= "</table>";
  1168. $message .= '<center><h3>Thank you for booking with essentialhotels; we hope you have an enjoyable stay and would be delighted to <br />
  1169. assist with any future bookings (UK or worldwide). <br />
  1170. Kind regards <br />
  1171. Marjorie Burrington | Director of Operations<br />
  1172. Essential Hotels<br />
  1173. Willowmead House, Mill Lane, Padworth RG7 4JX<br /></h3></center>';
  1174. print $message;
  1175. $message = '<html><head><meta charset="UTF-8"></head><body>' . $message . "</body></html>";
  1176. if ($_POST['debug'] == "1") {
  1177. } else {
  1178. mail($_POST['email'], $subject, $message, $headers);
  1179. }
  1180. } else {
  1181. print 'We cannot confirm this booking at the moment. Please contact us directly by phone or by email:<a href="tel:01189714700">0118 971 4700</a> or by <a href="nick@essential-hotels.com" >Email</a> or Online';
  1182. $subject = 'Your stay at the '. $hotel .' details.';
  1183. $headers = "From: " . $email_booking_to . "\r\n";
  1184. $headers .= "Reply-To: ". $email_booking_to . "\r\n";
  1185. $headers .= "MIME-Version: 1.0\r\n";
  1186. $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
  1187. $headers .= 'Bcc: nick@essential-hotels.com' . "\r\n";
  1188. $message .= '<center><h3>Contact Us Direct by Phone: <a href="tel:01189714700" >0118 971 4700</a> <br /> or replay to this email</h3></center>';
  1189. $message .= '<table rules="all" style="border-color:#666 ; max-width: 721px;" cellpadding="10">';
  1190. $message .= "<tr><td><strong>Name of Hotel</strong> </td><td>" . $hotel . "</td></tr>";
  1191. $message .= "<tr><td><strong>Cost</strong> </td><td>" . $Price . "</td></tr>";
  1192. $message .= "<tr><td><strong>Essential Rewards</strong></td><td>As a Rewards member there’s still time to be rewarded for your upcoming stay.
  1193. Please reply to this email with your membership details. If youre not already a Member, enrol today to begin earning High Street shopping vouchers.</td></tr>";
  1194. $message .= "<tr><td><strong>Payment Method</strong></td><td>Upon departure. The credit/debit card details that you have supplied have guaranteed your reservation; no payment has been deducted from this card.</td></tr>";
  1195. $message .= "</table>";
  1196. $message .= '<center><h3>Thank you for booking with essentialhotels; we hope you have an enjoyable stay and would be delighted to </br>
  1197. assist with any future bookings (UK or worldwide). <br />
  1198. Kind regards <br />
  1199. Marjorie Burrington | Director of Operations<br />
  1200. Essential Hotels<br />
  1201. Willowmead House, Mill Lane, Padworth RG7 4JX<br /></h3></center>';
  1202. print $message;
  1203. $message = '<html><head><meta charset="UTF-8"></head><body>' . $message . "</body></html>";
  1204. if ($_POST['debug'] == "1") {
  1205. } else {
  1206. mail($_POST['email'], $subject, $message, $headers);
  1207. }
  1208. }
  1209. ?></center>
  1210. <?php
  1211. if (( isset($_POST['debug']) && $_POST['debug'] == 1) || ( isset($_GET['debug']) && $_GET['debug'] == 1) || ( isset($_SESSION['debug']) && $_SESSION['debug'] == 1 ) ) {
  1212. // debug
  1213. print "<pre>";
  1214. print "< !-- headers " .print_r($headers,1) . " -->";
  1215. print "< !-- subject " .print_r($subject,1) . " -->";
  1216. print "< !-- message " .print_r($message,1) . " -->";
  1217. print "</pre>";
  1218. print "<pre>";
  1219. print "< !-- r " . print_r($response,1) ." -->";
  1220. print "< !-- respo array " . print_r($response_array ,1) ." -->";
  1221. print "< !-- xml " . print_r($xml ,1) ." -->";
  1222. print "< !-- array for response " . print_r($array ,1) ." -->";
  1223. print $message;
  1224. print "</pre>";
  1225. print '<form method="post" data-ajax="false" action="done.php" >'; // I've added this form, so that i can test the booking process without having to go through the booking process again
  1226. foreach ($_POST as $key => $value) {
  1227. print '<input type="hidden" name="'. $key.'" value="'.$value.'" />';
  1228. }
  1229. print '<input data-theme="f" type="submit" name="submit" value="re Book" />';
  1230. print '</form>';
  1231. }
  1232. //
  1233. // strip card details
  1234. //
  1235. // unset($array['XHI_HotelResRS']['BookingReservationDetails']['GuaranteeDetails']);
  1236. // unset($_POST['ccHolderFirstName']);
  1237. // unset($_POST['ccHolderLastName']);
  1238. // unset($_POST['ccnumber']);
  1239. // unset($_POST['cctype']);
  1240. // unset($_POST['ccexp_month']);
  1241. // unset($_POST['ccexp_year']);
  1242. // unset($_POST['ccexp']);
  1243. // unset($_POST['cvc']);
  1244. }
  1245. if ($array['XHI_HotelResRS']['@attributes']['success'] == "true") {
  1246. $subject = 'New Booking at the ' . $_POST['hotel'];
  1247. $message = $_POST['firstname'].' '.$_POST['surname'] . ' has booked at the ' .$_POST['hotel'] ."
  1248. staying on the " . $_POST['date-in'] . ' until ' . $_POST['date-out'] . '
  1249. there email is '. $_POST['email']. '
  1250. and you can phone them on ' . $_POST['phone']
  1251. . print_r($_POST,1).'
  1252. ' . print_r($array,1) ;
  1253. } else {
  1254. $subject = 'Booking failed for the ' . $_POST['hotel'];
  1255. $message = $_POST['firstname'].' '.$_POST['surname'] . ' has booked at the ' .$_POST['hotel'] ."
  1256. staying on the " . $_POST['date-in'] . ' until ' . $_POST['date-out'] . '
  1257. there email is '. $_POST['email']. '
  1258. and you can phone them on ' . $_POST['phone'] .'
  1259. ' . print_r($_POST,1) . '
  1260. ' . print_r($array,1) ;
  1261. }
  1262. $headers = 'From: site@essentialhotels.co.uk' . "\r\n" .
  1263. 'Reply-To: site@essentialhotels.co.uk' . "\r\n" .
  1264. 'X-Mailer: PHP/' . phpversion();
  1265. //
  1266. // email to essenial
  1267. //
  1268. mail($email_booking_to, $subject, $message, $headers);
  1269. ?>
  1270. </body>
  1271. </html><?php
  1272. $fp = fopen("./.ht.booking", "a");
  1273. fwrite($fp, json_encode(Array("from-client" => $_POST,"XML Header" => $xml_headers,"Posted to URL" => $url,"Raw posted XML" => $xml_post_string, "from-ota" => $array, "Raw" => $response , )));
  1274. fwrite($fp, PHP_EOL);
  1275. fclose($fp);
  1276. if ($_POST['debug']){
  1277. print_r($_POST,1);
  1278. }