public function entries() { $attributes = $this->attributes(); $attributes['_content'] = $this->content(); $data = entries($attributes); return $data; }
#The full software license can be found here: #http://www.accounting-123.com/a.php?a=153/GPLv3 # # # # # # # # # # # # get settings require "../settings.php"; $OUTPUT = entries($_GET); require "../template.php"; function entries($_GET) { extract($_GET); db_conn('cubit'); $i = 0; $Sl = "SELECT * FROM cashbook WHERE trantype='{$trantype}' AND amount='{$amount}' AND banked='no' AND rid!=333"; $Ri = db_exec($Sl); $data = "<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\n\t<tr><th>Date</th><th>Description</th><th>Amount</th></tr>"; while ($cd = pg_fetch_array($Ri)) { if ($cd['trantype'] != "deposit") { $cd['amount'] = -$cd['amount']; } $data .= "<tr bgcolor={$bgcolor}><td>{$cd['date']}</td><td>{$cd['descript']}</td><td align=right>R {$cd['amount']}</td></tr>"; }
// entries() /** * Insert a new post into the guestbook's database. * * @param array $p * @global mysql $link * @return void */ function create_entry($p) { global $link; $query = "INSERT INTO `guestbook` " . "SET `username` = '{$p['username']}', " . "`content` = '{$p['content']}'"; mysqli_query($link, $query); } // create_entry() $posts = entries(); if ($_SERVER['REQUEST_METHOD'] == "POST") { $new_post = ['username' => $_POST['user_name'], 'content' => $_POST['content']]; foreach ($new_post as $node => $value) { if (!$value) { $errors[] = $node; } } if (empty($errors)) { create_entry($new_post); header('Location: guestbook.php'); } // if } // if ?>
function content($where, $type, $amount, $style, $filename) { if ($where == 0) { $title = "HOME"; } elseif ($where == 1) { $title = "THE FEED"; } elseif ($where == 2) { $title = "THE LEAGUE"; } else { echo "Error: invalid {$where} parameter passed.\n"; } echo " <div class = \"content\">\n"; echo " <div class = \"spacer\"></div>\n"; echo " <h1><a class = \"lightbg\" href = \"http://www.turkiball.com/feed/index.php\">" . $title . "</a></h1>\n"; echo " <br>\n"; echo " <div class = \"contentline\"></div>\n"; echoContent($filename); entries($type, $amount, $style); if (strpos($filename, 'people') && !strpos($filename, '?')) { people(); } elseif (strpos($filename, 'pictures')) { pictures(); } echo " <br><br><br><br><br><br><br><br><br>\n"; echo " </div>\n"; }
function content($where, $type, $amount, $style, $filename) { if (strpos($filename, 'index')) { $title = "HOME"; $link = "index"; } if (strpos($filename, 'sport')) { $title = "THE SPORT"; $link = "sport"; } if (strpos($filename, 'rules')) { $title = "THE RULES"; $link = "rules"; } if (strpos($filename, 'more')) { $title = "MORE TURKIBALL"; $link = "more"; } echo " <div class = \"content\">\n"; echo " <div class = \"spacer\"></div>\n"; echo " <h1><a class = \"lightbg\" href = \"http://www.turkiball.com/" . $link . ".php\">" . $title . "</a></h1>\n"; echo " <br>\n"; echo " <div class = \"contentline\"></div>\n"; echoContent($filename); entries($type, $amount, $style); if (strpos($filename, 'people') && !strpos($filename, '?')) { people(); } elseif (strpos($filename, 'pictures')) { pictures(); } echo " <br><br><br><br><br><br><br><br><br>\n"; echo " </div>\n"; }