function index() { global $HTTP_SERVER_VARS; global $nl; global $already_loaded; $self = @$HTTP_SERVER_VARS['PHP_SELF']; $host = @$HTTP_SERVER_VARS['HTTP_HOST']; ob_start(); $success = (include dirname(__FILE__) . '/ioncube-encoded-file.php'); $php_info = ob_get_contents(); ob_end_clean(); $body = ""; $body .= "An ionCube Loader file is required by PHP to read files encoded with the ionCube Encoder. This page will determine how you can install Loaders on this particular server.{$nl}{$nl}"; $dir = dirname($self); $rtl = "<a href=\"{$self}?page=rtl-tester\">run-time loading installation instructions</a>"; $sys = "<a href=\"{$self}?page=sysinfo\">Server System Information</a>"; $ass = "<a href=\"{$self}?page=install-assistant\">php.ini installation instructions</a>"; if ($success) { $body .= "An ionCube encoded file has been loaded <b><font color=green>successfully</font></b>.<br>" . "Encoded files should now function correctly.<br><br>"; if (!$already_loaded) { $body .= "If you have permission to edit the php.ini configuration file for this server you can increase performance by following the {$ass}.<br><br>"; } $body .= "If you have a problem with your PHP application, please contact the application provider."; } else { $body .= "The loading of ionCube encoded files is not currently working correctly on this server.<br><br>\n"; $body .= "If you have permission to edit the php.ini configuration file for this server, please follow the " . "{$ass}.<br><br>"; $body .= "If you do not access to the php.ini file, please follow the " . "{$rtl}.<br><br>"; $body .= getInstructions(); } return $body; }
<head> <?php require './scripts/standardHEAD.php'; $DNS = "localhost"; // "www.meta4systems.com"; // @($file_selected = $_GET['file']); @($qtype = $_GET['qtype']); if (strlen($file_selected) < 1) { $file_selected = 'question.txt'; } if (strlen($qtype) < 1) { $qtype = 'oneline'; } require './scripts/getData.php'; $output = getData($file_selected); $instructions = getInstructions($file_selected); require './scripts/showQuestion.php'; $fulllines = explode(PHP_EOL, $output); $piece = explode('|', $fulllines[0]); $questions[] = $piece; for ($i = 1; $i < sizeof($fulllines); $i++) { $piece = explode('|', $fulllines[$i]); array_push($questions, $piece); } ?> <?php require './scripts/ajaxDataRequest.php'; ?>
$count = 0; foreach ($grid as $row) { foreach ($row as $cell) { if ($cell) { $count++; } } } return $count; } function calculateLightStrength($grid) { $strength = 0; foreach ($grid as $row) { foreach ($row as $cell) { $strength = $strength + $cell; } } return $strength; } $instructions = getInstructions("6input.txt"); $grid = generateGrid(); foreach ($instructions as $instruction) { processInstructionsFromSanta($instruction, $grid); } echo "Lights count: " . countLights($grid) . "<br>"; $grid = generateGrid(0); foreach ($instructions as $instruction) { processInstructionsFromSanta($instruction, $grid, true); } echo "Light strength: " . calculateLightStrength($grid);