} else { if ($theaction == 'setName') { setValue($id, "name"); } else { if ($theaction == 'getEmail') { printValue($id, "email"); } else { if ($theaction == 'setEmail') { setValue($id, "email"); } else { if ($theaction == 'getAddress') { printValue($id, "address"); } else { if ($theaction == 'setAddress') { setValue($id, "address"); } else { if ($theaction == 'getMajor') { printValue($id, "major"); } else { if ($theaction == 'setMajor') { setValue($id, "major"); } else { print "Invalid paramter"; } } } } } } } }
echo $data['inputType']; ?> " name="<?php echo $data['name']; ?> " id="<?php echo $data['name']; ?> " class="inputFields <?php echo array_key_exists($data['name'], $error) ? "error" : ""; ?> " value="<?php echo isset($_POST[$data['name']]) && empty($_POST[$data['name']]) ? htmlspecialchars($_POST[$data['name']]) : printValue($con, $data['name']); ?> " placeholder="<?php echo $data['display']; ?> " /> <!-- printValue checks if something has been posted, if not, show the database value in the input field. --> <span class="errormsg"><?php echo array_key_exists($data['name'], $error) ? $error[$data['name']] : ''; ?> </span> <?php } ?> <input type="submit" value="Wijzigen" class="button" id="register"/>
function printResult($name, $label, $value, $type) { ?> <section class="form-group"> <label for="<?php print $name; ?> " class="control-label col-xs-2"><?php print $label; ?> </label> <div class="col-xs-10"> <?php switch ($type) { case "input": ?> <input type="text" class="form-control" name="<?php print $name; ?> " id="<?php print $name; ?> " <?php printValue($value); printRequired($name); ?> ><?php break; case "radio": ?> <div class="radio"> <label><input type="radio" name="<?php print $name; ?> " value="true"<?php print $value == "true" ? " checked=''" : ""; ?> >Yes</label> </div> <div class="radio"> <label><input type="radio" name="<?php print $name; ?> " value="false"<?php print $value == "false" ? " checked=''" : ""; ?> >No</label> </div> <?php break; case "textarea": ?> <textarea class="form-control" name="<?php print $name; ?> " id="<?php print $name; ?> " rows="4"<?php printRequired($name); ?> ><?php printValue($value, true); ?> </textarea><?php break; } ?> </div> </section> <hr> <?php }
function printMatrixBySpiralCounterClockwise($matrix) { $matrixSize = count($matrix); $top = $left = 0; $bottom = $right = $matrixSize - 1; $direction = 0; while ($top <= $bottom && $left <= $right) { if ($direction === 0) { // From right to left for ($column = $right; $column >= $left; $column--) { printValue($matrix, $top, $column); } $top++; } else { if ($direction == 1) { // From top to bottom for ($row = $top; $row <= $bottom; $row++) { printValue($matrix, $row, $left); } $left++; } else { if ($direction === 2) { // From left to right for ($column = $left; $column <= $right; $column++) { printValue($matrix, $bottom, $column); } $bottom--; } else { if ($direction == 3) { // From bottom to top for ($row = $bottom; $row >= $top; $row--) { printValue($matrix, $row, $right); } $right--; } } } } $direction = ++$direction % 4; // 0,1,2,3,0,... } }
$temp->store_result(); $temp->bind_result($objectTitle, $partID); while ($temp->fetch()) { ?> <li class="list-part"> <?php print $objectTitle; ?> <button type="button" class="btn btn-xs btn-default pull-right" id="part<?php print $partID; ?> " <?php printValue($partID); ?> title="<?php printValue($objectTitle, true); ?> ">Select</button> </li> <?php } ?> </ul> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-warning" data-dismiss="modal">Close</button> </div> </div> </div> </div>
/** * display debug information */ public function printDebug() { $dispatcher = $this->getDI()->get('dispatcher'); $controller = $dispatcher->getControllerName(); $action = $dispatcher->getActionName(); //$main = $this->getDI()->get('view')->getMainView(); //$ = $view->getLayout(); $view->getMainView(); $now = microtime(TRUE); $time = $now - $_SERVER['REQUEST_TIME']; echo "<style>\n\t\t.debug-table td, .debug-table th {\n\t\t\tfont-size: 10px;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\t</style>\n\t\t<h7>Phalcon</h7>\n\t\t<table class='debug-table table table-striped table-condensed'>\n\t\t\t<tr>\n\t\t\t\t<td>Time</td>\n\t\t\t\t<td>{$time}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>Controller</td>\n\t\t\t\t<td>{$controller}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>Action</td>\n\t\t\t\t<td>{$action}</td>\n\t\t\t</tr>"; foreach ($this->_views as $view) { echo "<tr><td>View</td><td>{$view}</td></tr>"; } echo "</table>"; // Print out Session Data if (!empty($_SESSION)) { echo "<h7>Session</h7>\n\t\t\t<table class='debug-table table table-striped table-condensed'><tr><th>Session Name</th><th>Session Value</th></tr>"; echo "<tr><td>" . session_name() . "</td><td>" . session_id() . "</td></tr>"; foreach ($_SESSION as $index => $value) { echo "<tr><td>{$index}</td><td>" . printValue($value) . "</td></tr>"; } echo "</table>"; } //printSuperGlobal($_SESSION, "Session"); //printSuperGlobal($_POST, "Post"); //printSuperGlobal($_COOKIE, "Cookie"); echo 'welcome'; /*$queries = DatabaseFactory::getQueries(); if (!empty($queries)) { echo "<h7>Database</h7> <table class='table debug-table table-striped table-condensed'><tr><th>Query</th><th>File</th><th>Line</th><th>Success</th></tr>"; foreach($queries as $query) { echo "<tr> <td>{$query->query}</td> <td>{$query->file}</td> <td>{$query->line}</td> <td>{$query->success}</td> </tr>"; } echo "</table>"; }*/ if (class_exists('MemcachedCache', FALSE)) { echo "<h7>Memcached</h7>"; $cache = MemcachedCache::singleton(); echo "<table class='table debug-table table-striped table-condensed'>"; foreach ($cache->getServerList() as $server) { echo "<tr><td>{$server['host']}</td><td>{$server['port']}</td><td></td></tr>"; } echo "</table>"; } /* // Get All CLI Commands $commands = Command::singleton()->getCommands(); if (!empty($commands)) { echo "<h7>Shell Comamnds</h7> <table class='table debug-table table-striped table-condensed'><tr><th>Command</th><th>File</th><th>Line</th><th>Success</th></tr>"; foreach($commands as $command) { $command->toRow(); } echo "</table>"; }*/ }