Luyenkim.Net!

...where your idea grows!

 
  • Decrease font size
  • Default font size
  • Increase font size
Trang chủ arrow Công nghệ thông tin arrow Overview of Components - Sơ lược về Com
Overview of Components - Sơ lược về Com PDF In E-mail
(0 votes)
23/11/2007
Mục lục bài viết
Overview of Components - Sơ lược về Com
Trang 2
Trang 3
Trang 4
Trang 5
Trang 6
Trang 7
Trang 8

 

Developing the Database Schema

From Mambo Manual

We now have a rough brief to work with. What do we have to consider and how are we going to build it in the Mambo framework.

Firstly what information do we need to store?

The users that will be displayed on the in/out board.

If a user checks out, when did they do it, where are they and when are they coming back?

The first thought is simply to add a few fields to the mos_users table. OK, that's quick and easy but what happens if the client wants to upgrade their Mambo down the track? The Developers aren't going to be too sympathetic to thirdparties that hack into the core schema. So, it's obvious that we need to create a new table to support our Client's information without tampering with the core schema.

Let's call our new table mos_com_inout. This makes it obvious that the table is associated with the in/out component that we are going to build. Only users in this table will be displayed on the in/out board. We will link to the mos_users table via the id field (we shouldn't use the name field as this could change) as this is the primary key for the table. We need a few fields to store when the user checked out, where they are and when they are coming back. So, the sql for the mos_com_inout table might look like:

CREATE TABLE `mos_com_inout` ( `id` int(10) unsigned NOT NULL auto_increment, 
`user_id` int(10) unsigned NOT NULL default '0',
`time_out` datetime NOT NULL default '0000−00−00 00:00:00',
`time_in` datetime NOT NULL default '0000−00−00 00:00:00',
`location` varchar(100) NOT NULL default '',
`catid` int(10) unsigned NOT NULL default '0',
`checked_out` int(10) unsigned NOT NULL default '0',
`checked_out_time` datetime NOT NULL default '0000−00−00 00:00:00',
PRIMARY KEY (`id`)) TYPE=MyISAM;

We've included a primary key in this table, the `id` field, to help us edit specific records if we need to. We've also included a `catid` field. This is so we can link back to the categories table. You just have a hunch that your Client might ask you for a couple of different in/out boards for different groups of users. Using the Categories feature of Mambo will serve this purpose quite well without you having to write any additional code to support it.

You'll also see two other fields, `checked_out` and `checked_out_time`. These two fields are required by the MOS framework to check in and out the records in the mos_inout table when they are being edited (don't confuse this with the users checking in and checking out of the office).

So we have our schema planned, at least for stage 1. Next we need to think about what we need to provide in Mambo.




Tin liên quan:
Tin mới hơn:
Tin cũ hơn:

 

Please install Flash and turn on Javascript.

Đăng nhập






Bạn quên mật khẩu?
Chưa có tài khoản? Tạo một tài khoản

Liên kết website

buaxua.vn
Luyenkim.net
Sửa ĐTDD
Luyenkim.net
vnfolk.com
thietbidien.vn

Thống kê

Chúng ta có 21 khách trực tuyến