Beispiel #1
0
		 ($ry = intval ( $_REQUEST['run_at_year'] ) ) >0 ){
		 
		$result = array ();
		if( $_REQUEST["chassis-type"] != "new" ){
			$currentRun = intval($_REQUEST["mileage"]);
		}
		
		$with_out_washing = ($_REQUEST["exclude_washing"] == "Y" )? true:false ;
		
		$discount = floatval($_REQUEST["discount"]);
		try{

			$result["TO"] = GetTO ( $programTO, $chId, true, $with_out_washing );
			calcCostTOWorks( $result["TO"] );
			countTO  ( $result["TO"] , $yw*$ry, $currentRun );
			calcByTo ( $result , $ry, $yw , $currentRun );
		
		}catch(exception $e){
			$e->getMessage();
		}		
		$result["RESULTS"];
	}

	$path = $APPLICATION->GetDirProperty("path");
	$menu_path = $_SERVER["DOCUMENT_ROOT"].$path."/menu.php";
	include ( $menu_path );
?>

<? $class = "ui-corner-all ui-button ui-widget ui-widget-content ";?>

<div id="form-container">	
	$cntrct_type =  intval ( $_REQUEST["type"] );
	
	$d =  CIBlockPropertyEnum::GetByID( intval( $_REQUEST["exclude_washing"]) );
	$with_out_washing = ( $d["XML_ID"] == "N" )? true:false ;
	
	if ( $chId > 0 &&  $run_at_year > 0 && $years_of_work > 0 ){

		$discount = floatval($_REQUEST["discount"]);
		$params = array ( "CURRENT_RUN" => $currentRun, "WASHING" => $with_out_washing, "RUN_AT_YEAR" => $run_at_year,"YEARS_OF_WORK" => $years_of_work );

		try{

			$result ["TO"] = GetTO( $propramTOID, $chId, true, $with_out_washing );
			calcCostTOWorks( $result ["TO"] );
			countTO  ( $result["TO"] , $years_of_work * $run_at_year, $currentRun );
			calcByTo ( $result , $run_at_year, $years_of_work , $currentRun );

		}catch(exception $e){
			$e->getMessage();
		}
	}

//		Если тип контракта «Гарантия+» или «Комплекс» добавляю стоимость DLP в стоимость контракта
		$DLP = IBlockContractHandler::getDLPConditions ( $chId , intval ( $_REQUEST['years_of_work']), $cntrct_transport_task );
	

	/*	Если машин >1 умножаю результат расчета на кол-во машин. */
	setlocale(LC_MONETARY, 'ru_RU');
	if( isset( $_REQUEST["cars"] ) && is_array ( $_REQUEST["cars"] ) && count($_REQUEST["cars"]) > 0 ){
		$k = count( $_REQUEST["cars"] );
		$for_one = $result["RESULTS"];