Example #1
0
{
    echo '<tr>';
    echo '<td>';
    echo '<form action="update-edu.php" method="post">';
    echo '<table align="center">';
    echo '<tr><td>Name of institution</td><td><input ' . (isset($history['new']) ? '' : 'readonly') . ' type="text" name="name" value="' . htmlspecialchars($history['Name_of_School']) . '"/></td></tr>';
    echo '<tr><td>Year of graduation</td><td><input ' . (isset($history['new']) ? '' : 'readonly') . ' type="number" name="year" value="' . htmlspecialchars($history['Year_of_Grad']) . '"/></td></tr>';
    echo '<tr><td>Degree</td><td><input type="text" name="degree" value="' . htmlspecialchars($history['Degree']) . '"/></td></tr>';
    echo '<tr><td>Major</td><td><input type="text" name="major" value="' . htmlspecialchars($history['Major']) . '"/></td></tr>';
    echo '<tr><td>GPA</td><td><input type="text" name="gpa" value="' . htmlspecialchars($history['GPA']) . '"/></td></tr>';
    echo '<tr><td><input type="submit" name="submit" value="' . (isset($history['new']) ? 'Add' : 'Update') . '"/></td><td><input type="' . (isset($history['new']) ? 'reset' : 'submit') . '" name="submit" value="' . (isset($history['new']) ? 'Clear' : 'Remove') . '"/></td></tr>';
    echo '</table>';
    echo '</form>';
    echo '</td>';
    echo '</tr>';
}
echo '<h1>Education History</h1>';
$hist = $con->prepare("SELECT * FROM EducationHistory WHERE Username=:u");
$hist->bindParam(':u', $_SESSION['user']);
$hist->execute();
$count = 0;
echo '<table border="1" align="center">';
while ($entry = $hist->fetch()) {
    printHistory($entry);
    $count = $count + 1;
}
if ($count < 3) {
    printHistory(array('Name_of_School' => '', 'Year_of_Grad' => '', 'Degree' => '', 'Major' => '', 'GPA' => '', 'new' => True));
}
echo '</table>';
require 'foot.php';
Example #2
0
?>
/images/icons/b02_trans.gif" onmouseover="this.src='media/style<?php 
echo $theme;
?>
/images/icons/b02.gif';" onmouseout="this.src='media/style<?php 
echo $theme;
?>
/images/icons/b02_trans.gif';" alt="<?php 
echo $helpText;
?>
" class="icon help" onclick="alert(this.alt);" />
							
							<!-- replace history -->
							<span id="replace_history_box">
								<?php 
echo printHistory("replace");
?>
							</span>
						</p>
						
						<script type="text/javascript">
							tpSearchOptions.addTabPage($('tpSearchOptions_searchAndReplace'));
						</script>
					</div>
					
					<!-- Tab pane search and replace -->
					<div class="tab-page" id="tpSearchOptions_generalOptions">
						
						<h2 class="tab">General options</h2>
						
						<!-- search places -->
Example #3
0
<?php

