function get_minor_expectations($db_connection, $scode, $oid, $ocode)
{
    // Get strands for this course
    $query = "SELECT id, code, description FROM minor_expectation WHERE overall_expectation_id = " . $oid . " ORDER BY code ASC;";
    $result = mysqli_query($db_connection, $query);
    // Iterate over the result set
    $output = "";
    $count = 1;
    while ($row = mysqli_fetch_assoc($result)) {
        $output .= "\t\t\t\t<span class=\"expectation\">\n";
        if (isChecked('expectations', $row['id'])) {
            $checkedStatus = 'checked';
        } else {
            $checkedStatus = '';
        }
        $output .= "\t\t\t\t<input type=\"checkbox\" name=\"expectations[]\" value=\"" . $row['id'] . "\" " . $checkedStatus . "/>" . $scode . $ocode . "." . $row['code'] . " &nbsp;\n";
        $output .= "\t\t\t\t<span class=\"tooltip\">" . $row['description'] . "</span>\n";
        $output .= "\t\t\t\t</span>\n";
        $count += 1;
        if ($count > 5) {
            $count = 0;
            $output .= "<br/>";
        }
    }
    // Return the generated HTML
    return $output;
}
Exemple #2
0
function printCheckboxList($baseArray, $levelMenu = 0, $formName, $preCheckedArray = array(), $subMargin = 10)
{
    foreach (getParent($baseArray, $levelMenu) as $level) {
        echo '<input ' . isChecked($preCheckedArray, $level->id) . ' style="margin-left: ' . $subMargin . 'px;margin-bottom:7px" type="checkbox" name="' . $formName . '" value="' . $level->id . '">' . ' ' . $level->name . ' <br />';
        printCheckboxList($baseArray, $level->id, $formName, $preCheckedArray, $subMargin + 20);
    }
}
Exemple #3
0
function getAllChild($role_id, $parent_id = NULL, $level = 0)
{
    foreach (\app\models\Menu::find()->where(["parent_id" => $parent_id])->all() as $menu) {
        ?>
                    <div class="form-group" style="padding-left: <?php 
        echo $level * 20;
        ?>
px">
                        <label>
                            <input type="checkbox" name="menu[]" value="<?php 
        echo $menu->id;
        ?>
" class="minimal" <?php 
        echo isChecked($role_id, $menu->id) ? "checked" : "";
        ?>
>
                        </label>
                        <label style="padding-left: 10px"> <?php 
        echo $menu->name;
        ?>
</label>
                    </div>
                <?php 
        //Show All Actions
        $camelName = Inflector::id2camel($menu->controller);
        $fullControllerName = "app\\controllers\\" . $camelName . "Controller";
        if (class_exists($fullControllerName)) {
            $reflection = new ReflectionClass($fullControllerName);
            $methods = $reflection->getMethods();
            echo "<div class=\"form-group\" style=\"padding-left: " . ($level * 20 + 10) . "px;\">";
            echo "<label><input type=\"checkbox\" class=\"minimal select-all\" ></label><label style=\"padding: 0px 20px 0px 5px\"> Select All</label>";
            foreach ($methods as $method) {
                if (substr($method->name, 0, 6) == "action" && $method->name != "actions") {
                    $camelAction = substr($method->name, 6);
                    $id = Inflector::camel2id($camelAction);
                    $name = Inflector::camel2words($camelAction);
                    $action = \app\models\Action::find()->where(["action_id" => $id, "controller_id" => $menu->controller])->one();
                    if ($action == NULL) {
                        //If the action not in database, save it !
                        $action = new \app\models\Action();
                        $action->action_id = $id;
                        $action->controller_id = $menu->controller;
                        $action->name = $name;
                        $action->save();
                    }
                    showCheckbox("action[]", $action->id, $name, hasAccessToAction($role_id, $action->id));
                }
            }
            echo "</div>";
        }
        getAllChild($role_id, $menu->id, $level + 1);
    }
}
    $hol_dayname = array();
    if ($rec_q->num_rows > 0) {
        while ($rec_d = $rec_q->fetch_row()) {
            $hol_dayname[] = $rec_d[0];
        }
    }
    // small function to check the checkbox
    function isChecked($str_data)
    {
        global $hol_dayname;
        if (in_array($str_data, $hol_dayname)) {
            return 'checked';
        }
    }
    // create table object
    $table = new simbio_table();
    $table->table_attr = 'align="center" class="border fullWidth" cellpadding="5" cellspacing="0"';
    // dayname list
    $table->appendTableRow(array('<input type="checkbox" name="dayname[]" value="mon" ' . isChecked('mon') . ' /> ' . __('Monday'), '<input type="checkbox" name="dayname[]" value="tue" ' . isChecked('tue') . ' /> ' . __('Tuesday'), '<input type="checkbox" name="dayname[]" value="wed" ' . isChecked('wed') . ' /> ' . __('Wednesday')));
    $table->appendTableRow(array('<input type="checkbox" name="dayname[]" value="thu" ' . isChecked('thu') . ' /> ' . __('Thursday'), '<input type="checkbox" name="dayname[]" value="fri" ' . isChecked('fri') . ' /> ' . __('Friday'), '<input type="checkbox" name="dayname[]" value="sat" ' . isChecked('sat') . ' /> ' . __('Saturday')));
    $table->appendTableRow(array('<input type="checkbox" name="dayname[]" value="sun" ' . isChecked('sun') . ' /> ' . __('Sunday')));
    // set cell attribute
    $table->setCellAttr(3, 0, 'colspan="3"');
    // submit button
    $table->appendTableRow(array('<input type="button" name="saveDaynameData" value="' . __('Save Settings') . '" onclick="$(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '\', { method: \'POST\', addData: $(\'#holidayForm\').serialize() } )" />'));
    // set cell attribute
    $table->setCellAttr(4, 0, 'colspan="3" class="alterCell"');
    echo '<form name="holidayForm" id="holidayForm">';
    echo $table->printTable();
    echo '</form>';
}
Exemple #5
0
        echo "checked";
    }
}
?>
> I have purchased electronics within the past two years.<br>
                                <input name="statements[]" type="checkbox" value="working_computer" <?php 
