コード例 #1
0
ファイル: spread.php プロジェクト: reboxhost/phpb2b
        flash("action_failed");
    } else {
        flash("success", '', 0);
    }
}
if (isset($_GET['do'])) {
    $do = trim($_GET['do']);
    if (isset($_GET['id'])) {
        $id = intval($_GET['id']);
    }
    if ($do == "edit") {
        if (!empty($id)) {
            $linkinfo = $spread->read("*", $id, null, $conditions);
            setvar("item", $linkinfo);
        }
        $tpl_file = "spread_edit";
        vtemplate($tpl_file);
        exit;
    }
}
$amount = $spread->findCount(null, $conditions);
$page->setPagenav($amount);
$fields = "*";
$result = $spread->findAll($fields, null, $conditions, "id DESC", $page->firstcount, $page->displaypg);
for ($i = 0; $i < count($result); $i++) {
    $result[$i]['exp_date'] = df($result[$i]['expiration']);
}
setvar("CheckStatus", cache_read('typeoption', 'check_status'));
setvar("Items", $result);
setvar("ByPages", $page->pagenav);
vtemplate($tpl_file);
コード例 #2
0
ファイル: spread.php プロジェクト: reboxhost/phpb2b
            $item = $spread->read("*", $id);
            if (!empty($item['expiration'])) {
                $item['exp_date'] = df($item['expiration']);
            }
            setvar("item", $item);
        }
        $tpl_file = "spread.edit";
        template($tpl_file, true);
    }
}
if (isset($_POST['del']) && !empty($_POST['id'])) {
    $result = $spread->del($_POST['id']);
}
if (isset($_POST['pb_action']) && !empty($_POST['id'])) {
    $status = $_POST['pb_action'];
    $ids = "(" . implode(",", $_POST['id']) . ")";
    $sql = "UPDATE {$tb_prefix}spreads SET status='" . $status . "' WHERE id IN " . $ids;
    $result = $pdb->Execute($sql);
    if (!$result) {
        flash();
    }
}
$amount = $spread->findCount();
$page->setPagenav($amount);
$result = $spread->findAll("*", null, $conditions, " id desc", $page->firstcount, $page->displaypg);
for ($i = 0; $i < count($result); $i++) {
    $result[$i]['exp_date'] = df($result[$i]['expiration']);
}
setvar("Items", $result);
setvar("ByPages", $page->pagenav);
template($tpl_file);