Пример #1
0
function show_entries_admin()
{
    include_from_template('header.php');
    show_logout_button();
    show_checkboxes_js("entriesForm");
    ?>

<p>
<a href="index.php?action=showbans">Забаненные IP адреса</a> | <a href="index.php?action=showbadwords">Запрещенные слова</a>
</p>

<form method="post" action="index.php" id="entriesForm">
<fieldset>

<p>
<?php 
    global $MODERATION_ENABLED;
    if ($MODERATION_ENABLED === TRUE) {
        ?>
<strong>Выберите действие: </strong>
<br />
<select name="action">
	<option value="approve">Опубликовать выбранное</option>
	<option value="delete">Удалить выбранное</option>
</select>
<br /> 
<?php 
    } else {
        ?>
<input type="hidden" name="action" value="delete" />
<?php 
    }
    ?>
<!-- <input type="checkbox" name="banip" value="true" /> Так-же заблокировать авторов удаленных сообшений -->
<?php 
    if ($MODERATION_ENABLED === TRUE) {
        ?>
<input type="submit" value="Perform Action" class="submit" />
<?php 
    } else {
        ?>
<input type="submit" value="Удалить выбранные" class="submit" />
<input type="checkbox" name="banip" value="true" /> Так-же заблокировать авторов удаленных сообшений
<?php 
    }
    ?>
</p>
<p>
<a href="#" onclick="changeAllCheckboxes(true); return false;">Выбрать все</a> -  
<a href="#" onclick="changeAllCheckboxes(false); return false;">Снять пометку со всех</a>
</p>

<?php 
    // Show entries
    echo "<h2>Записи</h2>";
    show_entries(NULL, NULL, TRUE, TRUE, TRUE);
    ?>
</fieldset>
</form>
<?php 
    include_from_template('footer.php');
}
function print_entries($_POST)
{
    extract($_POST);
    if (!isset($print_entry) or !is_array($print_entry)) {
        return show_entries($_POST, "<li class='err'>Please select at least 1 entry to print.</li><br>");
    }
    db_connect();
    $listing = "";
    foreach ($print_entry as $each => $own) {
        #get this entry
        $get_entry = "SELECT * FROM supp_payment_cheques WHERE id = '{$own}' LIMIT 1";
        $run_entry = db_exec($get_entry) or errDie("Unable to get payment information.");
        if (pg_numrows($run_entry) < 1) {
            $listing .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td>Unable to get payment information. ({$own})</td>\n\t\t\t\t</tr>";
        } else {
            $parr = pg_fetch_array($run_entry);
            #now figure out what to output ...
            $pay_type = getCSetting("SUPP_PAY_TYPE");
            if (!isset($pay_type) or strlen($pay_type) < 1) {
                $pay_type = "cheq_man";
            }
            $do_auto = FALSE;
            $do_manu = FALSE;
            if ($pay_type == "cheq_man") {
                $do_manu = TRUE;
            } else {
                $do_auto = TRUE;
            }
            $supname = $parr['supname'];
            $cheqnum = $parr['cheqnum'];
            $amt = $parr['amt'];
            $date = $parr['date'];
            if ($do_auto) {
                $proc_amt = str_pad($amt, 8, "0", "PAD_LEFT");
                $val1 = substr($proc_amt, 0, 2);
                $val2 = substr($proc_amt, 2, 1);
                $val3 = substr($proc_amt, 3, 1);
                $val4 = substr($proc_amt, 4, 1);
                $val5 = substr($proc_amt, 5, 1);
                $val6 = substr($proc_amt, 6, 1);
                $val7 = substr($proc_amt, 7, 1);
                $val8 = substr($proc_amt, 9, 2);
                #lets calculate the stars to show on the cheque
                $star_mils = calc_stars($val1);
                $star_hundred_thou = calc_stars($val2);
                $star_ten_thou = calc_stars($val3);
                $star_thou = calc_stars($val4);
                $star_hundreds = calc_stars($val5);
                $star_tens = calc_stars($val6);
                $star_units = calc_stars($val7);
                $star_cents = calc_stars($val8, TRUE);
                #print the cheque ...
                $listing .= "\n\t\t\t\t\t<table " . TMPL_tblDflts . " width='60%'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td width='40%' colspan='7'>{$supname}</td>\n\t\t\t\t\t\t\t<td>{$date}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td width='40'>{$star_mils}</td>\n\t\t\t\t\t\t\t<td width='40'>{$star_hundred_thou}</td>\n\t\t\t\t\t\t\t<td width='40'>{$star_ten_thou}</td>\n\t\t\t\t\t\t\t<td width='40'>{$star_thou}</td>\n\t\t\t\t\t\t\t<td width='40'>{$star_hundreds}</td>\n\t\t\t\t\t\t\t<td width='40'>{$star_tens}</td>\n\t\t\t\t\t\t\t<td width='40'>{$star_units}</td>\n\t\t\t\t\t\t\t<td width='40'>{$star_cents}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan='5'></td>\n\t\t\t\t\t\t\t<td colspan='3' nowrap>" . CUR . " " . sprint($amt) . "</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t" . TBL_BR . "\n\t\t\t\t\t\t" . TBL_BR . "\n\t\t\t\t\t\t" . TBL_BR . "\n\t\t\t\t\t\t" . TBL_BR . "\n\t\t\t\t\t\t" . TBL_BR . "\n\t\t\t\t\t\t" . TBL_BR . "\n\t\t\t\t\t</table>";
            } elseif ($do_manu) {
                #show the details for the cheque ...
                $listing .= "\n\t\t\t\t\t<table " . TMPL_tblDflts . " width='60%'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>{$cheqnum}</td>\n\t\t\t\t\t\t\t<td>{$supname}</td>\n\t\t\t\t\t\t\t<td>{$date}</td>\n\t\t\t\t\t\t\t<td>" . CUR . " {$amt}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>";
            }
        }
    }
    $OUTPUT = "\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t{$listing}\n\t\t</table>";
    require "../tmpl-print.php";
    //	return $display;
}
Пример #3
0
function show_added_entry()
{
    show_entries(0, 1, FALSE, FALSE, FALSE, FALSE);
}
Пример #4
0
<?php

include_from_template('header.php');
?>

<?php 
show_guestbook_add_form();
?>

<?php 
show_entries();
?>

<p class="entryCount">
<b>Просмотр записей <?php 
show_entries_start_offset();
?>
 - <?php 
show_entries_end_offset();
?>
 
(Всего записей: <?php 
show_entry_count();
?>
</b>)
</p>

<?php 
include_from_template('footer.php');