Collaborative Computational Project No. 4
Software for Macromolecular X-Ray Crystallography

CCP4 People

Documentation for CCP4 People Page

The webpage is structured around a MySQL database called staff (should really be people but by this point I got bored changing things). This database contains all the data shown on the main page and various other bits in case the database is required for more in depth information about about CCP4 people.

The central page calls the data for each person from the database and formats that data depending on how they relate to CCP4. None of the data therefore needs to be on the page allowing for easier editing of members. It is also possible to have lots more people listed who are not directly involved with CCP4, without them appearing on the webpage. This could then be used as a multi-purpose contact listing.

The pages are all written primarily in PHP in order to easily produce a cohesive look to them and to call and connect to MySQL. The document headers with CCP4 logo are separate PHP files and are included in each page using require statements, the more complex sections are also called in chunks in a similar way. The PHP script also writes most of the HTML using echo statements in order to process the variables involved.

The actual database is divided into five tables at present (see fig.1). These tables (figs 2-6) include different data about the people registered in the database. The main table is called personal which has an entry for every person and contains the basic data about them e.g. name, job title, address, phone number. The next table, picture, contains the pathname for the image file and an alternative label for the image. The last three tables contain data specifying what type of relationship the person has with CCP4 (i.e. whether they are developers, funded developers or on the Committee) and what level the person is at. As you can see, the userid (highlighted red) is included in every table in order to link the data for each person. This is not necessarily the primary key though as every table should have it's own primary key (e.g. execid, staffid etc).

figure 1:


Personal (fig. 2):
+-------------+------------------+------+-----+---------+----------------+
| Field       | Type             | Null | Key | Default | Extra          |
+-------------+------------------+------+-----+---------+----------------+
| userid      | int(10) unsigned |      | PRI | NULL    | auto_increment |
| firstname   | varchar(50)      | YES  |     | NULL    |                |
| surname     | varchar(50)      | YES  |     | NULL    |                |
| institution | varchar(50)      | YES  |     | NULL    |                |
| address     | text             | YES  |     | NULL    |                |
| phone       | int(20) unsigned | YES  |     | NULL    |                |
| fax         | varchar(50)      | YES  |     | NULL    |                |
| email       | varchar(50)      | YES  |     | NULL    |                |
| homepage    | varchar(50)      | YES  |     | NULL    |                |
| ftpsite     | varchar(50)      | YES  |     | NULL    |                |
| synopsis    | text             | YES  |     | NULL    |                |
| title       | varchar(30)      | YES  |     | NULL    |                |
+-------------+------------------+------+-----+---------+----------------+
Picture (fig. 3):
+-----------+------------------+------+-----+-------------------+----------------+
| Field     | Type             | Null | Key | Default           | Extra          |
+-----------+------------------+------+-----+-------------------+----------------+
| userid    | int(10) unsigned |      | PRI | NULL              | auto_increment |
| firstname | char(30)         | YES  |     | NULL              |                |
| surname   | char(30)         | YES  |     | NULL              |                |
| picture   | char(40)         |      |     | /images/nopic.jpg |                |
| label     | char(30)         | YES  |     | picture           |                |
+-----------+------------------+------+-----+-------------------+----------------+
Staff (fig. 4):
+-----------+------------------+------+-----+------------+----------------+
| Field     | Type             | Null | Key | Default    | Extra          |
+-----------+------------------+------+-----+------------+----------------+
| staffid   | int(10) unsigned |      | PRI | NULL       | auto_increment |
| userid    | int(10) unsigned |      |     | 0          |                |
| ranking   | int(10) unsigned | YES  |     | NULL       |                |
| startdate | date             |      |     | 0000-00-00 |                |
+-----------+------------------+------+-----+------------+----------------+
Exec (fig. 5):
+--------+------------------+------+-----+---------+----------------+
| Field  | Type             | Null | Key | Default | Extra          |
+--------+------------------+------+-----+---------+----------------+
| execid | int(10) unsigned |      | PRI | NULL    | auto_increment |
| userid | int(10) unsigned |      |     | 0       |                |
| status | char(50)         | YES  |     | NULL    |                |
+--------+------------------+------+-----+---------+----------------+
Developers (fig. 6):
+---------+------------------+------+-----+---------+----------------+
| Field   | Type             | Null | Key | Default | Extra          |
+---------+------------------+------+-----+---------+----------------+
| develid | int(10) unsigned |      | PRI | NULL    | auto_increment |
| userid  | int(10) unsigned |      |     | 0       |                |
+---------+------------------+------+-----+---------+----------------+

The add and edit pages are fairly simple and self explanatory. They are HTML web forms which are processed by PHP scripts to add/update records in the database. The MySQL connecting and interacting commands are fairly standard, in case of emergency a good book to consult on PHP-MySQL commands is PHP and MySQL - Web Development by Welling and Thompson (SAMS).

If any editing of the programming is necessary, the code should not be too difficult to change slightly. Hopefully the comments in my code will help to explain what each section is doing if it is not obvious. The pictures can mostly be found in the images directory of the CCP4 web folder if these are needed. Apart from that, there shouldn't be any problems (touch wood). In case of emergency e-mail Peter Wood (p.a.wood@dl.ac.uk) or Alun Ashton (a.w.ashton@dl.ac.uk) for help.

Return to People Page Go to CCP4 Homepage