Показать сообщение отдельно
  #6 (permalink)  
Старый 04.01.2016, 01:08
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,112

вариант перевода на клиенте
sochi-russia,
на всякий случай ...
<!DOCTYPE HTML>

<html>

<head>
  <title>Untitled</title>
  <meta charset="utf-8">
  <style type="text/css">
  td  {
     outline: solid 1px #000000;
     background-image: -webkit-gradient(linear, top, bottom, color-stop(0, #E6E6E6), color-stop(1, #A9A9A9));
     background-image: -o-linear-gradient(top, #E6E6E6, #A9A9A9);
     background-image: -moz-linear-gradient(top, #E6E6E6, #A9A9A9);
     background-image: -webkit-linear-gradient(top, #E6E6E6, #A9A9A9);
     background-image: linear-gradient(to bottom, #E6E6E6, #A9A9A9)

  }

  </style>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
  <script>
     $(function(){
  var cities = {
    "success": true,
    "data": [{
        "show_to_affiliates": false,
        "trip_class": 0,
        "origin": "PEN",
        "destination": "KUL",
        "depart_date": "2016-04-11",
        "return_date": "2016-04-14",
        "number_of_changes": 0,
        "value": 983,
        "found_at": "2016-01-03T18:33:11+04:00",
        "distance": 286,
        "actual": true
    }, {
        "show_to_affiliates": false,
        "trip_class": 0,
        "origin": "UBP",
        "destination": "BKK",
        "depart_date": "2016-07-09",
        "return_date": "2016-07-11",
        "number_of_changes": 0,
        "value": 1178,
        "found_at": "2016-01-03T21:00:12+04:00",
        "distance": 502,
        "actual": true
    }, {
        "show_to_affiliates": false,
        "trip_class": 0,
        "origin": "KUL",
        "destination": "KBR",
        "depart_date": "2016-03-23",
        "return_date": "2016-03-31",
        "number_of_changes": 0,
        "value": 1295,
        "found_at": "2016-01-03T22:58:02+04:00",
        "distance": 343,
        "actual": true
    }, {
        "show_to_affiliates": false,
        "trip_class": 0,
        "origin": "KUL",
        "destination": "PEN",
        "depart_date": "2016-03-22",
        "return_date": "2016-03-27",
        "number_of_changes": 0,
        "value": 1492,
        "found_at": "2016-01-02T04:15:51+04:00",
        "distance": 286,
        "actual": true
    }, {
        "show_to_affiliates": false,
        "trip_class": 0,
        "origin": "BKK",
        "destination": "CNX",
        "depart_date": "2016-05-17",
        "return_date": "2016-05-17",
        "number_of_changes": 0,
        "value": 1555,
        "found_at": "2016-01-03T23:40:36+04:00",
        "distance": 583,
        "actual": true
    } ,{
        "show_to_affiliates": false,
        "trip_class": 0,
        "origin": "DUB",
        "destination": "LON",
        "depart_date": "2016-02-06",
        "return_date": "2016-02-08",
        "number_of_changes": 0,
        "value": 1591,
        "found_at": "2016-01-03T03:16:06+04:00",
        "distance": 477,
        "actual": true
    }, {
        "show_to_affiliates": false,
        "trip_class": 0,
        "origin": "BKK",
        "destination": "KBV",
        "depart_date": "2016-11-23",
        "return_date": "2016-11-28",
        "number_of_changes": 0,
        "value": 1625,
        "found_at": "2016-01-02T23:07:24+04:00",
        "distance": 646,
        "actual": true
    },  {
        "show_to_affiliates": false,
        "trip_class": 0,
        "origin": "CGN",
        "destination": "BER",
        "depart_date": "2016-01-20",
        "return_date": "2016-01-22",
        "number_of_changes": 0,
        "value": 1677,
        "found_at": "2016-01-03T22:00:07+04:00",
        "distance": 477,
        "actual": true
    }, {
        "show_to_affiliates": false,
        "trip_class": 0,
        "origin": "CGN",
        "destination": "LON",
        "depart_date": "2016-02-10",
        "return_date": "2016-02-11",
        "number_of_changes": 0,
        "value": 1678,
        "found_at": "2016-01-02T04:03:01+04:00",
        "distance": 484,
        "actual": true
    }, {
        "show_to_affiliates": false,
        "trip_class": 0,
        "origin": "KUL",
        "destination": "LGK",
        "depart_date": "2016-03-01",
        "return_date": "2016-03-08",
        "number_of_changes": 0,
        "value": 1684,
        "found_at": "2016-01-03T21:55:01+04:00",
        "distance": 417,
        "actual": true
    }, {
        "show_to_affiliates": false,
        "trip_class": 0,
        "origin": "BRU",
        "destination": "CPH",
        "depart_date": "2016-02-04",
        "return_date": "2016-02-09",
        "number_of_changes": 0,
        "value": 1750,
        "found_at": "2016-01-02T21:00:58+04:00",
        "distance": 767,
        "actual": true
    }, {
        "show_to_affiliates": false,
        "trip_class": 0,
        "origin": "BUH",
        "destination": "MIL",
        "depart_date": "2016-02-02",
        "return_date": "2016-02-09",
        "number_of_changes": 0,
        "value": 1750,
        "found_at": "2016-01-03T01:14:21+04:00",
        "distance": 1333,
        "actual": true
    }, {
        "show_to_affiliates": false,
        "trip_class": 0,
        "origin": "ATH",
        "destination": "RHO",
        "depart_date": "2016-02-08",
        "return_date": "2016-02-15",
        "number_of_changes": 0,
        "value": 1823,
        "found_at": "2016-01-03T05:29:12+04:00",
        "distance": 404,
        "actual": true
    }, {
        "show_to_affiliates": false,
        "trip_class": 0,
        "origin": "BRU",
        "destination": "BUD",
        "depart_date": "2016-02-16",
        "return_date": "2016-03-16",
        "number_of_changes": 0,
        "value": 1823,
        "found_at": "2016-01-03T07:00:43+04:00",
        "distance": 1129,
        "actual": true
    }]
};

var rep = { 'value':'цена',
           'airline':'авиакомпания',
           'origin':'город вылета',
           'destination':'город прилета',
           'number_of_changes':'кол-во пересадок',
           'flight_number':'номер рейса',
           'depart_date':'дата вылета',
           'return_date':'дата возвращения',
           'distance': 'расстояние',
           'found_at' : 'Срок истечения актуальности цены'
           };
var mytable = $("<table/>");
$.each(cities.data, function(i, myData) {
    var item = Object.keys(myData).filter(function(el) {
        return rep[el]
    });
    $(mytable).append($.map(item, function(key) {
        return $("<tr/>").append(
        $("<td/>", {text: rep[key] || key}),
        $("<td/>", {text: myData[key]}))
    }))
});
$("body").append(mytable);
});



  </script>
</head>

<body>


</body>

</html>

Последний раз редактировалось рони, 04.01.2016 в 01:36.
Ответить с цитированием