if ($_POST['submitapp']) {
    if (isChecked($statement, 'working_computer')) {
        echo "checked";
    }
}
?>
> I have a working computer in my home.<br>
                                <input name="statements[]" type="checkbox" value="internet_access" <?php 
if ($_POST['submitapp']) {
    if (isChecked($statement, 'internet_access')) {
        echo "checked";
    }
}
?>
> I have internet access in my home.
                            </div>
                            <p class="question">
                                Should you receive a computer, is it fine for us to post photos and your name on our website, www.linux4hope.org, as well as on social media, for promotional use?
                            </p>
                            <div class="answer">
                                <input name="permission" type="radio" value="Yes" <?php 
if ($PERM === "Yes") {
    echo "checked";
}
?>
Exemple #6
0
                <!--Row Section-->
                <div class="row_tab">
                    <label class="sfsi_heding">Border?</label>
					<ul class="border_shadow">
                    	<li>
                        	<input type="radio" class="styled" value="yes" name="sfsi_form_border"
                            	<?php 
echo isChecked($option8['sfsi_form_border'], 'yes');
?>
 >
                            <label>Yes</label>
                        </li>
                        <li>
                        	<input type="radio" class="styled" value="no" name="sfsi_form_border"
                            	<?php 
echo isChecked($option8['sfsi_form_border'], 'no');
?>
 >
                            <label>No</label>
                        </li>
                    </ul>
				</div>
                <!--Row Section-->
                <div class="row_tab" style="<?php 
echo $option8['sfsi_form_border'] == 'no' ? "display:none" : '';
?>
">
                	<div class="sfsi_field">
                    	<label>Thickness</label>
                        <input name="sfsi_form_border_thickness" type="text"
                        	value="<?php 
Exemple #7
0
						</label>

						<label class="checkbox">
							<input type="checkbox" name="car[]" value="HONDA"  <?php 
if (isset($_POST['car'])) {
    echo isChecked("HONDA");
}
?>
 >
							Honda
						</label>

						<label class="checkbox">
							<input type="checkbox" name= "car[]" value="TOYOTA"  <?php 
if (isset($_POST['car'])) {
    echo isChecked("TOYOTA");
}
?>
  >
							Toyota
						</label>
            <br />
						<button class="btn btn-success" type="submit" name="filter">Filter</button>
					</form>
				</div>
        	<div class="well">
          <form method = "POST" action = "">
          <legend>Search Cars</legend>
					<input id="Search" name="Search" type="text" placeholder="search by make" class="input-medium search-query"><br><br>
					<button type="submit" name = "text_search" class="btn btn-success">Search</button>
				</form>
