<?php require_once(APPPATH.'views/diy_tour/public/header.php');?>
<title>International Flights Booking</title>
<meta name="keywords" content="china flights, china flight, flights china"/>
<meta name="description" content="internal air ticket availability for flights within China"/>
<link type="text/css" rel="stylesheet" href="/min/f=/css/bootstrap/css/flight.css" />
<?php require_once(APPPATH.'views/diy_tour/public/nav.php');?>

<div  id="content" class="container-fluid">
    <div class="row">
      <div class="col-xs-24 btn-lg hidden-xs"></div>
      <?php $flight=$flight_group[0]; ?>
        <div class="col-sm-17" style="background:#f3f5f7;padding-top:15px;">
            
           <form id="form_flight_book" name="form_flight_book" method="post" action="/index.php/thirdparty/flight/flight/flight_thankyou/">
            
            <div class="panel panel-default train_book_box">
                
                <div class="panel-body">
                    <h4>Passenger Information</h4>
                    <p>Please make sure that you enter your name on the ticket application form exactly as it is written in your passport; if the two do not match, you will face some serious hassles, given today's level of airport security, during all phases of check-in and boarding. </p>
                    <p>Tips: Please fill in your middle name(s) (it/they MUST be typed as in your passport):</p>
                    <p class="btn-sm"></p>
                    <div class="form-horizontal passengerinfo" style="line-height:35px;">
                        <div class="form-group">
                        <strong class="col-md-3 col-sm-4 col-xs-24">Passager(s):</strong>
                        <div class="col-sm-6 col-xs-24">
                          <div class="input-group flight_inputgroup" style="margin-left:8px;">
                            <span class="input-group-addon">Adult(s):</span>
                            <select class="col-xs-24 input_style" name="passenerno" id="passenerno">
                              <option value="1">1</option>
                              <option value="2">2</option>
                              <option value="3">3</option>
                              <option value="4">4</option>
                              <option value="5">5</option>
                            </select>
                          </div>
                        </div>

                        <div class="col-sm-6 col-xs-24">
                          <div class="input-group flight_inputgroup">
                            <span class="input-group-addon">Children:</span>
                            <select class="col-xs-24 input_style" name="passenerno_chd" id="passenerno_chd">
                              <option value="0">0</option>
                              <option value="1">1</option>
                              <option value="2">2</option>
                              <option value="3">3</option>
                              <option value="4">4</option>
                              <option value="5">5</option>
                            </select>
                          </div>
                        </div>

                        <div class="col-sm-6 col-xs-24">
                          <div class="input-group flight_inputgroup">
                            <span class="input-group-addon">Babies:</span>
                            <select class="col-xs-24 input_style" name="passenerno_baby" id="passenerno_baby">
                              <option value="0">0</option>
                              <option value="1">1</option>
                              <option value="2">2</option>
                            </select>
                          </div>
                        </div>
                        
                      </div>
                    </div>
                    <div class="form-horizontal passagerbox" style="line-height:35px;background:#f0f0f0;">
                      <div class="form-group" style="padding:10px 0;margin:0;border-bottom: 2px solid #fff;">
                        <strong class="col-md-3 col-sm-4 col-xs-24"><span class="label-name">Adult</span> <span class="AdultTb-num">1</span>:</strong>
                        <div class="col-sm-6 col-xs-24">
                            <select class="form-control common_input sex" id="sex1" name="sex[]" style="border-left: 0;margin-left: -2px;">
                              <option value="1"> Mr.</option>
                              <option value="3"> Ms.</option>
                            </select>
                        </div>
                        <div class="col-sm-6 col-xs-24">
                            <input type="text" class="form-control common_input" id="guestName1" name="guestName[]" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your Passenger name!" placeholder="Surname/Given Names">
                        </div>
                        <div class="col-sm-6 col-xs-24">
                            <input type="text" class="form-control common_input" id="guestpassport1" name="guestpassport[]" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your Passport No..!" placeholder="Passport">
                        </div>
                        <div class="col-sm-18 col-sm-offset-4 col-md-offset-3">
                          <div class="input-group">
                              <span class="input-group-addon">Date of Birth:</span>
                              <div class="form-control common_input" style="padding:0;">
                                  <select name="birthday_m[]" id="birthday_m1" class="col-xs-8 input_style nopadding" style="border:none;border-radius:0;height:32px;">
                                      <option value="1">1</option>
                                      <option value="2">2</option>
                                      <option value="3">3</option>
                                      <option value="4">4</option>
                                      <option value="5">5</option>
                                      <option value="6">6</option>
                                      <option value="7">7</option>
                                      <option value="8">8</option>
                                      <option value="9">9</option>
                                      <option value="10">10</option>
                                      <option value="11">11</option>
                                      <option value="12">12</option>
                                  </select>
                                  <select name="birthday_d[]" id="birthday_d1" class="col-xs-8 input_style nopadding" style="border:none;border-right:1px solid #ddd;border-left:1px solid #ddd;border-radius:0;height:32px;">
                                      <option value="1">1</option>
                                      <option value="2">2</option>
                                      <option value="3">3</option>
                                      <option value="4">4</option>
                                      <option value="5">5</option>
                                      <option value="6">6</option>
                                      <option value="7">7</option>
                                      <option value="8">8</option>
                                      <option value="9">9</option>
                                      <option value="10">10</option>
                                      <option value="11">11</option>
                                      <option value="12">12</option>
                                      <option value="13">13</option>
                                      <option value="14">14</option>
                                      <option value="15">15</option>
                                      <option value="16">16</option>
                                      <option value="17">17</option>
                                      <option value="18">18</option>
                                      <option value="19">19</option>
                                      <option value="20">20</option>
                                      <option value="21">21</option>
                                      <option value="22">22</option>
                                      <option value="23">23</option>
                                      <option value="24">24</option>
                                      <option value="25">25</option>
                                      <option value="26">26</option>
                                      <option value="27">27</option>
                                      <option value="28">28</option>
                                      <option value="29">29</option>
                                      <option value="30">30</option>
                                      <option value="31">31</option>
                                  </select>
                                  <select name="birthday_y[]" id="birthday_y1" class="col-xs-8 input_style nopadding" style="border:none;border-radius:0;height:32px;">
                                      <option value="1925">1925</option>
                                      <option value="1926">1926</option>
                                      <option value="1927">1927</option>
                                      <option value="1928">1928</option>
                                      <option value="1929">1929</option>
                                      <option value="1930">1930</option>
                                      <option value="1931">1931</option>
                                      <option value="1932">1932</option>
                                      <option value="1933">1933</option>
                                      <option value="1934">1934</option>
                                      <option value="1935">1935</option>
                                      <option value="1936">1936</option>
                                      <option value="1937">1937</option>
                                      <option value="1938">1938</option>
                                      <option value="1939">1939</option>
                                      <option value="1940">1940</option>
                                      <option value="1941">1941</option>
                                      <option value="1942">1942</option>
                                      <option value="1943">1943</option>
                                      <option value="1944">1944</option>
                                      <option value="1945">1945</option>
                                      <option value="1946">1946</option>
                                      <option value="1947">1947</option>
                                      <option value="1948">1948</option>
                                      <option value="1949">1949</option>
                                      <option value="1950" selected>1950</option>
                                      <option value="1951">1951</option>
                                      <option value="1952">1952</option>
                                      <option value="1953">1953</option>
                                      <option value="1954">1954</option>
                                      <option value="1955">1955</option>
                                      <option value="1956">1956</option>
                                      <option value="1957">1957</option>
                                      <option value="1958">1958</option>
                                      <option value="1959">1959</option>
                                      <option value="1960">1960</option>
                                      <option value="1961">1961</option>
                                      <option value="1962">1962</option>
                                      <option value="1963">1963</option>
                                      <option value="1964">1964</option>
                                      <option value="1965">1965</option>
                                      <option value="1966">1966</option>
                                      <option value="1967">1967</option>
                                      <option value="1968">1968</option>
                                      <option value="1969">1969</option>
                                      <option value="1970">1970</option>
                                      <option value="1971">1971</option>
                                      <option value="1972">1972</option>
                                      <option value="1973">1973</option>
                                      <option value="1974">1974</option>
                                      <option value="1975">1975</option>
                                      <option value="1976">1976</option>
                                      <option value="1977">1977</option>
                                      <option value="1978">1978</option>
                                      <option value="1979">1979</option>
                                      <option value="1980">1980</option>
                                      <option value="1981">1981</option>
                                      <option value="1982">1982</option>
                                      <option value="1983">1983</option>
                                      <option value="1984">1984</option>
                                      <option value="1985">1985</option>
                                      <option value="1986">1986</option>
                                      <option value="1987">1987</option>
                                      <option value="1988">1988</option>
                                      <option value="1989">1989</option>
                                      <option value="1990">1990</option>
                                      <option value="1991">1991</option>
                                      <option value="1992">1992</option>
                                      <option value="1993">1993</option>
                                      <option value="1994">1994</option>
                                      <option value="1995">1995</option>
                                      <option value="1996">1996</option>
                                      <option value="1997">1997</option>
                                      <option value="1998">1998</option>
                                      <option value="1999">1999</option>
                                      <option value="2000">2000</option>
                                      <option value="2001">2001</option>
                                      <option value="2002">2002</option>
                                      <option value="2003">2003</option>
                                      <option value="2004">2004</option>
                                      <option value="2005">2005</option>
                                      <option value="2006">2006</option>
                                      <option value="2007">2007</option>
                                      <option value="2008">2008</option>
                                      <option value="2009">2009</option>
                                      <option value="2010">2010</option>
                                      <option value="2011">2011</option>
                                      <option value="2012">2012</option>
                                      <option value="2013">2013</option>
                                      <option value="2014">2014</option>
                                  </select>
                              </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div id="ChildTb" class="form-horizontal" style="line-height:35px;background:#f0f0f0;"></div>
                    <div id="BabyTb" class="form-horizontal" style="line-height:35px;background:#f0f0f0;"></div>
                </div>
            </div>

            <div class="panel panel-default train_book_box" style="padding-bottom:30px;">
                
                <div class="panel-body form-inline form-inline-input">
                    <h4>Contact Information</h4>
                      <div class="col-sm-6 col-xs-24">
                        <label for="fullname">fullname<span class="text-danger">*</span></label>
                        <input type="text" class="form-control common_input" name="fullname" id="fullname" placeholder="Your Full Name" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your Full Name!">
                      </div>
                      <div class="col-sm-6 col-xs-24">
                        <label for="Nationality">Nationality<span class="text-danger">*</span></label>
                          <select class="form-control" id="Nationality" name="Nationality">
                            <optgroup label="--Top Nationality--">
                            <option value="18" selected="selected">Australia</option>
                            <option value="5">Canada</option>
                            <option value="1">China</option>
                            <option value="8">France</option>
                            <option value="6">Germany</option>
                            <option value="9">Italy</option>
                            <option value="19">Malaysia</option>
                            <option value="27">Singapore</option>
                            <option value="7">United Kingdom</option>
                            <option value="3">United States</option>
                            </optgroup>
                            <optgroup label="--More Nationality--">
                            <option value="458">Afghanistan</option>
                            <option value="459">Albania</option>
                            <option value="460">Algeria</option>
                            <option value="461">American Samoa</option>
                            <option value="462">Andorra</option>
                            <option value="463">Angola</option>
                            <option value="464">Anguilla</option>
                            <option value="465">Antarctica</option>
                            <option value="466">Antigua And Barbuda</option>
                            <option value="467">Argentina</option>
                            <option value="468">Armenia</option>
                            <option value="469">Aruba</option>
                            <option value="18">Australia</option>
                            <option value="470">Austria</option>
                            <option value="471">Azerbaijan</option>
                            <option value="472">Bahamas</option>
                            <option value="473">Bahrain</option>
                            <option value="474">Bangladesh</option>
                            <option value="671">Barbadian</option>
                            <option value="475">Barbados</option>
                            <option value="476">Belarus</option>
                            <option value="477">Belgium</option>
                            <option value="478">Belize</option>
                            <option value="479">Benin</option>
                            <option value="480">Bermuda</option>
                            <option value="481">Bhutan</option>
                            <option value="482">Bolivia</option>
                            <option value="483">Botswana</option>
                            <option value="484">Bouvet Island</option>
                            <option value="38">Brazil</option>
                            <option value="485">British Indian Ocean Territory</option>
                            <option value="486">Brunei Darussalam</option>
                            <option value="487">Bulgaria</option>
                            <option value="488">Burkina Faso</option>
                            <option value="489">Burundi</option>
                            <option value="490">Cambodia</option>
                            <option value="491">Cameroon</option>
                            <option value="5">Canada</option>
                            <option value="493">Cape Verde</option>
                            <option value="494">Cayman Islands</option>
                            <option value="495">Central African Republic</option>
                            <option value="496">Chad</option>
                            <option value="497">Chile</option>
                            <option value="1">China</option>
                            <option value="10">China HK</option>
                            <option value="499">Christmas Island</option>
                            <option value="500">Colombia</option>
                            <option value="501">Comoros</option>
                            <option value="502">Congo</option>
                            <option value="504">Cook Islands</option>
                            <option value="505">Costa Rica</option>
                            <option value="506">Croatia</option>
                            <option value="507">Cuba</option>
                            <option value="508">Cyprus</option>
                            <option value="509">Czech Republic</option>
                            <option value="510">Czechoslovakia</option>
                            <option value="511">Denmark</option>
                            <option value="512">Djibouti</option>
                            <option value="513">Dominica</option>
                            <option value="514">Dominican Republic</option>
                            <option value="515">East Timor</option>
                            <option value="516">Ecuador</option>
                            <option value="517">Egypt</option>
                            <option value="518">El Salvador</option>
                            <option value="520">Equatorial Guinea</option>
                            <option value="521">Eritrea</option>
                            <option value="522">Estonia</option>
                            <option value="523">Ethiopia</option>
                            <option value="524">Falkland Islands</option>
                            <option value="525">Faroe Islands</option>
                            <option value="526">Fiji</option>
                            <option value="527">Finland</option>
                            <option value="8">France</option>
                            <option value="528">French Guiana</option>
                            <option value="529">French Polynesia</option>
                            <option value="530">Gabon</option>
                            <option value="531">Gambia</option>
                            <option value="532">Georgia</option>
                            <option value="6">Germany</option>
                            <option value="533">Ghana</option>
                            <option value="534">Gibraltar</option>
                            <option value="536">Greece</option>
                            <option value="537">Greenland</option>
                            <option value="538">Grenada</option>
                            <option value="539">Guadeloupe</option>
                            <option value="540">Guam</option>
                            <option value="670">Guatemala</option>
                            <option value="541">Guernsey</option>
                            <option value="542">Guinea</option>
                            <option value="543">Guinea-Bissau</option>
                            <option value="544">Guyana</option>
                            <option value="545">Haiti</option>
                            <option value="546">Honduras</option>
                            <option value="547">Hong Kong</option>
                            <option value="548">Hungary</option>
                            <option value="36">Iceland</option>
                            <option value="22">India</option>
                            <option value="549">Indonesia</option>
                            <option value="550">Iran</option>
                            <option value="551">Iraq</option>
                            <option value="552">Ireland</option>
                            <option value="553">Isle Of Man</option>
                            <option value="21">Israel</option>
                            <option value="9">Italy</option>
                            <option value="554">Jamaica</option>
                            <option value="2">Japan</option>
                            <option value="556">Jersey</option>
                            <option value="557">Jordan</option>
                            <option value="558">Kazakhstan</option>
                            <option value="668">Kazakhstan2</option>
                            <option value="559">Kenya</option>
                            <option value="560">Kiribati</option>
                            <option value="562">Korea</option>
                            <option value="563">Kuwait</option>
                            <option value="564">Kyrgyzstan</option>
                            <option value="35">Laos</option>
                            <option value="565">Latvia</option>
                            <option value="566">Lebanon</option>
                            <option value="567">Lesotho</option>
                            <option value="568">Liberia</option>
                            <option value="569">Libyan Arab Jamahiriya</option>
                            <option value="570">Liechtenstein</option>
                            <option value="571">Lithuania</option>
                            <option value="572">Luxembourg</option>
                            <option value="573">Macau</option>
                            <option value="574">Macedonia</option>
                            <option value="575">Madagascar</option>
                            <option value="576">Malawi</option>
                            <option value="19">Malaysia</option>
                            <option value="577">Maldives</option>
                            <option value="578">Mali</option>
                            <option value="579">Malta</option>
                            <option value="580">Marshall Islands</option>
                            <option value="581">Martinique</option>
                            <option value="582">Mauritania</option>
                            <option value="583">Mauritius</option>
                            <option value="584">Mayotte</option>
                            <option value="32">Mexican</option>
                            <option value="585">Micronesia</option>
                            <option value="586">Moldova</option>
                            <option value="587">Monaco</option>
                            <option value="29">Mongolia</option>
                            <option value="588">Montserrat</option>
                            <option value="589">Morocco</option>
                            <option value="590">Mozambique</option>
                            <option value="591">Myanmar</option>
                            <option value="592">Namibia</option>
                            <option value="593">Nauru</option>
                            <option value="31">Nepal</option>
                            <option value="39">Netherlands</option>
                            <option value="594">Netherlands Antilles</option>
                            <option value="595">Neutral Zone</option>
                            <option value="596">New Caledonia</option>
                            <option value="20">New Zealand</option>
                            <option value="597">Nicaragua</option>
                            <option value="598">Niger</option>
                            <option value="599">Nigeria</option>
                            <option value="600">Niue</option>
                            <option value="601">Norfolk Island</option>
                            <option value="33">North Korea</option>
                            <option value="602">Northern Mariana Islands</option>
                            <option value="37">Norway</option>
                            <option value="603">Oman</option>
                            <option value="604">Pakistan</option>
                            <option value="605">Palau</option>
                            <option value="606">Panama</option>
                            <option value="607">Papua New Guinea</option>
                            <option value="608">Paraguay</option>
                            <option value="609">Peru</option>
                            <option value="23">Philippines</option>
                            <option value="610">Pitcairn</option>
                            <option value="611">Poland</option>
                            <option value="612">Portugal</option>
                            <option value="613">Puerto Rico</option>
                            <option value="614">Qatar</option>
                            <option value="615">Reunion</option>
                            <option value="616">Romania</option>
                            <option value="24">Russian Federation</option>
                            <option value="617">Rwanda</option>
                            <option value="618">Saint Helena</option>
                            <option value="619">Samoa</option>
                            <option value="620">San Marino</option>
                            <option value="621">Sao Tome and Principe</option>
                            <option value="622">Saudi Arabia</option>
                            <option value="674">Scotland</option>
                            <option value="623">Senegal</option>
                            <option value="624">Seychelles</option>
                            <option value="625">Sierra Leone</option>
                            <option value="27">Singapore</option>
                            <option value="626">Slovakia</option>
                            <option value="627">Slovenia</option>
                            <option value="628">Solomon Islands</option>
                            <option value="629">Somalia</option>
                            <option value="630">South Africa</option>
                            <option value="631">South Georgia and The Sandwich</option>
                            <option value="26">Spain</option>
                            <option value="632">Sri Lanka</option>
                            <option value="633">Sudan</option>
                            <option value="634">Suriname</option>
                            <option value="635">Swaziland</option>
                            <option value="636">Sweden</option>
                            <option value="25">Switzerland</option>
                            <option value="637">Syrian Arab Republic</option>
                            <option value="638">Taiwan</option>
                            <option value="639">Tanzania</option>
                            <option value="28">Thailand</option>
                            <option value="676">The Republic of Cote d'ivoire</option>
                            <option value="640">Togo</option>
                            <option value="641">Tokelau</option>
                            <option value="642">Tonga</option>
                            <option value="643">Trinidad and Tobago</option>
                            <option value="644">Tunisia</option>
                            <option value="645">Turkey</option>
                            <option value="646">Turkmenistan</option>
                            <option value="647">Turks and Caicos Islands</option>
                            <option value="648">Tuvalu</option>
                            <option value="649">Uganda</option>
                            <option value="650">Ukraine</option>
                            <option value="651">United Arab Emirates</option>
                            <option value="7">United Kingdom</option>
                            <option value="3">United States</option>
                            <option value="667">unknown</option>
                            <option value="652">Uruguay</option>
                            <option value="653">USSR</option>
                            <option value="654">Uzbekistan</option>
                            <option value="655">Vanuatu</option>
                            <option value="656">Vatican City State</option>
                            <option value="657">Venezuela</option>
                            <option value="30">Vietnam</option>
                            <option value="659">Virgin Islands (British)</option>
                            <option value="660">Virgin Islands (U.S.)</option>
                            <option value="661">Western Sahara</option>
                            <option value="662">Yemen</option>
                            <option value="663">Yugoslavia</option>
                            <option value="664">Zaire</option>
                            <option value="665">Zambia</option>
                            <option value="666">Zimbabwe</option>
                            </optgroup>
                           </select>
                      </div>
                      <div class="col-sm-6 col-xs-24">
                        <label for="Email Address">Email<span class="text-danger">*</span></label>
                        <input type="text" class="form-control common_input" name="email" id="email" placeholder="Email Address" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your Email!">
                      </div>
                      <div class="col-sm-6 col-xs-24">
                        <label for="Phone Number">Phone Number<span class="text-danger">*</span></label>
                        <input type="text" class="form-control common_input" name="phone" id="phone" placeholder="Phone Number" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your Phone Number!">
                      </div>
                      <div class="col-xs-24">
                        <label>Other Special Request:</label>
                        <textarea name="SpecialRequest" id="SpecialRequest" class="form-control" rows="5"></textarea>
                      </div>
                </div>
            </div>
            <input type="hidden" name="from_city" value="<?php echo $form_city; ?>">
            <input type="hidden" name="to_city" value="<?php echo $to_city; ?>">
            <input type="hidden" name="form_city_code" value="<?php echo $form_city_code; ?>">
            <input type="hidden" name="to_city_code" value="<?php echo $to_city_code; ?>">
            <input type="hidden" name="flight_date" value="<?php echo $flight_date; ?>">
            <input type="hidden" name="return_date" value="<?php echo $return_date; ?>">
            <input type="hidden" id="route_rearch_token" name="route_rearch_token" value="<?php echo $route_rearch_token; ?>">

            <input type="hidden" name="org_price" id="org_price" value="<?php echo $flight_price['PriceUnitID'.$flight->PriceList->Price[0]->PriceUnitID]->PriceInfoList->PriceInfo->OriginalPriceDetail->SalePrice; ?>">
            <input type="hidden" name="org_taxes" id="org_taxes" value="<?php echo ($flight_price['PriceUnitID'.$flight->PriceList->Price[0]->PriceUnitID]->PriceInfoList->PriceInfo->OriginalPriceDetail->Tax+$flight_price['PriceUnitID'.$flight->PriceList->Price[0]->PriceUnitID]->PriceInfoList->PriceInfo->OriginalPriceDetail->FuelSurCharge); ?>">            
            <input type="hidden" name="org_price_org" id="org_price_org" value="<?php echo $flight_price['PriceUnitID'.$flight->PriceList->Price[0]->PriceUnitID]->PriceInfoList->PriceInfo->OriginalPriceDetail->PublishPrice; ?>">
            <input type="hidden" name="total_price_usd" id="total_price_usd" value="">
            <button type="button" class="btn btn-danger pull-right form-control" id="flight_book_btn" style="margin-bottom:15px;">Submit</button>
          </form>
        </div>
        <div class="col-sm-7 nopadding-R">
          <h4 class="text-danger">Booking summary</h4>
          <p class="text-muted"><strong>Departing - <?php echo date('D M,d,Y ',strtotime($flight_date));?></strong></p>
          <p><strong><?php echo $from_city.' to '.$to_city;?></strong></p>
          <?php 
          foreach ($flight->FlightSegmentList->FlightSegment as $key_air => $plane) { 
          ?>
              <?php if($plane->OrigDestSeqID == '2' && $flight->FlightSegmentList->FlightSegment[($key_air-1)]->OrigDestSeqID=='1') {?>
                <div class="col-xs-24 btn-sm"></div>
                <p class="text-muted"><strong>Returning - <?php echo date('D M,d,Y ',strtotime($return_date));?></strong></p>
                <p><strong><?php echo $to_city.' to '.$from_city;?></strong></p>
              <?php } ?>
              <div class="col-xs-24 nopadding flight_detail_box bg-info" style="padding-left:5px !important;">
                <p style="line-height:30px;">
                  <span class="pull-left">
                    <img class="img-circle" style="width:18px;" src="/image/airline_logos/<?php echo $flight_list['FlightID'.$plane->FlightID]->Carrier->AirlineCode;?>.png" >
                  </span>
                  <span class="pull-left"><?php echo $flight_list['FlightID'.$plane->FlightID]->FlightNumber; ?></span>
                  <span class="pull-left"><?php echo $flight_price['PriceUnitID'.$flight->PriceList->Price[0]->PriceUnitID]->BookingClassInfoListList->BookingClassInfoList[0]->BookingClassInfo[$key_air]->CabinClass; ?></span>
                </p>
                <div class="col-xs-24 nopadding">
                  <div class="col-xs-5 nopadding">
                    <?php echo date('H:i',$flight_list['FlightID'.$plane->FlightID]->TakeoffDateTime); ?>
                    <p class="text-muted"><?php echo floor($flight_list['FlightID'.$plane->FlightID]->Duration/60).'h'.($flight_list['FlightID'.$plane->FlightID]->Duration%60).'m'; ?></p>
                    <?php echo date('H:i',$flight_list['FlightID'.$plane->FlightID]->ArrivalDateTime);?>
                  </div>
                  <div class="col-xs-1 nopadding"><img src="/css/images/flight_stop.png"></div>
                  <div class="col-xs-18 text-muted">
                    <p style="line-height:12px;height:35px;">
                      <?php $flight_port_nameEN=ucfirst(strtolower($flight_list['FlightID'.$plane->FlightID]->DepartureAirport->PortNameEN));?>
                      <?php if(strtolower($flight_port_nameEN)!=strtolower($flight_list['FlightID'.$plane->FlightID]->DepartureCity->CityNameEN)) echo '<span>'.$flight_list['FlightID'.$plane->FlightID]->DepartureCity->CityNameEN.'</span>';?>
                      <span><?php echo $flight_port_nameEN.' International Airport '.$flight_list['FlightID'.$plane->FlightID]->DepartureAirport->Terminal;?></span> 
                    </p>
                    <p style="line-height:12px;">
                      <?php $ArrivalPortNameEN = ucfirst(strtolower($flight_list['FlightID'.$plane->FlightID]->ArrivalAirport->PortNameEN));?>
                      <?php if(strtolower($ArrivalPortNameEN)!=strtolower($flight_list['FlightID'.$plane->FlightID]->ArrivalCity->CityNameEN)) echo '<span>'.$flight_list['FlightID'.$plane->FlightID]->ArrivalCity->CityNameEN.'</span>';?>
                      <span><?php echo $ArrivalPortNameEN.' International Airport '.$flight_list['FlightID'.$plane->FlightID]->ArrivalAirport->Terminal;?></span>
                    </p>
                  </div>
                </div>
              </div>
          <?php } ?>

          <div class="col-xs-24 nopadding" style="border-bottom:1px dashed">
            <div class="btn-lg"></div>
            <legend></legend>
            <strong>Fares</strong>
            <p><span>Adult</span><span class="pull-right text-danger" id="adult_fares"></span></p>
            <p><span>Child</span><span class="pull-right text-danger" id="child_fares"></span></p>
            <p><span>Baby</span><span class="pull-right text-danger" id="baby_fares"></span></p>
            <strong>Taxes & fees</strong>
            <p><span>Adult</span><span class="pull-right text-danger" id="adult_taxes"></span></p>
            <p><span>Child</span><span class="pull-right text-danger" id="child_taxes"></span></p>
            <p><strong>Service Fee</strong><span class="pull-right text-danger" id="service_fee"></span></p>
            <p><strong>Bank Handling Fee</strong><span class="pull-right text-danger" id="bank_fee"></span></p>
          </div>
          <div class="col-xs-24 nopadding">
            <span class="col-xs-12 nopadding-L"><h4>Total</h4></span>
            <h4 class="col-xs-12 nopadding-R text-danger text-right" id="total_usd"></h4>
          </div>
        </div>
    </div>
