/** * @author Angelo M. * @global string $actualFileNameContents * @global string $yahooWeatherFileNameContents * @param type $atts */ function doGetWeather($atts) { global $actualFileNameContents; global $yahooWeatherFileNameContents; extract(shortcode_atts(array('zip_code' => '', 'location' => ''), $atts)); $URI = 'http://xml.weather.yahoo.com/forecastrss/' . $zip_code . '_f.xml'; $success = false; do { $value = array(); if (strlen($zip_code) > 0) { $contents = file_get_contents($URI); $file = fopen($actualFileNameContents, 'w+'); fputs($file, $contents); } else { $value = getGeoDetails($location); if (strlen($value['zipcode']) > 0) { $URI = 'http://xml.weather.yahoo.com/forecastrss/' . $value['zipcode'] . '_f.xml'; $contents = file_get_contents($URI); } } if ($contents) { $contents = extractYahooWeather($contents); $contents = implode('' . PHP_EOL, $contents); $file = fopen($yahooWeatherFileNameContents, 'w+'); fputs($file, $contents); fclose($file); } if (strlen($contents) > 0 && $contents) { displayTitle($location, $URI); $currentWeather = htmlCurrentWeather($contents); $success = true; } else { //if zip codes contain only two forecasts $URI = 'http://weather.yahooapis.com/forecastrss?w=' . $value['woeid']; $contents = file_get_contents($URI); $contents = extractYahooWeather($contents); $contents = implode('' . PHP_EOL, $contents); $file = fopen($yahooWeatherFileNameContents, 'w+'); fputs($file, $contents); fclose($file); displayTitle($location, $URI); $currentWeather = htmlCurrentWeather($contents); $success = true; } } while (!$success); $weatherForecasts = htmlYahooWeatherForecast(); }
function title() { global $LANG, $CFG_GLPI; if (countElementsInTable($this->getTable())) { $buttons = array(); $buttons["notimportedemail.php"] = $LANG['rulesengine'][142]; displayTitle($CFG_GLPI["root_doc"] . "/pics/users.png", $LANG['rulesengine'][142], '', $buttons); } }
/** * Print a good title for entity pages * *@return nothing (display) **/ function title() { global $LANG, $CFG_GLPI; $buttons = array(); $title = $LANG['Menu'][37]; $buttons["entity.form.php?id=0"] = $LANG['entity'][2]; displayTitle($CFG_GLPI["root_doc"] . "/pics/groupes.png", $LANG['Menu'][37], $title, $buttons); }
-------------------------------------------------------------------------- */ // ---------------------------------------------------------------------- // Original Author of file: Remi Collet // Purpose of file: Search engine from cron tasks // ---------------------------------------------------------------------- define('GLPI_ROOT', '..'); include GLPI_ROOT . "/inc/includes.php"; checkRight("config", "w"); if (isset($_GET['execute'])) { if (is_numeric($_GET['execute'])) { // Execute button from list. $name = CronTask::launch(CronTask::MODE_INTERNAL, intval($_GET['execute'])); } else { // Execute button from Task form (force) $name = CronTask::launch(-CronTask::MODE_INTERNAL, 1, $_GET['execute']); } if ($name) { addMessageAfterRedirect($LANG['crontask'][40] . " : " . $name); } glpi_header($_SERVER['HTTP_REFERER']); } commonHeader($LANG['crontask'][0], $_SERVER['PHP_SELF'], "config", "crontask"); $crontask = new CronTask(); if ($crontask->getNeedToRun(CronTask::MODE_INTERNAL)) { displayTitle(GLPI_ROOT . '/pics/warning.png', $LANG['crontask'][41], $LANG['crontask'][41] . " : " . $crontask->fields['name'], array($_SERVER['PHP_SELF'] . "?execute=1" => $LANG['buttons'][57])); } else { displayTitle(GLPI_ROOT . '/pics/ok.png', $LANG['crontask'][43], $LANG['crontask'][43]); } Search::show('CronTask'); commonFooter();
/** * Print a good title for group pages * *@return nothing (display) **/ function title() { global $LANG, $CFG_GLPI; $buttons = array(); if (haveRight("group", "w") && haveRight("user_authtype", "w") && AuthLdap::useAuthLdap()) { $buttons["ldap.group.php"] = $LANG['setup'][3]; $title = ""; } else { $title = $LANG['Menu'][36]; } displayTitle($CFG_GLPI["root_doc"] . "/pics/groupes.png", $LANG['Menu'][36], $title, $buttons); }
<div class="row" id="header"> <div class="medium-1 columns" id="space"> </div> <div class="medium-3 columns">Title</div> <div class="medium-1 columns">Views</div> <div class="medium-2 columns">Created by</div> <div class="medium-2 columns">Created on</div> <div class="medium-1 columns">Post ID</div> <div class="medium-1 columns"></div> <div class="medium-1 columns" id="space"> </div> </div> <div class="row" id="forum"> <div class="medium-1 columns" id="space"> </div> <div class="medium-3 columns"><?php echo displayTitle($thispost->title); ?> </div> <div class="medium-1 columns"><?php echo Post::viewCountViews($thispost->id); ?> </div> <div class="medium-2 columns"><?php echo displayCreator($this->_userIdtoUsername($thispost->user_id)); ?> </div> <div class="medium-2 columns"><?php echo stampToText($thispost->date_created); ?> </div> <div class="medium-1 columns"><?php
/** * Show the central personal view * * **/ static function showMyView() { global $LANG, $DB; $showticket = haveRight("show_all_ticket", "1") || haveRight("show_assign_ticket", "1"); echo "<table class='tab_cadre_central'>"; if ($DB->isSlave() && !$DB->first_connection) { echo "<tr><th colspan='2'><br>"; displayTitle(GLPI_ROOT . "/pics/warning.png", $LANG['setup'][809], $LANG['setup'][809]); echo "</th></tr>"; } echo "<tr><td class='top'><table>"; if (haveRight('validate_ticket', 1)) { echo "<tr><td class='top' width='450px'><br>"; Ticket::showCentralList(0, "tovalidate", false); echo "</td></tr>"; } echo "<tr><td class='top' width='450px'>"; Ticket::showCentralList(0, "toapprove", false); echo "</td></tr>"; echo "<tr><td class='top' width='450px'>"; Ticket::showCentralList(0, "requestbyself", false); echo "</td></tr>"; if ($showticket) { echo "<tr><td class='top' width='450px'>"; Ticket::showCentralList(0, "process", false); echo "</td></tr>"; echo "<tr><td class='top' width='450px'>"; Ticket::showCentralList(0, "waiting", false); echo "</td></tr>"; } echo "</table></td>"; echo "<td class='top'><table><tr>"; echo "<td class='top' width='450px'><br>"; Planning::showCentral(getLoginUserID()); echo "</td></tr>"; echo "<tr><td class='top' width='450px'>"; Reminder::showListForCentral(); echo "</td></tr>"; if (haveRight("reminder_public", "r")) { echo "<tr><td class='top' width='450px'>"; Reminder::showListForCentral($_SESSION["glpiactive_entity"]); $entities = array_reverse(getAncestorsOf("glpi_entities", $_SESSION["glpiactive_entity"])); foreach ($entities as $entity) { Reminder::showListForCentral($entity, true); } foreach ($_SESSION["glpiactiveentities"] as $entity) { if ($entity != $_SESSION["glpiactive_entity"]) { Reminder::showListForCentral($entity, false); } } echo "</td></tr>"; } echo "</table></td></tr></table>"; }
/** * Print a good title for user pages * * @return nothing (display) **/ function title() { global $LANG, $CFG_GLPI; $buttons = array(); $title = $LANG['Menu'][14]; if ($this->canCreate()) { $buttons["user.form.php?new=1"] = $LANG['setup'][2]; $title = ""; if (Auth::useAuthExt()) { // This requires write access because don't use entity config. $buttons["user.form.php?new=1&ext_auth=1"] = $LANG['setup'][125]; } } if (haveRight("import_externalauth_users", "w")) { if (AuthLdap::useAuthLdap()) { $buttons["ldap.php"] = $LANG['setup'][3]; } } displayTitle($CFG_GLPI["root_doc"] . "/pics/users.png", $LANG['Menu'][14], $title, $buttons); }
<div class="row" id="title"> <div class="medium-1 columns" id="space"> </div> <div class="medium-10 columns">Demo Forum</div> <div class="medium-1 columns" id="space"> </div> </div> <div class="row" id="header"> <div class="medium-1 columns" id="space"> </div> <div class="medium-1 columns"> </div> <div class="medium-3 columns">Title</div> <div class="medium-5 columns">Description</div> <div class="medium-1 columns">Posts</div> <div class="medium-1 columns" id="space"> </div> </div> <div class="row" id="forum"> <?php foreach ($categories as $category) { echo '<div class="medium-1 columns" id="space"> </div>'; echo '<div class="medium-1 columns">' . '<img src="' . BASE_URL . 'img/post.png' . '" width="20" height="20" alt="Post"/>' . '</div>'; echo '<div class="medium-3 columns">' . '<a href="' . BASE_URL . 'index.php?c=user&a=viewpubliccategory&id=' . $category['id'] . '">' . displayTitle($category['title']) . '</a>' . '</div>'; echo '<div class="medium-5 columns">' . displayDescription($category['description']) . '</div>'; echo '<div class="medium-1 columns">' . $postmodel->countTopPostsByCategoryId($category['id']) . '</div>'; echo '<div class="medium-1 columns" id="space"> </div>'; } ?> </div>
?> <div id="content-full" class="grid col-940"> <?php /*-----------------------------------sprocket-options.php-------------------------------------------- the second and final "phase" of generating a sprocket, this page allows the user to refine the originally inputted parameters and then preview and export the sprocket. */ // let's ignore that pedantic interpreter.... /*ini_set('display_errors',1); ini_set('display_startup_errors',1); error_reporting(E_ALL);*/ include '/var/www-chapresearch/wp-content/themes/accesspress-lite/sprocketr-form.php'; include '/var/www-chapresearch/wp-content/themes/accesspress-lite/blenderCalls.php'; displayTitle(); showPhase2HelpText(); showDataSummary($_SESSION["user_params"]); if (isset($_GET["tuningOptions"])) { // if this is not the first time through if (empty($_SESSION["options"])) { echo '<h1 style="text-align:center">You don\'t have any options to tune!</h1>'; } $params = array_merge($_SESSION["options"][0], array_slice($_GET, 0, -2)); } else { // sets the tuning option to the default (aka simply changing the number of teeth) // this occurs if this is the first time through, or if "tuningOptions" isn't set (because "reset" is) $params = array_merge($_SESSION["user_params"], array("option" => "numTeeth")); } //----------- ------------------------PNG or STL is being generated------------------------------------------ if (isset($_GET["output_type"])) {
<tr> <th>Title</th> <th>Description</th> <th>Moderator</th> <th>Created on</th> <th>Public</th> <th>Locked</th> <th></th> <th></th> </tr> </thead> <tbody> <?php foreach ($data as $category) { echo '<tr>'; echo '<td>' . displayTitle($category['title']) . '</td>'; echo '<td>' . displayDescription($category['description']) . '</td>'; echo '<td>' . displayModerator(ucfirst($this->_userIdToUsername($category['moderator_id']))) . '</td>'; echo '<td>' . stampToText($category['date_created']) . '</td>'; echo '<td>' . intToImg($category['view_public']) . '</td>'; echo '<td>' . intToImg($category['is_locked']) . '</td>'; echo '<td>' . '<a href="' . BASE_URL . 'index.php?c=user&a=editcategory&id=' . $category['id'] . '"><img src="' . BASE_URL . 'img/edit.png' . '" width="20" height="20" alt="Edit"/></a></td>'; echo '<td>' . '<a href="' . BASE_URL . 'index.php?c=category&a=deletecategory&id=' . $category['id'] . '"><img src="' . BASE_URL . 'img/delete.png' . '" width="20" height="20" alt="Delete"/></a></td>'; echo '</tr>'; } ?> </tbody> </table> <?php if ($pagination->total_pages() > 1) { // If there is more than 1 page, show pagination
* Erro se o usuarios nao esta logados no sistema */ if (!isset($_SESSION["identified"]) || $_SESSION["identified"] != 1) { die($BVS_LANG["error404"]); } //Dependendo da Base selecionada envocamos o a funcao que ira formatar os dados //para serem enviados ao dataset if (isset($_REQUEST["m"]) && !preg_match("=/=", $_REQUEST["m"])) { switch ($_REQUEST['m']) { case 'facic': $dataModel = new title(); $formatedRecords = displayFacic($dataModel); break; case 'title': $dataModel = new title(); $formatedRecords = displayTitle($dataModel, $_REQUEST["edit"], $_REQUEST["format"]); break; case 'titleplus': $dataModel = new titleplus(); $formatedRecords = displayTitlePlus($dataModel, $_REQUEST["edit"]); break; case 'import': $formatedRecords = importFile(); break; case 'reverseDB': $formatedRecords = reverseDatabase(); break; case 'unlockDB': $formatedRecords = unlockDatabase(); break; case 'report':
</div> <div class="row" id="forum"> <?php foreach ($categories as $category) { ?> <div class="medium-1 columns" id="space"> </div> <div class="medium-1 columns"><img src="<?php echo BASE_URL . 'img/post.png'; ?> " width="20" height="20" alt="Post"/></div> <div class="medium-3 columns"><a href="<?php echo BASE_URL . 'index.php?c=user&a=viewcategory&id=' . $category['id']; ?> "><?php echo displayTitle($category['title']); ?> </a></div> <div class="medium-3 columns"><?php echo displayDescription($category['description']); ?> </div> <div class="medium-1 columns"><?php echo $postmodel->countTopPostsByCategoryId($category['id']); ?> </div> <div class="medium-1 columns"><?php echo displayModerator($this->_userIdtoUsername($category['moderator_id'])); ?> </div> <div class="medium-1 columns"><?php
if ($page_no > 0) { echo "</table>\n"; drawHeader($page_no); echo "</div>\n"; } $page_no++; if ($page_no == 1) { echo "<div id=\"page{$page_no}\" style=\"display:block\">\n"; } else { echo "<div id=\"page{$page_no}\" style=\"display:none\">\n"; } drawHeader($page_no); echo "<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\" style=\"width:100%\">\n"; echo "<tr><td style=\"padding:2px; vertical-align:top; width:24px\"><img src=\"../single_page.png\" class=\"icon16_active\" /></td><td style=\"padding-bottom:10px\">"; } echo "<a class=\"searchtitle\" href=\"index.php?id=" . $search_result['id'] . "&highlight=" . $searchstring . "\">" . displayTitle($search_result['title']) . "</a><br /><div class=\"searchpath\">" . getPath($search_result['title'], $search_result['id'], $searchstring) . "<div></td></tr>\n"; $link_no++; if ($link_no >= $page_size) { $link_no = 0; } } echo "</table>\n"; drawHeader($page_no); echo "</div>\n"; } } $mysqli->close(); ?> </div> </div> </body>
</div> <div class="row" id="forum"> <?php foreach ($posts as $rows) { ?> <div class="medium-1 columns" id="space"> </div> <div class="medium-1 columns"><img src="<?php echo BASE_URL . 'img/post.png'; ?> " width="20" height="20" alt="Post"/></div> <div class="medium-5 columns"><a href="<?php echo BASE_URL . 'index.php?c=user&a=viewpost&id=' . $rows['id']; ?> "><?php echo displayTitle($rows['title']); ?> </a></div> <div class="medium-1 columns"><?php echo Post::viewCountViews($rows['id']); ?> </div> <div class="medium-1 columns"><?php echo $postsmodel->countRepliesTopPostsByPostId($rows['id']); ?> </div> <div class="medium-2 columns"><?php echo stampToText($postsmodel->timeLastPostInTopPost($rows['id'])); ?> </div> <div class="medium-1 columns" id="space"> </div>
<div class="row" id="header"> <div class="medium-1 columns" id="space"> </div> <div class="medium-1 columns"> </div> <div class="medium-6 columns">Title</div> <div class="medium-1 columns">Replies</div> <div class="medium-2 columns">Last post</div> <div class="medium-1 columns" id="space"> </div> </div> <div class="row" id="forum"> <?php foreach ($posts as $rows) { echo '<div class="medium-1 columns" id="space"> </div>'; echo '<div class="medium-1 columns">' . '<img src="' . BASE_URL . 'img/post.png' . '" width="20" height="20" alt="Post"/>' . '</div>'; echo '<div class="medium-6 columns">' . '<a href="' . BASE_URL . 'index.php?c=user&a=viewpublicpost&id=' . $rows['id'] . '">' . displayTitle($rows['title']) . '</a></div>'; echo '<div class="medium-1 columns">' . $postsmodel->countRepliesTopPostsByPostId($rows['id']) . '</div>'; echo '<div class="medium-2 columns">' . stampToText($postsmodel->timeLastPostInTopPost($rows['id'])) . '</div>'; echo '<div class="medium-1 columns" id="space"> </div>'; } ?> </div> <div class="row"> <div class="medium-1 columns" id="space"> </div> <div class="medium-10 columns"><a id="backbutton" class="button tiny" href="<?php echo slink('main', 'viewmainpage'); ?> ">Back </a></div> <div class="medium-1 columns" id="space"> </div> </div>
</div> <div class="row" id="header"> <div class="medium-1 columns" id="space"> </div> <div class="medium-4 columns">Title</div> <div class="medium-2 columns">Created by</div> <div class="medium-2 columns">Created on</div> <div class="medium-1 columns">Post ID</div> <div class="medium-1 columns"></div> <div class="medium-1 columns" id="space"> </div> </div> <div class="row" id="forum"> <div class="medium-1 columns" id="space"> </div> <div class="medium-4 columns"><?php echo 'Reply on ' . displayTitle($thispost->title); ?> </div> <div class="medium-2 columns"><?php echo displayCreator($user->_userIdtoUsername($reply['user_id'])); ?> </div> <div class="medium-2 columns"><?php echo stampToText($reply['date_created']); ?> </div> <div class="medium-1 columns"><?php echo $reply['id']; ?> </div> <div class="medium-1 columns"><a href="<?php
function displayForm($data, $badFields) { displayTitle(); echo "<p style=\"text-align:center;margin:auto;width:80%\">"; echo '<b>About SprocketR: </b>SprocketR is a web application to produce custom sprocket pairs based upon the parameters entered. The final output is a zip file of two 3D-printable STL files to download and test. During the process, the application will optimize the sprockets to create an appropriate amount of chain slack. In addition, it will give you the opportunity to change and balance your parameters to get the best sprockets for your application.</p>'; echo '<table style="text-align:center;margin:auto;width:20%"><tr><td style="text-align:left;border:none">'; echo '<a href="?page_id=2065"><button class="sprocketrButton">How It Was Created</button></a>'; echo '</td><td style="text-align:right;border:none">'; echo '<a href="?page_id=2090"><button class="sprocketrButton">How To Use</button></a>'; echo '</td></tr></table>'; echo '<div style="margin:auto;width:35%"><b>Instructions: </b>'; echo '<ul><li>Start by entering the desired "gear ratio" (if necessary) and the center-to-center distance of the two sprockets.</li>'; echo '<li>You may also enter the number of the teeth for one or both of the sprockets if needed.</li>'; echo '<li>Choose the chain type desired.</li>'; echo '<li>Choose the hub mounting holes for the sprockets (if any).</li>'; echo '<li>Click "Generate Sprocket Options".</li>'; echo '<li>The results page will provide the opportunity to change parameters to get the sprockets to best fit your application.</li>'; echo '</ul></div>'; echo "<p style=\"text-align:center;margin:auto;width:80%\">"; //start form and table echo "<form action=\"\" class=\"sprocketrForm\" method=\"get\">\n <table frame=\"void\" border=\"none\" class=\"form\" style=\"width:50%\" align=\"center\">\n "; //add class="form" when ready to remove gridlines //gearRatioField if (array_key_exists("gearRatioField", $data)) { //check if gear ratio entered if so show in field tableRow(array(tableData(promptWithError("gearRatioField", "<b>Gear Ratio*: </b>", $badFields, "Must be in the form of #:#"), "left", "center"), tableData('<input style="text-align: center;" size="5" type="text" placeholder="#:#" name="gearRatioField" value="' . $data["gearRatioField"] . '" title="Gear ratio of your sprockets, must be formatted like #:#" /> ', "left", "center"))); //gear ratio field } else { //if not entered show without data (see above comments, they still apply below) tableRow(array(tableData(promptWithError("gearRatioField", "<b>Gear Ratio*: </b>", $badFields, "Must be in the form of #:#"), "left", "center"), tableDataWidth('<input style="text-align: center;" size="5" type="text" placeholder="#:#" name="gearRatioField" title="Gear ratio of your sprockets, must be formatted like #:#" /> ', "left", "center", 1, "gRatFieldRow"))); } //centerToCenterField tableRow(array(tableData(promptWithError("centerToCenterField", "<b>Center to Center Distance (mm)*:</b>", $badFields, "Must be a number with optional decimal part"), "left", "center", 1), tableData(text($data, "centerToCenterField"), "left", "center", 2))); //chainSizeList tableRow(array(tableData(prompt("<b>Chain Size*: </b>"), "", "", "", "margin:0px"), tableData(dropDown($data, "chainSizeList", array("25" => "chain25", "35" => "chain35")))), "chainSize"); //leftSprocketTeeth#Field tableRow(array(tableData(promptWithError("leftSprocketTeeth#Field", '<b>Number of Teeth on Sprocket 1: </b><span style="color:red"> (optional)</span>', $badFields, "Must be an integer less than " . NUM_TEETH_MAX . " or left blank"), "left", "center", 1), tableData(text($data, "leftSprocketTeeth#Field"), "left", "center", 1)), "leftSprocketTeeth"); //rightSprocketTeeth#Field tableRow(array(tableData(promptWithError("rightSprocketTeeth#Field", '<b>Number of Teeth on Sprocket 2: </b><span style="color:red"> (optional)</span>', $badFields, "Must be an integer less than " . NUM_TEETH_MAX . " divisible by the gear ratio or left blank"), "left", "center", 1), tableData(text($data, "rightSprocketTeeth#Field"), "left", "center", 1)), "rightSprocketTeeth"); //desiredSlackField tableRow(array(tableData(promptWithError("desiredSlackField", "<b>Desired Slack (default 1%): </b>", $badFields, "Must be a decimal or left blank")), tableData(text($data, "desiredSlackField"))), "desiredSlack"); //holeOptionLabels echo "<tr><td class = \"form\"><b>Hub Choices:</b></td><td>"; echo '<table><tr>'; holeCheckBox("Versa Hub (small).png", $data, "holeOption_versaHub", " Versa Hub"); holeCheckBox("Tetrix Hub (small).png", $data, "holeOption_tetrixHub", " Tetrix Hub"); holeCheckBox("Versa Bearing Hole (small).png", $data, "holeOption_versaBearingHole", " Versa Bearing Hole"); echo '</tr></table></td></tr>'; // submit button & hidden field tableRow(array(tableData(hiddenField("page_id", $_GET["page_id"])))); echo '<tr><td class="centerCell" colspan=2 align="center">' . "<input type=\"submit\" class=\"sprocketrButton\" value=\"Generate Sprocket Options\">" . '</td></tr>'; formFooter("sprocketrForm"); }