//*
$hard = true;
$player = ['health' => 50, 'mana' => 500, 'armor' => 0];
$enemy = ['health' => 71, 'damage' => 10, 'armor' => 0];
/*/
$player = ['health' => 10, 'mana' => 250, 'armor' => 0];
$enemy  = ['health' => 14, 'damage' => 8, 'armor' => 0];
//*/
$spells = ['missile' => ['cost' => 53, 'duration' => 1], 'drain' => ['cost' => 73, 'duration' => 1], 'shield' => ['cost' => 113, 'duration' => 6], 'poison' => ['cost' => 173, 'duration' => 6], 'recharge' => ['cost' => 229, 'duration' => 5]];
$state = ['rounds' => 0, 'used' => 0, 'player' => $player, 'enemy' => $enemy, 'effects' => []];
$minState = ['used' => 99999];
playerRound($state);
printHistory($minState);
print 'MinMana ' . $minState['used'] . "\n";
//1481, 1394 is too low ?!?
$iters = 0;
function playerRound($state)
{
    global $iters, $minMana, $hard;
    if ($hard) {
        $state['player']['health']--;
    }
    if (checkFinished($state)) {
        return;
    }
    $state['history'][$state['rounds']++] = getHistory($state);
    $state = applyEffects($state);
    if (checkFinished($state)) {
        return;
if (isset($_GET['u']) && isset($_GET['s'])) {
    $user = mysqli_real_escape_string($mysqli, $_GET['u']);
    $section = mysqli_real_escape_string($mysqli, $_GET['s']);
    $mode = "AUTHOR";
    if (isset($_GET['g']) && !$userPrecedence) {
        //group takes precedence over user, quick fix for sustainability class
        // $query = "SELECT t1.user, t1.session_id, t1.time, solutions.solution_graph FROM session AS t1 JOIN solutions USING (session_id)  where t1.section = '$section' AND t1.mode = '$mode'
        //       AND t1.problem = '$shortProblemName' AND t1.group = '$group' AND t1.activity = '$activity' ORDER BY t1.time DESC LIMIT 100";
        $query = <<<EOT
\t\tSELECT t1.session_id,\tt1.time,\tt1.user, solutions.solution_graph FROM session AS t1 JOIN solutions USING (session_id)  where t1.section = '{$section}' AND t1.mode = '{$mode}' 
\t\t\tAND t1.problem = '{$shortProblemName}' AND t1.group = '{$group}' AND t1.activity = '{$activity}' ORDER BY t1.time DESC LIMIT 100
EOT;
    } else {
        $gs = isset($_GET['g']) ? "= '{$group}'" : 'IS NULL';
        if ($activity == 'construction') {
            $query = <<<EOT
\t\t\t\tSELECT t1.user, t1.session_id, t1.time, solutions.solution_graph FROM session AS t1 JOIN solutions USING (session_id)  where t1.section = '{$section}' AND t1.mode = '{$mode}' 
\t\t\t\t\tAND t1.problem = '{$shortProblemName}' AND  t1.activity = '{$activity}' AND t1.group {$gs} ORDER BY time DESC LIMIT 100
EOT;
        }
    }
    $result = $mysqli->query($query) or trigger_error("Previous work query failed." . $mysqli->error);
    $data = array();
    while ($row = $result->fetch_array(MYSQLI_ASSOC)) {
        $data[] = $row;
    }
    printHistory($data);
    mysqli_close($mysqli);
    exit;
}
mysqli_close($mysqli);
Example #5
0
    } else {
        if ($numFlights == 2) {
            $fid2 = $bigTuple['FID2'];
            $arrivalFlight = oci_fetch_assoc(executePlainSQL("select * from Flight where fid='{$fid2}'"));
        } else {
            $fid3 = $bigTuple['FID3'];
            $arrivalFlight = oci_fetch_assoc(executePlainSQL("select * from Flight where fid='{$fid3}'"));
        }
    }
    $arrivalApCode = $arrivalFlight['ARRIVALAP'];
    $arrivalAp = oci_fetch_assoc(executePlainSQL("select * from Airport where code='{$arrivalApCode}'"));
    $arrivalCity = $arrivalAp['CITY'];
    $arrivalCountry = $arrivalAp['COUNTRY'];
    $flightLoc = array("DEPARTDATE" => $departDate, "DEPARTCITY" => $departCity, "DEPARTCOUNTRY" => $departCountry, "ARRIVALCITY" => $arrivalCity, "ARRIVALCOUNTRY" => $arrivalCountry);
    return $flightLoc;
}
// Connect Oracle...
if ($db_conn) {
    $cid = $_COOKIE['cid'];
    $history = executePlainSQL("select m.resid,fid1,fid2,fid3,pclass,ticket_num,creditcard,total_cost \n\t\t\t\t\t\t\t   from deter_pay d, payment p,make_res m,\n\t\t\t\t\t\t\t\t  (select i1.resid, i1.fid as fid1,fid2,fid3 \n\t\t\t\t\t\t\t\t   from (select * from res_includes where resorder=1) i1 \n\t\t\t\t\t\t\t\t   left join (select i2.fid as fid2, i3.fid as fid3,i2.resid \n\t\t\t\t\t\t\t\t              from (select * from res_includes where resorder=2) i2 \n\t\t\t\t\t\t\t\t              left join (select * from res_includes where resorder=3) i3 \n\t\t\t\t\t\t\t\t              on i2.resid=i3.resid) i4\n\t\t\t\t\t\t\t   \t   on i1.resid=i4.resid) f \n\t\t\t\t\t\t\t   where m.resid=f.resid AND d.resid=m.resid AND p.payid=d.payid AND m.cid='{$cid}'\n\t\t\t\t\t\t\t   order by m.resid");
    printHistory($history);
    OCILogoff($db_conn);
} else {
    echo "cannot connect";
    $e = OCI_Error();
    // For OCILogon errors pass no handle
    echo htmlentities($e['message']);
}
?>
</div>
</body>