</div>
<?php require_once(APPPATH.'views/diy_tour/public/footer.php');?>

<script type="text/javascript">
$(document).ready(function()
{
    allBill();
    //change Passager 
    $("#passenerno,#passenerno_chd,#passenerno_baby").bind('change',function() {
        var num = parseInt($("#passenerno").val() || 1); //成人数
        var num_c = parseInt($("#passenerno_chd").val() || 0); //儿童数
        var num_b = parseInt($("#passenerno_baby").val() || 0); //婴儿数
        for (var i = 1; i <= num; i++) {
            if ($(".passagerbox>.form-group").eq(i - 1).size() == 0) {
                var gtable = $(".passagerbox>.form-group").eq(0).clone();
                gtable.find("input[name^=guestName]").attr('onkeyup', '');
                gtable.find(".AdultTb-num").html(i);
                gtable.find("input[name^=guestName]").val("").attr("id", "guestName" + i);
                gtable.find("input[name^=guestpassport]").val("").attr("id", "guestpassport" + i);
                gtable.find("select[name^=birthday_m]").val("").attr("id", "birthday_m" + i);
                gtable.find("select[name^=birthday_d]").val("").attr("id", "birthday_d" + i);
                gtable.find("select[name^=birthday_y]").val("").attr("id", "birthday_y" + i);
                gtable.find(".sex").val("").attr("id", "sex" + i);
                $(".passagerbox").append(gtable);
            }
        }
        $(".passagerbox>.form-group").slice(num).remove();

        for (var i = 1; i <= num_c; i++) {
            if ($("#ChildTb>.form-group").eq(i - 1).size() == 0) {
                var gtable = $(".passagerbox>.form-group").eq(0).clone();
                gtable.find("input[name^=guestName]").attr('onkeyup', '');
                gtable.find(".label-name").html("Child");
                gtable.find(".AdultTb-num").html(i);
                gtable.find("input[name^=guestName]").val("").attr({
                    "id": "guestNameCHD" + i,
                    "name": "guestNameCHD[]"
                });
                gtable.find("input[name^=guestpassport]").val("").attr({
                    "id": "guestpassportCHD" + i,
                    "name": "guestpassportCHD[]"
                });
                gtable.find("select[name^=birthday_m]").val("").attr({
                    "id": "birthday_m_CHD" + i,
                    "name": "birthday_m_CHD[]"
                });
                gtable.find("select[name^=birthday_d]").val("").attr({
                    "id": "birthday_d_CHD" + i,
                    "name": "birthday_d_CHD[]"
                });
                gtable.find("select[name^=birthday_y]").val("").attr({
                    "id": "birthday_y_CHD" + i,
                    "name": "birthday_y_CHD[]"
                });
                gtable.find(".sex").val("").attr({
                    "id": "sexCHD" + i,
                    "name": "sexCHD[]"
                });
                $("#ChildTb").append(gtable);
            }
        }
        $("#ChildTb>.form-group").slice(num_c).remove();

        for (var i = 1; i <= num_b; i++) {
            if ($("#BabyTb>.form-group").eq(i - 1).size() == 0) {
                var gtable = $(".passagerbox>.form-group").eq(0).clone();
                gtable.find("input[name^=guestName]").attr('onkeyup', '');
                gtable.find(".label-name").html("Baby");
                gtable.find(".AdultTb-num").html(i);
                gtable.find("input[name^=guestName]").val("").attr({
                    "id": "guestNameBaby" + i,
                    "name": "guestNameBaby[]"
                });
                gtable.find("input[name^=guestpassport]").val("").attr({
                    "id": "guestpassportBaby" + i,
                    "name": "guestpassportBaby[]"
                });
                gtable.find("select[name^=birthday_m]").val("").attr({
                    "id": "birthday_m_Baby" + i,
                    "name": "birthday_m_Baby[]"
                });
                gtable.find("select[name^=birthday_d]").val("").attr({
                    "id": "birthday_d_Baby" + i,
                    "name": "birthday_d_Baby[]"
                });
                gtable.find("select[name^=birthday_y]").val("").attr({
                    "id": "birthday_y_Baby" + i,
                    "name": "birthday_y_Baby[]"
                });
                gtable.find(".sex").val("").attr({
                    "id": "sexBaby" + i,
                    "name": "sexBaby[]"
                });
                $("#BabyTb").append(gtable);
            }
        }
        $("#BabyTb>.form-group").slice(num_b).remove();
        allBill();
    });
    //点击输入框时隐藏提示框
    $("input.common_input").live("click",function(){
        $(this).popover('hide');
    });
    //检测输入框、提交订单
    $("#flight_book_btn").click(function(){
        var flag=true;
        $("#flight_book_btn").text('loading...');
        $("input.common_input").each(function(){
            if ($(this).val()=='') {
                $(this).popover('show');
                flag = false;
                return false;
            };
        });
        if (flag) {
            $("#form_flight_book").submit();
        }else{
            $("#flight_book_btn").text('Submit');
        }
        return false;
    });
});
var rate = <?php echo($this->currency->get_site_currencyrate()); ?>; //汇率
//手续费计算 成人儿童70 婴儿50
function shouxu_func(num,num_c,num_b) {
    var r = 0;
    if (num_b>0) {
        r = 50*num_b;
    }
    var total=r+(num+num_c)*70;
    return total;
}
//计算价格
function allBill() {
    $("#child_taxes,#child_fares,#baby_fares").parent().hide();
    var per_A = parseInt($("#passenerno").val() || 1); //成人数
    var per_C = parseInt($("#passenerno_chd").val() || 0); //儿童数
    var per_B = parseInt($("#passenerno_baby").val() || 0); //婴儿数
    //手续费计算 成人儿童70 婴儿50人民币
    var serviceFee=shouxu_func(per_A,per_C,per_B);
    var serviceFee_usd=Math.ceil(serviceFee/rate);
    //原始价格
    var org_price = $("#org_price").val();//票价
    var org_taxes = $("#org_taxes").val();//税费
    var org_price_org = $("#org_price_org").val();//Y舱价格（全价）
    //税费总额
    var taxes_usd_a = Math.ceil(org_taxes/rate);
    var taxes_usd_c = Math.ceil(taxes_usd_a*0.5);    
    var total_taxes_rmb = Math.ceil(org_taxes*per_A+org_taxes*0.5*per_C);
    var total_taxes_usd = Math.ceil(total_taxes_rmb/rate);
    //成本价人民币价格
    var price_rmb_a = org_price;
    var price_rmb_c = Math.ceil(org_price_org*0.5);
    var price_rmb_b = Math.ceil(org_price_org*0.1);
    //成本价语种价格
    var price_usd_a = Math.ceil(price_rmb_a/rate);
    var price_usd_c = Math.ceil(price_rmb_c/rate);
    var price_usd_b = Math.ceil(price_rmb_b/rate);
    //总价=票价总额+税费总额+服务费总额
    var total_tmp = Number(price_usd_a*per_A)+Number(price_usd_c*per_C)+Number(price_usd_b*per_B)+Number(total_taxes_usd)+Number(serviceFee_usd);
    //信用卡费用
    var bankFee_usd = Math.ceil(total_tmp*0.03);
    //最后总价报价
    var total_usd = Math.ceil(total_tmp+bankFee_usd);
    //显示价格
    $("#adult_fares").html(per_A+'×'+price_usd_a);
    $("#adult_taxes").html(per_A+'×'+taxes_usd_a);
    if (per_C>0) {
        $("#child_fares").html(per_C+'×'+price_usd_c);
        $("#child_fares").parent().show();
        $("#child_taxes").html(per_C+'×'+taxes_usd_c);
        $("#child_taxes").parent().show();
    }
    if (per_B>0) {
        $("#baby_fares").html(per_B+'×'+price_usd_b);
        $("#baby_fares").parent().show();
    }
    
    $("#service_fee").html('$'+serviceFee_usd);
    $("#bank_fee").html('$'+bankFee_usd);
    $("#total_usd").html('$'+total_usd);
    $("#total_price_usd").val(total_usd);
}
</script>