コード例 #1
0
ファイル: standard.php プロジェクト: reboxhost/phpb2b
        }
    }
    if ($do == "del" && !empty($id)) {
        $deleted = false;
        $deleted = $standard->del($id);
    }
    if ($do == "edit") {
        if (!empty($id)) {
            $item = $standard->read("*", $id);
            if (!empty($item['publish_time'])) {
                $item['publish_date'] = df($item['publish_time']);
            }
            if (!empty($item['force_time'])) {
                $item['force_date'] = df($item['force_time']);
            }
            if (!empty($item['attachment_id'])) {
                $item['attach'] = $attachment_model->getAttachLink($item['attachment_id']);
            }
            setvar("item", $item);
        }
        setvar("StandardTypes", $_PB_CACHE['standardtype']);
        $tpl_file = "standard.edit";
        template($tpl_file, true);
    }
}
$amount = $standard->findCount(null, $conditions);
$page->setPagenav($amount);
$result = $standard->findAll("Standard.*,t.name AS typename", array("LEFT JOIN {$tb_prefix}standardtypes t ON Standard.type_id=t.id"), $conditions, "Standard.id DESC", $page->firstcount, $page->displaypg);
setvar("Items", $result);
setvar("ByPages", $page->pagenav);
template($tpl_file);