function professors_render($student) { if ($student["Type"] == professor) { h3($student['FirstName'] . " " . $student['LastName']); p("Email: " . $student['Email']); } }
function showSettingsGUI() { // adminpage, stop here if not logged in/right access-level if (!isValidAdmin()) { echo getString("not_valid_admin", "Administratorside, du må logge inn for å få tilgang her"); return; } if (isset($_REQUEST['module'])) { $module = $_REQUEST['module']; } else { $module = ""; } if (isset($_REQUEST['key'])) { $key = $_REQUEST['key']; } else { $key = ""; } h3(getString("settings_header", "Innstillinger")); // mulighet til å velge andre moduler: showModulesDropDown($module); if (isset($_REQUEST['save'])) { if ($_REQUEST['save'] == true && $key != "") { // check if we got a value, if we did not, it's a unchecked checkbox.' // did we get a value to save? if (isset($_REQUEST['setting'])) { $value = $_REQUEST['setting']; // "bugfix" kind of if (getSettingType($key) == "boolean") { // check if it is an checkbox, if so, its value is "on" if ($value == "on") { $value = "true"; } } } else { // setting the value to false, as this probably is an unchecked checkbox. $value = "false"; } // save $result = saveSetting($key, $value); div_open(); // success? reset key. if ($result == true) { // reset $key = ""; echo getString("settings_saved_setting", "Innstilling lagret!"); } else { echo getString("settings_could_not_save_setting", "Greide ikke å lagre innstilling!"); } div_close(); } } // if chosen, show the settings if ($module) { showModuleSettings($module, $key); } }
function subjects_render($subject) { h3($subject['Code'] . " -" . $subject['Name']); p("Building: " . $subject['Building'] . " " . $subject["Class"]); p("Imparted by: " . $subject['Professor']); p("Semester: " . $subject['Semester']); if (users_loggedIn()) { subjects_renderEnrollmentForm($subject); } }
function courses_render($courses) { foreach ($courses as $course) { $id = $course['Course_id']; h3("<li><h2><a href='index.php?option=courses&view=details&v1={$id}'>Course number:" . $course['Course_number'] . "</a></h2></li><h3>" . $course['Name'] . "</h3>"); p("Description: " . $course['Description']); echo '<hr>' . PHP_EOL; } //if (users_loggedIn()) { //books_renderEnrollForm($course); //} }
function display_render($course) { h3("Number: " . $course['Course_number']); p("Name: " . $course['Name']); p("Description: " . $course['Description']); p("Hours: " . $course['Credit_hours']); if (users_loggedIn()) { disp_renderEnrollForm($course); disp_renderEnrollsForm($course); //echo '<a href="index.php?option=users&view=enrolls&user=$_SESSION">View enrollments</a>'.PHP_EOL; } }
/** * Create a postbox widget on the admin pages * * * Notes: Similar to Yoast's potbox (sic) * * */ function oik_box($class = NULL, $id = NULL, $title = NULL, $callback = 'oik_callback') { if ($id == NULL) { $id = $callback; } sdiv("postbox {$class}", $id); sdiv("handlediv", NULL, kv('title', __("Click to toggle"))); br(); ediv(); h3(bw_translate($title), "hndle"); sdiv("inside"); call_user_func($callback); ediv("inside"); ediv("postbox"); }
function get_Form() { h1("First step:Create your database"); echo '<form id="CreateDataBase" action="installation.php" method="POST"> ' . PHP_EOL; h3("Introduce a Hostname"); echo '<p><input name="hostname" type="text"/></p>' . PHP_EOL; h3("Introduce an User"); echo '<p><input name="user" type="text" /></p>' . PHP_EOL; h3("Introduce a password"); echo '<p><input name="password" type="text" /></p>' . PHP_EOL; h3("Introduce a name for the database"); echo '<p><input name="db_name" type="text"/></p>' . PHP_EOL; echo ' <input type="submit" value="Submit"/> ' . PHP_EOL; echo '</form> '; }
function styleConfig() { echo '<div class="beta_box">'; div_open("beta_header"); echo "Personlig stilvalg - under utprøving! (beta)"; div_close(); echo '<div id="testediv"> </div>'; echo '<div id="xhrfeedback"> </div>'; h3("Velg en stil"); form_start_custom("styleedit", "javascript:changeUserStyle('modules/styleService.php')", "POST"); ?> <select id="userStyles"> <option value="NULL">Velg stilark</option> <option value="NULL">Gå tilbake til standard</option> </select> <script type="text/javascript"> fetchStyles('modules/styleService.php'); </script> <?php form_submit("submit", "Bruk valgt stil"); form_end(); h3("Legg opp en ny stil"); form_start_custom("styleadd", "javascript:addUserStyle('modules/styleService.php')", "POST"); form_textfield2("Navn", "styleName", ""); br(); form_textfield2("URL", "styleURL", ""); br(); form_submit("submit", "Legg opp stil"); br(); form_end(); h3("Stiler du kan slette"); echo "(Disse er lagt opp av deg og ikke i bruk av noen andre for øyeblikket.)"; div_open("", "", "deleteStyleList"); div_close(); div_close(); }
/** *###################################################################### *# takeaway heading *###################################################################### */ function takeaway_heading($atts) { if (isset($atts['type'])) { switch ($atts['type']) { case 'h1': return h1($atts); break; case 'h2': return h2($atts); break; case 'h3': return h3($atts); break; case 'h4': return h4($atts); break; case 'h5': return h5($atts); break; } } return ''; }
/** * Implement [29608] shortcode. * * Displays a form which you can use to enter content * and see the results of 'the_content' filtering before and * after the implementation of a fix for TRAC 29608 * * Output * * - input area * - information area for shortcode expansion options * - output area showing pre 29608 output - i.e. the original 'expected' output * - output area displaying post 29608 output - the new 'expected' output * - output area showing how pre 29608 output formats * - output area showing how post 29608 output format * * If there are differences * - output area showing the hexadecimal dump of the original output * - output area showing the hexadecimal dump of the new output * * Notes: Since the intended logic for TRAC 29608 is to perform autop processing after shortcode expansion * rather than before, and since this code is being run as a shortcode * then the whole of this output would normally be affected by the filters that run subsequently. * This makes a mockery of the processing. * We call trac_29608_disable_remaining_filters() to prevent this from happening. * */ function trac_29608($atts = null, $content = null, $tag = null) { $value = bw_array_get($_REQUEST, "input_29608", "Code is poetry"); define('WP_INSTALLING', true); $pre_29608_result = trac_pre_29608($value); $post_29608_result = trac_post_29608($value); h3("Results"); $match = trac_29608_compare($pre_29608_result, $post_29608_result); e(bw_do_shortcode("[div class=w50p5]")); $version = bw_wp(array("v")); h3($version); trac_29608_input($pre_29608_result); ediv(); //sdiv( "w50p0" ); e(bw_do_shortcode("[div class=w50p0]")); h3("autopia"); trac_29608_input($post_29608_result); ediv(); sediv("cleared"); e("<hr />"); e(bw_do_shortcode("[div class=w50p0]")); trac_29608_display($pre_29608_result); ediv(); e(bw_do_shortcode("[div class=w50p0]")); trac_29608_display($post_29608_result); ediv(); sediv("cleared"); //if ( !$match ) { h3("Hex dump"); trac_29608_dump($pre_29608_result); trac_29608_dump($post_29608_result); //} h3("Performance comparison"); trac_29608_perf($value); $bw_ret = bw_ret(); trac_29608_form($value); $bw_ret_form = bw_ret(); $bw_ret = $bw_ret_form . $bw_ret; trac_29608_disable_remaining_filters(); bw_trace2($bw_ret, "bw_ret", false); return $bw_ret; }
h2("LatLngBounds class: maximum bounds in GMaps"); $bounds3 = new LatLngBounds(new LatLng(-85.051128779807, -180), new LatLng(85.051128779807, 180)); h3("Constructor (new LatLng(-85.051128779807, -180), new LatLng(85.051128779807, 180))"); p($bounds3->toString()); h3("getCenter()"); p($bounds3->getCenter()->toString()); h3("getSouthWest()"); p($bounds3->getSouthWest()->toString()); h3("getNorthEast()"); p($bounds3->getNorthEast()->toString()); h3('contains(moscow)'); p($bounds3->contains($moscow)); h3('contains(sydney)'); p($bounds3->contains($sydney)); h3('contains(buenosaires)'); p($bounds3->contains($buenosaires)); h2('Spherical geometry static class'); h3('computeArea(london, donostia, newyork)'); p(float_to_string(SphericalGeometry::computeArea(array($london, $donostia, $newyork)))); h3('computeSignedArea(london, donostia, newyork)'); p(float_to_string(SphericalGeometry::computeSignedArea(array($london, $donostia, $newyork)))); h3('computeDistanceBetween(london, newyork)'); p(float_to_string(SphericalGeometry::computeDistanceBetween($london, $newyork))); h3('computeHeading(london, newyork)'); p(float_to_string(SphericalGeometry::computeHeading($london, $newyork))); h3('computeLength(london, newyork, moscow, sydney)'); p(float_to_string(SphericalGeometry::computeLength(array($london, $newyork, $moscow, $sydney)))); h3('computeOffset(london, 5576353.232683, -71.669371)'); p(SphericalGeometry::computeOffset($london, 5576353.232683, -71.669371)->toString()); h3('interpolate(newyork, sydney, 0.7)'); p(SphericalGeometry::interpolate($newyork, $sydney, 0.7)->toString());
function purchases_render($purchase) { h3($purchase['Course_number']); p("Name: " . $purchase['Name']); }
function mostrar_informacion() { global $d, $t, $pk, $pki, $con, $meta; echo h3("Tabla {$t}"); echo h4("Clave primaria: {$pk} con index {$pki}"); echo h4("Claves forraneas:"); $fka = db_getFK($meta, $d, $t); if ($fka[0]) { foreach ($fka[1] as $fk) { echo h5($fk[0] . " hace referencia a " . link_table($fk[1]) . "(" . $fk[2] . ")"); } } echo h4("Referencias a esta tabla:"); $rfka = db_getrFK($meta, $d, $t); if ($rfka[0]) { foreach ($rfka[1] as $rfk) { echo h5(link_table($rfk[1]) . "(" . $rfk[2] . ") hace referencia a " . $rfk[0]); } } }
echo $relationship_calculator->female_ascendant_lord, " is in the ", $relationship_calculator->female_houses['ASCL'], " house from the Ascendant. ", $relationship_calculator->female_positionals['ASCL'], br(), br(); foreach (array('Moon', 'Sun', 'Venus') as $planet) { echo h4($planet, " Analysis"), h5($planet, " Position"), $planet, " is in the ", $relationship_calculator->female_houses[$planet], " house from the Ascendant. ", $relationship_calculator->female_positionals[$planet], h5("Planets Influencing ", $planet), ul($relationship_calculator->female_influences[$planet]), ul($relationship_calculator->female_natures_influencing[$planet]); } echo h4("Marriage and Partnership Analysis"); echo h5("7th House: ", $relationship_calculator->female_seventh_house); echo h5("7th Lord: ", $relationship_calculator->female_seventh_house_lord); echo h5("Planets Influencing 7th House"); echo ul($relationship_calculator->female_influences[7]); echo ul($relationship_calculator->female_natures_influencing[7]); echo h5("Planets Influencing 7th Lord- ", $relationship_calculator->female_seventh_house_lord); echo ul($relationship_calculator->female_influences['7L']); echo ul($relationship_calculator->female_natures_influencing['7L']); echo h5("7th Lord Position"); echo $relationship_calculator->female_seventh_house_lord, " is in the ", $relationship_calculator->female_houses['7L'], " house from the 7th. ", $relationship_calculator->female_positionals['7L']; echo h3("Interplay of Relationship"), h4("Relative House Position of each other's Ascendant, Sun, Moon and Venus."), begin_ul(); foreach ($relationship_calculator->relative_positionals as $planet => $positional) { $positional_text = ''; if ($positional) { $positional_text = ", " . $positional; } echo li($planet, "- house ", $relationship_calculator->relative_houses[$planet], $positional_text); } echo end_ul(); echo h4("Deeper Synastry Analysis of each other's Ascendant, Sun, Moon and Venus."), h5("Influences to ", $female_data['report_name'], "'s Planets in ", $male_data['report_name'], "'s chart."); foreach (array('Ascendant', 'Sun', 'Moon', 'Venus') as $planet) { echo h5($planet), ul($relationship_calculator->female_male_influences[$planet]); } echo h5("Influences to ", $male_data['report_name'], "'s Planets in ", $female_data['report_name'], "'s chart."); foreach (array('Ascendant', 'Sun', 'Moon', 'Venus') as $planet) { echo h5($planet), ul($relationship_calculator->male_female_influences[$planet]);
/** * An easy way to make a paginated bootStrapTable * * @param String $sql * @param Array $buttons * @param String $hideColumns * @param String $toolbar * @param Integer $rowLimit * @param Integer $selected_page * @param Array $customFields * @param String $name * @param String $class * @param Boolean $paginate * @param Boolean $searchable * @param Boolean $checked * @param String $checkPostURL * @return type */ function bootStrapTable($sql = "select * from user_detail", $buttons = "", $hideColumns = "", $toolbar = "My Grid", $customFields = null, $name = "grid", $tableInfo = "", $formHideFields = "", $class = "table table-striped", $rowLimit = 10, $paginate = true, $searchable = true, $checked = false, $selected_page = 1, $checkedPostURL = "", $checkSingleSelect = true, $event = "", $mobiletooltip = "") { $DEB = $this->DEB; $hideColumns = explode(",", strtoupper($hideColumns)); $object = rawurlencode(json_encode(func_get_args())); $paginating = "false"; if ($paginate) { $paginating = "true"; } $options = ["id" => $name, "class" => $class, "data-toolbar" => "#toolbar" . $name, "data-pagination" => "{$paginating}", "data-side-pagination" => "server", "data-search" => "false", "data-height" => "400", "data-page-list" => "[5, 10, 20, 50, 100, 200]", "data-page-size" => $rowLimit]; if ($searchable) { $options["data-search"] = "true"; } if ($checked) { $options["data-click-to-select"] = "true"; if ($checkSingleSelect) { $options["data-single-select"] = "true"; } } $data = @$DEB->getRow("select first 1 * from ({$sql}) t "); $fieldInfo = @$DEB->fieldinfo; if (empty($fieldInfo)) { die("Perhaps the SQL for this query is broken {$sql} or the table does not exist, have you specified the correct database in your Cody initialization, Try running migrations with maggy"); } $header = ""; if ($checked) { $header .= th(["data-field" => "checked" . $name . "[]", "class" => "text-left", "data-checkbox" => "true"], ""); } foreach ($fieldInfo as $fid => $field) { if (!in_array(strtoupper($field["name"]), $hideColumns)) { if (isset($customFields[$field["name"]])) { $customField = $customFields[$field["name"]]; if (empty($customField["type"])) { $customField["type"] = "text"; } switch ($customField["type"]) { default: $header .= th(["data-field" => $field["name"], "class" => "text-" . $field["align"], "data-sortable" => "true"], ucwords(str_replace("_", " ", strtolower($field["alias"])))); break; case "checkbox": $header .= th(["data-field" => $field["name"], "class" => "text-" . $field["align"], "data-checkbox" => "true"], ""); break; case "hidden": $header .= th(["data-field" => $field["name"], "class" => "hidden"], ucwords(str_replace("_", " ", strtolower($field["alias"])))); break; } } else { $header .= th(["data-field" => $field["name"], "class" => "text-" . $field["align"], "data-sortable" => "true"], ucwords(str_replace("_", " ", strtolower($field["alias"])))); } } } $addColumn = ""; if ($buttons) { $addColumn .= th(["data-field" => "BUTTONS"], "Options"); } $header = thead(tr($header . $addColumn)); if (empty($toolbar["caption"])) { $toolbar = array(); $toolbar["caption"] = ""; } $insertButton = $this->bootStrapButton("btnInsert", "Add", "call{$name}Ajax('/cody/form/insert','{$name}Target', {object : a{$name}object, record: null, db: '{$DEB->tag}' })", "btn btn-success pull-left", "", true); if (empty($toolbar["buttons"])) { $toolbar["buttons"] = ""; } $toolbar["buttons"] = $insertButton . $toolbar["buttons"]; if (empty($toolbar["filter"])) { $toolbar["filter"] = ""; } $tableHeading = ""; if (!empty($toolbar["caption"])) { $tableHeading = h3($toolbar["caption"]) . hr(); } $toolbarButtons = $toolbar["buttons"]; $toolbarFilters = $toolbar["filter"]; if ($searchable) { $toolbarFilters .= div(["class" => "search"], input(["id" => "search{$name}", "class" => "search form-control", "type" => "text", "placeholder" => "Search " . $toolbar["caption"], "onkeyup" => '$table' . $name . '.bootstrapTable(\'getData\')'])); } $toolbarFilters = div(["class" => "form-inline", "role" => "form"], $toolbarFilters); $html = $tableHeading . div(["class" => "table-responsive"], div(["class" => "table-toolbar clearfix"], div(["class" => "toolbar-buttons"], $toolbarButtons) . div(["class" => "toolbar-filters"], $toolbarFilters)) . table($options, $header, tbody())); $html .= script(' var a' . $name . 'object = "' . $object . '"; var $table' . $name . ' = $("#' . $name . '").bootstrapTable({search : false, url : "/cody/data/ajax/' . $this->DEB->tag . '", method : "post", onCheck: function (row) { eventType = \'check\'; ' . $event . ' }, onUnCheck: function (row) { eventType = \'uncheck\'; ' . $event . ' }, queryParams: function (p) { return {object: a' . $name . 'object, limit: p.limit, offset :p.offset, order: p.order, search : $("#search' . $name . '").val(), sort: p.sort } } }); $search = $("#search' . $name . '"); var timeoutId = null; $search.off("keyup").on("keyup", function (event) { clearTimeout(timeoutId); timeoutId = setTimeout(function () { $table' . $name . '.bootstrapTable("refresh", {pageNumber: 1}); }, 1000); }); '); if ($checked) { $html = form(["method" => "post", "action" => $checkedPostURL, "enctype" => "multipart/form-data"], $html); } $html .= div(["id" => "{$name}Target"]); $html .= $this->ajaxHandler("", "{$name}Target", "call{$name}Ajax"); return $html; }
function execute_loginAdm() { $username = $_POST['username']; //echo "username is $username"; $password = $_POST['password']; $success = users_checkExists($username, $password); //echo $success; $admin = users_checkAdmin($username); //echo "admin is $admin"; if ($admin) { execute_admin(); //view courses after logging in } else { h1("You don't have permission to access this section"); h3("<a href='index.php?option=courses&view=list'>Click here to be logged as an student</a>"); } }
<?php function h3() { $x = array(1, 2, 3, 4); next($x); $y = $x; array_pop($y); var_dump(current($x)); var_dump(current($y)); } h3();
function previewArticle($article) { if (!$article) { h3("Fant ikke artikkelen."); } else { table_open(); tr_open(); td_open(1); h1_link($article['title'], url_to_article($article['articleid'])); articleMetaInfo($article['author'], $article['author_username'], make_date($article['date_posted']), make_time($article['time_posted']), $article['language']); div_open("textbody", ""); $paragraph = makeReadyForPrint(nl2br($article['body'])); echo $paragraph; div_close(); td_close(); tr_close(); table_close(); } }
function textSearchResultGUI() { if (isset($_REQUEST['nopartialmatch'])) { $partialmatch = 0; } else { $partialmatch = 1; } if (isset($_REQUEST['searchcomments'])) { $searchcomments = 1; } else { $searchcomments = 0; } $table = textSearchService($_REQUEST['text'], $partialmatch, $_REQUEST['author'], $searchcomments); if ($searchcomments) { h3("Søkte etter '" . $_REQUEST['text'] . "' i alle artikler og kommentarer, " . count($table) . " treff, nyeste først"); } else { h3("Søkte etter '" . $_REQUEST['text'] . "' i alle artikler, " . count($table) . " treff, nyeste først"); } if ($table == NULL) { //echo("no_articles_with_that_text"); echo "Sorry Mac!"; } else { table_open(); foreach ($table as $row) { tr_open(); echo '<td style="width:80px">'; echo make_ddmmyy_date($row['date_posted']); td_close(); td_open(1); if (isset($row['comment_to'])) { print_article_link($row['comment_to'], $row['title']); echo "(Kommentar til: "; print_parent_article_link($row['comment_to']); echo ")"; } else { print_article_link($row['articleid'], $row['title']); } td_close(); td_open(1); echo $row['author']; td_close(); tr_close(); tr_open(); td_open(3); echo create_paragraph($row['body'], 200, 200); echo "..."; br(); br(); td_close(); } table_close(); } }
foreach ($funciones as $fig => $funcs) { echo implode(array_keys($funcs), ","), " de {$fig}", br(); } } } echo h4("Que desea?"); echo form([lnvinput("figura", $fma_figura, ["autofocus" => ""]), lnvinput("funcion", $fma_funcion), lnvinput("n1", $fma_n1 + 1), lnvinput("n2", $fma_n2), lnvinput("n3", $fma_n3), hidden("action", $fma_action), submit("enviar")]); // FIN PAGINA FUNCIONES MATEMATICAS } else { if ($fma_action == $adm_label) { // INICIO PAGINA FUNCIONES ADMINISTRATIVAS echo h3("Funciones {$adm_label}"); echo calcular_factura($na = adm_add($fma_articulos, $fma_articulo), $np = adm_add($fma_precios, $fma_precio), $nc = adm_add($fma_cantidades, $fma_cantidad), $ni = $fma_iva); echo form([lninput("articulo", ["autofocus" => ""]), lninput("precio"), lninput("cantidad"), lnvinput("iva", $ni), submit("afactura", "Añadir"), hidden("articulos", $na), hidden("precios", $np), hidden("cantidades", $nc), hidden("action", $fma_action)]); // FIN PAGINA FUNCIONES ADMINISTRATIVAS } else { echo h3("se me ha perdido la acción por el camino, tengo esto: {$fma_action}"); } } } #'; eval($code); echo gpp($code); // getting my URL $yo = "https://" . $_SERVER["HTTP_HOST"] . $_SERVER["SCRIPT_NAME"]; include_once "incf.php"; if (!$editing) { echo disqus_code($yo, __FILE__, "cursomm"); } ?>
function enrollments_render($enrollment) { h3($enrollment['Name']); p("imparted by " . $enrollment['Professor']); }
<?php require_once 'site/base.inc.php'; head('Download - jMList'); topheading('download'); open('div', array('id' => 'body')); $_jMList = txttag('span', array('class' => 'jmlist'), 'jMList'); h2('Requirements'); tag('p', array(), "The following libraries are required in order to use or compile " . "{$_jMList}:"); open('ul', array()); tag('li', array(), a('GLib', 'http://www.gtk.org/') . " 2.4.0 or higher (required)"); tag('li', array(), a('LibXML', 'http://xmlsoft.org/') . " 2.6.0 or higher (require)"); tag('li', array(), a('LibXSLT', 'http://xmlsoft.org/XSLT/') . " 1.1.0 or higher (required)"); tag('li', array(), a('ID3Lib', 'http://id3lib.sourceforge.net/') . " 3.8.0 or higher (required)"); tag('li', array(), a('OggVorbis', 'http://www.xiph.org/ogg/vorbis/') . " 1.1.0 or higher (optional, for OggVorbis support)"); close(); h2('Source Packages'); h3('Version 0.1.0 (beta)'); tag('p', array(), a('jmlist-0.1.0.tar.gz', 'http://download.berlios.de/jmlist/jmlist-0.1.0.tar.gz') . " (initial release) - " . a('Release Notes', 'http://developer.berlios.de/project/shownotes.php?release_id=5187')); h2('Repository Access'); tag('p', array(), "{$_jMList} is hosted on a " . a('Subversion', 'http://subversion.tigris.org/') . " repository. " . "You can checkout it from " . a('svn://svn.berlios.de/jmlist/source/trunk') . " " . "or browse it at " . a('http://svn.berlios.de/viewcvs/jmlist/source/trunk') . "."); tag('p', array(), "In order to compile from the repository, you will need the following " . "additional software:"); open('ul', array()); tag('li', array(), a('autoconf', 'http://www.gnu.org/software/autoconf/') . " 2.59 or higher"); tag('li', array(), a('automake', 'http://www.gnu.org/software/automake/') . " 1.8 or higher"); close(); tag('p', array(), "After checking-out the trunk tree, run " . txttag('code', array(), './configure.svn') . " on the working copy " . "directory in order to generate support files needed to configure and " . "compile {$_jMList}. After that, proceed as usual with " . txttag('code', array(), './configure --help') . ", " . txttag('code', array(), './configure') . ", " . txttag('code', array(), 'make') . " and " . txttag('code', array(), 'make install') . ".");