Sunday, April 27, 2008

Admin interface

I set up the structure for the staff interface today. It is divided into four tabs: Dashboard, Loans, Equipment and Settings. Each tab is a separate canvas so we can work on different tabs without worrying about interfering with each other's work.

I set up the loans tab, which allows users to apply different filters to the loans stored in the database and find specific loans. I am going to work on the dashboard tab next. Long is going to set up the settings tab.

Friday, April 25, 2008

Project structure


I set up a structure for the Flex part of our project. It is divided into three parts:

ELS_admin_interface
This is the AIR application that runs on the staff computer in the BSIT office. ELS stands for Equipment Loaning System.

ELS_components
This part contains components that can be shared between both interfaces. By sharing them we will reduce data redundancy during development.

ELS_customer_interface
This is the Flash browser-based interface students will use to place bookings.

Friday, April 18, 2008

Outputting SQL results as XML

We are using XML as a format to pass data from PHP to Flex. We have a few different options for how to do this. We have opted to write a function that automatically converts SQL results into XML documents. Another option would have been to convert the results within each separate function, which would have allowed us to sort results into function-specific tree structures. But this would have been a lot of extra work for each function.

I wrote a function called sql2xml() which takes an SQL query as input, runs this query, and returns either the query results or an error message as XML. This is what it looks like (you can click the image to see it at a readable size):

Thursday, April 17, 2008

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

All of the posts prior to the 16th of April were submitted as the first half of the process diary and workbook.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Wednesday, April 16, 2008

Monash Web Server

Yesterday Mark Szota sent us the details for a Monash webspace we can use to host this service. Dave Sole set it up for us. Long is going to test it out, and make sure all these things work: MySQL, PHP 5 and the PHP mail() function or the Pear:Mail function. He is also going to test out the LDAP integration so we can verify student usernames and passwords and retrieve basic information about students.

Tuesday, April 15, 2008

Writing PHP functions

We have started writing PHP functions that interact with the database. We are trying to keep our PHP as object oriented and reusable as we can. None of the functions read values directly from the GET or POST vars, instead they are passed them by a handler function. For testing, we put an HTML form in front of the PHP functions, but soon we will be calling them from within Flex.

Here's a screenshot of the HTML form in front of the getLoans function I wrote. It shows all the different optional filters we are using to select loans from the database.


While writing this function I learned that MySQL provides search functionality. You need to set up FULLTEXT keys for the items you want to be searchable, and then use MATCH () AGAINST() in the SELECT query. It supports natural language search and conditional search, where users enter symbols like +, -, "" to change the meaning of their keywords. It is apparently more efficient than using LIKE in the SELECT query, which could achieve a similar result.

Sunday, April 13, 2008

Subversion

I set up a subversion space for our project at the Assembla website, which offers this service for free. Subversion allows us to synchronise and merge our work with each other. Last year we would copy all our files onto one PC once or twice a week and use WinMerge to combine them. Using SVN will streamline this process, and provide us with automatic backups every step of the way.

Wednesday, April 2, 2008

Optimising the equipment collection process

In studio today we went through our database schema with Matt, and he pointed out an area where we could improve our design. We had been allocating specific equipment items to loans when students placed a booking. This added unnecessary complications to the loan process because it meant we had to check if a specific item was available for the duration of the booking, rather than just checking if any suitable item was available on each day.

Matt suggested that we link a piece of equipment to a loan when the student collects it instead. That will also make it easier for Mark and Shelley to process collections, because they will be able to pick up any suitable item off the shelf, instead of having to look for specific items (i.e. DV Camera #564).

Fixing this problem in the database meant simply adding a relationship between the loan and product tables.