Location: PHPKode > projects > Phpgw Time Tracking Add On App > timetrack/admin4.php
<?php
  /**************************************************************************\
  * phpgwtimetrack - phpGroupWare addon application                          *
  * http://phpgwtimetrack.sourceforge.net                                    *
  * Written by Robert Schader <hide@address.com>                         *
  * --------------------------------------------                             *
  *  This program is free software; you can redistribute it and/or modify it *
  *  under the terms of the GNU General Public License as published by the   *
  *  Free Software Foundation; either version 2 of the License, or (at your  *
  *  option) any later version.                                              *
  \**************************************************************************/

  /* $Id: admin4.php,v 1.2 2001/01/17 19:29:39 rschader Exp $ */

 if($submit) {
  $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
 } 

  $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
  $phpgw_info["flags"]["currentapp"] = "timetrack";
  include("../header.inc.php");

if ($submit) {
 //echo "Not implemented just yet. Check back on 1/17/2001";

 if ($man_grp) {
  $phpgw->db->query("delete from config where config_name='ttrack_mangrp'");
  $phpgw->db->query("insert into config (config_name,config_value) VALUES ('ttrack_mangrp',$man_grp)");
 }

 if ($pay_grp) {
  $phpgw->db->query("delete from config where config_name='ttrack_paygrp'");
  $phpgw->db->query("insert into config (config_name,config_value) VALUES ('ttrack_paygrp',$pay_grp)");
 }

 $phpgw->redirect($phpgw_info["server"]["webserver_url"] . "/admin");

} else {

  echo "<center><h3>" . lang("Assign Group Permissions") . "</h3>";
  echo '<form method="POST" name="grpperms" action="' . $phpgw->link() . '">';

  echo '<table border=0>';
  echo '<tr><td>' . lang("Timetrack Managers Group") . '</td><td>';
  echo '<select name="man_grp" >';
  // Need to fill the options list with the names and values of groups here
  echo '<option value="">Select Group...</option>';
  $phpgw->db->query("select group_id, group_name from groups order by group_id");
  while ($phpgw->db->next_record()) {
    $gname = $phpgw->db->f("group_name");
    $gid = $phpgw->db->f("group_id");
    echo '<option value="' . $gid . '"';
    if ($gid == $phpgw_info["apps"]["timetrack"]["manager_gid"]) {
      echo " selected";
    }
    echo ">" . $gname . "</option>";
  }
  echo '</select></td></tr>';

  echo '<tr><td>' . lang("Timetrack Payroll Group") . '</td><td>';
  echo '<select name="pay_grp" >';
  // Need to fill the options list with the names and values of groups here
  echo '<option value="">Select Group...</option>';
  $phpgw->db->query("select group_id, group_name from groups order by group_id");
  while ($phpgw->db->next_record()) {
    $pgname = $phpgw->db->f("group_name");
    $pgid = $phpgw->db->f("group_id");
    echo '<option value="' . $pgid . '"';
    if ($pgid == $phpgw_info["apps"]["timetrack"]["payroll_gid"]) {
      echo " selected";
    }
    echo ">" . $pgname . "</option>";
  }
  echo '</select></td></tr>';

  echo '<tr><td colspan=2 align="center"><input type="submit" name="submit" value="'
	. lang("update") . '">';
  echo '&nbsp;&nbsp;<A HREF="' . $phpgw->link("/admin") . '">' . lang("Cancel") . '</a>';
  echo '</td></tr>';

  echo '</table></form></center>';

  $phpgw->common->phpgw_footer();
}
Return current item: Phpgw Time Tracking Add On App