示例#1
0
<?php

/**
 * Created by PhpStorm.
 * User: evolutionarycoder
 * Date: 2/16/16
 * Time: 2:43 PM
 */
header("Cache-Control: no-cache, no-store");
header("Pragma: no-cache");
use Backend\Database\Tables\Reassurance;
use Backend\Helpers\Email;
include "../../../vendor/autoload.php";
if (isset($_GET["fetch"])) {
    $table = new Reassurance();
    if ($table->createJson()) {
        $email = new Email("MyLove Synced", "Table " . Reassurance::TABLE_NAME);
        $email->send();
        header("Location: ../json/" . Reassurance::JSON_NAME);
    } else {
        echo "false";
    }
}
示例#2
0
}
// update rows in database
if (isset($_POST["update"])) {
    $reassure = $_POST[\Backend\Database\Tables\Reassurance::REASSURE];
    $id = $_POST[\Backend\Database\Tables\Reassurance::ROW_ID];
    $obj = new \Backend\Database\Schemas\Reassure($id, $reassure);
    $obj->setSynced(null);
    $obj->setToUpdate("true");
    $table = new \Backend\Database\Tables\Reassurance();
    if ($table->update($obj)) {
        echo "true";
    } else {
        echo "false";
    }
}
// delete rows in database
if (isset($_POST["delete"])) {
    $id = $_POST[\Backend\Database\Tables\Reassurance::ROW_ID];
    $table = new \Backend\Database\Tables\Reassurance();
    if ($table->delete($id)) {
        echo "true";
    } else {
        echo "false";
    }
}
// fetch total rows
if (isset($_GET["total"])) {
    $table = new Reassurance();
    $total = $table->totalRows();
    echo $total . " reassure";
}
<?php

/**
 * Created by PhpStorm.
 * User: evolutionarycoder
 * Date: 2/4/16
 * Time: 5:02 PM
 */
use Backend\Database\Tables\Reassurance;
use Backend\Helpers\TableBuilder;
$table = new Reassurance();
$data = $table->readAll();
$builder = new TableBuilder();
if ($data !== false) {
    for ($i = 0; $i < count($data); $i++) {
        $decoded = clone $data[$i];
        $table->stripAndDecode($decoded);
        $table->strip($data[$i]);
        $current = $data[$i];
        $builder->buildCell($decoded->getReassure())->buildCell($decoded->getSynced());
        $builder->addActionAttrs("reassure", $current->getReassure())->addActionAttrs("id", $current->getId());
        $builder->addRowAttr("id", $current->getId());
        echo $builder->buildRow();
    }
}
示例#4
0
                </div>

                
    <!-- Fetch Total Records from the relevant table  -->
    <?php 
use Backend\Database\Tables\ILove;
use Backend\Database\Tables\Memory;
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">