JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
update wfpl and templates
[contractor-progress.git] / people.php
index 60e3121..2443042 100644 (file)
@@ -46,8 +46,8 @@ function people_tem_sets($username, $password, $name, $privs, $balance) {
 }
 
 # You may pass a "where clause" for the db query.
-function people_display_listing($where = 'order by username limit 100') {
-       $rows = db_get_rows('people', 'id,username', $where);
+function people_display_listing($where = 'order by name limit 100') {
+       $rows = db_get_rows('people', 'id,name,username', $where);
        if($rows == false || count($rows) == 0) {
                tem_show('empty_listing');
                tem_show('listings');
@@ -55,11 +55,12 @@ function people_display_listing($where = 'order by username limit 100') {
        }
 
        foreach($rows as $row) {
-               list($id, $username) = $row;
+               list($id, $name, $username) = $row;
                tem_set('id', $id);
                if($username == '') {
                        $username = '--';
                }
+               tem_set('name', $name);
                tem_set('username', $username);
                tem_show('listing_row');
        }
@@ -79,7 +80,6 @@ function people_main() {
        if($ret) {
                return $ret;
        }
-       tem_show('main_body');
 }
 
 function _people_main() {
@@ -123,7 +123,7 @@ function _people_main() {
                                db_update('people', PEOPLE_DB_FIELDS, $username, $password_hash, $name, $privs, $balance, 'where id=%i', $edit_id);
                                message('Entry updated.');
                        } else {
-                               db_insert('people', PEOPLE_DB_FIELDS, $username, $password_hash, $name, $privs, $balance);
+                               db_insert('people', PEOPLE_DB_FIELDS . ',tiny_agreement', $username, $password_hash, $name, $privs, $balance, 1000);
                                message('Entry saved.');
                        }
                        if($error !== true) {