<?php
function throwProducer( $iProducer ){
	$oDB = DataBase::getInstance( );
	$aData = $oDB->throwData( DB_PRODUCERS, $iProducer, 'iProducer' );
	if( isset( $aData ) ){
		$aData['sFileSize'] = filesize( 'upload' . $aData['sGuaranteFile'] ) . 'kB';
		$aData['sFileDate'] = date( 'Y-m-d H:i', filemtime( $GLOBALS['config']['dir_files'] . $aData['sGuaranteeFile'] ) );
		$aData['aGuarantee'] = $oDB->executeSQL( 'SELECT * FROM `' . $oDB->throwTableName( DB_PRODUCERS_GUARANTEE ) . '` WHERE `iProducer` = ' . intval( $iProducer ), true, DataBase::ASSOCIATIVE, 'iPage' );
		return $aData;
	} else{
		return false;
	}
}
function throwProducers( ){
	$oDB = DataBase::getInstance( );
	return $oDB->throwFileArray( DB_PRODUCERS );
}
function throwProducersForSelect( ){
	$oDB = DataBase::getInstance( );
	return $oDB->throwFileArraySmall( DB_PRODUCERS, 'iProducer', 'sName' );
}
?>