Exemple #8
0
    echo '<div style="clear: right;"></div>';
    echo '<div id="autocomplete-case-data"></div>' . "\n";
    echo "</div>\n";
}
echo '<div id="case_data">';
$obj_case = new LcmCaseInfoUI($id_case);
$obj_case->printEdit();
echo "</div>\n";
/* div case_data */
echo "<script type=\"text/javascript\">\n\t\tautocomplete('casesearchkey', 'autocomplete-case-popup', 'ajax.php', 'autocomplete-case-data', 'case_data')\n\t</script>\n";
//
// Follow-up data (only for new case, not edit case)
//
if (!$id_case) {
    echo '<p class="normal_text">';
    echo '<input type="checkbox"' . isChecked(_session('add_fu')) . 'name="add_fu" id="box_new_followup" onclick="display_block(\'new_followup\', \'flip\')" />';
    echo '<label for="box_new_followup">' . "Add a follow-up to the case" . '</label>';
    // TRAD
    echo "</p>\n";
    echo '<div id="new_followup" ' . (_session('add_fu') ? '' : ' style="display: none;"') . '>';
    show_page_subtitle("Follow-up information", 'followups_intro');
    // TRAD
    echo '<div id="autocomplete-fu-alt">';
    $fu = new LcmFollowupInfoUI();
    $fu->printEdit();
    echo "</div>\n";
    echo "</div>\n";
}
echo '<p><button name="submit" type="submit" value="submit" class="simple_form_btn">' . _T('button_validate') . "</button></p>\n";
echo '<input type="hidden" name="admin" value="' . $_SESSION['form_data']['admin'] . "\" />\n";
echo '<input type="hidden" name="ref_edit_case" value="' . $_SESSION['form_data']['ref_edit_case'] . "\" />\n";
Exemple #9
0
 <?php 
        if ($v->type == 1) {
            ?>
  <input type="radio" class="question-item" name="radio-<?php 
            echo $v->id;
            ?>
"
  <?php 
            echo isChecked($v->id, $idx) ? "checked" : "";
            ?>
 />
<?php 
        } else {
            ?>
  <input type="checkbox" class="question-item" name="chkbox" <?php 
            echo isChecked($v->id, $idx) ? "checked" : "";
            ?>
 />
<?php 
        }
        ?>
      <?php 
        echo $item;
        ?>
      </label><br>
    <?php 
    }
    ?>
    <?php 
    if ($v->otherfields) {
        ?>
Exemple #10
0
        $WRONG = $WRONG . "&INCOME=1";
        $INCOME = false;
    }
}
# CHECK THE STATEMENTS THAT MAY APPLY TO YOU.
#if(empty($STATEMENT)){
#	$WRONG = $WRONG."&STATEMENT=1";
#	$STATEMENT = 'false';
#} else {
#    $PURCHASED_ELECTRONICS = isChecked($statement,'purchased_electronics') ? 'true' : 'false';
#    $WORKING_COMP = isChecked($statement,'working_computer') ? 'true' : 'false';
#    $INTERNET_ACCESS = isChecked($statement,'internet_access') ? 'true' : 'false';
#}
$PURCHASED_ELECTRONICS = isChecked($STATEMENT, 'purchased_electronics') ? 'true' : 'false';
$WORKING_COMP = isChecked($STATEMENT, 'working_computer') ? 'true' : 'false';
$INTERNET_ACCESS = isChecked($STATEMENT, 'internet_access') ? 'true' : 'false';
#$PURCHASED_ELECTRONICS = in_array('purchased_electronics') ? 'true' : 'false';
#$WORKING_COMP = in_array('working_computer') ? 'true' : 'false';
#$INTERNET_ACCESS = in_array($statement,'internet_access') ? 'true' : 'false';
# DOES LINUX4HOPE HAVE PERMISSION TO USE PICTURES FOR PROMOTIONAL USE?
if (empty($PERM)) {
    $WRONG = $WRONG . "&PERM=1";
    $PERM = false;
} else {
    if ($PERM === 'Yes') {
        $PERM = 'true';
    } else {
        $PERM = 'false';
    }
}
# Check for errors before inserting into database
Exemple #11
0
function DisplayProcessing()
{
    global $self;
    global $ListNOption;
    global $TopNOption;
    global $OutputFormatOption;
    global $IPStatOption;
    global $IPStatOrder;
    global $LimitScale;
    $detail_opts = $_SESSION['detail_opts'];
    $process_form = $_SESSION['process_form'];
    ?>
	<a name="processing"></a>
	<h3 class="NfProcessing">Netflow Processing</h3>

<form action="<?php 
    echo $self;
    ?>
" onSubmit="return ValidateProcessForm()" id="FlowProcessingForm" method="POST">
<TABLE border="0" cellspacing="3" cellpadding="3" style='font-size:14px;font-weight:bold'>
<tr>
    <TD>Source:</TD>
    <TD>Filter:</TD>
    <TD>Options:</TD>
</tr>

<TR>
	<TD style='vertical-align:top;'>
		<SELECT name="srcselector[]" id=SourceSelector size="6" style="width: 100%" multiple>
<?php 
    foreach ($process_form['srcselector'] as $selected_channel) {
        $_tmp[$selected_channel] = 1;
    }
    $i = 0;
    foreach (array_keys($_SESSION['profileinfo']['channel']) as $channel) {
        $checked = array_key_exists($channel, $_tmp) ? 'selected' : '';
        print "<OPTION value='{$channel}' {$checked}>{$channel}</OPTION>\n";
    }
    ?>
		</SELECT><br>
		<INPUT TYPE="button" NAME="JSbutton2" Value="All Sources" onClick="SelectAllSources()">
	</TD>
	<td style="vertical-align:top;">
		<textarea name="filter" id="filter" multiline="true" wrap="phisical" rows="6" cols="50" maxlength="10240"><?php 
    $display_filter = array_key_exists('editfilter', $process_form) ? $process_form['editfilter'] : $process_form['filter'];
    foreach ($display_filter as $line) {
        print htmlspecialchars(stripslashes($line)) . "\n";
    }
    ?>
</textarea><br>
<?php 
    $deletefilter_display_style = array_key_exists('editfilter', $process_form) ? '' : 'style="display:none;"';
    ?>
		<input type="image" name="filter_delete" id="filter_delete" title="Delete filter" align="right"
			onClick="HandleFilter(3)" value="" src="icons/trash.png" <?php 
    echo $deletefilter_display_style;
    ?>
>
		<input type="image" name="filter_save" id="filter_save" title="Save filter" align="right"
			onClick="HandleFilter(2)" 
			value="" src="icons/save.png">
		<input type="hidden" name="filter_name" id="filter_name" value="none">
		<span id="filter_span">and
		<select name="DefaultFilter" id="DefaultFilter" onChange="HandleFilter(0)" size="1">
<?php 
    print "<option value='-1' label='none'>&lt;none&gt;</option>\n";
    foreach ($_SESSION['DefaultFilters'] as $name) {
        $checked = $process_form['DefaultFilter'] == $name ? 'selected' : '';
        print "<option value='{$name}' {$checked}>{$name}</option>\n";
    }
    $editfilter_display_style = 'style="display:none;"';
    foreach ($_SESSION['DefaultFilters'] as $name) {
        if ($process_form['DefaultFilter'] == $name) {
            $editfilter_display_style = '';
        }
    }
    ?>
		</select></span>
		<input type="image" name="filter_edit" id="filter_edit" title="Edit filter" <?php 
    echo $editfilter_display_style;
    ?>
			onClick="HandleFilter(1)" value="" src="icons/edit.png">
        <script language="Javascript" type="text/javascript">
            var DefaultFilters = new Array();
<?php 
    foreach ($_SESSION['DefaultFilters'] as $name) {
        print "DefaultFilters.push('{$name}');\n";
    }
    if (array_key_exists('editfilter', $process_form)) {
        print "edit_filter = '" . $process_form['DefaultFilter'] . "';\n";
    }
    ?>
        </script>
	</td>
	<!-- Options start here -->
	<td style='padding: 0px;vertical-align:top;'>
 		<table border="0"id="ProcessOptionTable" style="font-size:14px;font-weight:bold;">
			<tr><td colspan="2">
<?php 
    $i = 0;
    foreach (array('List Flows', 'Stat TopN') as $s) {
        $checked = $process_form['modeselect'] == $i ? 'checked' : '';
        print "<input type='radio' onClick='SwitchOptionTable({$i})' name='modeselect' id='modeselect{$i}' value='{$i}' {$checked}>{$s}&nbsp;";
        $i++;
    }
    $list_display_style = $process_form['modeselect'] == 0 ? '' : 'style="display:none;"';
    $stat_display_style = $process_form['modeselect'] == 0 ? 'style="display:none;"' : '';
    $formatselect_display_opts = $process_form['modeselect'] == 1 && $process_form['stattype'] != 0 ? 'style="display:none;"' : '';
    ?>
			</td></tr>
			<tr id="listNRow" <?php 
    echo $list_display_style;
    ?>
>
				<td class='TDnfprocLabel'>Limit to:</td>
				<td class='TDnfprocControl'>
					<select name="listN" id="listN" style="margin-left:1" size="1">
<?php 
    for ($i = 0; $i < count($ListNOption); $i++) {
        $checked = $process_form['listN'] == $i ? 'selected' : '';
        print "<OPTION value='{$i}' {$checked}>" . $ListNOption[$i] . "</OPTION>\n";
    }
    ?>
					</select> Flows<br>
				</td>
			</tr>
			<tr id="topNRow" <?php 
    echo $stat_display_style;
    ?>
>
				<td class='TDnfprocLabel'>Top:</td>
				<td class='TDnfprocControl'> 
					<select name="topN" id="TopN" size="1">
<?php 
    for ($i = 0; $i < count($TopNOption); $i++) {
        $checked = $process_form['topN'] == $i ? 'selected' : '';
        print "<OPTION value='{$i}' {$checked}>" . $TopNOption[$i] . "</OPTION>\n";
    }
    ?>
					</select>
				</td>
			</tr>
			<tr id="stattypeRow" <?php 
    echo $stat_display_style;
    ?>
>
				<td class="TDnfprocLabel">Stat:</td>
				<td class="TDnfprocControl">
					<select name="stattype" id="StatTypeSelector" onChange="ShowHideOptions()" size="1">
<?php 
    for ($i = 0; $i < count($IPStatOption); $i++) {
        $checked = $process_form['stattype'] == $i ? 'selected' : '';
        print "<OPTION value='{$i}' {$checked}>" . $IPStatOption[$i] . "</OPTION>\n";
    }
    ?>
					</select>
					order by&nbsp;
					<select name='statorder' id="statorder" size='1'>
<?php 
    for ($i = 0; $i < count($IPStatOrder); $i++) {
        $checked = $process_form['statorder'] == $i ? 'selected' : '';
        print "<OPTION value='{$i}' {$checked}>" . $IPStatOrder[$i] . "</OPTION>\n";
    }
    ?>
					</select>					
				</td>
			</tr>
			<tr id="AggregateRow" <?php 
    echo $formatselect_display_opts;
    ?>
>
				<td class='TDnfprocLabel'>Aggregate</td>
				<td class='TDnfprocControl'>
					<input type="checkbox" name="aggr_bidir" id="aggr_bidir" value="checked" onClick="ToggleAggregate();"
						style="margin-left:1" <?php 
    echo $process_form['aggr_bidir'];
    ?>
>&nbsp;bi-directional<br>
					<input type="checkbox" name="aggr_proto" id="aggr_proto" value="checked" 
						style="margin-left:1" <?php 
    echo $process_form['aggr_proto'];
    ?>
>&nbsp;proto<br>
					<input type="checkbox" name="aggr_srcport" id="aggr_srcport" value="checked" 
						style="margin-left:1" <?php 
    echo $process_form['aggr_srcport'];
    ?>
>&nbsp;srcPort
					<input type="checkbox" name="aggr_srcip" id="aggr_srcip" value="checked" 
						style="margin-left:1" <?php 
    echo $process_form['aggr_srcip'];
    ?>
>&nbsp;
    				<select name="aggr_srcselect" id="aggr_srcselect" onChange="NetbitEntry('src')" size="1">
<?php 
    $i = 0;
    foreach (array('srcIP', 'srcIPv4/', 'srcIPv6/') as $s) {
        $checked = $process_form['aggr_srcselect'] == $i ? 'selected' : '';
        print "<option value='{$i}' {$checked}>{$s}</option>\n";
        $i++;
    }
    $_style = $process_form['aggr_srcselect'] == 0 ? 'style="display:none"' : '';
    ?>
					</select>
					<input size="3" type="text" name="aggr_srcnetbits" id="aggr_srcnetbits" 
						value="<?php 
    echo $process_form['aggr_srcnetbits'];
    ?>
" <?php 
    echo $_style;
    ?>
><br>
					<input type="checkbox" name="aggr_dstport" id="aggr_dstport" value="checked" 
						style="margin-left:1" <?php 
    echo $process_form['aggr_dstport'];
    ?>
>&nbsp;dstPort
					<input type="checkbox" name="aggr_dstip" id="aggr_dstip" value="checked" 
						style="margin-left:1" <?php 
    echo $process_form['aggr_dstip'];
    ?>
>&nbsp;
    				<select name="aggr_dstselect" id="aggr_dstselect" onChange="NetbitEntry('dst')" size="1">
<?php 
    $i = 0;
    foreach (array('dstIP', 'dstIPv4/', 'dstIPv6/') as $s) {
        $checked = $process_form['aggr_dstselect'] == $i ? 'selected' : '';
        print "<option value='{$i}' {$checked}>{$s}</option>\n";
        $i++;
    }
    $_style = $process_form['aggr_dstselect'] == 0 ? 'style="display:none"' : '';
    ?>
					</select>
					<input size="3" type="text" name="aggr_dstnetbits" id="aggr_dstnetbits" 
						value="<?php 
    echo $process_form['aggr_dstnetbits'];
    ?>
" <?php 
    echo $_style;
    ?>
><br>
				</td>
			</tr>
			<tr id="timesortedRow" <?php 
    echo $list_display_style;
    ?>
>
				<td class='TDnfprocLabel'>Sort:</td>
				<td class='TDnfprocControl'>
					<input type="checkbox" name="timesorted" id="timesorted" value="checked" 
						style="margin-left:1" <?php 
    echo $process_form['timesorted'];
    ?>
>
					start time of flows</td>
			</tr>
			<tr id="limitoutputRow" <?php 
    echo $stat_display_style;
    ?>
>
				<td class='TDnfprocLabel'>Limit:</td>
				<td class='TDnfprocControl'>
					<input type="checkbox" name="limitoutput" id="limitoutput" value="checked" style="margin-left:1" 
						size="1" <?php 
    echo $process_form['limitoutput'];
    ?>
>
					<select name="limitwhat" id="limitwhat" size="1">
<?php 
    $i = 0;
    foreach (array('Packets', 'Traffic') as $s) {
        $checked = $process_form['limitwhat'] == $i ? 'selected' : '';
        print "<option value='{$i}' {$checked}>{$s}</option>\n";
        $i++;
    }
    ?>
					</select>
					<select name="limithow" id="limithow" size="1">
<?php 
    $i = 0;
    foreach (array('&gt;', '&lt;') as $s) {
        $checked = $process_form['limithow'] == $i ? 'selected' : '';
        print "<option value='{$i}' {$checked}>{$s}</option>\n";
        $i++;
    }
    ?>
					</select>
					<input type="text" name="limitsize" id="limitsize" value="<?php 
    echo $process_form['limitsize'];
    ?>
" SIZE="6" MAXLENGTH="8">
					<select name="limitscale" id="limitscale" size="1" style="margin-left:1">
<?php 
    $i = 0;
    foreach ($LimitScale as $s) {
        $checked = $process_form['limitscale'] == $i ? 'selected' : '';
        print "<option value='{$i}' {$checked}>{$s}</option>\n";
        $i++;
    }
    ?>
					</select>
				</td>
			</tr>

			<tr id="outputRow">
				<td class='TDnfprocLabel'>Output:</td>
				<td class='TDnfprocControl'>
					<span id="FormatSelect" <?php 
    echo $formatselect_display_opts;
    ?>
>
					<select name="output" id="output" onChange="CustomOutputFormat()"  style="margin-left:1" size="1">
<?php 
    foreach ($_SESSION['formatlist'] as $key => $value) {
        $checked = $process_form['output'] == $key ? 'selected' : '';
        print "<OPTION value='{$key}' {$checked}>{$key}</OPTION>\n";
    }
    $fmt = $_SESSION['formatlist'][$process_form['output']];
    if ($process_form['output'] == $fmt) {
        // built in format
        $space_display_style = '';
        $edit_display_style = 'style="display:none"';
    } else {
        $space_display_style = 'style="display:none"';
        $edit_display_style = '';
    }
    ?>
					</select>
    				<script language="Javascript" type="text/javascript">
						var fmts = new Hash();
<?php 
    foreach ($_SESSION['formatlist'] as $key => $value) {
        print "fmts.setItem('{$key}', '{$value}');\n";
    }
    ?>
					</script>
					<img src="icons/space.png" border="0" alt='space' id='space' <?php 
    echo $space_display_style;
    ?>
></img>
					<a href="#null" onClick="EditCustomFormat()"
						title="Edit format" ><IMG SRC="icons/edit.png" name="fmt_doedit" id="fmt_doedit" border="0" 
						<?php 
    echo $edit_display_style;
    ?>
 alt="Edit format"></a>
					</span>
					<input type="checkbox" name="IPv6_long" id="IPv6_long" style="margin-left:1" value="checked" <?php 
    echo $process_form['IPv6_long'];
    ?>
>
					&nbsp;/ IPv6 long
<?php 
    $fmt_edit_display_style = $process_form['output'] == 'custom ...' ? '' : 'style="display:none"';
    ?>
					<span id="fmt_edit" <?php 
    echo $fmt_edit_display_style;
    ?>
>
					<br>Enter custom output format:<br>
					<input size="30" type="text" name="customfmt" id="customfmt" 
						value="<?php 
    echo htmlspecialchars(stripslashes($process_form['customfmt']));
    ?>
" >
					<input type="image" name="fmt_save" id="fmt_save" title="Save format" 
						onClick="SaveOutputFormat()" 
						value="" src="icons/save.png">
					<input type="image" name="fmt_delete" id="fmt_delete" title="Delete format" 
						onClick="DeleteOutputFormat()" 
						value="" src="icons/trash.png" <?php 
    echo $edit_display_style;
    ?>
>
					</span>
				</td>
			</tr>
		</table>
 	</td>
</tr>
<tr>
	<td></td><td></td>
	<td align="right">
		<input type="button" name="JSbutton1" value="Clear Form" onClick="ResetProcessingForm()">
		<input type="submit" name="process" value="process" onClick="form_ok=true;" size="1">
	</td>
</tr>

</TABLE>
</form>

<div id="lookupbox">
	<div id="lookupbar" align="right" style="background-color:olivedrab"><img src="icons/close.png"
		onmouseover="this.style.cursor='pointer';" onClick="hidelookup()" title="Close lookup box"></div>
	<iframe id="cframe" src="" frameborder="0" scrolling="auto" width="100%" height="166"></iframe>
</div>


<?php 
    if (!array_key_exists('run', $_SESSION)) {
        return;
    }
    //print var_dump($_SESSION);
    print "<div class='flowlist'>\n";
    $run = $_SESSION['run'];
    if ($run != null) {
        $filter = $process_form['filter'];
        if ($process_form['DefaultFilter'] != -1) {
            $cmd_opts['and_filter'] = $process_form['DefaultFilter'];
        }
        $cmd_opts['type'] = ($_SESSION['profileinfo']['type'] & 4) > 0 ? 'shadow' : 'real';
        $cmd_opts['profile'] = $_SESSION['profileswitch'];
        $cmd_opts['srcselector'] = implode(':', $process_form['srcselector']);
        print "<pre>\n";
        $patterns = array();
        $replacements = array();
        $patterns[0] = '/(\\s*)([^\\s]+)/';
        $replacements[0] = "\$1<a href='#null' onClick='lookup(\"\$2\", this, event)' title='lookup \$2'>\$2</a>";
        // gets HAP4NfSens plugin id. returns -1 if HAP4NfSen is not installed.
        function getHAP4NfSenId()
        {
            $plugins = GetPlugins();
            for ($i = 0; $i < count($plugins); $i++) {
                $plugin = $plugins[$i];
                if ($plugin == "HAP4NfSen") {
                    return $i;
                }
            }
            return -1;
        }
        ClearMessages();
        $cmd_opts['args'] = "-T {$run}";
        $cmd_opts['filter'] = $filter;
        $cmd_out = nfsend_query("run-nfdump", $cmd_opts);
        if (!is_array($cmd_out)) {
            ShowMessages();
        } else {
            $hap4nfsen_id = getHAP4NfSenId();
            if ($hap4nfsen_id >= 0) {
                // ICMP "port" filter are no currently supported by the HAP4NfSen plugin
                function isChecked(&$form, $name)
                {
                    // helper function used to find out, if an option is checked
                    return $form[$name] == "checked";
                }
                $ip_and_port_columns = preg_match('/(flow records)/i', $IPStatOption[$process_form['stattype']]) && (isChecked($process_form, 'aggr_srcip') && isChecked($process_form, 'aggr_srcport') || isChecked($process_form, 'aggr_dstip') && isChecked($process_form, 'aggr_dstport'));
                $ip_contains_port = $_SESSION["process_form"]["modeselect"] == '0' || !preg_match('/[ip|flow_records]/i', $IPStatOption[$process_form['stattype']]) || preg_match('/(flow records)/i', $IPStatOption[$process_form['stattype']]) && !(isChecked($process_form, 'aggr_srcip') || isChecked($process_form, 'aggr_srcport') || isChecked($process_form, 'aggr_dstip') || isChecked($process_form, 'aggr_dstport'));
                $_SESSION["plugin"][$hap4nfsen_id]["cmd_opts"] = $cmd_opts;
                $hap_pic = "<img src=\"plugins/HAP4NfSen/graphviz.png\" valign=\"middle\" border=\"0\" alt=\"HAP\" />";
                $default_pattern = array_pop($patterns);
                $default_replacement = array_pop($replacements);
                if ($ip_contains_port) {
                    // matches cases like ip:port
                    $max_prot_length = 5;
                    // max. port length = 5 chars(highest port number = 65535)
                    for ($i = $max_prot_length; $i >= 1; $i--) {
                        $diff = $max_prot_length - $i;
                        // difference between actual and max port length
                        $ip_port_pattern_icmp = "/(\\s*)([^\\s|^:]+)(:)(0\\s{4}|\\d\\.\\d\\s{2}|\\d{2}\\.\\d\\|\\d\\.\\d{2}\\s|\\d{2}\\.\\d{2})/";
                        $ip_port_pattern_normal = "/(\\s*)([^\\s|^:]+)(:)([\\d|\\.]{{$i}})(\\s{{$diff}})/";
                        $spaces = '';
                        for ($k = 0; $k < $diff; $k++) {
                            $spaces = $spaces . ' ';
                        }
                        // spaces required to align hap viewer icons
                        array_push($patterns, $ip_port_pattern_icmp);
                        array_push($replacements, $default_replacement . "\$3\$4 <a href=\"nfsen.php?tab=5&sub_tab=" . $hap4nfsen_id . "&ip=\$2&mode=new\" title='HAP graphlet for \$2'>{$hap_pic}</a> ");
                        array_push($patterns, $ip_port_pattern_normal);
                        array_push($replacements, $default_replacement . "\$3\$4{$spaces} <a href=\"nfsen.php?tab=5&sub_tab=" . $hap4nfsen_id . "&ip=\$2&port=\$4&mode=new\" title='HAP graphlet for \$2 on port \$4'>{$hap_pic}</a> ");
                    }
                    array_push($patterns, '/(\\sIP\\sAddr:Port)/i');
                    array_push($replacements, "\$1  {$hap_pic}");
                } else {
                    if ($ip_and_port_columns) {
                        // matches cases when both ip and port are available but are located in separate columns
                        // ICMP verion
                        $ip_and_port_pattern = "/(\\s*)([^\\s]+)(\\s+)(0|\\d\\.\\d)/";
                        $ip_and_port_replacement = "\$1\$2\$3\$4 " . "<a href=\"nfsen.php?tab=5&sub_tab=" . $hap4nfsen_id . "&ip=\$2&mode=new\" title='HAP graphlet for \$2'>{$hap_pic}</a>";
                        array_push($patterns, $ip_and_port_pattern);
                        array_push($replacements, $ip_and_port_replacement);
                        // non-ICMP version with port filter
                        $ip_and_port_pattern = "/(\\s*)([^\\s]+)(\\s*)([\\d|.]+)/";
                        $ip_and_port_replacement = "\$1\$2\$3\$4 " . "<a href=\"nfsen.php?tab=5&sub_tab=" . $hap4nfsen_id . "&ip=\$2&port=\$4&mode=new\" title='HAP graphlet for \$2 on port \$4'>{$hap_pic}</a>";
                        array_push($patterns, $ip_and_port_pattern);
                        array_push($replacements, $ip_and_port_replacement);
                        array_push($patterns, '/(\\s\\s(Src\\sIP\\sAddr\\s*Src\\sPt|Dst\\sIP\\sAddr\\s*Dst\\sPt))/i');
                        array_push($replacements, "\$1 {$hap_pic}");
                    } else {
                        // matches all other cases
                        array_push($patterns, $default_pattern);
                        array_push($replacements, $default_replacement . " <a href=\"nfsen.php?tab=5&sub_tab=" . $hap4nfsen_id . "&ip=\$2&mode=new\" title='HAP graphlet for \$2'>{$hap_pic}</a>");
                        array_push($patterns, '/(\\s(|\\s(Src|Dst))\\sIP\\sAddr)/i');
                        array_push($replacements, "\$1 {$hap_pic}");
                    }
                }
            }
            if (array_key_exists('arg', $cmd_out)) {
                print "** nfdump " . $cmd_out['arg'] . "\n";
            }
            if (array_key_exists('filter', $cmd_out)) {
                print "nfdump filter:\n";
                foreach ($cmd_out['filter'] as $line) {
                    print "{$line}\n";
                }
            }
            foreach ($cmd_out['nfdump'] as $line) {
                print preg_replace($patterns, $replacements, $line) . "\n";
            }
        }
        print "</pre>\n";
    }
    print "</div>\n";
    return;
}
Exemple #12
0
    $hol_dayname = array();
    if ($rec_q->num_rows > 0) {
        while ($rec_d = $rec_q->fetch_row()) {
            $hol_dayname[] = $rec_d[0];
        }
    }
    // small function to check the checkbox
    function isChecked($str_data)
    {
        global $hol_dayname;
        if (in_array($str_data, $hol_dayname)) {
            return 'checked';
        }
    }
    // create table object
    $table = new simbio_table();
    $table->table_attr = 'align="center" class="border fullWidth" cellpadding="5" cellspacing="0"';
    // dayname list
    $table->appendTableRow(array('<input type="checkbox" name="dayname[]" value="mon" ' . isChecked('mon') . ' /> ' . lang_sys_conf_holiday_field_day_1, '<input type="checkbox" name="dayname[]" value="tue" ' . isChecked('tue') . ' /> ' . lang_sys_conf_holiday_field_day_2, '<input type="checkbox" name="dayname[]" value="wed" ' . isChecked('wed') . ' /> ' . lang_sys_conf_holiday_field_day_3));
    $table->appendTableRow(array('<input type="checkbox" name="dayname[]" value="thu" ' . isChecked('thu') . ' /> ' . lang_sys_conf_holiday_field_day_4, '<input type="checkbox" name="dayname[]" value="fri" ' . isChecked('fri') . ' /> ' . lang_sys_conf_holiday_field_day_5, '<input type="checkbox" name="dayname[]" value="sat" ' . isChecked('sat') . ' /> ' . lang_sys_conf_holiday_field_day_6));
    $table->appendTableRow(array('<input type="checkbox" name="dayname[]" value="sun" ' . isChecked('sun') . ' /> ' . lang_sys_conf_holiday_field_day_7));
    // set cell attribute
    $table->setCellAttr(3, 0, 'colspan="3"');
    // submit button
    $table->appendTableRow(array('<input type="button" name="saveDaynameData" value="' . lang_sys_conf_holiday_form_save . '" onclick="setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '\', \'post\', $(\'holidayForm\').serialize())" />'));
    // set cell attribute
    $table->setCellAttr(4, 0, 'colspan="3" class="alterCell"');
    echo '<form name="holidayForm" id="holidayForm">';
    echo $table->printTable();
    echo '</form>';
}
?>
 />
                                        <input type="checkbox" class="cbx" name="motion[]" data-sdb-image="url('img/bt40_simulation.png')" value="2" alt="Simulation" <?php 
