Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/bouncer:master commit in: php/lib/
Date: Tue, 30 Jan 2018 18:16:22
Message-Id: 1517326966.8a8cccee7bc2ff11600bf83b684e627feefeb3d6.grknight@gentoo
1 commit: 8a8cccee7bc2ff11600bf83b684e627feefeb3d6
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 30 15:42:46 2018 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 30 15:42:46 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/bouncer.git/commit/?id=8a8cccee
7
8 Remove unused function from the list lib
9
10 php/lib/list.php | 51 +--------------------------------------------------
11 1 file changed, 1 insertion(+), 50 deletions(-)
12
13 diff --git a/php/lib/list.php b/php/lib/list.php
14 index c7e872b..9f480bc 100644
15 --- a/php/lib/list.php
16 +++ b/php/lib/list.php
17 @@ -9,7 +9,7 @@
18 * <code>
19 * $orderby=get_order();
20 * $query="SELECT * FROM fic_courses $orderby";
21 - * $courses=db_get($query,MYSQL_ASSOC);
22 + * $courses=DB::get($query,PDO::FETCH_ASSOC);
23 * $headers=array(
24 * 'course_id'=>'',
25 * 'title'=>'Course Title',
26 @@ -314,52 +314,3 @@ function get_orderby($method='get')
27 }
28 else return null;
29 }
30 -
31 -/**
32 - * Parses $_POST for ids, shows edit forms for each id with populated data.
33 - * <ul>
34 - * <li>name will be used to retrieve an _array_ from $_POST of the same name</li>
35 - * <li>the form will be an include, with $posts[col_name] as the default for all values</li>
36 - * <li>try to keep your query simple (no crazy sorting, etc.) -- we're talking one record at a time here anyway</li>
37 - * </ul>
38 - * Example:
39 - * <code>
40 - * list_edit_ids('course_id','../forms/course.php','SELECT * FROM fic_courses','1');
41 - * </code>
42 - * @param string $name name of id field
43 - * @param string $form path to form to be used to items
44 - * @param string $q_front front half of query
45 - * @param string $q_where where statement
46 - * @param array $dates array of date field names, so they can be fixed for forms
47 - * @param array $datetimes array of datetime field names, so they can be fixed for forms
48 - */
49 -function list_edit_ids($name,$form,$q_front,$q_where='1',$dates=null,$datetimes=null)
50 -{
51 - if ( !empty($_SESSION[$name]) && is_array($_SESSION[$name]) )
52 - {
53 - $ids=implode(',',$_SESSION[$name]);
54 - $orderby=get_orderby('session');
55 - $query=$q_front.' WHERE '.$q_where." AND $name IN($ids) ".$orderby;
56 - $records=db_get($query);
57 - form_start($name);
58 - foreach ($records as $record)
59 - {
60 - echo "\n".'<div class="record">';
61 - $record=form_array_fix_dates($dates,$datetimes,2,$record);
62 - foreach ($record as $key=>$val)
63 - {
64 - $posts[$key]=clean_out($val);
65 - }
66 - include($form);
67 - echo "\n".'<div class="record-submit">';
68 - form_submit('submit', '', 'button1');
69 - echo "\n".'</div>';
70 - echo "\n".'</div>';
71 - }
72 - form_end();
73 - }
74 - else
75 - {
76 - echo '<p>You must select a record. <a href="javascript:history.back();">Go back</a>.</p>';
77 - }
78 -}