The change to SQL Server would have to be done in the config file. But as you already noticed all SQL statements do not change because of this. You would have to edit about every PHP file by hand. Simple Invoices was not really designed for many different databases.
If you want to help out then I could tell you how to do all the changes. It will be a lot of hard word but it will help everyone a lot.
OK. first a question. Did you already work once with Subversion? If yes, then I can give you access to our code repository. Then you can commit all changes there. Else it is better if it is going over me.
One more important thing. With the next version of Simple Invoice we will change the directory structure a lot. So if you are going to work on this it is better if you start working on the newest version we have in the code repository. I can send it to you if needed.
So here is what you have to do. Currently we are using PDO to access the database. But as you have already seen it is not that easy to connect to MS SQL Server with it. So you will have to switch to Zend_DB which is part of the Zend Framework. We wanted to do this switch anyway once but didn't have the manpower will now. Here is the documentation of Zend_DB_Select: http://framework.zend.com/manual/en/zend.db.select.html This is what you need most.
In the init process of SI we already create a Zend DB Adapter object like this:
$zendDb = Zend_Db::factory(....)
So you can always use $zendDb. You then need to get a select object like this:
$select = $db->select();
Here is now an example I have taken from the current code:
$sql = "SELECT * FROM ".TB_PREFIX."customers ORDER BY $sort $dir LIMIT $start, $limit";
This would now be rewritten like this:
$select = $db->select()
->from( TB_PREFIX . 'customers' );
->order(array($sort . ' ' . $dir))
->limit($start, $limit);
Zend DB will then do all the magic regarding quotations etc.
Attention: Sometimes you have to make the zendDb object global, by calling this code:
global $zendDb;
Sadly we have to do this because the code is not always well structured. Usually you have to do this when you see "global $dbh;" already at the beginning of a function.
If you want I can give you my Skype name and then I can help you there. Probably this is easier for you.
Raffael
It looks like you're new here. If you want to get involved, click one of these buttons!