isChecked($getMotion_Type, 2);
?>
 />
                                        <input type="checkbox" class="cbx" name="motion[]" data-sdb-image="url('img/bt40_animation.png')" value="3" alt="Cartoon (Drawing)" <?php 
isChecked($getMotion_Type, 3);
?>
 />
                                        <input type="checkbox" class="cbx" name="motion[]" data-sdb-image="url('img/bt40_stop_motion.png')" value="4" alt="Stop Motion" <?php 
isChecked($getMotion_Type, 4);
?>
 />
                                        <input type="checkbox" class="cbx" name="motion[]" data-sdb-image="url('img/bt40_video.png')" value="5" alt="Video" <?php 
isChecked($getMotion_Type, 5);
?>
 />
                                    </div>
                                </div>

                                <div class="CanvasLine<?php 
if (!Check_Digits($getTempo)) {
    echo ' input_error';
}
?>
">
                                    <div class="Header"><?php 
echo $nme_Tempo;
?>
                                        <div id="TempoDisplay"></div>
Exemple #14
0
                    <input name="q5" id="q5" type="checkbox" <?php 
isChecked("5");
?>
/>
                </div>
                <div>
                    <label for="q6">Faire du shopping</label>
                    <input name="q6" id="q6" type="checkbox" <?php 
