function cmdRepo() { $file = new File('/home/billy/1.tar.bz2', true); $target = new Dir('/home/billy/temp/1.unpack/includes', true); //Packer::unpack($file, $target); Packer::pack($target, new File(dirname(__FILE__) . '/2.tbz', true)); return; $pm = new PM(); $pm->startup(); $rb = PM::getRollback(); $rb->push('delete', dirname(__FILE__) . '/_files/source', dirname(__FILE__) . '/_files/target/includes/Controller.php'); //$rb->push('delete', './_files/source', '_files/target/includes/Controller.php' ); //$r = $rb->pop(); $r = $rb->stepBack(); print_r($r); return; $ps = PM::getPackageSequence(); print_r($ps->get()); print_r($ps->getAfter('news', '2.3')); //print_pre($ps->addPackage('news', '2.8')); print_pre($ps->removePackage('news', '2.8')); return; Autoload::addDir(Dir::get($this->root, true)->getDir('repo')); $rl = new RepositoryList($this->dataDir->getFile('source.list')); $r = $rl->search(explode(' ', 'qt package')); print_pre($r); $pm->shutdown(); }
/** * * @param string $service * @param string $method * @param array $parameters * @return array|bool */ static function call($service = "", $method = "", $parameters = [], $type = 'get') { // Check if cache exist $response = Cache::get(self::$cache_name); if (null == $response) { // Curl call if ('post' == $type) { $resp = Curl::to(config('services.gulliver.host') . ':' . config('services.gulliver.port') . '/' . $service . (false == empty($method) ? '/' . $method : ""))->withData($parameters)->withOption('TIMEOUT', self::$timeout)->withOption('FAILONERROR', false)->withOption('RETURNTRANSFER', self::$returntransfer)->withOption('ENCODING', self::$encoding)->asJson()->post(); } else { $resp = Curl::to(config('services.gulliver.host') . ':' . config('services.gulliver.port') . '/' . $service . (false == empty($method) ? '/' . $method : ""))->withData($parameters)->withOption('TIMEOUT', self::$timeout)->withOption('FAILONERROR', false)->withOption('RETURNTRANSFER', self::$returntransfer)->withOption('ENCODING', self::$encoding)->get(); } #print_pre(['to'=>config('services.gulliver.host').':'.config('services.gulliver.port').'/'.$service.((false==empty($method)) ? '/'.$method : ""),'response'=>$response]); // Check response if (false == $resp) { self::$error = true; return false; } #print_pre($response,1,1); // Decode the response $response = json_decode($resp, true); #dd(['response'=>$response,'method'=>$method]); // Check for json error if (json_last_error() != JSON_ERROR_NONE) { self::$error = 'json error: ' . json_last_error() . '<br>' . print_pre($resp); return false; } else { unset($resp); } // Check error if (false == empty($response['errors'])) { self::$error = false == empty($response['errors'][0]['description']) ? $response['errors'][0]['description'] : true; return false; } // Check data if (true == empty($response['data'])) { self::$error = 'Empty data node in response'; return false; } // Check method if (false == empty($method) && true == empty($response['data'][$method])) { self::$error = 'Empty method node in response'; return false; } // return array if (false == empty($method)) { $response = (array) $response['data'][$method]; } else { $response = (array) $response['data']; } // Cache Store ? if (0 < self::$cache_ttl) { Cache::put(self::$cache_name, $response, self::$cache_ttl); } } // self::reset(); // return return $response; }
function controller_test($args, $output = "inline") { $playback = $this->parent->getMPDPlayback(); $playlist = $this->parent->getMPDPlaylist(); $song = $playback->getCurrentSong(); print_pre(get_class_methods($playlist)); print_pre($song); print_pre($playlist->getPlaylistInfoId($song["Id"])); return ""; }
function execute() { global $wgUser, $wgTitle, $wgArticle, $wgOut, $wgSkin; print_pre("Theme: " . $this->data['skin']->themename); print_pre($this); print_pre($wgTitle); print_pre($wgArticle); print_pre($wgUser); print_pre($wgOut); }
function autoloader($class) { $file = BASE_DIR . DIRECTORY_SEPARATOR . $class . ".php"; $file = str_replace("/", DIRECTORY_SEPARATOR, $file); $file = str_replace("\\", DIRECTORY_SEPARATOR, $file); if (file_exists($file)) { require_once $file; return; } else { if (ENV_DEVELOPMENT) { print_pre(debug_backtrace()); die("Failed to include class " . $class . " as " . $file); } } }
/** * Print out a simpler backtrace than debug_print_backtrace and faster * @param boolean $buffer should not print * @param string $tag name of tag to surround output in * @return string * @see debug_backtrace * @see print_pre **/ function print_stack($buffer = false, $tag = "pre") { $output = ""; $backtrace = debug_backtrace(); $spacing = 40; foreach ($backtrace as $traceEntry) { $newline = PHP_EOL . $traceEntry['class'] . $traceEntry['type'] . $traceEntry['function'] . "()"; if (strlen($newline) > $spacing) { $spacing = strlen($newline) + 10; } $newline = str_pad($newline, $spacing); $newline .= " from " . $traceEntry['file'] . ':' . $traceEntry['line']; $output .= $newline; } return print_pre($output, $buffer, $tag); }
function print_model($model_or_array, $description = "", $debug = true, $return = false) { if (is_object($model_or_array)) { return print_pre($model_or_array->getAttributes(), '(Model) ' . $description, $debug, $return); } else { $array = array(); if (is_array($model_or_array)) { foreach ($model_or_array as $model) { $array[] = $model->getAttributes(); } } else { $array = $model_or_array; } return print_pre($array, '(Model[s]) ' . $description, $debug, $return); } }
/** * 数据结构优化、修复、结构查看 */ function public_repair() { $tables = trim($this->input->get_post('tables')); $operation = trim($this->input->get_post('operation')); $pdo_name = trim($this->input->get_post('pdo_name')); $tables = is_array($tables) ? implode(',', $tables) : $tables; if ($tables && in_array($operation, array('repair', 'optimize'))) { $sql = "{$operation} TABLE {$tables}"; $this->db->query($sql)->result_array(); $this->showmessage('success', lang('com_success'), HTTP_REFERER); } elseif ($tables && $operation == 'showcreat') { $res = $this->db->query("SHOW CREATE TABLE {$tables}")->result_array(); if (!empty($res[0]['Create Table'])) { print_pre($res[0]['Create Table']); } } $this->showmessage('error', lang('com_parameter'), HTTP_REFERER); }
function controller_create($args, $output = "inline") { if (!empty($args["blog"])) { $vars["blog"] = new Blog(); $vars["blog"]->blogname = $args["blog"]["blogname"]; $vars["blog"]->title = $args["blog"]["title"]; $vars["blog"]->subtitle = $args["blog"]["subtitle"]; $vars["blog"]->owner = $args["blog"]["owner"]; try { OrmManager::save($vars["blog"]); $vars["success"] = true; header("Location: /demo/blog#blog_create_success:" . $vars["blog"]->blogname); } catch (Exception $e) { $vars["success"] = false; print_pre($e); } } return $this->GetComponentResponse("./create.tpl", $vars); }
function controller_form($args, $output = "inline") { $vars["args"] = $args; $vars["obj"] = $args["obj"]; $vars["elements"] = $args["elements"]; $vars["formname"] = any($args["formname"], "htmlform"); $vars["formhandler"] = $args["formhandler"]; $vars["dispatchname"] = any($args["dispatchname"], $vars["formname"]); //print_pre($vars); if (empty($args[$vars["formname"]])) { $ret = $this->GetTemplate("./form.tpl", $vars); } else { try { $this->conn->save($vars[$formname]); $vars["success"] = true; } catch (Exception $e) { print_pre($e); $vars["success"] = false; } $ret = $this->GetTemplate("./create_status.tpl", $vars); } return $this->GetTemplate("./form.tpl", $vars); }
function ApplyRedirects($req, $rules) { $doRedirect = false; foreach ($rules as $rule) { //if (!empty($rule->match)) { // FIXME - Never ever upgrade to PHP 5.2.6. It breaks empty() on SimpleXML objects. if ($rule->match) { $ismatch = true; $isexcept = false; $matchvars = array(NULL); // Force first element to NULL to start array indexing at 1 (regex-style) foreach ($rule->match->attributes() as $matchkey => $matchstr) { $checkstr = array_get($req, $matchkey); if ($checkstr !== NULL) { $m = NULL; if (substr($matchstr, 0, 1) == "!") { $ismatch &= !preg_match("#" . substr($matchstr, 1) . "#", $checkstr, $m); } else { $ismatch &= preg_match("#" . $matchstr . "#", $checkstr, $m); } //Logger::Debug("Check rewrite (%s): '%s' =~ '%s' ? %s", $matchkey, $checkstr, $matchstr, ($ismatch ? "YES" : "NO")); if (is_array($m) && count($m) > 0) { if (count($m) > 1) { for ($i = 1; $i < count($m); $i++) { $matchvars[] = $m[$i]; } } } } else { if (substr($matchstr, 0, 1) != "!") { $ismatch = false; } } } if ($ismatch && $rule->except) { $exceptflag = true; foreach ($rule->except->attributes() as $exceptkey => $exceptstr) { $checkstr = array_get($req, $exceptkey); if ($checkstr !== NULL) { $m = NULL; if (substr($exceptstr, 0, 1) == "!") { $exceptflag &= !preg_match("#" . substr($exceptstr, 1) . "#", $checkstr, $m); } else { $exceptflag &= preg_match("#" . $exceptstr . "#", $checkstr, $m); } } } if ($exceptflag) { $isexcept = true; } } if ($ismatch && !$isexcept) { // Apply nested rules first... if ($rule->rule) { $req = $this->ApplyRedirects($req, $rule->rule); } // Then process "set" command if ($rule->set) { Logger::Info("Applying redirect:\n " . $rule->asXML()); if (!empty($req["args"]["testredir"])) { print "<pre>" . htmlspecialchars($rule->asXML()) . "</pre><hr />"; } foreach ($rule->set->attributes() as $rewritekey => $rewritestr) { if (count($matchvars) > 1 && strpos($rewritestr, "%") !== false) { $find = array(NULL); for ($i = 1; $i < count($matchvars); $i++) { $find[] = "%{$i}"; } $rewritestr = str_replace($find, $matchvars, $rewritestr); } array_set($req, (string) $rewritekey, (string) $rewritestr); } if ($rule["type"] == "redirect") { $doRedirect = 301; } else { if ($rule["type"] == "bounce") { $doRedirect = 302; } } } // And finally process "unset" if ($rule->unset) { $unset = false; foreach ($rule->unset->attributes() as $unsetkey => $unsetval) { if ($unsetkey == "_ALL_" && $unsetval == "ALL") { $req["args"] = array(); } else { if (!empty($unsetval)) { $reqval = array_get($req, $unsetkey); if ($reqval !== NULL) { array_unset($req, $unsetkey); $unset = true; } } } } if ($unset) { if ($rule["type"] == "redirect") { $doRedirect = 301; } else { if ($rule["type"] == "bounce") { $doRedirect = 302; } } } } if ($doRedirect !== false) { break; } } } } if ($doRedirect !== false) { $origscheme = "http" . ($req["ssl"] ? "s" : ""); if ($req["host"] != $_SERVER["HTTP_HOST"] || $req["scheme"] != $origscheme) { $newurl = sprintf("%s://%s%s", $req["scheme"], $req["host"], $req["path"]); } else { $newurl = $req["path"]; } if (empty($req["args"]["testredir"])) { if (empty($req["friendly"])) { $querystr = makeQueryString($req["args"]); $newurl = http_build_url($newurl, array("query" => $querystr)); } else { $newurl = makeFriendlyURL($newurl, $req["args"]); } if ($newurl != $req["url"]) { http_redirect($newurl, NULL, true, $doRedirect); } } else { print_pre($req); } } return $req; }
function controller_location_enablecategories($args, $output = "inline") { return print_pre($_SESSION, true); }
/** * Smarty {printpre} plugin * * Type: function<br> * Name: printpre<br> * Purpose: Print a dump of the requested variable * * @author James Baicoianu * @param array * @param Smarty * @return string|null if the assign parameter is passed, Smarty assigns the * result to a template variable */ function smarty_function_printpre($args, &$smarty) { return print_pre($args["var"], true); }
public function create_pm_plan() { $data_pm = array("pm_vendor" => "KJN", "pm_plan_name" => "plan Q2", "pm_description" => "", "pm_period_idpm_period" => "1011", "om_create_date" => date('Y-m-d H:i:s'), "om_update_date" => date('Y-m-d H:i:s'), "om_deletion_flag" => 0); $idpm = $this->db->insert('pm', $data_pm); $data_pm_plan = array("PM_idpm" => $idpm, "pmp_vendor" => "KJN", "pmp_idsite" => "JAW-CCJ-1996-H-B", "pmp_status" => "Missing PIC Assignment", "pmp_task_type" => "PM", "pmp_blocked_access" => 0, "om_created_date" => date('Y-m-d H:i:s'), "om_update_date" => date('Y-m-d H:i:s'), "om_deletion_flag" => 0, "pmp_vendor_deadline_date" => date('Y-m-d H:i:s'), "pmp_tenant" => ""); $idpm_plan_detil = $this->db->insert('pm_plan_detail', $data_pm_plan); if ($idpm != false and $idpm_plan_detil != false) { echo alert('berhasil membuat data pm plan', 'success'); print_pre($this->model_pm->find($idpm)); print_pre($this->model_pm->get_single('pm_plan_detail', 'idpm_plan_detil', $idpm_plan_detil)); } else { echo alert('gagal membuat data pm plan', 'danger'); } }
/** * Prints errors array */ public function printErrors() { print_pre($this->_errors); }
session_start(); $debug = false; $authentication = new Authentication(); // ---- Security ---------------------------------------------------------- // if (!isset($_SESSION['accessGranted']) || !$_SESSION['accessGranted']) { $result = $storageManager->grantAccess($_POST['login'], $_POST['mdp']); if (!$result) { header('Location: /admin/?action=error'); } else { $_SESSION['accessGranted'] = true; } } // ------------------------------------------------------------------------ // // ---- Forms processing -------------------------------------------------- // if ($debug) { print_pre($_POST); } if (!empty($_POST)) { // ---- Traitement des Contact if ($_POST['reference'] == 'contact') { $contact = new Contact(); if ($_POST['action'] == 'modif') { //Modifier try { $result = $contact->contactModify($_POST); $contact = null; header('Location: /admin/contact-list.php'); } catch (Exception $e) { echo 'Erreur contactez votre administrateur <br> :', $e->getMessage(), "\n"; $contact = null; exit;
print "<a href=#c>Client Driver Tests</a><p>"; print "<h3>Test Error</h3>"; $rs = send2server($serverURL, $sql1); print_pre($rs); print "<hr />"; print "<h3>Test Insert</h3>"; $rs = send2server($serverURL, $sql2); print_pre($rs); print "<hr />"; print "<h3>Test Insert2</h3>"; $rs = send2server($serverURL, $sql3); print_pre($rs); print "<hr />"; print "<h3>Test Delete</h3>"; $rs = send2server($serverURL, $sql4); print_pre($rs); print "<hr />"; print "<h3>Test select</h3>"; $rs = send2server($serverURL, $sql5); if ($rs) { rs2html($rs); } print "<hr />"; } print "<a name=c><h1>CLIENT Driver Tests</h1>"; $conn = ADONewConnection('csv'); $conn->Connect($serverURL); $conn->debug = true; print "<h3>Bad SQL</h3>"; $rs = $conn->Execute($sql1); print "<h3>Insert SQL 1</h3>";
$vps = $r->new_vps('dummy-order.com', 'centos5.64', 'EU2B', array('billing_oid' => $billing_method->billing_oid, 'memory_mb' => 256)); print_pre($vps); close_div(); /**/ /** * Testing vps->restart **********************/ open_div('Testing vps->reboot', 'reboot_vps'); $reboot_info = $vps->reboot(); print_pre($reboot_info); close_div(); /**/ /** * Testing vps->power_cycle ***************************/ open_div('Testing vps->power_cycle', 'powercycle'); $cycle_info = $vps->power_cycle(); print_pre($cycle_info); close_div(); /**/ /** * Testing vps->destroy **********************/ open_div('Testing vps->destroy', 'destroy'); $destroy_info = $vps->destroy(); print_pre($destroy_info); close_div(); /**/ ?> </body> </html>
/** * @brief This returns the HTML output of any SpecialPage::execute function * @details * SpecialPage::capturePath will skip SpecialPages which are not "includable" * (which is all the interesting ones) So we need to force it. * * @requestParam string page the name of the Special page to invoke * @responseParam string output the HTML output of the special page */ public function GetSpecialPage() { if (!$this->wg->User->isAllowed('admindashboard')) { $this->displayRestrictionError(); return false; // skip rendering } // Construct title object from request params $pageName = $this->getVal("page"); $title = SpecialPage::getTitleFor($pageName); // Save global variables and initialize context for special page global $wgOut, $wgTitle; $oldTitle = $wgTitle; $oldOut = $wgOut; $wgOut = new OutputPage(); $wgOut->setTitle($title); $wgTitle = $title; // Construct special page object try { $basePages = array("Categories", "Recentchanges", "Specialpages"); if (in_array($pageName, $basePages)) { $sp = SpecialPageFactory::getPage($pageName); } else { $sp = new $pageName(); } } catch (Exception $e) { print_pre("Could not construct special page object"); } if ($sp instanceof SpecialPage) { $ret = $sp->execute(false); } else { print_pre("Object is not a special page."); } // TODO: check retval of special page call? $this->output = $wgOut->getHTML(); // Restore global variables $wgTitle = $oldTitle; $wgOut = $oldOut; }
public function __construct($config) { parent::__construct($config); $this->load_config('hooks', 'hook_test'); print_pre($this->config['hooks']); }
<h2>Success</h2> <p>Your file was uploaded! <a href="<?php print SITE_URL; ?> uploads/upload">Upload again?</a></p> <?php print_pre($this->upload->file_data); print_pre($_FILES);
*/ $options = array('help'); @(require_once '../commandLine.inc'); global $IP, $wgCityId; echo "Remove Duplicate Badges\n\n"; if (isset($options['help']) && $options['help']) { echo "Usage: php achievements_removeDuplicateBadges.php\n\n"; exit(0); } require_once "{$IP}/extensions/wikia/AchievementsII/Ach_setup.php"; echo "Loading list of users to process"; $dbw = WikiFactory::db(DB_MASTER); // select user_id, wiki_id, badge_type_id, badge_lap, badge_level, min(date) as first, count(badge_type_id) dupes from ach_user_badges group by user_id,badge_type_id, badge_lap, badge_level having dupes > 1 ; $rows = $dbw->select('ach_user_badges', array("user_id", 'wiki_id', 'badge_type_id', 'badge_lap', 'badge_level', 'min(date) as first', 'count(badge_type_id) as dupes'), array(), __METHOD__, array("GROUP BY" => "wiki_id, user_id,badge_type_id, badge_lap, badge_level having dupes > 1")); $rowCount = $rows->numRows(); print_pre($dbw); echo ": {$rowCount} duplicate badges to process\n\n"; if ($rowCount) { while ($dupe = $dbw->fetchObject($rows)) { echo "- Processing dupe for user {$dupe->user_id} on wiki {$dupe->wiki_id}\n"; // Delete all but the first duplicate badge $criteria = array(); $criteria['user_id'] = $dupe->user_id; $criteria['wiki_id'] = $dupe->wiki_id; $criteria['badge_type_id'] = $dupe->badge_type_id; $criteria['badge_lap'] = $dupe->badge_lap; $criteria['badge_level'] = $dupe->badge_level; $criteria[] = "date > '{$dupe->first}'"; $dbw->delete('ach_user_badges', $criteria); $dbw->commit(); // wait for slave lag
public function driver_installed() { //If this install of PHP does NOT have the right PDO driver if (!in_array($this->config['type'], PDO::getAvailableDrivers())) { print_pre(PDO::getAvailableDrivers()); trigger_error('The PDO Database type <b>' . $this->config['type'] . '</b> is not supported on this PHP install.', E_USER_ERROR); } //Driver is installed return TRUE; }
static function bookStore() { $bookingId = self::$response['bookingId']; // $cambio = 1; $uatp = false == empty(self::$form['uatp']) ? self::$form['uatp'] : 0; $htl_gastos = false == empty(self::$form['htl_gastos']) ? self::$form['htl_gastos'] : 0; $confirmData = false == empty(self::$form['confirmData']) ? self::$form['confirmData'] : ""; $cargosGestion = 0; $descCargosGestion = 0; $totalIns = self::$response['purchasedPlans'][0]['insuranceTotalPrices']['requestedSellingPrice']['afterTax']; $payment = BookingController::getPayment(self::$form['data-pago']['tarjeta'], self::$form['data-pago']['cuotas'], self::$form['data-pago']['banco']); $payment_try = 1 != $htl_gastos ? 1 : 0; $precioParcial = $totalIns + $cargosGestion - $descCargosGestion; $gastosFinancieros = ceil($precioParcial * $payment->coeficiente); $bonificacion = ceil($gastosFinancieros * $payment->coef_bonif_banco); $totalAmount = ceil($precioParcial + $gastosFinancieros - $bonificacion); // Share variables for template renders view()->share(['form' => self::$form, 'search' => self::$search, 'product' => self::$response, 'totalAmount' => $totalAmount, 'creditCardImage' => $payment->imagen_tarjeta, 'creditCardName' => $payment->nombre_tarjeta]); // Prepare data for store in 'payment_product_data' $payment_product_data = ['typeProd' => 'INSURANCE', 'dataProd' => ['TotalIns' => ceil($totalIns), 'intereses' => $gastosFinancieros, 'bonificacion' => $bonificacion, 'cargos' => self::$form['maxCargosGestion'] - self::$form['descCargosGestion'], 'TotalAmount' => $totalAmount, 'currency' => self::$response['purchasedPlans'][0]['insuranceTotalPrices']['requestedSellingPrice']['currency'], 'qPax' => self::$response['coveredTravelersCount'], 'destination' => mb_convert_case(self::$search['destination'], MB_CASE_TITLE, 'UTF-8'), 'dateFrom' => self::$search['dateFrom'], 'dateTo' => self::$search['dateTo'], 'prodDescription' => self::$response['purchasedPlans'], 'userPostData' => self::$form], 'TempateOk' => view('Insurance/compra-ok')->render(), 'BodyMailReserva' => "", 'BodyMailCompra' => view('Insurance/mails/compra-ok')->render()]; // Prepare data for store in 'payment_gateway_data' $payment_gateway_data = ['uatp' => $uatp, 'htl_gastos' => $htl_gastos, 'bookingId' => $bookingId, 'totalAmount' => $totalAmount, 'gastosFinancieros' => $gastosFinancieros, 'bonificacion' => $bonificacion, 'cambio' => $cambio]; // Prepare data for store in 'payment_gulliver_data' $payment_gulliver_data = ['gastos_HTL' => $htl_gastos, 'payment_try' => $payment_try, 'email_reserva' => self::$form['email'], 'analitycs_data' => json_encode(['bookingId' => $bookingId, 'productName' => 'INSURANCE', 'prod' => self::$response['purchasedPlans'][0]['insurancePlan']['name'], 'proov' => self::$response['purchasedPlans'][0]['insurancePlan']['insuranceProvider'], 'total' => $totalAmount, 'pax' => self::$response['coveredTravelersCount']]), 'confirm_data' => $confirmData]; // Finally send all to be stored BookingController::storeBook($bookingId, $payment_product_data, $payment_gateway_data, $payment_gulliver_data); print_pre($bookingId); // return redirect('http://www.garbarinoviajes.com.ar/pago-online/pago-confirma.php?refId=' . $bookingId)->send(); }
public function test() { $table_reff = $this->input->get('table_reff'); $id = $this->input->get('id'); $meta_name = $this->input->get('meta_name'); $input_type = $this->input->get('input_type'); $result = $this->model_meta->get_meta_single($table_reff, $id, $meta_name, $input_type); print_pre($result); }
private function extInfo() { ob_start(); phpinfo(8); $s = ob_get_contents(); ob_end_clean(); $lines = explode(PHP_EOL, $s); $c = count($lines) + 1; $list = get_loaded_extensions(); $list[] = 'Module Name'; $res = array(); $current_ext = null; while ($c-- > 0) { $l = array_shift($lines); $l = trim($l); if (empty($l)) { continue; } if (in_array($l, $list)) { $current_ext = $l; } else { $a = explode(' => ', $l); if ($current_ext == 'Module Name') { print_pre($a); } switch (count($a)) { case 2: $res[$current_ext]['opt'][trim($a[0])] = trim($a[1]); break; case 3: if ($a[0] != 'Directive') { $res[$current_ext]['opt2'][array_shift($a)] = $a; } break; default: $res[$current_ext]['info'][] = $l; } } } return $res; }
$res->data_seek($row); $datarow = $res->fetch_array(); return $datarow[$field]; } if (!isset($_POST['jobid'])) { echo "<br />"; box_start(500); ?> <center> <h3>Search for contact rate</h3> <form action = "report_contact_rate.php" method="post"> Job Name: <select name="jobid"> <?php $result = mysqli_query($connection, "SELECT id, name FROM jobs"); while ($row = mysqli_fetch_assoc($result)) { print_pre($row); echo '<option value="' . $row['id'] . '">' . $row['name'] . '</option>'; } ?> </select><br /> Time Period:<select name="range" id="range"> <option value="alltime">All Time</option> <?php /*<option value="today">Today</option> <option value="date">Select Date</option>*/ ?> </select><br /> <div id="dateselect" style="display:none"> <p>From Date: <input type="text" id="from_date" name="from_date" style="width: 200px"> <br />
/** * LocalConfigManager::commitCommands * * Given a set of indexes to commit, commit them using ConfigManager then delete them from the stored commands * @param $indexes array [1,4,5] * @return bool success **/ public function commitCommands($indexes) { $cfg = ConfigManager::singleton(); $status = true; $commandsToRun = array(); if (!empty($indexes)) { foreach ($this->storedCommands as $key => $value) { if (in_array($key, $indexes)) { $commandsToRun[] = $this->storedCommands[$key]; } } foreach ($commandsToRun as $cmd) { $setcurrent = true; $skipcache = true; $skipLocalConfig = true; //load an unmodified version of the cobrand, otherwise the localconfig changes will have already been applied //and committing the commands won't work outside of this session, as they'll already have been //temporarily applied by the localconfig calls in getConfig()/Load(). To make the commits //be applied to the db pass the $skipLocalConfig flag $cfg->GetConfig($cmd['cobrand'], $setcurrent, $cmd['role'], $skipcache, $skipLocalConfig); switch ($cmd['action']) { case 'update': $skipLocalConfig = true; $newcfg = array($cmd['name'] => array('value' => $cmd['val'], 'type' => $cmd['type'])); $status = $cfg->Update($cmd['cobrand'], $newcfg, $cmd['role'], null, $skipLocalConfig); if (!$status) { print_pre('Update failed for ' . print_r($cmd, true)); } break; case 'delete': $keys = explode('.', $cmd['name']); $depth = count($keys); $currentDepth = 1; $deleteConfig = array(); $arrayPtr =& $deleteConfig; foreach ($keys as $key) { if ($currentDepth == $depth) { $arrayPtr[$key] = 1; } else { $arrayPtr[$key] = array(); } $arrayPtr =& $arrayPtr[$key]; $currentDepth++; } unset($arrayPtr); $status = $cfg->Update($cmd['cobrand'], array(), $cmd['role'], $deleteConfig, $skipLocalConfig); if (!$status) { print_pre('Delete failed for ' . print_r($cmd, true)); } break; case 'create': $skipLocalConfig = true; $status = $cfg->AddConfigValue($cmd['cobrand'], array('key' => $cmd['name'], 'value' => $cmd['val'], 'type' => $cmd['type']), $cmd['role'], $skipLocalConfig); if (!$status) { print_pre('create failed for ' . print_r($cmd, true)); } break; } } $this->deleteCommands($indexes); } else { $status = false; } return $status; }
<? include_once '../../inc/inc.config.php'; include_once '../classes/utils.php'; require '../classes/ImageManager.php'; require '../classes/Produit.php'; session_start(); $debug = false; if ( $debug ) print_pre( $_POST ); // ---- Security ---------------------------------------------------------- // if ( !isset( $_SESSION[ "accessGranted" ] ) || !$_SESSION[ "accessGranted" ] ) { $result = $storageManager->grantAccess($_POST[ "login" ], $_POST[ "mdp" ]); if (!$result){ header('Location: /admin/?action=error'); } else { $_SESSION[ "accessGranted" ] = true; } } // ------------------------------------------------------------------------ // // ---- Gestion des produits --------------------------------------------- // if ( $_POST[ "mon_action" ] == "gerer" ) { $produit = new Produit(); $imageManager = New ImageManager(); // ---- Traitement de l'image ------------------- // if ( $_POST[ "url1" ] != '' ) { $source = $_SERVER[ "DOCUMENT_ROOT" ] . $_POST[ "url1" ]; if ( $debug ) echo "Source : " . $source . "<br>";
public function debug() { print_pre($this->uri_segments, $this->uri_string, @$_SERVER['PATH_INFO'], @$_SERVER['REQUEST_URI']); }