} if (strlen($style) > 0) { $style = "style=\"" . $style . "\" "; } echo "<td class=\"" . ($col == 0 ? "row-label" : "entry-" . ($col < 4 ? "1" : "2")) . "\"" . $style . ">\n"; if ($col == 0) { echo $case_labels[$row]; } else { // ugly math to map tab indices $base = $fieldCount % 30; $sect = (int) ($fieldCount / 30); $subrow = (int) ($base % 15 / 3); $wholerow = (int) ($base / 6); $offset = $base % 6 > 2 ? (4 - $wholerow) * 3 : $wholerow * -3; $tabindex = $fieldCount + $offset + 1; writeField("{$adjs[$section]}{$cases[$row]}_" . $columns[$col - 1], $tabindex); $fieldCount++; } echo "</td>\n"; } echo "</tr>\n"; } } ?> </table> <script language="javascript"> window.oncontextmenu = null; var inputs = document.getElementsByTagName("input"); for (elem in inputs) { inputs[elem].oncontextmenu = handleClick; inputs[elem].onchange = handleChange;
<h1>Application preview</h1> <? page_advanced_include("category_manager", "admin", array("categories" => $categories)); ?> <table> <? if(count($questionList) == 0 ) { echo "<p>You don't have any questions in your application!</p>"; } else { ?> <p>The below questions represent the content that will be viewable to the applicant.</p><br /> <tr><td width=80%> <? echo "<table>"; foreach($questionList as $questionInfo) { writeField(0, 0, $questionInfo[0], $questionInfo[1], $questionInfo[2]); } echo "</table>"; ?> </td><td width=20%> <? if(isset($message) && $message != "") { ?> <form method="post" action="preview.php"> <input type="submit" name="gen" value="Re-Generate PDF" class="pdf_icon right"> </form> <? echo "$message"; } else { ?> <form method="post" action="preview.php">
<h1>Easy Q Adder</h1> <p>Your question preview has been generated and should appear below. You may wish to <a href="easy_question.php">try again</a> or press the button below to add your question.</p> <form method="POST" action="man_questions.php"> <input type="hidden" name="action" value="Add multiple questions" /> <textarea name="data" cols="60" rows="10" style="display:none"><?php echo $generate; ?> </textarea> <table> <? writeField(0, 0, $name, $description, $type); ?> </table> <br /><input type="submit" value="Add question" class="add"/> </form>
if ($section % 3 != 2 || ($col - 1) / 2 % 2 != 1) { // don't write fields for subjunctive future tenses // ugly math to map tab indices $offset = $section * 24 - (int) ($section / 3) * 12; $base = $fieldCount - $offset; $subrow = (int) ($base / ($section % 3 == 2 ? 4 : 8)); $effectiveCol = $section % 3 == 2 && $col > 4 ? $col - 2 : $col; // compensate for missing columns in some rows $tabindex = $offset + $subrow + ($effectiveCol - 1) * 3 + 1; // skip empty fields $fieldName = $columns[$col - 1] . "_{$tenses[$section]}_{$persons[$row]}"; if ($answers[$fieldName] == "" || !array_key_exists($fieldName, $answers)) { $tabindex = -1; } // TODO: maybe remove parent loop and just check if the current field exists in the cells collection? writeField($fieldName, $tabindex); $fieldCount++; } } echo "</td>\n"; } echo "</tr>\n"; } } ?> </table> <script language="javascript"> window.oncontextmenu = null; var inputs = document.getElementsByTagName("input"); for (elem in inputs) { inputs[elem].oncontextmenu = handleClick;
</div> <div class="ctrlHolder"> <label for=""><em>*</em>Full name</label> <input type="text" name="name" /> <p class="formHint">Enter your first and last name, and middle initial if you have one</p> </div> <div class="ctrlHolder"> <label for=""><em>*</em>Email address</label> <input type="text" name="email" /> <p class="formHint">Your password will be sent here</p> </div> <? //Display all required profile items; $profile is an array of $var_id => ($var_name, $var_desc, $var_type) foreach($profile as $var_id => $item) { writeField($var_id, $var_id, $item[0], $item[1], $item[2]); } ?> <? if($config['captcha_enabled']) { ?> <label for=""><img id="captcha" src="<?php echo $basePath; ?> /securimage/securimage_show.php" alt="CAPTCHA Image" /> <a href="#" onclick="document.getElementById('captcha').src = '<?php echo $basePath; ?> /securimage/securimage_show.php?' + Math.random(); return false"><img src="<?php echo $basePath; ?> /securimage/images/refresh.gif" /></a></label> <input type="text" name="captcha_code" />
function writeApplication($user_id, $application_id, $category_id = 0) { $user_id = escape($user_id); $application_id = escape($application_id); $category_id = escape($category_id); //only used if application_id = 0, for baseapp //first verify that application belongs to user $checkArray = checkApplication($user_id, $application_id, true); if ($checkArray[0] == -2) { return FALSE; } $mutable = $checkArray[0] == 0; $club_id = $checkArray[1]; //get application fields if ($club_id == 0) { $result = mysql_query("SELECT answers.id, baseapp.id, baseapp.varname, baseapp.vardesc, baseapp.vartype, answers.val FROM answers, baseapp WHERE answers.application_id = '{$application_id}' AND baseapp.id = answers.var_id AND baseapp.category = '{$category_id}' ORDER BY baseapp.orderId"); } else { $result = mysql_query("SELECT answers.id, supplements.id, supplements.varname, supplements.vardesc, supplements.vartype, answers.val FROM answers, supplements WHERE answers.application_id = '{$application_id}' AND supplements.id = answers.var_id ORDER BY supplements.orderId"); } writeApplicationHeader($club_id, $application_id, $category_id); //We write the div here so that the actual question can add more content inside when using writeField while ($row = mysql_fetch_row($result)) { echo '<div class="ctrlHolder">'; writeField($row[1], $row[0], $row[2], $row[3], $row[4], $row[5], $mutable); echo '</div>'; } writeApplicationFooter(); }
} echo "<td class=\"" . ($col == 0 ? "row-label" : "entry-" . ($col < 5 ? "1" : "2")) . "\"" . $style . ">\n"; if ($col == 0) { echo $case_labels[$row]; } else { if ($section % 3 != 2 || ($col - 1) / 2 % 2 != 1) { // don't write fields for subjunctive future tenses // ugly math to map tab indices $offset = $section * 24 - (int) ($section / 3) * 12; $base = $fieldCount - $offset; $subrow = (int) ($base / ($section % 3 == 2 ? 4 : 8)); $effectiveCol = $section % 3 == 2 && $col > 4 ? $col - 2 : $col; // compensate for missing columns in some rows $tabindex = $offset + $subrow + ($effectiveCol - 1) * 3 + 1; // TODO: maybe remove parent loop and just check if the current field exists in the cells collection? writeField($columns[$col - 1] . "_{$tenses[$section]}_{$persons[$row]}", $tabindex); $fieldCount++; } } echo "</td>\n"; } echo "</tr>\n"; } } ?> </table> <script language="javascript"> window.oncontextmenu = null; var inputs = document.getElementsByTagName("input"); for (elem in inputs) { inputs[elem].oncontextmenu = handleClick;
function customDisplay($instance_id, $target_page, $mutable = true, $submit_text = "Submit") { $instance_id = escape($instance_id); $result = mysql_query("SELECT custom_response.id, custom.id, custom.varname, custom.vardesc, custom.vartype, custom_response.val FROM custom_response LEFT JOIN custom ON custom.id = custom_response.var_id WHERE instance_id = '{$instance_id}' ORDER BY custom.orderId"); echo '<SCRIPT LANGUAGE="JavaScript" SRC="../style/limit.js"></SCRIPT>'; echo "<form enctype=\"multipart/form-data\" method=\"POST\" action=\"{$target_page}\"><table><tr><td width\"60%\"></td><td></td></tr>"; echo '<tr><td colspan="2" align="right"><input type="submit" value="' . $submit_text . '" style="width:100px"></td></tr><tr style="background-color:#ABB4BA"><td colspan="2" style="height:1px"></td></tr><tr><td colspan="2" style="height:10px"></td></tr>'; while ($row = mysql_fetch_row($result)) { writeField($row[1], $row[0], $row[2], $row[3], $row[4], $row[5], $mutable); } echo '<tr><td colspan="2" style="height:10px"></td><tr style="background-color:#ABB4BA"><td colspan="2" style="height:1px"></td></tr></tr><tr><td colspan="2" align="right"><input type="submit" value="' . $submit_text . '" style="width:100px"></td></tr>'; echo "</table></form>"; }