require 'mc_table.php'; // Load data function LoadData($file) { // Read file lines $datas = explode('end', trim($file)); foreach ($datas as $line) { $line = substr($line, 0, -3); $line_br = str_replace("<br>", "\r\n", explode('$@$', trim($line))); $data[] = str_replace(" ", " ", $line_br); } return $data; } $hed = explode('end', $heds); $line = substr($hed[0], 0, -3); $header = explode('$@$', $line); $data = LoadData($bdy); //$header = array('Bill-To','Ship-To/Ship-To Location','PO #','Order/Quote/Plant','Planned/Est. Arr Shipping','Status'); $pdf = new PDF_MC_Table(); $pdf->SetWidths(array(40, 70, 40, 50, 55, 25)); $pdf->AddPage('L'); $pdf->SetFont('Arial', '', ''); $pdf->Image('../../images/madix-logo300.png', 10, 12, 50, 0, '', ''); $pdf->SetTopMargin(35); $pdf->Row($header); foreach ($data as $row) { $pdf->Rows($row); } $pdf->Output(); header('Content-type: application/pdf'); header('Content-Disposition: attachment; filename="Order_list.pdf"');
} switch ($iStep) { case 11: // Asynchronous tab $oPage = new ajax_page(''); BulkChange::DisplayImportHistory($oPage); $oPage->add_ready_script('$("#CSVImportHistory table.listResults").tableHover();'); $oPage->add_ready_script('$("#CSVImportHistory table.listResults").tablesorter( { widgets: ["myZebra", "truncatedList"]} );'); break; case 10: // Case generated by BulkChange::DisplayImportHistory $iChange = (int) utils::ReadParam('changeid', 0); BulkChange::DisplayImportHistoryDetails($oPage, $iChange); break; case 5: LoadData($oPage); break; case 4: Preview($oPage); break; case 3: SelectMapping($oPage); break; case 2: SelectOptions($oPage); break; case 1: case 6: // Loop back here when we are done // Loop back here when we are done default:
$x_location = @$_POST["x_location"]; $x_company = @$_POST["x_company"]; $x_profile = @$_POST["x_profile"]; $x_contact_email = @$_POST["x_contact_email"]; $x_link = @$_POST["x_link"]; } if ($x_jobid == "" || is_null($x_jobid)) { ob_end_clean(); header("Location: account.php"); exit; } $conn = phpmkr_db_connect(HOST, USER, PASS, DB, PORT); switch ($sAction) { case "I": // Display record if (!LoadData($conn)) { // Load record $_SESSION[ewSessionMessage] = "No records found"; phpmkr_db_close($conn); ob_end_clean(); header("Location: account.php"); exit; } break; case "U": // Update if (EditData($conn)) { // Update record $_SESSION[ewSessionMessage] = "Update Record Successful"; phpmkr_db_close($conn); ob_end_clean();
function LoadDataTSV($benchmark, $cached, $metric, $aggregate, $loc, &$annotations) { $tsv = null; $isbytes = false; $istime = false; $annotations = array(); if (stripos($metric, 'bytes') !== false) { $isbytes = true; } elseif (stripos($metric, 'time') !== false || stripos($metric, 'render') !== false || stripos($metric, 'fullyloaded') !== false || stripos($metric, 'visualcomplete') !== false || stripos($metric, 'eventstart') !== false || stripos($metric, 'lastVisualChange') !== false || stripos($metric, 'domContentLoadedEventStart') !== false || stripos($metric, 'ttfb') !== false) { $istime = true; } if (LoadData($data, $configurations, $benchmark, $cached, $metric, $aggregate, $loc)) { $series = array(); $tsv = 'Date'; foreach ($configurations as &$configuration) { if (array_key_exists('title', $configuration) && strlen($configuration['title'])) { $title = $configuration['title']; } else { $title = $configuration['name']; } if (count($configuration['locations']) > 1) { $name = "{$title} "; if (count($configurations) == 1) { $name = ''; } foreach ($configuration['locations'] as &$location) { if (is_numeric($location['label'])) { $tsv .= "\t{$name}{$location['location']}"; $series[] = "{$name}{$location['location']}"; } else { $tsv .= "\t{$name}{$location['label']}"; $series[] = "{$name}{$location['label']}"; } } } else { $tsv .= "\t{$title}"; $series[] = $title; } } $tsv .= "\n"; $dates = array(); foreach ($data as $time => &$row) { $date_text = gmdate('c', $time); $tsv .= $date_text; $dates[$date_text] = $time; foreach ($configurations as &$configuration) { foreach ($configuration['locations'] as &$location) { $tsv .= "\t"; if (array_key_exists($configuration['name'], $row) && array_key_exists($location['location'], $row[$configuration['name']])) { $value = $row[$configuration['name']][$location['location']]; if ($aggregate != 'count') { $divisor = $isbytes ? 1024.0 : $istime ? 1000.0 : 1; if (strpos($value, ';') === false) { $value = isset($divisor) ? number_format($value / $divisor, 3, '.', '') : $value; } else { $values = explode(';', $value); foreach ($values as $index => $val) { $values[$index] = isset($divisor) ? number_format($val / $divisor, 3, '.', '') : $value; } $value = implode(';', $values); } } $tsv .= $value; } } } $tsv .= "\n"; } if (is_file("./settings/benchmarks/{$benchmark}.notes")) { $notes = parse_ini_file("./settings/benchmarks/{$benchmark}.notes", true); $i = 0; asort($dates); foreach ($notes as $note_date => $note) { // find the closest data point on or after the selected date $note_date = str_replace('/', '-', $note_date); if (!array_key_exists($note_date, $dates)) { $UTC = new DateTimeZone('UTC'); $date = DateTime::createFromFormat('Y-m-d H:i', $note_date, $UTC); if ($date !== false) { $time = $date->getTimestamp(); unset($note_date); if ($time) { foreach ($dates as $date_text => $date_time) { if ($date_time >= $time) { $note_date = $date_text; break; } } } } } if (isset($note_date) && array_key_exists('text', $note) && strlen($note['text'])) { $i++; foreach ($series as $data_series) { $annotations[] = array('series' => $data_series, 'x' => $note_date, 'shortText' => "{$i}", 'text' => $note['text']); } } } } } return $tsv; }
<?php ob_start(); //these are for the PHP Helper files include 'headers/databaseConn.php'; include 'helpers.php'; //this is the file that contains all the functions used in AJAX. if (isset($_POST["no"]) && $_POST["no"] == "1") { //this is to save the details of the user coming first time to the MR Connect Portal SaveUser($_POST["basic"], $_POST["education"], $_POST["experience"], $_POST["contact"], $_POST["picture"]); } else { if (isset($_GET["no"]) && $_GET["no"] == "2") { //this is the function to load the data from the database and show it to the Front end. LoadData($_GET["email"], $_GET["id"]); } else { if (isset($_GET["no"]) && $_GET["no"] == "3") { //for saving/updating the interests thing. SaveUpdateInterests($_GET["id"], $_GET["email"], $_GET["i1"], $_GET["i2"], $_GET["i3"], $_GET["i4"], $_GET["i5"], $_GET["i6"], $_GET["i7"]); } else { if (isset($_GET["no"]) && $_GET["no"] == "4") { //for getting all the users from the database GetAllUsers($_GET["email"]); } else { if (isset($_GET["no"]) && $_GET["no"] == "5") { //for getting all the users from the database UserExists($_GET["email"], $_GET["id"]); } else { if (isset($_GET["no"]) && $_GET["no"] == "6") { //for getting all the users from the database SetCookieID($_GET["email"]); } else {
$fr->addInput('Email', 'email', 'email', '', false, 'Tu email'); $fr->addInput('Tu web', 'url', 'tu_web', 'http://', false, 'Web personal'); $fr->addSeparator(); $fr->addNumber('Edad', 'age', '', false, false, 2, 100, 2, false); $fr->addNumber('Salario', 'salario', '', true, false, 2, 100, 2); $fr->addDate('Fecha', 'fecha', '', false, false, '', '', '', false); $fr->addSeparator(); $fr->addSelect('RANK', 'RANK', array('test', 'test2')); // Some option autocreated, Is required use addRadio, NOT addINPUT // in this case, the value is the same that text to show, so key is optional (is incremental) $fr->addRadio('Valoration', 'valoration', array(0 => '0', 5 => '5', 10 => '10'), null, true); $fr->addCheck('Accept conditions', 'accept conditions', '1'); $fr->addSeparator(); $fr->addSubmit('send', 'Enviar'); return $fr; } $fr = LoadData(); if ($_POST) { // Checking reply if (!$fr->validate()) { echo 'unvalidated'; echo '<br /><b>ERRORS:</b><br />' . $fr->errors; } else { echo 'validated'; // Now you can get values and save on you like // or if is to manipule a database, you can use the module "FormGeneratorDB" } echo '<hr />'; } // Show form everytime $fr->showForm();