Диплом: Автоматизация продажи авиабилетов в ООО «Avia Traffic Company»

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
87
Приложение 2
XML запрос/ответ get_schedule
Запрос:
<?xml version="1.0" encoding="UTF-8"?> <sirena>
<query>
<get_schedule>
<company>ТФ</company>
<date>20.05.20</date>
<date2>20.01.21</date2>
</get_schedule>
</query>
</sirena>
Ответ:
<?xml version="1.0" encoding="UTF-8"?>
<sirena>
<answer pult="АВТК58" msgid="19534949" time="07:52:01 20.05.2020" instance="ГРУ">
<get_schedule>
<flight company="ТФ" num="179">
<period date_start="110220" date_end="241020" freq="1234567" tts="733" classes="Э">
<segment index="0">
<city>БИШ</city>
<dep_time>1700</dep_time>
<dep_offset>0</dep_offset>
<reg_type>В ПОРТУ</reg_type>
</segment>
<segment index="1">
<city>ОШШ</city>
<arr_time>1740</arr_time>
<arr_offset>0</arr_offset>
<reg_type>?</reg_type>
</segment>
</period>
88
<flight company="ТФ" num="180">
<period date_start="100220" date_end="241020" freq="1234567" tts="733" classes="Э">
<segment index="0">
<city>ОШШ</city>
<dep_time>1840</dep_time>
<dep_offset>0</dep_offset>
<reg_type>В ПОРТУ</reg_type>
</segment>
<segment index="1">
<city>БИШ</city>
<arr_time>1920</arr_time>
<arr_offset>0</arr_offset>
<reg_type>?</reg_type>
</segment>
</period>
</flight>
<flight company="ТФ" num="883">
<period date_start="110220" date_end="241020" freq="1234567" tts="733" classes="Э">
<segment index="0">
<city>БИШ</city>
<dep_time>0805</dep_time>
<dep_offset>0</dep_offset>
<reg_type>В ПОРТУ</reg_type>
</segment>
<segment index="1">
<city>МОВ</city>
<port>ДМД</port>
<arr_time>0925</arr_time>
<arr_offset>0</arr_offset>
<reg_type>?</reg_type>
</segment>
89
</period>
</flight>
<flight company="ТФ" num="884">
<period date_start="110220" date_end="241020" freq="1234567" tts="733" classes="Э">
<segment index="0">
<city>МОВ</city>
<port>ДМД</port>
<dep_time>1055</dep_time>
<dep_offset>0</dep_offset>
<reg_type>В ПОРТУ</reg_type>
</segment>
<segment index="1">
<city>БИШ</city>
<arr_time>1755</arr_time>
<arr_offset>0</arr_offset>
<reg_type>?</reg_type>
</segment>
</period>
</flight>
</get_schedule>
</answer>
</sirena>
90
Приложение 3
Маршрут-квитанция
91
Приложение 4
Листинг модуля поиска вариантов перевозки
<?php namespace MihailBishkek\Cousteau\Components;
use Cms\Classes\ComponentBase;
use MihailBishkek\Cousteau\Models\Towns;
use Carbon\Carbon;
use MihailBishkek\Cousteau\Models\Schedule;
use MihailBishkek\Cousteau\Models\Orders;
use MihailBishkek\Cousteau\Models\Paxs;
use MihailBishkek\Cousteau\Models\Notes;
use MihailBishkek\Cousteau\Models\MetaSearch;
use Redirect;
use Response;
use Validator;
use ValidationException;
use Flash;
use Mail;
use MihailBishkek\Cousteau\Models\Settings;
use Request;
use Input;
//use October\Rain\Support\Collection;
//use Illuminate\Database\Eloquent\Collection;
class FindFlight extends ComponentBase
{
use \MihailBishkek\Cousteau\Traits\Sirena;
use \MihailBishkek\Cousteau\Traits\Platron;
use \MihailBishkek\Cousteau\Traits\Search;
public $towns; // Список всех городов, что есть в client_id'шках...
public $findme; // массив с данными для поиска авиарейсов
public $order; // Массив с заказом
public $notes; // Оповещалки в заказе
public function componentDetails()
{
return [
'name' => 'FindFlight компонент',
'description' => 'Главный компонент плагина. Устанавливается на страницы
поиска, продажи, и заказов.'
];
}
public function defineProperties()
{
return [
'button_go_class' => [
'title' => 'CSS класс кнопки поиска',
'description' => 'Введите уникальный класс для кнопки поиска
GO!',
'default' => 'btn-primary',
'type' => 'string'
]
];
92
}
public function onRun()
{
$this->addCss('assets/css/style.css');
if ($this->page->id == 'finder-findflight' or $this->page->id == 'finder-
search')
{
$this->addJs('assets/js/search.js');
$this->addJs('assets/js/search_findflight.js');
//$this->addJs('assets/js/datepicker.min.js');
$this->addJs('assets/js/maskedinput.min.js');
//$this->addCss('assets/css/datepicker.min.css');
$this->addJs('assets/js/moment.min.js');
$this->addJs('assets/js/bootstrap-datetimepicker.min.js');
$this->addCss('assets/css/bootstrap-datetimepicker.min.css');
$this->addJs('assets/js/findflight.js');
$this->addJs('assets/js/litranslit.js');
// Добавляем рекапчу от гугла версии 3, для автоматического определения
ботов.
$this-
>addJs('https://www.google.com/recaptcha/api.js?render=6LeUisYUAAAAAJk-
Po9nI5wuKMOZn4Bzq-f7QwEo');
$this->addJs('assets/js/recaptcha.js?ver=1');
// получаем список всех активных городов
$this->towns = Towns::where('is_active','1')->whereNull('parent_id')-
>orderBy('town_name_ru', 'asc')->get();
if (Input::has('search_engine')){
$meta_code = Input::get('search_engine');
$meta_marker = 'none';
if (Input::has('meta_marker')) {
$meta_marker = Input::get('meta_marker');
}
\Cookie::queue('search_engine', $meta_code.':'.$meta_marker, 43200); //
ставим куку на 30 дней.
}
} else if ($this->page->id == 'finder-order')
{
$this->addJs('assets/js/order.js');
if (mb_strlen($this->param('pnr')) != 6) { return Response::make($this-
>controller->run('404')->getContent(), 404); }
// Проводим транслитерацию
$translit_pnr = array(
'W' => 'Ш',
'R' => 'Р',
'T' => 'Т',
'P' => 'П',
'S' => 'С',
'D' => 'Д',
93
'F' => 'Ф',
'G' => 'Г',
'K' => 'К',
'L' => 'Л',
'Z' => 'Ж',
'X' => 'Х',
'C' => 'Ц',
'V' => 'В',
'B' => 'Б',
'N' => 'Н',
'M' => 'М',
);
$find_pnr = strtr(mb_strtoupper($this->param('pnr')), $translit_pnr);
$order = Orders::where('pnr', $find_pnr)->first();
//$order->prices = simplexml_load_string($order->prices);
$this->notes = Notes::where('where', 'order_top')->where('is_active', 1)-
>get();
if (!$order) {
//return Response::make($this->controller->run('404')->getContent(),
404);
$this->order = 'none';
} else {
$this->order = $order;
}
} else {
//$this->addJs('assets/js/datepicker.min.js');
$this->addJs('assets/js/maskedinput.min.js');
//$this->addCss('assets/css/datepicker.min.css');
$this->addJs('assets/js/moment.min.js');
$this->addJs('assets/js/bootstrap-datetimepicker.min.js');
$this->addCss('assets/css/bootstrap-datetimepicker.min.css');
// получаем список всех активных городов
$this->towns = Towns::where('is_active','1')->whereNull('parent_id')-
>orderBy('town_name_ru', 'asc')->get();
}
// до этого if надо добавить обработку и проверку URL с возвратом 404 ошибки.
if ($this->param('findme'))
{
$town_from_code = mb_substr($this->param('findme'), 0, 3);
$town_to_code = mb_substr($this->param('findme'), 9, 3);
$town_from_code_bd = Towns::where('town_code_en', $town_from_code)-
>first();
if ($town_from_code_bd){
$this->findme[0] = $town_from_code_bd->town_code_ru;
} else {
$this->findme[0] = $town_from_code;
}
94
$town_to_code_bd = Towns::where('town_code_en', $town_to_code)->first();
if ($town_to_code_bd){
$this->findme[1] = $town_to_code_bd->town_code_ru;
} else {
$this->findme[1] = $town_to_code;
}
$this->findme[2] = mb_substr($this->param('findme'), 3,
2).'.'.mb_substr($this->param('findme'), 5, 2).'.20'.mb_substr($this->param('findme'),
7, 2);
if (mb_substr($this->param('findme'), 12, 4) == "BACK")
{
$this->findme[3] = mb_substr($this->param('findme'), 16,
2).'.'.mb_substr($this->param('findme'), 18, 2).'.20'.mb_substr($this->param('findme'),
20, 2);
$this->findme[4] = mb_substr($this->param('findme'), 22, 1);
$this->findme[5] = mb_substr($this->param('findme'), 23, 1);
$this->findme[6] = mb_substr($this->param('findme'), 24, 1);
$this->findme[7] = mb_substr($this->param('findme'), 25, 1);
$this->findme[8] = mb_substr($this->param('findme'), 26, 1);
} else {
$this->findme[4] = mb_substr($this->param('findme'), 12, 1);
$this->findme[5] = mb_substr($this->param('findme'), 13, 1);
$this->findme[6] = mb_substr($this->param('findme'), 14, 1);
$this->findme[7] = mb_substr($this->param('findme'), 15, 1);
$this->findme[8] = mb_substr($this->param('findme'), 16, 1);
}
}
}
public function onWhatLimit()
{
$order = Orders::find(post('order_id'));
$timetoend = strtotime(post('limit')) - strtotime(Carbon::now());
return [
'timetoend' => $timetoend,
'html' => 'Итого по заказу:<br><span class="price-total">'.$order-
>total.'</span> '.$order->currency.'<br><div id="error_on_pay_system"></div><button
data-request="onGetPlatron" data-request-data="pg_amount: \''.$order->total.'\',
pg_order_id: \''.$order->pnr.'\', pg_user_phone: \''.$order->customer_tel.'\',
my_order_id: \''. $order->id .'\'" class="btn btn-success btn-
lg">ОПЛАТИТЬ<br>банковской картой</button>',
];
}
public function onLetMeKnowWhatLimit()
{
$order = Orders::find(post('order_id'));
if ( is_null($order->utc_timelimit)) { return ['havelimit' => 'no' ]; } else {
return ['havelimit' => 'yes' ]; }
}
public function onMakeFindMe()
{
if (mb_substr($this->param('findme'), 12, 4) == 'BACK')
{
$back = 1;
$date2 = mb_substr($this->param('findme'), 16, 2).'.'.mb_substr($this-
95
>param('findme'), 18, 2).'.'.mb_substr($this->param('findme'), 20, 2);
$class = mb_substr($this->param('findme'), 22, 1);
$aaa = mb_substr($this->param('findme'), 23, 1);
$chd = mb_substr($this->param('findme'), 24, 1);
$infx = mb_substr($this->param('findme'), 25, 1);
$inf = mb_substr($this->param('findme'), 26, 1);
} else {
$back = 0;
$date2 = '';
$class = mb_substr($this->param('findme'), 12, 1);
$aaa = mb_substr($this->param('findme'), 13, 1);
$chd = mb_substr($this->param('findme'), 14, 1);
$infx = mb_substr($this->param('findme'), 15, 1);
$inf = mb_substr($this->param('findme'), 16, 1);
}
$datas = ['departure'=>mb_substr($this->param('findme'), 0, 3), 'arrival' =>
mb_substr($this->param('findme'), 9, 3), 'date' => mb_substr($this->param('findme'), 3,
2).'.'.mb_substr($this->param('findme'), 5, 2).'.'.mb_substr($this->param('findme'), 7,
2), 'company' => $this->property('avk_code'), 'back' => $back, 'date2' => $date2,
'class' => $class, 'aaa' => $aaa, 'chd' => $chd, 'infx' => $infx, 'inf' => $inf ];
$answer = $this->getAnswer('pricing', $datas);
$xml = simplexml_load_string($answer);
//trace_log($xml);
$notes = Notes::where('where', 'finder_variants')->where('is_active', 1)-
>get();
return ['#findme' => $this->renderPartial($this.'::list_pricing',['xml'=>$xml,
'user' => \Auth::getUser(), 'notes' => $notes ]) ];
}
public function onListPassengers()
{
//$search_engine = post('search_engine');
$from = post('from'); //mb_substr($this->param('findme'), 0, 3);
$to = post('to');//mb_substr($this->param('findme'), 9, 3);
$company = post('company');
$flight = post('flight');
$class = post('class');
$date = Carbon::createFromDate('20'.mb_substr(post('deptdate1'),6,2),
mb_substr(post('deptdate1'),3,2), mb_substr(post('deptdate1'),0,2))-
>addDays(post('delay1'))->format('d.m.y');
$datedept = Carbon::create('20'.mb_substr(post('deptdate1'),6,2),
mb_substr(post('deptdate1'),3,2), mb_substr(post('deptdate1'),0,2),
mb_substr(post('depttime1'),0,2), mb_substr(post('depttime1'),3,2))-
>addDays(post('delay1'))->toDateTimeString();
$datearrv = Carbon::create('20'.mb_substr(post('arrvdate1'),6,2),
mb_substr(post('arrvdate1'),3,2), mb_substr(post('arrvdate1'),0,2),
mb_substr(post('arrvtime1'),0,2), mb_substr(post('arrvtime1'),3,2))-
>addDays(post('delay1'))->toDateTimeString();
if (($from == 'БИШ' and $to == 'ОШШ') or ($from == 'ОШШ' and $to == 'БИШ') or
($from == 'БИШ' and $to == 'ДЖБ') or ($from == 'ДЖБ' and $to == 'БИШ'))
{
$inside = true;
} else {
$inside = false;
96
}
if ($inside == true){ $infyear = 5; } else { $infyear = 2; }
if (mb_substr($this->param('findme'), 12, 4) == 'BACK')
{
$back = 1;
$aaa = mb_substr($this->param('findme'), 23, 1);
$chd = mb_substr($this->param('findme'), 24, 1);
$infx = mb_substr($this->param('findme'), 25, 1);
$inf = mb_substr($this->param('findme'), 26, 1);
$flight_back = post('flight2');
$class_back = post('class2');
$date2 = Carbon::createFromDate('20'.mb_substr(post('deptdate2'),6,2),
mb_substr(post('deptdate2'),3,2), mb_substr(post('deptdate2'),0,2))-
>addDays(post('delay2'))->format('d.m.y');
$datedept_back = Carbon::create('20'.mb_substr(post('deptdate2'),6,2),
mb_substr(post('deptdate2'),3,2), mb_substr(post('deptdate2'),0,2),
mb_substr(post('depttime2'),0,2), mb_substr(post('depttime2'),3,2))-
>addDays(post('delay2'))->toDateTimeString();
$datearrv_back = Carbon::create('20'.mb_substr(post('arrvdate2'),6,2),
mb_substr(post('arrvdate2'),3,2), mb_substr(post('arrvdate2'),0,2),
mb_substr(post('arrvtime2'),0,2), mb_substr(post('arrvtime2'),3,2))-
>addDays(post('delay2'))->toDateTimeString();
$dateaaamax = Carbon::createFromDate('20'.mb_substr(post('deptdate2'),6,2),
mb_substr(post('deptdate2'),3,2), mb_substr(post('deptdate2'),0,2))-
>addDays(post('delay2'))->subYears(18)->format('m/d/Y');
$datechdmax = Carbon::createFromDate('20'.mb_substr(post('deptdate2'),6,2),
mb_substr(post('deptdate2'),3,2), mb_substr(post('deptdate2'),0,2))-
>addDays(post('delay2'))->subYears($infyear)->format('m/d/Y');
$datechdmin = Carbon::createFromDate('20'.mb_substr(post('deptdate2'),6,2),
mb_substr(post('deptdate2'),3,2), mb_substr(post('deptdate2'),0,2))-
>addDays(post('delay2'))->subYears(12)->format('m/d/Y');
$dateinfmin = Carbon::createFromDate('20'.mb_substr(post('deptdate2'),6,2),
mb_substr(post('deptdate2'),3,2), mb_substr(post('deptdate2'),0,2))-
>addDays(post('delay2'))->subYears($infyear)->format('m/d/Y');
$dateaaadop = Carbon::createFromDate('20'.mb_substr(post('deptdate2'),6,2),
mb_substr(post('deptdate2'),3,2), mb_substr(post('deptdate2'),0,2))-
>addDays(post('delay2'))->subYears(8)->format('m/d/Y');
} else {
$back = 0;
$aaa = mb_substr($this->param('findme'), 13, 1);
$chd = mb_substr($this->param('findme'), 14, 1);
$infx = mb_substr($this->param('findme'), 15, 1);
$inf = mb_substr($this->param('findme'), 16, 1);
$dateaaamax = Carbon::createFromDate('20'.mb_substr(post('deptdate1'),6,2),
mb_substr(post('deptdate1'),3,2), mb_substr(post('deptdate1'),0,2))-
>addDays(post('delay1'))->subYears(18)->format('m/d/Y');
$datechdmax = Carbon::createFromDate('20'.mb_substr(post('deptdate1'),6,2),
mb_substr(post('deptdate1'),3,2), mb_substr(post('deptdate1'),0,2))-
>addDays(post('delay1'))->subYears($infyear)->format('m/d/Y');
$datechdmin = Carbon::createFromDate('20'.mb_substr(post('deptdate1'),6,2),
mb_substr(post('deptdate1'),3,2), mb_substr(post('deptdate1'),0,2))-
>addDays(post('delay1'))->subYears(12)->format('m/d/Y');
$dateinfmin = Carbon::createFromDate('20'.mb_substr(post('deptdate1'),6,2),
mb_substr(post('deptdate1'),3,2), mb_substr(post('deptdate1'),0,2))-
>addDays(post('delay1'))->subYears($infyear)->format('m/d/Y');
$dateaaadop = Carbon::createFromDate('20'.mb_substr(post('deptdate1'),6,2),

Смотрите также:

"Автоматизация обработки заявок ООО "Проектно-Строительная Компания"
"Автоматизация процесса аттестации персонала для ООО "Нэт Бай Нэт Холдинг"
"Анализ интернет-активности конкурентов ( на примере конкурентов "Газпром нефть")
"Бухгалтерский учёт и аудит расчётов с подотчётними лицами в организации на примере ООО "ЛОЦ 10""
«Психологическое сопровождение персонала в организации на примере ООО «Крокус»
Cовершенствование деловой оценки персонала в организации (на примере ООО "Даймонд кейтеринг развитие")
IPO - инструмент финансирования деятельности организации. На примере ПАО «Нефтяная компания «Лукойл»
PR как средство продвижения организации (на примере ПАО "Тамбовский завод "Комсомолец им. Н.С. Артемова")
PR-коммуникации в сфере общественного питания (на примере кафе-кондитерской «Cream Cheese»)
SMM как средство повышения эффективности работы учреждений социокультурной сферы (на примере Малого театра)