当前位置: 首页>>代码示例>>PHP>>正文


PHP table_class::update_attributes方法代码示例

本文整理汇总了PHP中table_class::update_attributes方法的典型用法代码示例。如果您正苦于以下问题:PHP table_class::update_attributes方法的具体用法?PHP table_class::update_attributes怎么用?PHP table_class::update_attributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在table_class的用法示例。


在下文中一共展示了table_class::update_attributes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: redirect

		<meta http-equiv=Content-Language content=zh-CN>
		<title>福布斯中文网</title>
		<?php 
include "../../frame.php";
?>
	</head>
	<body>
		<?php 
$user = new table_class($tb_user);
if ($_POST['id'] != '0') {
    $user->find($_POST['id']);
    if ($user->name != $_POST['post']['name']) {
        $db = get_db();
        $record = $db->query("select * from " . $tb_user . " where name='" . $_POST['post']['name'] . "'");
        if (count($record) == 0) {
            if ($user->update_attributes($_POST['post'])) {
                redirect('user_list.php');
            } else {
                display_error('修改用户失败');
                echo '<a href="user_list.php">返回</a>';
            }
        } else {
            alert("您注册的用户名已经存在,请重新注册!");
            redirect($_SERVER['HTTP_REFERER']);
        }
    } else {
        if ($_FILES['image_src']['name'] != '') {
            $upload = new upload_file_class();
            $upload->save_dir = '/upload/news/';
            $user->image_src = '/upload/news/' . $upload->handle('image_src', 'filter_pic');
            $changed = true;
开发者ID:sauger,项目名称:forbes,代码行数:31,代码来源:user.post.php

示例2: intval

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv=Content-Type content="text/html; charset=utf-8">
	<meta http-equiv=Content-Language content=zh-CN>
	<title>forbes</title>
	<?php 
require_once '../../frame.php';
?>
</head>
<?php 
require_once '../../frame.php';
#var_dump($_POST);
$magazine = new table_class("fb_old_magazine");
$id = intval($_POST['id']);
if ($id != '') {
    $magazine->find($id);
}
$magazine->update_attributes($_POST['post']);
redirect('old_magazine_index.php');
开发者ID:sauger,项目名称:forbes_old,代码行数:20,代码来源:old_magazine_edit.post.php

示例3: alert

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv=Content-Type content="text/html; charset=utf-8">
	<meta http-equiv=Content-Language content=zh-CN>
</head>
<?php 
require "../../frame.php";
$id = $_POST['id'];
$city = new table_class('fb_city');
if ($id != '') {
    $city->find($id);
}
if ($_FILES['city_photo']['name'] != null) {
    $upload = new upload_file_class();
    $upload->save_dir = "/upload/city/";
    $img = $upload->handle('city_photo', 'filter_pic');
    if ($img === false) {
        alert('上传文件失败 !');
        redirect($_SERVER['HTTP_REFERER']);
    }
    $city->photo = "/upload/city/{$img}";
}
if (!$city->update_attributes($_POST['city'])) {
    alert('城市已存在或执行错误!');
    redirect($_SERVER['HTTP_REFERER']);
}
redirect('index.php');
?>
</html>
开发者ID:sauger,项目名称:forbes_old,代码行数:30,代码来源:edit.post.php

示例4: alert

<?php

require_once "../frame.php";
var_dump($_POST);
$upload = new upload_file_class();
$employ = new table_class("hoau_employ");
if ($_FILES['url']['name'] != '') {
    $upload->save_dir = "/upload/employ/";
    $em = $upload->handle('url');
    if ($em === false) {
        alert('上传失败 !');
        redirect($_SERVER['HTTP_REFERER']);
    }
    $employ->url = "/upload/employ/" . $em;
}
$employ->id_read = 0;
$employ->date = date("Y-m-d H:i:s");
$employ->update_attributes($_POST['post']);
redirect($_POST['url']);
开发者ID:justin1986,项目名称:hoau,代码行数:19,代码来源:test_employ.post.php

示例5: alert

    $upload = new upload_file_class();
    $upload->save_dir = '/upload/images/';
    $img = $upload->handle('image', 'filter_pic');
    if ($img === false) {
        alert('上传文件失败 !');
        ?>
				<script>
					parent.remove_tb2();
				</script>
				<?php 
        die;
    }
    $vote->photo_url = "/upload/images/" . $img;
}
//如果投票上传图片,做处理
$vote->update_attributes($_POST['vote'], false);
$vote->save();
$count = count($_POST['vote_item']['title']);
$old_count = count($_POST['old_item']['title']);
$item = new table_class("fb_vote_item");
if ($_POST['vote']['vote_type'] == 'image_vote') {
    $upload = new upload_file_class();
    $upload->save_dir = '/upload/images/';
    $img = $upload->handle('vote_item', 'filter_pic');
    $old_img = $upload->handle('old_item', 'filter_pic');
}
for ($i = 0; $i < $count; $i++) {
    $item->id = 0;
    $item->vote_id = $vote->id;
    if ($_POST['vote']['vote_type'] == 'image_vote') {
        if ($img[$i]['result']) {
开发者ID:sauger,项目名称:forbes,代码行数:31,代码来源:ajax.post.php

示例6: intval

include "../../frame.php";
?>
	</head>
	<body>
		<?php 
$image = new table_class('fb_magazine_image');
$id = intval($_POST['id']);
if ($id != '') {
    $image->find($id);
} else {
    $image->created_at = date("Y-m-d H:i:s");
}
//var_dump($_POST);
if ($_FILES['image']['name'] != null) {
    $upload = new upload_file_class();
    $upload->save_dir = "/upload/images/";
    $img = $upload->handle('image', 'filter_pic');
    if ($img === false) {
        alert('上传文件失败 !');
        redirect($_SERVER['HTTP_REFERER']);
    }
    $image->src = "/upload/images/{$img}";
}
if ($_POST['image']["priority"] == null) {
    $image->update_attribute("priority", "100");
}
$image->update_attributes($_POST['image']);
redirect('img_list.php?id=' . $image->magazine_id);
?>
	</body>
</html>
开发者ID:sauger,项目名称:forbes_old,代码行数:31,代码来源:image.post.php

示例7: alert

<?php

require "../../frame.php";
$id = $_POST['id'];
$f_mrb = new table_class('fb_fhb');
if ($id != '') {
    $f_mrb->find($id);
}
$f_mrb->update_attributes($_POST['fhb'], false);
if ($_FILES['image_src']['name'] != '') {
    $upload = new upload_file_class();
    $upload->save_dir = '/upload/news/';
    if (!($upload_name = $upload->handle('image_src', 'filter_pic'))) {
        alert('上传图片失败!');
        redirect($_SERVER['HTTP_REFERER']);
        die;
    }
    $f_mrb->image_src = '/upload/news/' . $upload_name;
}
$f_mrb->save();
redirect('index.php');
开发者ID:sauger,项目名称:forbes_old,代码行数:21,代码来源:bdedit.post.php

示例8: intval

<?php

include '../../frame.php';
$table = new table_class('fb_filte_words');
$id = intval($_POST['id']);
if ($id) {
    $table->find($id);
}
$table->update_attributes($_POST['post']);
redirect('list.php');
开发者ID:sauger,项目名称:forbes_old,代码行数:10,代码来源:post.php

示例9:

<?php

include_once "../../frame.php";
use_jquery();
js_include_tag('jquery.colorbox-min');
$pos = new table_class('eb_page_pos');
$pos->find_by_name($_POST[pos][name]);
$pos->update_file_attributes('pos');
$pos->update_attributes($_POST['pos'], false);
$pos->save();
?>
<script>
	parent.$.fn.colorbox.close();
	parent.frames['admin_iframe'].location.reload();
</script>
开发者ID:justin1986,项目名称:eachbb,代码行数:15,代码来源:edit.post.php

示例10: alert

}
if (empty($_FILES)) {
    alert("上传的文件太大!");
    redirect('edit.php');
    die;
}
if ($_FILES['image'][name]) {
    $upload = new upload_file_class();
    $upload->save_dir = '/upload/images/';
    $img = $upload->handle('image', 'filter_pic');
    if ($img === false) {
        alert('上传图片失败 !');
        redirect('edit.php');
        die;
    }
    $teach->img_url = "/upload/images/" . $img;
}
if ($_FILES['flash'][name]) {
    $upload = new upload_file_class();
    $upload->save_dir = '/upload/flash/';
    $flash = $upload->handle('flash');
    if ($flash === false) {
        alert('上传flash失败 !');
        redirect('edit.php');
        die;
    }
    $teach->content = "/upload/flash/" . $flash;
}
$teach->update_attributes($_POST['post'], false);
$teach->save();
redirect('index.php');
开发者ID:justin1986,项目名称:eachbb,代码行数:31,代码来源:edit.post.php

示例11: intval

<?php

include '../../frame.php';
$post_type = intval($_POST['mlist']['list_type']);
$id = intval($_POST['id']);
$list_type = new table_class('fb_custom_list_type');
if ($id) {
    $list_type->find($id);
}
$list_type->update_attributes($_POST['mlist'], false);
$list_type->table_name = 'fb_picture_list_items';
if ($_FILES['image_src']['name'] != '') {
    $upload = new upload_file_class();
    $upload->save_dir = '/upload/news/';
    if (!($upload_name = $upload->handle('image_src', 'filter_pic'))) {
        alert('上传图片失败!');
        redirect($_SERVER['HTTP_REFERER']);
        die;
    }
    $list_type->image_src = '/upload/news/' . $upload_name;
}
$list_type->save();
redirect('picture_list_list.php');
开发者ID:sauger,项目名称:forbes_old,代码行数:23,代码来源:picture_list_edit.post.php

示例12: elseif

        if ($right->id) {
            $db->execute("delete from fb_role_rights where rights_id = {$right->id}");
            $right->delete();
        }
    }
    if (isset($_POST['rela'])) {
        $db = get_db();
        $db->execute("delete from fb_position_relation where type='{$_POST['rela']}' and news_id={$_POST['del_id']}");
    }
    $post->delete($_POST['del_id']);
    echo $_POST['del_id'];
} elseif ("edit" == $_POST['post_type']) {
    if ($_POST['id'] != '') {
        $post->find($_POST['id']);
    }
    $post->update_attributes($_POST['post']);
    redirect($_POST['url']);
} elseif ("edit_priority" == $_POST['post_type']) {
    $id_str = explode("|", $_POST['id_str']);
    $priority_str = explode("|", $_POST['priority_str']);
    $id_str_num = sizeof($id_str) - 1;
    if ($_POST['is_dept_list'] == 'true') {
        $priority = 'dept_priority';
    } else {
        $priority = 'priority';
    }
    for ($i = $id_str_num - 1; $i >= 0; $i--) {
        if ($priority_str[$i] == "") {
            $priority_str[$i] = "100";
        }
        $db = get_db();
开发者ID:sauger,项目名称:forbes,代码行数:31,代码来源:pub.post.php

示例13: intval

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv=Content-Type content="text/html; charset=utf-8">
	<meta http-equiv=Content-Language content=zh-CN>
	<title>forbes</title>
	<?php 
require_once '../../frame.php';
?>
</head>
<?php 
require_once '../../frame.php';
#var_dump($_POST);
$survey = new table_class("fb_survey");
$id = intval($_POST['id']);
if ($id != '') {
    $survey->find($id);
}
$survey->update_attributes($_POST['post'], false);
$survey->update_file_attributes('post');
$survey->save();
redirect('index.php');
开发者ID:sauger,项目名称:forbes_old,代码行数:22,代码来源:edit.post.php

示例14:

<?php

#var_dump($_POST);
require "../../frame.php";
$module = new table_class('fb_subject_modules');
$module->update_attributes($_POST['module'], false);
$module->id = $_POST['id'];
if ($module->save()) {
    echo 'ok';
} else {
    echo 'fail';
}
开发者ID:sauger,项目名称:forbes,代码行数:12,代码来源:subject_module.post.php

示例15: intval

<?php

session_start();
include_once '../../frame.php';
$role = judge_role();
$yh_id = intval($_POST['id']);
$db = get_db();
$info = $db->query("select id from fb_yh_xx where yh_id={$yh_id}");
if ($db->record_count == 1) {
    $id = $info[0]->id;
} else {
    $id = 0;
}
$info = new table_class('fb_yh_xx');
if ($id != 0) {
    $info->find($id);
}
$info->update_attributes($_POST['info'], false);
if ($_FILES['tx']['name'] != null) {
    $upload = new upload_file_class();
    $upload->save_dir = "/upload/user/";
    $img = $upload->handle('tx', 'filter_pic');
    if ($img === false) {
        alert('上传文件失败 !');
        redirect($_SERVER['HTTP_REFERER']);
    }
    $info->tx = "/upload/user/{$img}";
}
$info->yh_id = $yh_id;
$info->save();
redirect('index.php');
开发者ID:sauger,项目名称:forbes,代码行数:31,代码来源:edit_info.post.php


注:本文中的table_class::update_attributes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。