function draw($out) { foreach ($out as &$item) { $item['color'] = randomColor(128, 255); } echo "<table><tr style='font-size:200%;text-align:center;'><td style='width:30%;'>Table</td><td style='width:30%;'>Keys</td><td style='width:30%;'>Parents</td></tr>"; foreach ($out as $table => &$item) { echo "<tr style='border:solid 1px grey;'>"; echo "<td><a href='#table_structure_short_" . $table . "'><div id='table_" . $table . "' style='float:left;margin:10px;padding:10px;background-color:" . $item['color'] . "' >" . $table . "<span style='color:grey;font-size:small;'>(" . $item['num'] . ")</span></div></a></td>"; echo "<td>"; if (isset($item['ref'])) { foreach ($item['ref'] as $columname => &$data) { echo "<a href='#table_" . $data['table'] . "'><div style='float:left;margin:10px;padding:10px;background-color:" . $out[$data['table']]['color'] . "' >" . $data['table'] . ":" . $data['column'] . "<span style='color:grey;font-size:small;'>(" . $out[$data['table']]['num'] . ")</span></div>"; } } echo "</td>"; echo "<td>"; if (isset($item['parents'])) { foreach ($item['parents'] as &$parent) { echo "<a href='#table_" . $parent['table'] . "'><div style='float:left;margin:10px;padding:10px;background-color:" . $out[$parent['table']]['color'] . "' >" . $parent['table'] . ":" . $parent['column'] . "<span style='color:grey;font-size:small;'>(" . $out[$parent['table']]['num'] . ")</span></div>"; } } echo "</td>"; echo "</tr>"; } echo "</table><div style='clear:both;'></div>"; /*echo "<pre>"; print_r($out); echo "</pre>";*/ }
function hacode($content) { if (isset($_GET['reply'])) { $content = preg_replace("#>>(\\d+)#i", "<span class='quoteLink'><a href='#\\1'>>>\\1</a></span>", $content); } $content = preg_replace("#>>>/(.+?)/(\\d+)#i", "<span class='quote'><a href='" . config::$url . "/\\1/?reply=\\2'>>>>/\\1/\\2</a></span> ", $content); $content = preg_replace("#>(.+?)<#i", "<span class='quote'>> \\1 <</span> ", $content); $content = nl2br($content); // "Custom" $content = str_replace('7', 'over 9000', $content); $content = str_replace('penis', '<span style="background-color: #' . randomColor() . ';"><b> <span style="color:#' . randomColor() . ';">P</span> <span style="color:#' . randomColor() . ';">E</span> <span style="color:#' . randomColor() . ';">N</span> <span style="color:#' . randomColor() . ';">I</span> <span style="color:#' . randomColor() . ';">S</span> </b></span>', $content); $content = str_replace('v****a', '<span style="background-color: #' . randomColor() . ';"><b> <span style="color:#' . randomColor() . ';">V</span> <span style="color:#' . randomColor() . ';">A</span> <span style="color:#' . randomColor() . ';">G</span> <span style="color:#' . randomColor() . ';">I</span> <span style="color:#' . randomColor() . ';">N</span> <span style="color:#' . randomColor() . ';">A</span> </b></span>', $content); return $content; }
} // Sets Live Players position $livePlayer = place($car, $track, $color); // Generates Sims to race against $sim1 = place(randomCar(), $track, randomColor()); $sim2 = place(randomCar(), $track, randomColor()); $sim3 = place(randomCar(), $track, randomColor()); // Makes sure every player has a unique position while ($sim1 == $sim2 || $sim1 == $sim3 || $sim1 == $livePlayer) { $sim1 = place(randomCar(), $track, randomColor()); } while ($sim2 == $sim1 || $sim2 == $sim3 || $sim2 == $livePlayer) { $sim2 = place(randomCar(), $track, randomColor()); } while ($sim3 == $sim1 || $sim3 == $sim2 || $sim3 == $livePlayer) { $sim3 = place(randomCar(), $track, randomColor()); } ?> <h1>Results</h1> <table> <tr> <td> <ul> <?php // If statements that displays players rankings accordingly if ($livePlayer == "first") { echo "<li> First Place: " . $name . "</li>"; } else { if ($sim1 == "first") { echo "<li> First Place: Player 2</li>";
<h4 class="modal-title">Nuevo calendario</h4> </div> <div class="modal-body"> <fieldset> <div class="form-group"> <label for="cmp_calendario_nombre" class="visible-xs">Nombre</label> <input type="text" class="form-control" id="cmp_calendario_nombre" name="cmp_calendario_nombre" placeholder="Nombre del calendario" maxlength="30" required autofocus> </div> <div class="form-group" id="colorpicker1"> <label for="cmp_calendario_color">Color</label> <div class="input-group"> <input type="text" class="form-control" id="cmp_calendario_color" name="cmp_calendario_color" value="<?php echo randomColor(); ?> " required> <span class="input-group-addon"><i></i></span> </div> </div> <?php if (stristr($_SESSION['cargo'], '1')) { ?> <div class="checkbox"> <label> <input type="checkbox" id="cmp_calendario_publico" name="cmp_calendario_publico"> Hacer público este calendario.<br> <small class="text-muted">Será visible por todos los profesores del centro. Solo el Equipo directivo puede crear y editar eventos en este calendario.</small> </label> </div>
float: left; border-radius: 10px; padding:40px; width: 500px; height: 500px; background-color: <?php randomColor(".9"); ?> } .words { border-radius: 20px; padding: 20px; margin-left: 40px; width: 50%; height: 500px; float: left; background-color: <?php randomColor(".2"); ?> } </style> <div class="img-border"> <img src="me.jpg" class="img-circle" alt="image of me" style="margin-left: auto; margin-right: auto; width: 400px;"> </div> <div class="words"> <p style="font-size:24px; color: black;"> I use a PHP function that grabs a random 0-255 number for red, green, and blue and sends back a color for my border! Don't you just love fun random colors!</p> </div> <?php include 'includes/footer.php';
$s->execute(); $newId = $app->db->lastInsertId(); header('Location: /' . $newId); exit; } $board = null; if (is_numeric($uri[0])) { $board = Whiteboard::getBySchoolId($uri[0], $school->id); } else { $board = Whiteboard::getbySchoolName($uri[0], $school->id); } if ($board) { $roomId = $board->id; $board->brandImage = $school->bgImg; $board->backgroundColor = $school->bgColor; $color = randomColor(); $inviteText = $board->getNameUrl($school->domain . ".sneffel.com"); $embedText = $board->getEmbed(500, 500, $school->domain . ".sneffel.com"); if ($board->brandImage) { $size = getimagesize("./" . $board->brandImage); $heightAdjust = $size[1] + 25; } else { $heightAdjust = 25; } $controller = "subdomainBoard"; } else { $controller = "subdomain"; if ($school->id == 1) { $controller = "community"; } $s = $app->db->prepare("select DoodleBoard.id, DoodleBoard.name,BoardUsers.users,DoodleBoard.views from DoodleBoard left join BoardUsers on BoardUsers.boardId=DoodleBoard.id where DoodleBoard.schoolId = :id order by DoodleBoard.timeCreated desc");
</div> </div> </section> <?php /** * Generate random rgb color * * @return color */ function randomColor() { $color = mt_rand(0, 255) . "," . mt_rand(0, 255) . "," . mt_rand(0, 255); return $color; } $colorplay = randomColor(); $colordown = randomColor(); ?> <script type="text/javascript" src="js/datatables.js"></script> <script type="text/javascript" src="js/chart.min.js"></script> <script> var pieData = [ { value: <?php echo $numup; ?> , color:"#5cb85c", highlight: "#32b836", title: "<?php print $encodeExplorer->getString('add');
public static function register($db, $lang, $username, $password, $email) { Account::cleanup($db); $result = $db->query("SELECT COUNT(*) FROM " . DB_PREFIX . "user WHERE name = '" . escape($db, $username) . "' LIMIT 1"); $result = $result->fetch_row(); if ($result[0] != 0) { return AccountError::USERNAME_OCCUPIED; } $result = $db->query("SELECT COUNT(*) FROM " . DB_PREFIX . "user WHERE email = '" . escape($db, $email) . "' LIMIT 1"); $result = $result->fetch_row(); if ($result[0] != 0) { return AccountError::EMAIL_OCCUPIED; } if (strlen($username) < self::USERNAME_MIN_LENGTH || strlen($username) > self::USERNAME_MAX_LENGTH) { return AccountError::USERNAME_INVALID_LENGTH; } //if (! preg_match("/^[-0-9A-Z_@+.\s]+$/i", $username) || strpos($username, " ") !== false) { if (preg_match("/\\s/i", $username)) { return AccountError::USERNAME_INVALID_CHARS; } $pwerror = Account::validatePassword($password); if ($pwerror != AccountError::NO_ERROR) { return $pwerror; } if (filter_var($email, FILTER_VALIDATE_EMAIL) === false) { return AccountError::INVALID_EMAIL; } $crypted_pw = better_crypt($password); $token = ""; if (EMAIL_VERIFICATION) { $token = Account::sendRegisterMail($lang, $email, $username); if ($token === false) { return AccountError::EMAIL_SEND_ERROR; } } $query = "INSERT INTO " . DB_PREFIX . "user (name, password, power, status, nameColor, registerToken, email, registerDate) VALUES ('" . escape($db, $username) . "', '" . $crypted_pw . "', 10, '" . self::DEFAULT_STATUS . "', '" . randomColor() . "', '" . $token . "', '" . escape($db, $email) . "', " . time() * 1000 . ")"; $result = $db->query($query); if ($result === false) { echo '<pre>' . $query . "\n" . $db->error; return AccountError::DATABASE_ERROR; } return AccountError::NO_ERROR; }
$graph->SetShadow(); $graph->title->Set($_SESSION['lang']['hargapasar'] . " - " . $optNmBarang[$komoditi] . " (" . $periodePsr . ")"); $graph->title->SetFont(FF_DEFAULT, FS_NORMAL, 14); $graph->xaxis->SetFont(FF_DEFAULT, FS_NORMAL, 11); $graph->xaxis->SetTickLabels($labels); $graph->xaxis->SetLabelAngle(45); $optPasar = array(); $no = 0; function randomColor() { $colorArray = array('#00FFFF', '#F0FFFF', '#7FFF00', '#FF8C00', '#00FFFF', '#FF00FF', '#98FB98', '#CD5C5C', '#ADD8E6', '#E0FFFF', '#FAFAD2', '#3CB371', '#FFDEAD', '#FF4500', '#B0E0E6', '#D8BFD8'); return $colorArray[array_rand($colorArray)]; } foreach ($resPasar as $row) { $no += 1; $resultColor = randomColor(); if ($row['pasar'] == $optNamaPasar[$row['pasar']]) { $optPasar[$no] = new LinePlot($optNilai[$row['pasar']]); $optPasar[$no]->SetColor($resultColor); $optPasar[$no]->SetLegend($row['pasar']); $optPasar[$no]->mark->SetType(MARK_FILLEDCIRCLE); $optPasar[$no]->mark->SetFillColor($resultColor); $optPasar[$no]->SetCenter(); } } $graph->legend->SetFrameWeight(1); $graph->Add($optPasar); $graph->Stroke(); break; case 'excel': $bgcoloraja = "bgcolor=#DEDEDE align=center";