// added upgrade files (sql and php) in new installer

This commit is contained in:
mMarinetti
2012-01-11 17:57:49 +00:00
parent 401d585449
commit 1a435a0c54
157 changed files with 10495 additions and 0 deletions
@@ -0,0 +1,17 @@
<?php
function generate_order_reference()
{
// Get all orders
$orders = Db::getInstance()->executeS('SELECT id_order FROM '._DB_PREFIX_.'orders');
foreach ($orders as $order)
{
$random_ref = '';
for ($i = 0, $passwd = ''; $i < 9; $i++)
$random_ref .= substr('ABCDEFGHIJKLMNOPQRSTUVWXYZ', mt_rand(0,25), 1);
Db::getInstance()->execute('
UPDATE '._DB_PREFIX_.'orders
SET reference = \''.$random_ref.'\'
WHERE id_order = '.(int)$order['id_order']);
}
}