isChecked("6");
?>
/>
                </div>
                <div>
                    <label for="q7">Aller au car wash</label>
                    <input name="q7" id="q7" type="checkbox" <?php 
isChecked("7");
?>
/>
                </div>
                <input type="submit" value="Alors, t'es d'accord ?"/>
            </form>
            <section class="response">
                <?php 
if ($isAsked) {
    responseDady($for, $against);
}
?>
            </section>
		</main>

<?php 
Exemple #15
0
    print "&nbsp;<input type=submit name=submitDetailMaps value=\"Export map entries\" class=form>";
    print "<input type=hidden name=name value={$name}>";
    if ($ZoneDebug == TRUE) {
        print "<td class=tab_title><a href={$PHP_SELF}?name={$name}&order=id>Id</a></td>";
    }
    print "<td class=tab_title>List</a></td><td class=tab_title><a href={$PHP_SELF}?name={$name}&order=name>Name</a></td>";
    if ($ZoneDebug == TRUE) {
        print "<td class=tab_title><a href={$PHP_SELF}?name={$name}&order=loottable_id>Loottable</a></td>";
    }
    print "\n         <td class=tab_title><a href={$PHP_SELF}?name={$name}&order=class>Class</a></td>\n         <td class=tab_title><a href={$PHP_SELF}?name={$name}&order=race>Race</a></td>\n         <td class=tab_title><a href={$PHP_SELF}?name={$name}&order=level>Level</a></td>\n         ";
    while ($row = mysql_fetch_array($result)) {
        print "<tr>";
        if ($ZoneDebug == TRUE) {
            print "<td>" . $row["id"] . "</td>";
        }
        print "<td align=center><input type=checkbox name=npc[] value=" . $row["id"] . (isChecked($row["id"]) ? " checked" : "") . " class=form></td>";
        print "<td><a href=npc.php?id=" . $row["id"] . ">" . str_replace(array('_', '#'), ' ', $row["name"]) . "</a>";
        if ($ZoneDebug == TRUE) {
            print "</td><td>" . $row["loottable_id"];
        }
        print "</td>\n           <td align=center>" . $dbclasses[$row["class"]] . "</td>\n           <td align=center>" . $dbiracenames[$row["race"]] . "</td>\n           <td align=center>" . $row["level"] . "</td>\n           </tr>";
    }
    print "</form>";
    print "</table><p></center>";
}
// end npcs
print "</td><td width=0% nowrap>";
// end first column
print "<p class=page_small_title>Ressources</p>";
print "<li><a href=zone.php?name={$name}&mode=npcs>" . $zone["long_name"] . " Bestiary List</a>";
print "<li><a href=zonenameds.php?name={$name}&mode=npcs>" . $zone["long_name"] . " Named Mobs List</a>";