diff --git a/.top.menu.php b/.top.menu.php index 5e1faab..9cdd0ae 100644 --- a/.top.menu.php +++ b/.top.menu.php @@ -1,39 +1,46 @@ \ No newline at end of file diff --git a/about/career/index.php b/about/career/index.php index d231a92..4e7878e 100644 --- a/about/career/index.php +++ b/about/career/index.php @@ -1,6 +1,16 @@ SetTitle("Эволюция автолизинга: Карьера"); +$APPLICATION->AddHeadString(''); +?> +IncludeComponent("bitrix:breadcrumb", "evolution", Array( + "PATH" => "", // Путь, для которого будет построена навигационная цепочка (по умолчанию, текущий путь) + "SITE_ID" => "s1", // Cайт (устанавливается в случае многосайтовой версии, когда DOCUMENT_ROOT у сайтов разный) + "START_FROM" => "0", // Номер пункта, начиная с которого будет построена навигационная цепочка + ), + false + ); ?> IncludeComponent( diff --git a/about/contacts/index.php b/about/contacts/index.php index 8bd8587..6a3eeba 100644 --- a/about/contacts/index.php +++ b/about/contacts/index.php @@ -2,6 +2,15 @@ require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php"); $APPLICATION->SetTitle("Эволюция автолизинга: Контакты"); ?> +IncludeComponent("bitrix:breadcrumb", "evolution", Array( + "PATH" => "", // Путь, для которого будет построена навигационная цепочка (по умолчанию, текущий путь) + "SITE_ID" => "s1", // Cайт (устанавливается в случае многосайтовой версии, когда DOCUMENT_ROOT у сайтов разный) + "START_FROM" => "0", // Номер пункта, начиная с которого будет построена навигационная цепочка + ), + false + ); +?> IncludeComponent( "evolution:about.contacts.list", diff --git a/about/index.php b/about/index.php index f2a5b3c..9c92da2 100644 --- a/about/index.php +++ b/about/index.php @@ -3,6 +3,16 @@ require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php"); $APPLICATION->SetPageProperty("keywords", "Эволюция Автолизинга, о компании Эволюция Автолизинга, история развития Эволюция Автолизинга, достижения компании Эволюция Автолизинга"); $APPLICATION->SetPageProperty("description", "Эволюция – самая динамично развивающаяся автолизинговая компания России. Благодаря огромному опыту в лизинге и лучшим практикам на рынке, за год работы вошли в Топ 10 лизинговых компаний."); $APPLICATION->SetTitle("Эволюция Автолизинга: история развития и достижения компании"); +$APPLICATION->AddHeadString(''); +?> +IncludeComponent("bitrix:breadcrumb", "evolution", Array( + "PATH" => "", // Путь, для которого будет построена навигационная цепочка (по умолчанию, текущий путь) + "SITE_ID" => "s1", // Cайт (устанавливается в случае многосайтовой версии, когда DOCUMENT_ROOT у сайтов разный) + "START_FROM" => "0", // Номер пункта, начиная с которого будет построена навигационная цепочка + ), + false + ); ?>
diff --git a/about/news/index.php b/about/news/index.php index 74c5b79..8cd3b5a 100644 --- a/about/news/index.php +++ b/about/news/index.php @@ -1,6 +1,16 @@ SetTitle("Эволюция автолизинга: Новости"); +$APPLICATION->AddHeadString(''); +?> +IncludeComponent("bitrix:breadcrumb", "evolution", Array( + "PATH" => "", // Путь, для которого будет построена навигационная цепочка (по умолчанию, текущий путь) + "SITE_ID" => "s1", // Cайт (устанавливается в случае многосайтовой версии, когда DOCUMENT_ROOT у сайтов разный) + "START_FROM" => "0", // Номер пункта, начиная с которого будет построена навигационная цепочка + ), + false + ); ?> IncludeComponent( diff --git a/about/requisites/index.php b/about/requisites/index.php index 631e4e2..f6eb6ea 100644 --- a/about/requisites/index.php +++ b/about/requisites/index.php @@ -1,7 +1,17 @@ SetTitle("Эволюция автолизинга: Реквизиты"); -?>
+?> +IncludeComponent("bitrix:breadcrumb", "evolution", Array( + "PATH" => "", // Путь, для которого будет построена навигационная цепочка (по умолчанию, текущий путь) + "SITE_ID" => "s1", // Cайт (устанавливается в случае многосайтовой версии, когда DOCUMENT_ROOT у сайтов разный) + "START_FROM" => "0", // Номер пункта, начиная с которого будет построена навигационная цепочка + ), + false + ); +?> +

Реквизиты

diff --git a/about/revocation/index.php b/about/revocation/index.php index 5b4388c..8942539 100644 --- a/about/revocation/index.php +++ b/about/revocation/index.php @@ -2,6 +2,15 @@ require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php"); $APPLICATION->SetTitle("Эволюция автолизинга: Отзыв доверенностей"); ?> +IncludeComponent("bitrix:breadcrumb", "evolution", Array( + "PATH" => "", // Путь, для которого будет построена навигационная цепочка (по умолчанию, текущий путь) + "SITE_ID" => "s1", // Cайт (устанавливается в случае многосайтовой версии, когда DOCUMENT_ROOT у сайтов разный) + "START_FROM" => "0", // Номер пункта, начиная с которого будет построена навигационная цепочка + ), + false + ); +?>

Отзыв доверенностей

diff --git a/about/rules/index.php b/about/rules/index.php index a949927..f91ff2d 100644 --- a/about/rules/index.php +++ b/about/rules/index.php @@ -2,6 +2,15 @@ require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php"); $APPLICATION->SetTitle("Эволюция автолизинга: Общие условия договора лизинга"); ?> +IncludeComponent("bitrix:breadcrumb", "evolution", Array( + "PATH" => "/about/rules/", // Путь, для которого будет построена навигационная цепочка (по умолчанию, текущий путь) + "SITE_ID" => "s1", // Cайт (устанавливается в случае многосайтовой версии, когда DOCUMENT_ROOT у сайтов разный) + "START_FROM" => "0", // Номер пункта, начиная с которого будет построена навигационная цепочка + ), + false + ); +?> IncludeComponent( "evolution:about.rules", diff --git a/api/index.php b/api/index.php index a4e1158..aaea660 100644 --- a/api/index.php +++ b/api/index.php @@ -1,5 +1,4 @@ [ "verify_peer" => false, @@ -68,12 +59,7 @@ $arrContextOptions = [ $secret = "YnFN1EcbB4osQyKx53OoMs0seHcIcoUVv2mCQOleHdn9o07bIniM5TreQNvQtgsQo6zWxsxLNFbSBrywjmerU5VnKZVQD1EGVcO"; $secret_crm = "lk_evolution_the_best_leasing_company_of_the_world_sSOvumhogyAtZydpaITb"; -//$token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImNybSJ9.WxzNiB4W5kwqZoy6-kenc1X6Q7XDCVjGraux9rU9zro"; -//print \Bitrix\Main\Web\JWT::encode(["username" => "crm"], $secret, 'HS256', $keyId = null, $head = null); -//die(); - $auth = []; -//$token = ""; use Bitrix\Main\Context, Bitrix\Main\Type\DateTime, @@ -178,9 +164,6 @@ function getUsersForCompany($code) $company_record['PROPERTIES'] = $company_element->GetProperties(); $user = []; - //print_r($company_record); - //die(); - foreach($company_record['PROPERTIES']['USERS']['VALUE'] AS $user_id) { $user_res = \CUser::GetList(["ID" => "ASC"], false, [ "ID" => $user_id ], []); @@ -194,21 +177,6 @@ function getUsersForCompany($code) "companies" => $companies, "is_admin" => in_array($user_element['ID'], $company_record['PROPERTIES']['ADMINS']['VALUE']), ]; - ///print_r($user_element); - //$rs_user = \CUser::GetByLogin($user_element['LOGIN']); - //$ar_user = $rs_user->Fetch(); - - //array_push($existed_accounts, $existed_user['XML_ID']); - - /* - foreach($company_record['PROPERTIES']['ADMINS']['VALUE'] AS $k => $v) - { - if($v == $user_id) - { - $company['is_admin'] = true; - } - } - */ array_push($users, $user); } @@ -302,11 +270,6 @@ if($_SERVER['REMOTE_USER'] && strpos($_SERVER['REMOTE_USER'], "Bearer") > -1) try { $auth = (array) \Bitrix\Main\Web\JWT::decode($token, $secret, ["HS256"]); - //print json_encode([ - // "status" => "success", - // "token" => $auth['username'], - //]); - //die(); } catch(\Exception $e) { @@ -423,6 +386,55 @@ switch($PARAM_1) ) ]); + $user_properties = [ + 'COMPANY' => $REQ['org_title'], + 'INN' => (string)$REQ['inn'], + 'KPP' => (string)$REQ['kpp'], + 'OGRN' => (string)$REQ['ogrn'], + 'ADMINS' => [ $ID ], + 'USERS' => [ $ID ], + ]; + + $ar_new_client = [ + 'IBLOCK_ID' => IBLOCK_ID_CLIENTS, + 'NAME' => $REQ['org_title'], + 'CODE' => $REQ['crm_id'], + 'PROPERTY_VALUES' => $user_properties, + 'ACTIVE' => 'Y', // активен + ]; + + $new_client = new CIBlockElement; + if($new_client_id = $new_client->Add($ar_new_client)) + { + } + else + { + $existed_client_res = CIBlockElement::GetList([ 'id' => 'desc' ], [ 'IBLOCK_ID' => IBLOCK_ID_CLIENTS, 'CODE' => $REQ['crm_id'] ], false, []); + while ($existed_client_element = $existed_client_res->GetNextElement()) + { + $existed_client_record = $existed_client_element->GetFields(); + $existed_client_record['PROPERTIES'] = $existed_client_element->GetProperties(); + + $admins = $existed_client_record['PROPERTIES']['ADMINS']['VALUE']; + $users = $existed_client_record['PROPERTIES']['USERS']['VALUE']; + + array_push($admins, $ID); + array_push($users, $ID); + + $admins = array_unique($admins); + $users = array_unique($users); + + $updated_fields = [ + 'PROPERTY_VALUES' => [ + 'ADMINS' => $admins, + 'USERS' => $users, + ] + ]; + + CIBlockElement::SetPropertyValuesEx($existed_client_record['ID'], IBLOCK_ID_CLIENTS, [ 'ADMINS' => $admins, 'USERS' => $users, ]); + } + } + print json_encode([ "status" => "success" ]); @@ -563,15 +575,6 @@ switch($PARAM_1) ) ]); - //"PASSWORD" => $REQ['password'], - //"CONFIRM_PASSWORD" => $REQ['password'], - - //print json_encode([ - // "status" => "error", - // "error" => "company_already_registered", - // "message" => "Company already registered", - //]); - print json_encode([ "status" => "success" ]); @@ -581,7 +584,6 @@ switch($PARAM_1) else { //new company - //setCompanyForUser($user_registered_id, $REQ); print json_encode([ "status" => "error", @@ -599,7 +601,6 @@ switch($PARAM_1) if($company_registered_id !== null) { //existed company - //THIS! $profile["PASSWORD"] = $REQ['password']; $profile["CONFIRM_PASSWORD"] = $REQ['password']; @@ -653,37 +654,6 @@ switch($PARAM_1) die(); } } - -/* ******************************* - \Bitrix\Main\Mail\Event::send([ - "EVENT_NAME" => "USER_INFO", - "LID" => "s1", - "C_FIELDS" => Array( - "EMAIL" => $REQ['email'], - "ORG_NAME" => (string)$REQ['org_title'], - "LOGIN" => $REQ['email'], - "PASS" => $REQ['password'], - ) - ]); - - if($user->LAST_ERROR) - { - print json_encode([ - "status" => "error", - "error" => "wrong_payload", - "message" => $user->LAST_ERROR, - ]); - } - else - { - print json_encode([ - "status" => "success" - ]); - } - - die(); -******************************* */ - } break; @@ -792,6 +762,110 @@ switch($PARAM_1) } break; + case "check": + { + if(CModule::IncludeModule('iblock')) + { + if(checkRequestIsLocal()) + { + try + { + $user_registered = false; + $ar_user; + + $existed_accounts = []; + $auth = (array) \Bitrix\Main\Web\JWT::decode($REQ['token'], $secret_crm, ["HS256"]); + + $default_admin_id; + + $existed_client_as_admin_res = CIBlockElement::GetList([ 'ID' => 'ASC' ], [ 'IBLOCK_ID' => IBLOCK_ID_CLIENTS, 'CODE' => $auth['acc_number'] ], false, []); + while ($existed_client_as_admin_element = $existed_client_as_admin_res->GetNextElement()) + { + $existed_client_as_admin_record = $existed_client_as_admin_element->GetFields(); + $existed_client_as_admin_record['PROPERTIES'] = $existed_client_as_admin_element->GetProperties(); + $default_admin_id = $existed_client_as_admin_record['PROPERTIES']['ADMINS']['VALUE'][0]; + $user_registered = true; + } + + $existed_users_res = \CUser::GetList(["ID" => "ASC"], false, [ "ID" => $default_admin_id ], []); + while($existed_user = $existed_users_res->Fetch()) + { + $rs_user = \CUser::GetByLogin($existed_user['LOGIN']); + $ar_user = $rs_user->Fetch(); + + array_push($existed_accounts, $existed_user['XML_ID']); + } + + if(isset($REQ['filter'])) + { + if(!in_array($auth['acc_number'], $existed_accounts)) + { + print json_encode([ + "status" => "error", + "error" => "access_denied", + ]); + die(); + } + } + + if($user_registered) + { + $user_data = [ + "email" => $ar_user['LOGIN'], + "name" => $ar_user['NAME'], + "secondname" => $ar_user['SECOND_NAME'], + "lastname" => $ar_user['LAST_NAME'], + "phone" => $ar_user['UF_PHONE_NUMBER'], + "phone_verified" => $ar_user['UF_PHONE_VERIFIED'], + ]; + + $companies = getCompaniesForUser($ar_user['ID']); + $company_data = [ + "inn" => $companies[0]['inn'], + "kpp" => $companies[0]['kpp'], + "ogrn" => $companies[0]['ogrn'], + "title" => $companies[0]['title'], + ]; + + print json_encode([ + "status" => "success", + "user" => $user_data, + "company" => $company_data, + "companies" => $companies, + "token" => \Bitrix\Main\Web\JWT::encode([ "acc_number" => $auth['acc_number'], "is_admin" => $companies[0]['is_admin'], "login" => $ar_user['LOGIN'], "companies" => $companies ], $secret, 'HS256', null, null), + ]); + } + else + { + print json_encode([ + "status" => "error", + "error" => "unknown account", + ]); + } + die(); + } + catch(\Exception $e) + { + print json_encode([ + "status" => "error", + "error" => "wrong_jwt", + "message" => $e->getMessage(), + ]); + die(); + } + } + else + { + print json_encode([ + "status" => "error", + "error" => "wrong_source", + "error" => "Wrong source", + ]); + } + } + } + break; + default: { print json_encode([ @@ -1027,9 +1101,6 @@ switch($PARAM_1) if(count($user_companies) === 0) { \CUser::Delete($removed_user_id); - - //$user = new CUser; - //$user->Update($removed_user_id, [ "BLOCKED" => "Y" ]); } } @@ -1107,28 +1178,58 @@ switch($PARAM_1) $drive = []; $body = []; $fuel = []; + $volume = []; - $iterator = CIBlockElement::GetPropertyValues( 1, $filter, true, [ 'ID' => [ 7, 8, 9, 12 ] ] ); + $filter_props_ids = []; + + if(empty($REQ['GEAR'])) { array_push($filter_props_ids, 7); } + if(empty($REQ['DRIVE'])) { array_push($filter_props_ids, 8); } + if(empty($REQ['BODY'])) { array_push($filter_props_ids, 9); } + if(empty($REQ['ENGINE_FUEL'])) { array_push($filter_props_ids, 12); } + if(empty($REQ['ENGINE_VOLUME_FROM']) && empty($REQ['ENGINE_VOLUME_TO'])) { array_push($filter_props_ids, 11); } + + $iterator = CIBlockElement::GetPropertyValues( 1, $filter, true, [ 'ID' => [ 7, 8, 9, 11, 12 ] ] ); while ($row = $iterator->Fetch()) { - //print_r($row); - array_push($gear, $row[7]); - array_push($drive, $row[8]); - array_push($body, $row[9]); - array_push($fuel, $row[12]); + if(empty($REQ['GEAR'])) { array_push($gear, $row[7]); } + if(empty($REQ['DRIVE'])) { array_push($drive, $row[8]); } + if(empty($REQ['BODY'])) { array_push($body, $row[9]); } + if(empty($REQ['ENGINE_FUEL'])) { array_push($fuel, $row[12]); } + if(empty($REQ['ENGINE_VOLUME_FROM']) && empty($REQ['ENGINE_VOLUME_TO'])) { array_push($volume, $row[11]); } } - $gear = array_unique($gear); - $drive = array_unique($drive); - $body = array_unique($body); - $fuel = array_unique($fuel); - print json_encode([ + $gear = array_values(array_unique($gear)); + $drive = array_values(array_unique($drive)); + $body = array_values(array_unique($body)); + $fuel = array_values(array_unique($fuel)); + $volume = array_values(array_unique($volume)); + sort($volume); + + $volumes = []; + $min = floor($volume[0] / 100) * 100; + $max = (floor($volume[count($volume)-1] / 100) + 1) * 100; + + while($min <= $max) + { + if($min > 0) + { + array_push($volumes, $min); + } + + $min = $min + 100; + } + + $result = [ "total" => $total, - "gear" => $gear, - "drive" => $drive, - "body" => $body, - "fuel" => $fuel, - ]); + ]; + + if(empty($REQ['GEAR'])) { $result["gears"] = $gear; } + if(empty($REQ['DRIVE'])) { $result["drives"] = $drive; } + if(empty($REQ['BODY'])) { $result["bodies"] = $body; } + if(empty($REQ['ENGINE_FUEL'])) { $result["engine_fuels"] = $fuel; } + if(empty($REQ['ENGINE_VOLUME_FROM']) && empty($REQ['ENGINE_VOLUME_TO'])) { $result["engine_volumes"] = $volumes; } + + print json_encode($result); } } break; @@ -1210,6 +1311,261 @@ switch($PARAM_1) break; case "parameters": + { + if(CModule::IncludeModule('iblock')) + { + $filter = [ "ACTIVE" => "Y", ]; + + if(!empty($REQ['PROGRAM'])) { $filter['PROPERTY_LEASING_PROGRAMS'] = $REQ['PROGRAM']; } + + if(!empty($REQ['BRAND_ID'])) { $filter["PROPERTY_BRAND"] = $REQ['BRAND_ID']; } + if(!empty($REQ['MODEL_ID'])) { $filter["PROPERTY_MODEL"] = $REQ['MODEL_ID']; } + if(!empty($REQ['MODIFICATION'])) { $filter["PROPERTY_MODIFICATION"] = $REQ['MODIFICATION']; } + + if(!empty($REQ['GEAR'])) { $filter["PROPERTY_GEAR"] = $REQ['GEAR']; } + if(!empty($REQ['DRIVE'])) { $filter["PROPERTY_DRIVE"] = $REQ['DRIVE']; } + if(!empty($REQ['BODY'])) { $filter["PROPERTY_BODY"] = $REQ['BODY']; } + if(!empty($REQ['ENGINE_FUEL'])) { $filter["PROPERTY_ENGINE_FUEL"] = $REQ['ENGINE_FUEL']; } + + if(!empty($REQ['ENGINE_VOLUME_FROM']) || !empty($REQ['ENGINE_VOLUME_TO'])) + { + $filter['> "ASC", "NAME" => "ASC" ], array_merge([ "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_NEW ], $filter), [], []); + $result = [ + "total" => $total, + "possible_volumes" => [], + ]; + + $brands = []; + $models = []; + $modifications = []; + + $gears = []; + $drives = []; + $bodies = []; + $engine_fuels = []; + $engine_volumes = []; + + $filter_props_ids = []; + + array_push($filter_props_ids, 3); + if(!empty($REQ['BRAND_ID'])) { array_push($filter_props_ids, 4); } + array_push($filter_props_ids, 7); + array_push($filter_props_ids, 8); + array_push($filter_props_ids, 9); + array_push($filter_props_ids, 12); + //if(empty($REQ['ENGINE_VOLUME_FROM']) || empty($REQ['ENGINE_VOLUME_TO'])) { array_push($filter_props_ids, 11); } + + $result['filter'] = $filter; + + //filter for brands + $filter_brands = $filter; + unset($filter_brands['PROPERTY_BRAND']); + + $brands_ids = []; + $iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_NEW, $filter_brands, true, [ 'ID' => [ 3 ] ] ); + while ($row = $iterator->Fetch()) + { + array_push($brands_ids, $row[ 3 ]); + } + + $brands_ids = array_values(array_unique($brands_ids)); + + $brands_res = CIBlockElement::GetList(["NAME" => "ASC"], array_merge([ "IBLOCK_ID" => IBLOCK_ID_BRANDS ], [ "ID" => $brands_ids ]), false, []); + while ($brands_ob_element = $brands_res->GetNextElement()) + { + $brands_ar_res = $brands_ob_element->GetFields(); + $brands_ar_res['PROPERTIES'] = $brands_ob_element->GetProperties(); + + array_push($brands, [ + "id" => $brands_ar_res['ID'], + "value" => $brands_ar_res['CODE'], + "text" => $brands_ar_res['NAME'], + "uid" => $brands_ar_res['PROPERTIES']['UID']['VALUE'], + ]); + } + + //filter for models + if(!empty($REQ['BRAND_ID'])) + { + $filter_models = $filter; + unset($filter_models['PROPERTY_MODEL']); + + $models_ids = []; + $iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_NEW, $filter_models, true, [ 'ID' => [ 4 ] ] ); + while ($row = $iterator->Fetch()) + { + array_push($models_ids, $row[ 4 ]); + } + + $models_ids = array_values(array_unique($models_ids)); + + $models_res = CIBlockElement::GetList(["NAME" => "ASC"], array_merge([ "IBLOCK_ID" => IBLOCK_ID_MODELS ], [ "ID" => $models_ids ]), false, []); + while ($models_ob_element = $models_res->GetNextElement()) + { + $models_ar_res = $models_ob_element->GetFields(); + $models_ar_res['PROPERTIES'] = $models_ob_element->GetProperties(); + + array_push($models, [ + "id" => $models_ar_res['ID'], + "value" => $models_ar_res['CODE'], + "text" => $models_ar_res['NAME'], + "uid" => $models_ar_res['PROPERTIES']['UID']['VALUE'], + ]); + } + } + + //filter for modifications + if(!empty($REQ['MODEL_ID'])) + { + $filter_modifications = $filter; + unset($filter_modifications['PROPERTY_MODIFICATION']); + + $modifications_ids = []; + + $iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_NEW, $filter_modifications, true, [ 'ID' => [ 5 ] ] ); + while ($row = $iterator->Fetch()) + { + array_push($modifications_ids, $row[ 5 ]); + } + + $modifications_ids = array_values(array_unique($modifications_ids)); + + $modifications_res = CIBlockElement::GetList(["NAME" => "ASC"], array_merge([ "IBLOCK_ID" => IBLOCK_ID_MODIFICATIONS ], [ "ID" => $modifications_ids ]), false, []); + while ($modifications_ob_element = $modifications_res->GetNextElement()) + { + $modifications_ar_res = $modifications_ob_element->GetFields(); + + array_push($modifications, [ + "id" => $modifications_ar_res['ID'], + "text" => $modifications_ar_res['NAME'], + ]); + } + } + + //filter for bodies + $filter_bodies = $filter; + unset($filter_bodies['PROPERTY_BODY']); + + $iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_NEW, $filter_bodies, true, [ 'ID' => [ 9 ] ] ); + while ($row = $iterator->Fetch()) + { + array_push($bodies, $row[ 9 ]); + } + + //filter for gears + $filter_gears = $filter; + unset($filter_gears['PROPERTY_GEAR']); + + $iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_NEW, $filter_gears, true, [ 'ID' => [ 7 ] ] ); + while ($row = $iterator->Fetch()) + { + array_push($gears, $row[ 7 ]); + } + + //filter for drives + $filter_drives = $filter; + unset($filter_drives['PROPERTY_DRIVE']); + + $iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_NEW, $filter_drives, true, [ 'ID' => [ 8 ] ] ); + while ($row = $iterator->Fetch()) + { + array_push($drives, $row[ 8 ]); + } + + //filter for engine fuels + $filter_engine_fuels = $filter; + unset($filter_engine_fuels['PROPERTY_ENGINE_FUEL']); + + $iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_NEW, $filter_engine_fuels, true, [ 'ID' => [ 12 ] ] ); + while ($row = $iterator->Fetch()) + { + array_push($engine_fuels, $row[ 12 ]); + } + + //filter for engine fuels + $filter_engine_volumes = $filter; + unset($filter_engine_volumes['> [ 11 ] ] ); + while ($row = $iterator->Fetch()) + { + if($row[ 11 ] != 0) + { + array_push($engine_volumes, $row[ 11 ]); + array_push($result["possible_volumes"], $row[ 11 ]); + } + } + /* + $iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_NEW, $filter, true, [ 'ID' => $filter_props_ids ] ); + while ($row = $iterator->Fetch()) + { + if(!empty($REQ['BRAND_ID'])) { array_push($models, $row[4]); } + + array_push($gear, $row[7]); + array_push($drive, $row[8]); + array_push($fuel, $row[12]); + } + */ + + /* + $result['filter2'] = array_merge($filter, [ "> [ 0, 10000 ]]); + + $iterator_volume = CIBlockElement::GetPropertyValues( 1, array_merge($filter, [ "> [ 0, 10000 ]]), true, [ 'ID' => [ 11 ] ] ); + while ($row = $iterator_volume->Fetch()) + { + if($row[11] != 0) + { + array_push($volume, $row[11]); + array_push($result["vvv"], $row[11]); + } + } + */ + + //$models = array_values(array_unique($models)); + + $gears = array_values(array_unique($gears)); + $drives = array_values(array_unique($drives)); + $bodies = array_values(array_unique($bodies)); + $engine_fuels = array_values(array_unique($engine_fuels)); + $engine_volumes = array_values(array_unique($engine_volumes)); + sort($engine_volumes); + + $volumes = []; + $min = floor($engine_volumes[0] / 100) * 100; + $max = (floor($engine_volumes[count($engine_volumes)-1] / 100) + 1) * 100; + + while($min <= $max) + { + if($min > 0) + { + array_push($volumes, $min); + } + + $min = $min + 100; + } + + $result["brands"] = $brands; + $result["models"] = $models; + $result["modifications"] = $modifications; + + $result["gears"] = $gears; + $result["drives"] = $drives; + $result["bodies"] = $bodies; + $result["engine_fuels"] = $engine_fuels; + //if(empty($REQ['ENGINE_VOLUME_FROM']) || empty($REQ['ENGINE_VOLUME_TO'])) { + $result["engine_volumes"] = $volumes; + //} + + print json_encode($result); + } + } + break; + + /* + case "-arameters": { if(CModule::IncludeModule('iblock')) { @@ -1220,7 +1576,7 @@ switch($PARAM_1) $ENGINE_VOLUME = []; $ENGINE_FUEL = []; - $iterator = CIBlockElement::GetPropertyValues(1, ['ACTIVE' => 'Y', ], false, ['ID' => [ 7, 8, 9, 10, 11, 12, ] ]); + $iterator = CIBlockElement::GetPropertyValues(1, ['ACTIVE' => 'Y', ], false, ['ID' => [ 7, 8, 9, 10, 11, 12, ] ]); while ($row = $iterator->Fetch()) { if(!in_array($row[7], $GEAR)) { array_push($GEAR, $row[7]); } @@ -1246,6 +1602,7 @@ switch($PARAM_1) } } break; + */ case "reset": { @@ -1661,19 +2018,6 @@ switch($PARAM_1) } else { - /* - \Bitrix\Main\Mail\Event::send([ - "EVENT_NAME" => "USER_INFO", - "LID" => "s1", - "C_FIELDS" => Array( - "EMAIL" => $REQ['email'], - "ORG_NAME" => $ar_user['UF_ORG_TITLE'], - "LOGIN" => $REQ['email'], - "PASS" => $REQ['password'], - ) - ]); - */ - print json_encode([ "status" => "success", ]); @@ -1988,12 +2332,6 @@ switch($PARAM_1) { $auth = (array) \Bitrix\Main\Web\JWT::decode($token, $secret, ["HS256"]); print_r($auth); - - //print json_encode([ - // "status" => "success", - // "token" => $auth['username'], - //]); - //die(); } catch(\Exception $e) { @@ -2090,15 +2428,6 @@ switch($PARAM_1) $filter = ["ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_ACCOUNT_SUPPORT]; $options = []; - /* - if(!empty($REQ['query'])) - { - $filter[' "ASC" ], [ 'IBLOCK_ID' => IBLOCK_ID_ACCOUNT_SUPPORT, 'GLOBAL_ACTIVE' => 'Y', ], false, ); while($theme_result = $themes_res->GetNext()) @@ -2211,10 +2540,7 @@ switch($PARAM_1) break; case "vizitka": - { - //define("LOG_FILENAME", $_SERVER["DOCUMENT_ROOT"]."/vizitka/tmp/log.txt"); - //AddMessage2Log("_REQUEST['guid'] => ".$_REQUEST['guid'], "my_module_id"); - + { $c = curl_init(); curl_setopt($c, CURLOPT_URL, API_HOST."/site/GetUserBusinessCard/?guid=".$_REQUEST['guid']); curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 30); diff --git a/catalog/index.php b/catalog/index.php index f327968..1b127a5 100644 --- a/catalog/index.php +++ b/catalog/index.php @@ -1,13 +1,24 @@ SetTitle("Каталог"); +$APPLICATION->SetTitle("Новые автомобили в лизинг"); +//$APPLICATION->AddHeadString(''); +?> +IncludeComponent("bitrix:breadcrumb", "evolution", Array( + "PATH" => "", // Путь, для которого будет построена навигационная цепочка (по умолчанию, текущий путь) + "SITE_ID" => "s1", // Cайт (устанавливается в случае многосайтовой версии, когда DOCUMENT_ROOT у сайтов разный) + "START_FROM" => "0", // Номер пункта, начиная с которого будет построена навигационная цепочка + ), + false + ); ?> IncludeComponent( "evolution:catalog", - "", + isset($_REQUEST['ajax']) ? "ajax" : "", array( "PAGINATION" => "Y", + "COUNT_PER_PAGE" => 12, "BRAND" => $_REQUEST['BRAND'], "MODEL" => $_REQUEST['MODEL'], "MODIFICATION" => $_REQUEST['MODIFICATION'], @@ -25,6 +36,7 @@ $APPLICATION->SetTitle("Каталог"); ) ); ?> + IncludeComponent( "evolution:form.leasing", diff --git a/images/icons/icon-header-phone.svg b/images/icons/icon-header-phone.svg index 444cea6..c95733e 100644 --- a/images/icons/icon-header-phone.svg +++ b/images/icons/icon-header-phone.svg @@ -1,6 +1,13 @@ - + + + - + + + + + + diff --git a/images/icons/icon-header-recall.svg b/images/icons/icon-header-recall.svg new file mode 100644 index 0000000..e34954b --- /dev/null +++ b/images/icons/icon-header-recall.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/images/man.png b/images/man.png new file mode 100644 index 0000000..f6537cf Binary files /dev/null and b/images/man.png differ diff --git a/images/manager.png b/images/manager.png new file mode 100644 index 0000000..5137edd Binary files /dev/null and b/images/manager.png differ diff --git a/images/no_car_photo_380.png b/images/no_car_photo_380.png new file mode 100644 index 0000000..266444d Binary files /dev/null and b/images/no_car_photo_380.png differ diff --git a/images/no_image_380.png b/images/no_image_380.png new file mode 100644 index 0000000..2f00709 Binary files /dev/null and b/images/no_image_380.png differ diff --git a/images/no_image_650.png b/images/no_image_650.png new file mode 100644 index 0000000..ad39dd0 Binary files /dev/null and b/images/no_image_650.png differ diff --git a/images/programs_faq.png b/images/programs_faq.png new file mode 100644 index 0000000..d5ef4b2 Binary files /dev/null and b/images/programs_faq.png differ diff --git a/index.php b/index.php index 447f6c6..4970b37 100644 --- a/index.php +++ b/index.php @@ -1,13 +1,14 @@ SetTitle("Эволюция автолизинга. Лизинг автомобилей"); +$APPLICATION->SetTitle("Лизинг для юридических лиц и ИП в Москве и других городах России | Лизинговая компания Эволюция"); +$APPLICATION->SetPageProperty("description", "Лизинговая компания Эволюция предлагает быстрое оформление авто в лизинг для юридических лиц и ИП в Москве и других городах России. Выгодные цены, спецпредложения, простое оформление, консультирование и сопровождение."); +$APPLICATION->AddHeadString(''); ?> IncludeComponent( "evolution:slider.main", "", Array() ); ?> -
IncludeComponent( @@ -22,7 +23,6 @@ $APPLICATION->SetTitle("Эволюция автолизинга. Лизинг а ); ?>
- IncludeComponent( "evolution:calculator", "", diff --git a/local/catalog_sitemap_generation.php b/local/catalog_sitemap_generation.php new file mode 100644 index 0000000..0b9c543 --- /dev/null +++ b/local/catalog_sitemap_generation.php @@ -0,0 +1,75 @@ + 8, "ACTIVE" => "Y" ], false, false, [ "CODE", "PROPERTY_UID" ] ); +while($all_brands_search_ob = $all_brands_search_res->GetNextElement()) +{ + $brand = $all_brands_search_ob->GetFields(); + $brand['MODELS'] = []; + + $catalog[$brand['PROPERTY_UID_VALUE']] = $brand; +} + +$all_models_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => 9, "ACTIVE" => "Y" ], false, false, [ "CODE", "PROPERTY_BRAND_UID"] ); +while($all_models_search_ob = $all_models_search_res->GetNextElement()) +{ + $model = $all_models_search_ob->GetFields(); + $model['PROPERTIES'] = $all_models_search_ob->GetProperties(); + + array_push($catalog[$model['PROPERTY_BRAND_UID_VALUE']]['MODELS'], $model); + + //print_r($model); + //array_push( $bitrix_existed_models, $model_search['PROPERTIES']['UID']['VALUE'] ); +} + +//print_r($catalog); + +//7f7534ad-5382-469c-8e40-f77267fb5644 + +$url = "https://".SITE_SERVER_NAME."/catalog"; +$lastmod = date(DATE_W3C); + +$strBegin = "\n\n"; + +foreach($catalog AS $brand) +{ + //print ; + //print "\n"; + //"\t". + $strBegin .= "".$url."/".$brand['CODE']."/"."".$lastmod.""."\n"; + + foreach($brand['MODELS'] AS $model) + { + //print "\t"; + //print $url."/".$brand['CODE']."/".$model['CODE']."/"; + //print "\n"; + //"\t"."\t". + $strBegin .= "".$url."/".$brand['CODE']."/".$model['CODE']."/"."".$lastmod.""."\n"; + } + + /* + + + https://evo.quickcode.ru/2022-03-29T15:01:44+03:00 + */ +} +$strBegin .= ""."\n"; + +file_put_contents("../sitemap-catalog.xml", $strBegin); +//print $strBegin; + +die(); + +?> \ No newline at end of file diff --git a/local/check_user.php b/local/check_user.php new file mode 100644 index 0000000..b3bf496 --- /dev/null +++ b/local/check_user.php @@ -0,0 +1,28 @@ + 'desc' ], [ 'IBLOCK_ID' => IBLOCK_ID_CLIENTS, 'PROPERTY_USERS' => $user_id ], false, []); +while ($existed_client_element = $existed_client_res->GetNextElement()) +{ + $existed_client_record = $existed_client_element->GetFields(); + $existed_client_record['PROPERTIES'] = $existed_client_element->GetProperties(); + + print_r("existed_client_record"); + print_r($existed_client_record); +} + +die(); + +?> \ No newline at end of file diff --git a/local/components/evolution/footer/component.php b/local/components/evolution/__footer/component.php similarity index 100% rename from local/components/evolution/footer/component.php rename to local/components/evolution/__footer/component.php diff --git a/local/components/evolution/footer/templates/.default/style.css b/local/components/evolution/__footer/templates/.default/style.css similarity index 100% rename from local/components/evolution/footer/templates/.default/style.css rename to local/components/evolution/__footer/templates/.default/style.css diff --git a/local/components/evolution/footer/templates/.default/template.php b/local/components/evolution/__footer/templates/.default/template.php similarity index 100% rename from local/components/evolution/footer/templates/.default/template.php rename to local/components/evolution/__footer/templates/.default/template.php diff --git a/local/components/evolution/top/component.php b/local/components/evolution/__top/component.php similarity index 100% rename from local/components/evolution/top/component.php rename to local/components/evolution/__top/component.php diff --git a/local/components/evolution/top/templates/.default/style.css b/local/components/evolution/__top/templates/.default/style.css similarity index 100% rename from local/components/evolution/top/templates/.default/style.css rename to local/components/evolution/__top/templates/.default/style.css diff --git a/local/components/evolution/top/templates/.default/template.php b/local/components/evolution/__top/templates/.default/template.php similarity index 100% rename from local/components/evolution/top/templates/.default/template.php rename to local/components/evolution/__top/templates/.default/template.php diff --git a/local/components/evolution/about.career.vacancy/component.php b/local/components/evolution/about.career.vacancy/component.php index 3f85473..18da80f 100644 --- a/local/components/evolution/about.career.vacancy/component.php +++ b/local/components/evolution/about.career.vacancy/component.php @@ -52,6 +52,8 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true)))) $APPLICATION->SetPageProperty("title", $meta['ELEMENT_META_TITLE']); $APPLICATION->SetPageProperty("keywords", $meta['ELEMENT_META_KEYWORDS']); $APPLICATION->SetPageProperty("description", $meta['ELEMENT_META_DESCRIPTION']); + + $APPLICATION->AddHeadString(''); } $this->IncludeComponentTemplate(); diff --git a/local/components/evolution/about.contacts.list/templates/.default/script.js b/local/components/evolution/about.contacts.list/templates/.default/script.js index cc28db8..9a5b1d8 100644 --- a/local/components/evolution/about.contacts.list/templates/.default/script.js +++ b/local/components/evolution/about.contacts.list/templates/.default/script.js @@ -1,5 +1,44 @@ $(function() { + var hash = document.location.hash.replace("#", ""); + + if(hash !== "") + { + var agency = null; + var region = null; + + $(".agency_item").each(function() + { + if($(this).data('agency') == hash) + { + agency = $(this).data('agency'); + region = $(this).data('region'); + + console.log("agency", $(this).data('agency'), "region", $(this).data('region')); + + /* + faq_section_index = $(this).data('section'); + faq_item_index = $(this).data('index'); + + $(".faq_section_button").removeClass("active"); + $(".faq_section_button_"+faq_section_index).addClass("active"); + $(".faq_items_list").css("display", "none"); + $(".faq_items_list_"+faq_section_index).css("display", "block"); + + $(".faq_item").removeClass("open"); + $(".faq_item_"+faq_item_index).addClass("open"); + */ + + + $(".tab").last().click(); + $(".regions_select").val(region); + onRegionChange(region); + + return false; + } + }); + } + $(".regions_select").on("change", function() { if($(this).val() === "") @@ -30,35 +69,7 @@ $(function() }, 200); } - $(".region_selected").remove(); - $(".region_block").css("display", "none"); - - var text_blocks = $(".column_desktop").find(".region_"+parseInt($(this).val(), 10)); - - text_blocks.map(function(index, item) - { - var n = $(item).clone(); - $(n).addClass("open").addClass("region_selected").css("display", "block"); - - if(index % 2 == 0) - { - $(".column_left").append(n); - } - else - { - $(".column_right").append(n); - } - }); - - var text_blocks = $(".column_mobile").find(".region_"+parseInt($(this).val(), 10)); - - text_blocks.map(function(index, item) - { - var n = $(item).clone(); - $(n).addClass("open").addClass("region_selected").css("display", "block"); - - $(".column_all").append(n); - }); + onRegionChange($(this).val()); } }); @@ -73,4 +84,39 @@ $(function() scrollTop: $("#contacts_top").offset().top - 100 }, 100); }); -}); \ No newline at end of file +}); + +function onRegionChange(region) +{ + console.log("region", region); + + $(".region_selected").remove(); + $(".region_block").css("display", "none"); + + var text_blocks = $(".column_desktop").find(".region_"+parseInt(region, 10)); + + text_blocks.map(function(index, item) + { + var n = $(item).clone(); + $(n).addClass("open").addClass("region_selected").css("display", "block"); + + if(index % 2 == 0) + { + $(".column_left").append(n); + } + else + { + $(".column_right").append(n); + } + }); + + var text_blocks = $(".column_mobile").find(".region_"+parseInt(region, 10)); + + text_blocks.map(function(index, item) + { + var n = $(item).clone(); + $(n).addClass("open").addClass("region_selected").css("display", "block"); + + $(".column_all").append(n); + }); +} \ No newline at end of file diff --git a/local/components/evolution/about.contacts.list/templates/.default/template.php b/local/components/evolution/about.contacts.list/templates/.default/template.php index 4274671..257da59 100644 --- a/local/components/evolution/about.contacts.list/templates/.default/template.php +++ b/local/components/evolution/about.contacts.list/templates/.default/template.php @@ -12,6 +12,71 @@ /** @var CBitrixComponent $component */ $this->setFrameMode(true); ?> + "https://schema.org", + "@type" => "FinancialService", + "image" => [ + "https://avatars.mds.yandex.net/get-altay/2389272/2a000001749629d635959647ec27834f22be/XXXL", + ], + "name" => "Эволюция Автолизинга", + "address" => [ + "@type" => "PostalAddress", + "streetAddress" => "Котляковская ул., 8", + "addressLocality" => "Москва", + "addressRegion" => "Москва", + "postalCode" => "115201", + "addressCountry" => "Россия", + ], + //"review" => [ + // "@type" => "Review", + // "reviewRating" => [ + // "@type" => "Rating", + // "ratingValue" => "4", + // "bestRating" => "5" + // ], + // "author" => [ + // "@type" => "Person", + // "name" => "Lillian Ruiz", + // ] + //], + "geo" => [ + "@type" => "GeoCoordinates", + "latitude" => 55.643978, + "longitude" => 37.640452, + ], + "url" => "https://".SITE_SERVER_NAME."/about/contacts/", + "telephone" => "+74951466767", + "openingHoursSpecification" => [ + [ + "@type" => "OpeningHoursSpecification", + "dayOfWeek" => [ + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + ], + "opens" => "09:00", + "closes" => "18:00", + ], + [ + "@type" => "OpeningHoursSpecification", + "dayOfWeek" => "Saturday", + "opens" => "00:00", + "closes" => "00:00", + ], + [ + "@type" => "OpeningHoursSpecification", + "dayOfWeek" => "Sunday", + "opens" => "00:00", + "closes" => "00:00", + ], + ], +]; + +$APPLICATION->AddHeadString('', false, "AFTER_JS"); +?> setFrameMode(true);
-