Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LQDN Adminsys
don
Commits
093426e8
Commit
093426e8
authored
Nov 16, 2018
by
Okhin
Browse files
Adding a page field where needed
parent
151faf24
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/controller/admin.php
View file @
093426e8
...
...
@@ -85,13 +85,15 @@ class Admin extends Controller
$public
=
$f3
->
exists
(
'POST.public'
)
?
$f3
->
get
(
'POST.public'
)
:
''
;
$status
=
$f3
->
exists
(
'POST.status'
)
?
$f3
->
get
(
'POST.status'
)
:
''
;
$limit
=
$f3
->
exists
(
'POST.limite'
)
?
(
int
)
$f3
->
get
(
'POST.limite'
)
:
50
;
$page
=
$f3
->
exists
(
'POST.page'
)
?
(
int
)
$f3
->
get
(
'POST.page'
)
:
1
;
$results
=
$f3
->
get
(
'container'
)[
'donation_finder'
]
->
adminSearch
(
$text
,
$sum
,
$public
,
$status
,
$limit
);
$results
=
$f3
->
get
(
'container'
)[
'donation_finder'
]
->
adminSearch
(
$text
,
$sum
,
$public
,
$status
,
$limit
,
$page
);
$f3
->
set
(
'row_count'
,
count
(
$results
));
$f3
->
set
(
'texte'
,
$text
);
$f3
->
set
(
'somme'
,
$sum
);
$f3
->
set
(
'limite'
,
$limit
);
$f3
->
set
(
'page'
,
$page
);
$f3
->
set
(
'public'
,
$public
);
$f3
->
set
(
'status'
,
$status
);
$f3
->
set
(
'data'
,
$results
);
...
...
@@ -383,7 +385,8 @@ class Admin extends Controller
$hoodie
=
''
;
$pseudo
=
''
;
$quoi
=
0
;
$limite
=
'50'
;
$limite
=
50
;
$page
=
1
;
$status
=
''
;
$db
=
$f3
->
get
(
'DB'
);
if
(
$f3
->
get
(
'VERB'
)
==
'POST'
)
{
...
...
@@ -415,10 +418,8 @@ class Admin extends Controller
$pishirt
=
$f3
->
get
(
'POST.pishirt'
);
$hoodie
=
$f3
->
get
(
'POST.hoodie'
);
$quoi
=
$quoi
+
$pibag
+
$piplome
+
$pishirt
+
$hoodie
;
$limite
=
$f3
->
get
(
'POST.limite'
);
if
(
$limite
==
''
)
{
$limite
=
'50'
;
}
$limite
=
$f3
->
exists
(
'POST.limite'
)
?
(
int
)
$f3
->
get
(
'POST.limite'
)
:
50
;
$page
=
$f3
->
exists
(
'POST.page'
)
?
(
int
)
$f3
->
get
(
'POST.page'
)
:
1
;
$status
=
$f3
->
get
(
'POST.status'
);
}
...
...
@@ -486,7 +487,9 @@ class Admin extends Controller
if
(
$status
)
{
$query
.
=
" AND c.status IN ("
.
\
Utils
::
asl
(
$status
)
.
") "
;
}
$query
.
=
" ORDER BY c.datec DESC LIMIT 0,"
.
$limite
.
";"
;
$first
=
(
$page
-
1
)
*
$limite
;
$last
=
$page
*
$limite
;
$query
.
=
" ORDER BY c.datec DESC LIMIT
$first
,
$last
;"
;
$result
=
$db
->
query
(
$query
);
$data
=
array
();
if
(
$result
)
{
...
...
@@ -525,6 +528,7 @@ class Admin extends Controller
$f3
->
set
(
'pishirt'
,
$pishirt
);
$f3
->
set
(
'hoodie'
,
$hoodie
);
$f3
->
set
(
'limite'
,
$limite
);
$f3
->
set
(
'page'
,
$page
);
$f3
->
set
(
'status'
,
$status
);
$f3
->
set
(
'query'
,
$query
);
$f3
->
set
(
'data'
,
$data
);
...
...
@@ -792,12 +796,14 @@ class Admin extends Controller
$text
=
$f3
->
exists
(
'POST.texte'
)
?
$f3
->
get
(
'POST.texte'
)
:
''
;
$status
=
$f3
->
exists
(
'POST.status'
)
?
$f3
->
get
(
'POST.status'
)
:
''
;
$limit
=
$f3
->
exists
(
'POST.limite'
)
?
(
int
)
$f3
->
get
(
'POST.limite'
)
:
50
;
$page
=
$f3
->
exists
(
'POST.page'
)
?
(
int
)
$f3
->
get
(
'POST.page'
)
:
1
;
$results
=
$f3
->
get
(
'container'
)[
'user_finder'
]
->
adminSearch
(
$text
,
$status
,
$limit
);
$f3
->
set
(
'texte'
,
$text
);
$f3
->
set
(
'status'
,
$status
);
$f3
->
set
(
'limite'
,
$limit
);
$f3
->
set
(
'page'
,
$page
);
$f3
->
set
(
'data'
,
$results
);
$f3
->
set
(
'row_count'
,
count
(
$results
));
$f3
->
set
(
'block_content'
,
'backend/users.html'
);
...
...
@@ -809,6 +815,7 @@ class Admin extends Controller
$texte
=
''
;
$status
=
''
;
$limite
=
'50'
;
$page
=
'1'
;
$db
=
$f3
->
get
(
'DB'
);
if
(
$f3
->
get
(
'VERB'
)
==
'POST'
)
{
if
(
$f3
->
exists
(
'POST.action'
))
{
...
...
@@ -836,12 +843,11 @@ class Admin extends Controller
break
;
}
}
$texte
=
$f3
->
get
(
'POST.texte'
);
$status
=
$f3
->
get
(
'POST.status'
);
$limite
=
$f3
->
get
(
'POST.limite'
);
if
(
$limite
==
''
)
{
$limite
=
'50'
;
}
$limit
=
$f3
->
exists
(
'POST.limite'
)
?
(
int
)
$f3
->
get
(
'POST.limite'
)
:
50
;
$page
=
$f3
->
exists
(
'POST.page'
)
?
(
int
)
$f3
->
get
(
'POST.page'
)
:
1
;
$texte
=
$f3
->
exists
(
'POST.texte'
)
?
$f3
->
get
(
'POST.texte'
)
:
''
;
$status
=
$f3
->
exists
(
'POST.status'
)
?
$f3
->
get
(
'POST.status'
)
:
''
;
}
$query
=
"SELECT id, email, expiration, status FROM users WHERE identifier!='' AND identifier IS NOT NULL AND status != ''"
;
...
...
@@ -852,7 +858,9 @@ class Admin extends Controller
if
(
$status
!=
''
)
{
$query
.
=
" AND status='"
.
$status
.
"'"
;
}
$query
.
=
" ORDER BY expiration ASC LIMIT 0,"
.
$limite
.
";"
;
$first
=
(
$page
-
1
)
*
$limit
;
$last
=
$page
*
$limit
;
$query
.
=
" ORDER BY expiration ASC LIMIT
$first
,
$last
;"
;
$result
=
$db
->
query
(
$query
);
$cbs
=
array
();
if
(
$result
)
{
...
...
@@ -886,6 +894,7 @@ class Admin extends Controller
$f3
->
set
(
'limite'
,
$limite
);
$f3
->
set
(
'query'
,
$query
);
$f3
->
set
(
'data'
,
$cbs
);
$f3
->
set
(
'page'
,
$page
);
if
(
$export
)
{
$statuts
=
$f3
->
get
(
'CB_STATUTS'
);
...
...
app/view/backend/cbs.html
View file @
093426e8
...
...
@@ -17,6 +17,9 @@
</repeat>
</select>
<label
for=
"page"
>
Page
</label>
<input
type=
"text"
id=
"page"
name=
"page"
size=
"3"
value=
"{{ @page }}"
/>
<label
for=
"limite"
>
Limite
</label>
<input
type=
"text"
id=
"limite"
name=
"limite"
size=
"3"
value=
"{{ @limite }}"
/>
...
...
app/view/backend/dons.html
View file @
093426e8
...
...
@@ -33,6 +33,8 @@
<label
for=
"limite"
>
Limite
</label>
<input
type=
"text"
id=
"limite"
name=
"limite"
size=
"3"
value=
"{{ @limite }}"
/>
<label
for=
"page"
>
Page
</label>
<input
type=
"text"
id=
"page"
name=
"page"
size=
"3"
value=
"{{ @page }}"
/>
<input
type=
"submit"
value=
"Filtrer"
/>
</form>
...
...
app/view/backend/users.html
View file @
093426e8
...
...
@@ -16,6 +16,9 @@
</repeat>
</select>
<label
for=
"page"
>
Page
</label>
<input
type=
"text"
id=
"page"
name=
"page"
size=
"3"
value=
"{{ @page }}"
/>
<label
for=
"limite"
>
Limite
</label>
<input
type=
"text"
id=
"limite"
name=
"limite"
size=
"3"
value=
"{{ @limite }}"
/>
...
...
src/LQDN/Finder/DonationFinder.php
View file @
093426e8
...
...
@@ -43,7 +43,7 @@ class DonationFinder
*
* @return array
*/
public
function
adminSearch
(
$text
,
$sum
,
$public
,
$status
,
$limit
=
50
)
public
function
adminSearch
(
$text
,
$sum
,
$public
,
$status
,
$limit
=
50
,
$page
=
1
)
{
$query
=
<<<EOQ
SELECT d.id as id,
...
...
@@ -86,7 +86,10 @@ EOQ;
$query
.
=
' AND d.status IN (:status) '
;
$params
[
'status'
]
=
$status
;
}
$query
.
=
" ORDER BY datec DESC LIMIT 0,
$limit
"
;
$first
=
(
$page
-
1
)
*
$limit
;
$last
=
(
$page
)
*
$limit
;
$query
.
=
" ORDER BY datec DESC LIMIT
$first
,
$last
"
;
return
$this
->
connection
->
fetchAll
(
$query
,
$params
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment