Beispiel #1
0
function errorCheck($csv)
{
    echo "<h1>Error Check Results</h1>";
    $output['errorCount'] = 0;
    $output['errorList'] = [];
    $raw = [];
    $lineOffset = 2;
    $data = buildArray($csv);
    foreach ($data['data'] as $k => $v) {
        $roster = $v['class roster'];
        $proto = explode(' -', $v['tracking item'])[0] . '-' . $roster;
        $name = $v['student name'];
        if (!isset($raw[$name])) {
            $raw[$name] = [];
        }
        $lineNum = $k + $lineOffset;
        if (empty($raw[$name][$proto])) {
            $raw[$name][$proto]['count'] = 1;
            $raw[$name][$proto]['info'][] = ['Line Number' => $lineNum, 'Reviewer' => $v['lfz reviewer'], 'Proto Name' => $proto];
        } else {
            $raw[$name][$proto]['count']++;
            $raw[$name][$proto]['info'][] = ['Line Number' => $lineNum, 'Reviewer' => $v['lfz reviewer'], 'Proto Name' => $proto];
            $output['errorCount']++;
            $output['errorList'][$name] = $raw[$name][$proto]['info'];
        }
    }
    $output['raw data'] = $raw;
    echo '<pre>';
    print_r($output);
    echo '</pre>';
}
      <td>Odd or Even</td>
      <td>
          <?php 
for ($i = 0; $i < 5; $i++) {
    echo "{$i} " . oddEven($i) . "<br>";
}
?>
      </td>
    </tr>
 
     <tr>
      <td>Build Array</td>
      <td>
          <pre>
<?php 
print_r(buildArray("One", "Two", "Three", "Four"));
?>
          </pre>
      </td>
    </tr>
 
    <tr>
      <td>Read Local File</td>
      <td class="localfile"><?php 
echo readLocalFile();
?>
</td>
    </tr>

    <tr>
      <td>Server Software</td>
Beispiel #3
0
    /*
    	print "now: $now\n";
    	print "nowPretty: $nowPretty\n";
    	print "apparent: ". $weatherCSV['apparent'] ."\n";
    	print "relative: ". $weatherCSV['relative'] ."\n";
    	print "barometer: ". $weatherCSV['barometer'] ."\n";
    	print "sustained: ". $weatherCSV['sustained'] ."\n";
    	print "gust: ". $weatherCSV['gust'] ."\n";
    	print "wind: ". $weatherCSV['wind'] ."\n";
    	print "weather-conditions: ". $weatherCSV['weather-conditions'] ."\n";
    */
    $stringCSV = "";
    $stringCSV .= "{$now}";
    $stringCSV .= "," . $nowPretty;
    $stringCSV .= "," . $weatherCSV['apparent'];
    $stringCSV .= "," . $weatherCSV['relative'];
    $stringCSV .= "," . $weatherCSV['barometer'];
    $stringCSV .= "," . $weatherCSV['sustained'];
    $stringCSV .= "," . $weatherCSV['gust'];
    $stringCSV .= "," . $weatherCSV['wind'];
    $stringCSV .= "," . $weatherCSV['weather-conditions'];
    print $stringCSV . "\n";
}
foreach ($places as $place => $location) {
    $lat = $location['lat'];
    $lon = $location['lon'];
    getWeather($place, $lat, $lon);
    buildArray($weatherXML);
    makeCSV($weatherCSV);
    print "===========================\n";
}
<?php

require_once 'checksession.php';
//already includes config.php
//###############################procedures#####################################
if (!empty($_SESSION['client'])) {
    $arCompte = getCompteDisplay();
    $arCompte = preg_split("/,/", $arCompte);
}
//###############################variables######################################
$legend = 'Cr&eacute;ation d&apos;une facture d&apos;amarrage';
$deliblink = '46-2011';
$deliblink2 = '83-2010';
$fact = buildArray();
//details de la facture
$jsarType = buildJSArray($fact, 'Type');
$jsarMontantFCP = buildJSArray($fact, 'MontantFCP');
$jsarMontantEURO = buildJSArray($fact, 'MontantEURO');
$jsarUnite = buildJSArray($fact, 'Unite');
//#################################building forms################################
$InValidationList = buildFacturesEnAttente($arCompte[1]);
//$PeriodeList = buildOptionsPeriod(0);
//#################################functions#####################################
function buildJSArray($f, $col)
{
    $i = 0;
    $jsar = '';
    while ($i < count($f)) {
        $jsar .= '"' . $f[$i][$col] . '",';
        $i++;
    }
//already includes config.php
//###############################procedures#####################################
if (!empty($_SESSION['client'])) {
    $arCompte = getCompteDisplay();
    $arCompte = preg_split("/,/", $arCompte);
}
//###############################variables######################################
$legend = 'Cr&eacute;ation d&apos;une facture cantine';
$deliblink = '217-2013';
$fact = buildArray("tarifs_cantines");
//details de la facture
$jsarType = buildJSArray($fact, 'status');
$jsarMontantFCP = buildJSArray($fact, 'MontantFCP');
$jsarMontantEURO = buildJSArray($fact, 'MontantEURO');
$jsarUnite = buildJSArray($fact, 'Unite');
$enf = buildArray("enfants", $arCompte[1]);
//details des enfants
//echo(print_r($enf));
$jsarID_Enfant = buildJSArray($enf, 'enfantid');
$jsarNom_Enfant = buildJSArray($enf, 'nom');
$jsarPrenom_Enfant = buildJSArray($enf, 'prenom');
$jsarEcoleID_Enfant = buildJSArray($enf, 'ecole');
$jsarEcole_Enfant = buildJSArray($enf, 'nomecole');
$jsarClasse_Enfant = buildJSArray($enf, 'classe');
$jsarStatus_Enfant = buildJSArray($enf, 'status');
//#################################building forms################################
$InValidationList = buildFacturesEnAttente($arCompte[1]);
$KidsList = buildOptionsKids($enf);
//#################################functions#####################################
function buildJSArray($f, $col)
{