Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
ee92c36e
authored
2011-03-17 14:33:31 +0000
by
Chris Boden
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fixed loop on invoice fix
1 parent
3624166b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
com/UserManager/views/fix_unpaid.php
com/UserManager/views/fix_unpaid.php
View file @
ee92c36
...
...
@@ -21,7 +21,12 @@ $begin_date = strtotime('March 1');
date_default_timezone_set
(
$original_timezone
);
if
(
!
empty
(
$_POST
[
'do_fix'
])
&&
$_POST
[
'do_fix'
]
==
'y'
)
{
$users
=
$wpdb
->
get_results
(
"SELECT ID FROM
{
$wpdb
->
users
}
LIMIT 0,1000"
);
$count_result
=
mysql_query
(
"SELECT COUNT(*) FROM `
{
$wpdb
->
users
}
`"
,
$wpdb
->
dbh
);
list
(
$num
)
=
mysql_fetch_row
(
$count_result
);
$max
=
1000
;
for
(
$ui
=
0
;
$ui
<
$num
;
$ui
+=
$max
)
{
$users
=
$wpdb
->
get_results
(
"SELECT ID FROM `
{
$wpdb
->
users
}
` LIMIT
{
$ui
}
,
{
$max
}
"
);
foreach
(
$users
as
$user
)
{
$invoices
=
get_user_meta
(
$user
->
ID
,
'invoices'
,
TRUE
);
foreach
(
$invoices
as
$invoice_id
)
{
...
...
@@ -59,6 +64,8 @@ if (! empty($_POST['do_fix']) && $_POST['do_fix'] == 'y') {
update_post_meta
(
$invoice_id
,
'trans_amount'
,
$trans_amount
);
}
}
unset
(
$users
,
$invoices
);
}
}
?>
...
...
Please
register
or
sign in
to post a comment