Modeles.php 3.27 KB
Newer Older
1 2 3 4 5 6 7
<?php 
$config_ini = parse_ini_file('./config.ini', true); 

echo '<table>';
switch ($_GET['data']) {
    case 'pv':
		echo '<tr>';
David's avatar
David committed
8 9 10 11 12
			echo '<th>'._('Type').'</th>';
			echo '<th>'._('Max power (Pmax)').'</th>';
			echo '<th>'._('Open circuit voltage (Voc)').'</th>';
			echo '<th>'._('Short-circuit current (Isc)').'</th>';
			echo '<th>'._('Estimate price').'</th>';
13 14 15 16
		echo '</tr>';
		foreach ($config_ini['pv'] as $pvModele => $valeur) {
			echo '<tr>';
				echo '<td>'.ucfirst($valeur['type']).'</td>';
David's avatar
David committed
17
				echo '<td>'.$valeur['W'].' W</td>';
18 19 20
				echo '<td>'.$valeur['Vdoc'].' V</td>';
				echo '<td>'.$valeur['Isc'].' A</td>';
				echo '<td>'.round($config_ini['prix']['pv_bas']*$valeur['W']).'
David's avatar
David committed
21
				 - '.round($config_ini['prix']['pv_haut']*$valeur['W']).' &euro;</td>';
22 23 24 25 26
			echo '</tr>';
		}	
	break;
	case 'batterie':
		echo '<tr>';
David's avatar
David committed
27 28 29 30 31
			echo '<th>'._('Name').'</th>';
			echo '<th>'._('Type').'</th>';
			echo '<th>'._('Capacity (C10)').'</th>';
			echo '<th>'._('Voltage').'</th>';
			echo '<th>'._('Estimate price').'</th>';
32 33 34 35
		echo '</tr>';
		foreach ($config_ini['batterie'] as $modele => $valeur) {
			echo '<tr>';
				echo '<td>'.ucfirst($valeur['nom']).'</td>';
root's avatar
root committed
36
				echo '<td>'.$valeur['type'].'</td>';
37 38
				echo '<td>'.$valeur['Ah'].' Ah</td>';
				echo '<td>'.$valeur['V'].' V</td>';
root's avatar
root committed
39
				echo '<td>'.round($config_ini['prix']['bat_'.$valeur['type'].'_bas']*$valeur['Ah']*$valeur['V']).'
David's avatar
David committed
40
				 - '.round($config_ini['prix']['bat_'.$valeur['type'].'_haut']*$valeur['Ah']*$valeur['V']).' &euro;</td>';
41 42 43 44 45
			echo '</tr>';
		}	
	break;
	case 'regulateur':
		echo '<tr>';
David's avatar
David committed
46 47 48 49 50 51
			echo '<th>'._('Name').'</th>';
			echo '<th>'._('Battery plant voltage').'</th>';
			echo '<th>'._('Max panel power').'</th>';
			echo '<th>'._('Max panel voltage').'</th>';
			echo '<th>'._('Max panel current').'</th>';
			echo '<th>'._('Estimate price').'</th>';
52 53 54 55 56 57 58 59
		echo '</tr>';
		foreach ($config_ini['regulateur'] as $modele => $valeur) {
			echo '<tr>';
				echo '<td>'.ucfirst($valeur['nom']).'</td>';
				echo '<td>'.$valeur['Vbat'].' V</td>';
				echo '<td>'.$valeur['PmaxPv'].' W</td>';
				echo '<td>'.$valeur['VmaxPv'].' V</td>';
				echo '<td>'.$valeur['ImaxPv'].' A</td>';
David's avatar
David committed
60
				echo '<td>~'.$valeur['Prix'].' &euro;</td>';
61 62 63 64 65
			echo '</tr>';
		}	
	break;
	case 'convertisseur':
		echo '<tr>';
David's avatar
David committed
66 67 68 69 70
			echo '<th>'._('Name').'</th>';
			echo '<th>'._('Battery park voltage').'</th>';
			echo '<th>'._('Max power (at 25 °C)').'</th>';
			echo '<th>'._('Peak power').'</th>';
			echo '<th>'._('Estimate price').'</th>';
71 72 73 74 75 76 77 78
		echo '</tr>';
		foreach ($config_ini['convertisseur'] as $modele => $valeur) {
			echo '<tr>';
				echo '<td>'.ucfirst($valeur['nom']).'</td>';
				echo '<td>'.$valeur['Vbat'].' V</td>';
				echo '<td>'.$valeur['Pmax'].' W</td>';
				echo '<td>'.$valeur['Ppointe'].' W</td>';
				echo '<td>'.round($config_ini['prix']['conv_bas']*$valeur['VA']).'
David's avatar
David committed
79
				 - '.round($config_ini['prix']['conv_haut']*$valeur['VA']).' &euro;</td>';
80 81 82
			echo '</tr>';
		}	
	break;
83 84
	case 'cable':
		echo '<tr>';
David's avatar
David committed
85 86
			echo '<th>'._('Section').'</th>';
			echo '<th>'._('Estimate price').'</th>';
87 88 89 90
		echo '</tr>';
		foreach ($config_ini['cablage'] as $modele => $valeur) {
			echo '<tr>';
				echo '<td>'.ucfirst($valeur['nom']).'</td>';
David's avatar
David committed
91
				echo '<td>'.$valeur['prix'].' &euro;/m</td>';
92 93 94
			echo '</tr>';
		}	
	break;
95 96 97 98 99
	default:
       echo 'no hack';
}
echo '</table>';
?>