function _xmlToQuote() { $xd = new MiniXMLDoc($this->xml_response); $startTag = 'eparcel/error/'; $this->statusCode = fetchValue($xd, $startTag . 'statusCode'); if ($this->statusCode != "") { $this->error = true; $this->error_msg = fetchValue($xd, $startTag . 'statusMessage'); } else { $this->error = false; $startTag = 'eparcel/ratesAndServicesResponse/'; $this->shipping_comment = fetchValue($xd, $startTag . 'comment'); $shipping_fields = array("name", "rate", "shippingDate", "deliveryDate", "deliveryDayOfWeek", "nextDayAM", "packingID"); $this->shipping_methods = fetchArray($xd, $startTag, 'product', $shipping_fields); } }
<?php /** ensure this file is being included by a parent file */ defined('_JEXEC') or die('Restricted access'); require "minixml/minixml.inc.php"; print "<pre>\n"; $xd = new MiniXMLDoc(); $xd->fromFile("canPos_return.xml"); print "\nStatusCode = " . fetchValue($xd, 'eparcel/ratesAndServicesResponse/statusCode'); print "\ncomment = " . fetchValue($xd, 'eparcel/ratesAndServicesResponse/comment'); print "\nstatusMessage = " . fetchValue($xd, 'eparcel/ratesAndServicesResponse/statusMessage'); print "\n\n"; $shipping_fields = array("name", "rate", "shippingDate", "deliveryDate", "deliveryDayOfWeek", "nextDayAM", "packingID"); var_dump(fetchArray($xd, 'eparcel/ratesAndServicesResponse', 'product', $shipping_fields)); print "\n</pre>"; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function fetchArray(&$xmldoc, $path, $tag, $fields) { $response = $xmldoc->getElementByPath($path); $children = $response->getAllChildren(); $count = 0; $array = array(); for ($i = 0; $i < $response->numChildren(); $i++) { if ($tag == $children[$i]->name()) { foreach ($fields as $field) { $name = $children[$i]->getElement($field); $array[$count][$field] = $name->getValue(); } $count++; } }
function fetchWord($key) { global $words_; return fetchValue($key, $words_); }
<h2 class="hidden">Eurofound Surveys</h2> <div id="langSelect"> <label for="locale" class="hidden"></label> <select id="locale" name="locale" class="side-tooltip" title="Available languages"> <?php foreach ($surveyLocales as $entry) { ?> <option <?php echo $locale == $entry ? "selected" : ""; ?> value="<?php echo $entry; ?> "><?php echo fetchValue($entry, $countryToLanguage); ?> </option> <?php } ?> </select> </div> </header> <article> <section class="hidden"> <input name="dataSource" id="dataSource" type="hidden" value="<?php echo $survey;
function addRehearsal($date) { $default_location = 'Greenpeace Warehouse'; $default_time = '17:00'; $default_end = '20:00'; if (!$date) { $date = date('Y-m-d', strtotime('next sunday + 6 weeks')); } $count = fetchValue("select count(*) as count from gigs where type='rehearsal' and date = '{$date}'") ?: 0; if ($count == 0) { $request['data'] = array('date' => $date, 'type' => 'rehearsal', 'title' => 'Rehearsal', 'band_start' => $default_time, 'band_end' => $default_end, 'location' => $default_location); gigs_saveGig($request); } }
function demo() { print "<pre>\n"; $xd = new MiniXMLDoc(); $xd->fromFile("canPos_return.xml"); print "\nStatusCode = " . fetchValue($xd, 'eparcel/ratesAndServicesResponse/statusCode'); print "\ncomment = " . fetchValue($xd, 'eparcel/ratesAndServicesResponse/comment'); print "\nstatusMessage = " . fetchValue($xd, 'eparcel/ratesAndServicesResponse/statusMessage'); print "\n\n"; $shipping_fields = array("name", "rate", "shippingDate", "deliveryDate", "deliveryDayOfWeek", "nextDayAM", "packingID"); var_dump(fetchArray($xd, 'eparcel/ratesAndServicesResponse', 'product', $shipping_fields)); print "\n</pre>"; }
$parameter = $_GET["locale"]; if (in_array($parameter, $surveyLocales)) { $locale = $parameter; } } //----------------------------- require_once "model/" . $survey . "/php/" . $locale . ".php"; require_once "model/fetchTranslation.php"; $printStandaloneExportOptions = true; ///////////////////////////////////////////////// // SEO google enhancement ///////////////////////////////////////////////// $pageTitle = fetchTitle("survey"); $visualizationUrl = "/DVS/render/?locale=EN&dataSource=3RDEQLS&media=png&width=740&question=Y11_Q8_PreferredWorkingHours&plot=heatMap&countryGroup=linear&subset=Y11_Agecategory&subsetValue=All&answer=1--Work-less"; $visualizationDescription = fetchTooltip("heatMap"); require_once '../render/VL/validParametersFunctions.php'; if (isPlotParametersValid($_GET)) { $pageTitle .= " : " . fetchValue($_GET['plot'], fetchVisualizations()) . ", " . fetchLabel("question") . " : " . $_GET['question']; $visualizationUrl = "/DVS/render/?" . $_SERVER['QUERY_STRING']; $plotDescriptionFileName = getPlotBodyFileName($_GET); $plotDescriptionFileName = substr($plotDescriptionFileName, 0, strlen($plotDescriptionFileName) - 4); //remove the width $plotDescriptionFileName = "/DVS/render/plots/txt/" . $plotDescriptionFileName . ".htm"; if (file_exists($plotDescriptionFileName)) { $visualizationDescription = file_get_contents($plotDescriptionFileName, true); $visualizationDescription = trim($visualizationDescription); } } ///////////////////////////////////////////////// ///////////////////////////////////////////////// /////////////////////////////////////////////////