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

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12379 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mMarinetti
2012-01-11 17:57:49 +00:00
parent c869ca4550
commit be2ee1b8da
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']);
}
}