Skip to content

Instantly share code, notes, and snippets.

@totynho
Created September 9, 2016 13:34
Show Gist options
  • Save totynho/8f162c8505de56fca7493085558a99bd to your computer and use it in GitHub Desktop.
Save totynho/8f162c8505de56fca7493085558a99bd to your computer and use it in GitHub Desktop.
<?php
header('Content-Type: text/plain; charset=ANSI');
$row = 1;
$corid = 0;
if (($handle = fopen("apoia.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
$num = count($data);
$row++;
switch($corid){
case 0:
$cor = "laranja";
break;
case 1:
$cor = "azul";
break;
case 2:
$cor = "amarelo";
break;
case 3:
$cor = "vermelho";
break;
case 4:
$cor = "verde";
break;
}
echo '
<div class="gantry-width-20 bloco-conheca bloco-'.$cor.'">
<div class="gantry-width-spacer">
<div class="">
<h2>'.$data[0].'</h2>
<p>'.$data[1].'</p>
</div>
</div>
</div>
';
$corid = $corid+1;
if($corid == 5){$corid = 0;}
}
fclose ($handle);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment