function render_table_out_of_text($text, $table) { $text2 = explode("\n", $text); $t2 = $table; $i = -1; foreach ($text2 as $line) { $i++; $t2["row-" . $i] = explode(' | ', $line); } return render_table($t2); }
function credit($term, $rate, $amount, $month, $year, $round = 2) { // $term - срок кредита (в месяцах), $rate процентная ставка, $amount - сумма кредита (в рублях) // $month - месяц начала выплат, $year - год начала выплат, $round - округление сумм global $month_array; $result = array(); $term = (int) $term; $rate = (double) str_replace(",", ".", $rate); $amount = (double) str_replace(",", ".", $amount); $round = (int) $round; $month_rate = $rate / 100 / 12; // месячная процентная ставка по кредиту (= годовая ставка / 12) $k = $month_rate * pow(1 + $month_rate, $term) / (pow(1 + $month_rate, $term) - 1); // коэффициент аннуитета $payment = round($k * $amount, $round); // Размер ежемесячных выплат $overpay = $payment * $term - $amount; $debt = $amount; for ($i = 1; $i <= $term; $i++) { $schedule[$i] = array(); $percent_pay = round($debt * $month_rate, $round); $credit_pay = round($payment - $percent_pay, $round); $schedule[$i]['month'] = $month_array[$month - 1] . ' ' . $year; $schedule[$i]['dept'] = number_format($debt, $round, ',', ' '); $schedule[$i]['percent_pay'] = number_format($percent_pay, $round, ',', ' '); $schedule[$i]['credit_pay'] = number_format($credit_pay, $round, ',', ' '); $schedule[$i]['payment'] = number_format($payment, $round, ',', ' '); $debt = $debt - $credit_pay; if ($month++ >= 12) { $month = 1; $year++; } } $result['overpay'] = number_format($overpay, $round, ',', ' '); $result['payment'] = number_format($payment, $round, ',', ' '); $result['schedule'] = render_table($schedule); return $result; }
<br> Tagged genres: <?php echo implode(', ', $genres); ?> <br> Average Rating: <?php echo $avg_rating; ?> /5 </p> <?php echo render_table($directors, PERSON_VIEW, 'id', 'Name', 'Directed By', false); ?> <br> <?php echo render_table($cast, PERSON_VIEW, 'id', 'Name', 'Film Cast'); ?> <br> <div class="comment-wrapper"> <strong>User reviews</strong> <br> <?php echo hyperlink(REVIEW_FORM, $id, 'Add review'); ?> <?php echo $comments_html; ?> </div> <?php page_footer();
Tagged genres: <?php echo implode(', ', $genres); ?> <br> Average Rating: <?php echo $avg_rating; ?> /5 </p> <?php echo render_table($directors, 'person-view.php', 'id', 'Name', 'Directed By', false); ?> <br> <?php echo render_table($cast, 'person-view.php', 'id', 'Name', 'Film Cast'); ?> <br> <div class="comment-wrapper"> <strong>User reviews</strong> <br> <?php echo hyperlink('review.php', $id, 'Add review'); ?> <?php echo $comments_html; ?> </div> <br> <br> <a href="<?php
function render($data, $format = 'table', $time) { $func_name = "render_" . $format; if (function_exists($func_name)) { call_user_func($func_name, $data, $time); } else { render_table($data, $time); } }
page_footer(); } else { page_header('Search Results for ' . $term); $term_list = explode(' ', strtolower($term)); $actor_sql = 'SELECT Actor.id, CONCAT(Actor.first, " ", Actor.last, " (", dob, ")") as Name FROM Actor WHERE 1'; $director_sql = 'SELECT Director.id, CONCAT(Director.first, " ", Director.last, " (", dob, ")") as Name FROM Director WHERE 1'; $movie_sql = 'SELECT Movie.id, CONCAT(Movie.title, " (", year, ")") as title FROM Movie WHERE 1'; // No PDO bindings here because of some wonkiness concerning bindings that are not surrounded by whitespace foreach ($term_list as $individual_term) { $actor_sql .= ' AND ( LOWER(Actor.first) LIKE "%' . $individual_term . '%" OR LOWER(Actor.last) LIKE "%' . $individual_term . '%" )'; $director_sql .= ' AND ( LOWER(Director.first) LIKE "%' . $individual_term . '%" OR LOWER(Director.last) LIKE "%' . $individual_term . '%" )'; $movie_sql .= ' AND LOWER(Movie.title) LIKE "%' . $individual_term . '%"'; } $dbh = get_db_handle(); $stmt = $dbh->prepare($actor_sql); $stmt->execute(); $actors = $stmt->fetchAll(PDO::FETCH_ASSOC); $stmt = $dbh->prepare($director_sql); $stmt->execute(); $directors = $stmt->fetchAll(PDO::FETCH_ASSOC); $stmt = $dbh->prepare($movie_sql); $stmt->execute(); $movies = $stmt->fetchAll(PDO::FETCH_ASSOC); echo '<div><h2>Actor Results for <em>' . implode($term_list, ' AND ') . '</em></h2>'; echo render_table($actors, 'person-view.php', 'id', 'Name', '', false) . '</div>'; echo '<div><h2>Director Results for <em>' . implode($term_list, ' AND ') . '</em></h2>'; echo render_table($directors, 'person-view.php', 'id', 'Name', '', false) . '</div>'; echo '<div><h2>Movie Results for <em>' . implode($term_list, ' AND ') . '</em></h2>'; echo render_table($movies, 'movie-view.php', 'id', 'title', '', false) . '</div>'; page_footer(); }
echo '</tr>'; } echo '<tr>'; echo "<td>Born</td>"; echo '<td>' . date('F j, Y', strtotime($actor['dob'])) . '</td>'; echo '</tr>'; echo '<tr>'; echo "<td>Died</td>"; if ($actor['dod'] != '0000-00-00') { echo '<td>' . date('F j, Y', strtotime($actor['dod'])) . '</td>'; } else { echo '<td>' . 'Still Alive' . '</td>'; } echo '</tr>'; ?> </table> <br> <?php echo render_table($directed, 'viewMovie.php', 'id', 'Title', 'Films Directed') . '<br>'; ?> <?php echo render_table($acted, 'viewMovie.php', 'id', 'Title', 'Filmography'); page_footer(); ?> <br> <a href="<?php echo 'index.php'; ?> " >Back to Main Menu</a>
} $s .= "</ul>"; return render_widget("blog", "BrowserPlus: <a href=\"/blog/\">Blog</a>", $s); } // IRC Transcript $irc = new IRC(); $results = $irc->get_rows($irc->get_max_id(), $tableRowsToShow); $ircnav = l("#browserplus", "/discuss/"); $irctable = render_table($results, "stamp", "who", "utterance", array("show_long_dates" => true, "top_nav" => "<strong>IRC: {$ircnav}</strong>")); //$ircwidgets = $irc->render_widget("day") . $irc->render_widget("week") . $irc->render_widget("month"); $ircwidgets = $irc->render_widget("week"); // GIT Projects $git = new GIT(); $results = $git->get_rows($tableRowsToShow); $gitnav = "<strong>GitHub: <a href=\"http://www.github.com/browserplus/\">BrowserPlus</a></strong>"; $gittable = render_table($results, "tcommit", "project", "msg", array("show_long_dates" => true, "top_nav" => $gitnav, "url_key" => "url", "url_pat" => "%s")); $gitwidgets = $git->render_project_widget(); // bugzilla issues $bugzilla = new Bugzilla(); $issuewidget = $bugzilla->render_widget($listItemsToShow); // Links Widget $linkswidget = get_links_widget(); // Blog Widget $blogwidget = get_blog_widget($listItemsToShow); // Twitter Widgets $twitter = new Twitter(); $tw_user_widget = $twitter->render_user_widget("browserplus", $listItemsToShow); $tw_search_widget = $twitter->render_search_widget("browserplus", $listItemsToShow); $forums = new Forum(); $forum_widget = $forums->render_widget($listItemsToShow); $body = <<<EOS
<link rel="stylesheet" type="text/css" href="<?php echo BASE_URL_STATIC; ?> css/datatable.css" /> <h2>User Groups</h2> <a href="<?php echo BASE_URL; ?> admin/add-group" class="button">Add Group</a> <br/><br/> <?php render_table($schema, $groups, 'tbl-groups');
if ($l[note] && in_array(1, $P[print_note]) && !$rapida) { add_table_row('Tabella1', array("NOTE: " . $l[note]), $oo_ar10); } } // create content $OO_PAGE_STYLE = set_page_style($PAGE_STYLE); $OO_PAGE_HEADER = set_page_header("#DATA#\t\t\t\tELENCO PRATICHE\t\tPag.: #PAGINA#"); $OO_PAGE_FOOTER = ''; // set_page_footer('#DATA# #ORA#'); $header_style = array(color => '#000000', size => '12pt', align => 'start', face => 'Verdana'); //$footer_style = array(color => '#ffff00', size => '12pt', align => 'end', face => 'Verdana'); $OO_HEADER_STYLE = set_header_style($header_style); $OO_FOOTER_STYLE = ''; // set_footer_style($footer_style); $OO_TABLE_STYLES = gen_table_style(); $OO_TEXT .= render_table('Tabella1'); $OO_FONT_STYLES = gen_font_style(); $url = make_sxw($filename); print '<a href="../output_sxw.php?file=' . $filename . '">Fare click per visualizzare il file</a><br>'; } else { print 'selezionare almeno un parametro di ricerca'; } } else { print draw_form($thissearch[form], $module, $error, $_GET); } } else { print draw_form($thissearch[form], $module, "", $_GET); } $PAGE[PAGE_CONTENT] = ob_get_contents(); ob_end_clean(); final_render();
<link rel="stylesheet" type="text/css" href="<?php echo BASE_URL_STATIC; ?> css/datatable.css" /> <h2>Static Pages</h2> <?php if (!isset($page)) { render_table($schema, $pages, 'tbl-users'); } else { render_form($schema, $content, 'admin/page/' . $content['stub']); }
'; $sth = $dbh->prepare($directed_sql); $sth->execute(array(':id' => $id)); $directed = $sth->fetchAll(PDO::FETCH_ASSOC); page_header($actor['first'] . ' ' . $actor['last']); ?> <p> <strong><?php echo $actor['first'] . ' ' . $actor['last']; ?> </strong> <br> <?php if (!empty($actor['sex'])) { echo ucfirst($actor['sex']) . '<br>'; } ?> <?php echo $actor['dob'] ? 'Born: ' . date('F j, Y', strtotime($actor['dob'])) . '<br>' : ''; ?> <?php echo $actor['dod'] ? 'Died: ' . date('F j, Y', strtotime($actor['dod'])) . '<br>' : ''; ?> </p> <?php echo render_table($directed, MOVIE_VIEW, 'id', 'Title', 'Films Directed') . '<br>'; ?> <?php echo render_table($acted, MOVIE_VIEW, 'id', 'Title', 'Filmography'); page_footer();
<h2><?php echo $html_head['title']; ?> </h2> <?php if (!isset($article)) { ?> <a href="<?php echo BASE_URL; ?> dashboard/add/new" class="button">Add Content</a> <br/><br/> <?php render_table($schema, $news, 'tbl-news'); ?> <?php if ($pages > 1) { for ($i = 1; $i < $pages + 1; $i++) { ?> <a class="button<?php echo $i == $page ? ' current' : ''; ?> " href="<?php echo BASE_URL; ?> dashboard/index/<?php echo $i; ?>
$id = (int) $_GET['id']; $id = $max_id - $id < 0 ? $max_id : $id; } else { $id = $max_id; } $results = $irc->get_rows($id, IRC_MAX_ROWS); $rcount = count($results); if ($rcount > 0) { $first_id = $results[0]["id"]; $last_id = $results[count($results) - 1]["id"]; $next_id = $last_id + IRC_MAX_ROWS - 1; $blurb = "To chat with the BrowserPlus community, fire up your favorite IRC client and "; $blurb .= "head on over to <tt>#browserplus</tt> on <tt>freenode</tt>."; $nav = l("« Older", "?id={$first_id}", $first_id > 0) . " | " . l("Current", "/discuss/", $id != $max_id) . " | " . l("Newer »", "?id={$next_id}", $last_id < $max_id); } } $cfg = array("show_long_date" => false, "top_nav" => $nav, "bot_nav" => $nav); if ($in_search) { $cfg["url_pat"] = "/discuss/?mid=%s"; $cfg["url_key"] = "id"; } $table = render_table($results, "stamp", "who", "utterance", $cfg); $widgets = $irc->render_widget("day") . $irc->render_widget("week") . $irc->render_widget("month"); $body = <<<EOS <h1>IRC Transcript</h1> <p>{$blurb}</p> <div class="irc-logs"> {$table} </div> EOS; render2c("IRC Logs", "Discuss", $body, $widgets);
<link rel="stylesheet" type="text/css" href="<?php echo BASE_URL_STATIC; ?> css/datatable.css" /> <h2>My Account</h2> <?php render_form($schema, $user, 'user'); ?> <br/> <h3>Recently used devices</h3> <?php render_table($logins_schema, $logins, 'logins'); ?> <style>table.table-striped tr td img {width:24px;}</style>
<link rel="stylesheet" type="text/css" href="<?php echo BASE_URL_STATIC; ?> css/datatable.css" /> <h2>User Accounts</h2> <a href="<?php echo BASE_URL; ?> admin/add-user" class="button">Add User</a> <br/><br/> <?php render_table($schema, $users, 'tbl-users');
<link rel="stylesheet" type="text/css" href="<?php echo BASE_URL_STATIC; ?> css/datatable.css" /> <h2>Static Pages</h2> <?php if (!isset($page)) { render_table($schema, $pages, 'tbl-pages'); } else { render_form($schema, $content, 'admin/pages/' . $content['slug']); ?> <style>iframe#content_ifr{height:300px !important; width:99.8% !important;}</style><?php }
<link rel="stylesheet" type="text/css" href="<?php echo BASE_URL_STATIC; ?> css/datatable.css" /> <h2>My Apps</h2> <a href="<?php echo BASE_URL; ?> dashboard/developer/create-app" class="button">Create App</a> <br/><br/> <?php render_table($schema, $apps, 'tbl-apps');
echo BASE_URL_STATIC; ?> css/datatable.css" /> <h2>Blog Articles</h2> <?php if (!isset($article)) { ?> <a href="<?php echo BASE_URL; ?> user/blog/add/new" class="button">Add a Blog Article</a> <br/><br/> <?php render_table($schema, $blog, 'tbl-blog'); ?> <?php if ($pages > 1) { for ($i = 1; $i < $pages + 1; $i++) { ?> <a class="button<?php echo $i == $page ? ' current' : ''; ?> " href="<?php echo BASE_URL; ?> admin/blog/<?php echo $i; ?>