本文整理汇总了PHP中item::add方法的典型用法代码示例。如果您正苦于以下问题:PHP item::add方法的具体用法?PHP item::add怎么用?PHP item::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类item
的用法示例。
在下文中一共展示了item::add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: item
require MD_ROOT . '/item.class.php';
$do = new item($specialid);
$_mid = 5;
foreach ($MODULE as $m) {
if ($m['module'] == 'article') {
$_mid = $m['moduleid'];
break;
}
}
$menus = array(array('添加信息', '?moduleid=' . $moduleid . '&file=' . $file . '&specialid=' . $specialid . '&action=add'), array('批量添加', '?moduleid=' . $moduleid . '&file=' . $file . '&specialid=' . $specialid . '&action=batch&mid=' . $_mid), array('信息列表', '?moduleid=' . $moduleid . '&file=' . $file . '&specialid=' . $specialid), array('信息分类', 'javascript:Dwidget(\'?file=type&item=' . $tid . '\', \'[' . $special['title'] . '] 专题信息分类\', 550, 250);'));
$MOD['level'] = $MOD['level_item'];
switch ($action) {
case 'add':
if ($submit) {
if ($do->pass($post)) {
$do->add($post);
dmsg('添加成功', '?moduleid=' . $moduleid . '&file=' . $file . '&action=' . $action . '&specialid=' . $specialid . '&typeid=' . $post['typeid']);
} else {
msg($do->errmsg);
}
} else {
foreach ($do->fields as $v) {
isset(${$v}) or ${$v} = '';
}
$content = '';
$addtime = timetodate($DT_TIME);
$typeid = 0;
$item = array();
$menuid = 0;
$tname = $menus[$menuid][0];
include tpl('item_edit', $module);
示例2: item
require 'components/query_string_standard.php';
require 'subclasses/item.php';
$dbh_item = new item();
$object_name = 'dbh_item';
require 'components/create_form_data.php';
extract($arr_form_data);
if ($_POST['btn_cancel']) {
log_action('Pressed cancel button');
redirect("listview_item.php?{$query_string}");
}
if ($_POST['btn_submit']) {
log_action('Pressed submit button');
$message .= $dbh_item->sanitize($arr_form_data)->lst_error;
extract($arr_form_data);
if ($dbh_item->check_uniqueness($arr_form_data)->is_unique) {
//Good, no duplicate in database
} else {
$message = "Record already exists with the same primary identifiers!";
}
if ($message == "") {
$dbh_item->add($arr_form_data);
redirect("listview_item.php?{$query_string}");
}
}
}
require 'subclasses/item_html.php';
$html = new item_html();
$html->draw_header('Add Item', $message, $message_type);
$html->draw_listview_referrer_info($filter_field_used, $filter_used, $page_from, $filter_sort_asc, $filter_sort_desc);
$html->draw_controls('add');
$html->draw_footer();