コード例 #1
0
ファイル: quote.php プロジェクト: evolutionarycoder/projectz
        echo "true";
    } else {
        echo "false";
    }
}
if (isset($_POST["update"])) {
    $quote = $_POST[\Backend\Database\Tables\Quotes::QUOTE];
    $id = $_POST[\Backend\Database\Tables\Quotes::ROW_ID];
    $obj = new \Backend\Database\Schemas\Quote($id, $quote);
    $table = new \Backend\Database\Tables\Quotes();
    if ($table->update($obj)) {
        echo "true";
    } else {
        echo "false";
    }
}
if (isset($_POST["delete"])) {
    $id = $_POST[\Backend\Database\Tables\Quotes::ROW_ID];
    $table = new \Backend\Database\Tables\Quotes();
    if ($table->delete($id)) {
        echo "true";
    } else {
        echo "false";
    }
}
// fetch total rows
if (isset($_GET["total"])) {
    $table = new Quotes();
    $total = $table->totalRows();
    echo $total . " quotes";
}
コード例 #2
0
ファイル: index.php プロジェクト: evolutionarycoder/projectz
use Backend\Database\Tables\Poems;
use Backend\Database\Tables\Promises;
use Backend\Database\Tables\Quotes;
use Backend\Database\Tables\Reassurance;
$poems = new Poems();
$totalPoems = (int) $poems->totalRows();
$iloves = new ILove($poems->getConnection());
$totalIloves = (int) $iloves->totalRows();
$assure = new Reassurance($poems->getConnection());
$totalAssure = (int) $assure->totalRows();
$promise = new Promises($poems->getConnection());
$totalPromise = (int) $promise->totalRows();
$memory = new Memory($poems->getConnection());
$totalMemory = (int) $memory->totalRows();
$quote = new Quotes($poems->getConnection());
$totalQuotes = (int) $quote->totalRows();
$total = $totalPoems + $totalIloves + $totalAssure + $totalPromise + $totalMemory + $totalQuotes;
?>
    <!--Widget-4 -->
    <div class="row">
        <div class="col-lg-7">
            <div class="col-md-6 col-sm-6 col-lg-3">
                <div class="mini-stat clearfix bx-shadow">
                    <div class="mini-stat-info text-center text-muted">
                        <span class="counter"><?php 
echo $totalPoems;
?>
</span>
                        Poems
                    </div>
                </div>