<?
$needed_groups = array("admin");
include "config.php";
check_auth_page($userinfo["user_type"], $needed_groups);
?>
<title>phpPrintAdmin</title>
<link rel="stylesheet" href="conf/printadmin.css" type="text/css">
<body bgcolor="#000000" text="#FFFFFF" link="#FFFFFF" alink="#FFFFFF">
<table width="74%">
<tr align="left" valign="top">
<td width="23%" height="49"> <img src="images/ppa_logo.gif" width="162" height="60"></td>
<td width="2%" height="49" align="right" class="regtext"> </td>
<td width="75%" height="49" align="right" class="regtext">
<?echo `/bin/date`;?>
<br>
<?echo "Logged in as <b>$PHP_AUTH_USER</b>(group: $PHP_AUTH_GRP)";?>
</td>
</tr>
<tr align="left" valign="top">
<td width="23%" height="28"> </td>
<td width="2%" height="28"></td>
<td width="75%" height="28"></td>
</tr>
<tr align="left" valign="top">
<td height="455" bgcolor="#FFCC66" rowspan="2" width="23%">
<!-- begin menu -->
<? include "conf/menu.php"; ?>
<!-- end menu -->
</td>
<td height="444" width="2%"> </td>
<td height="444" width="75%">
<p class="regtextbold">Modify a Printer</p>
<?
// for importing an ifhp config file to grab model names and so forth
// see echoed html below for more info
/// get input info if runme isn't set
if (!isset($runme))
{
echo <<<EOF
Create a list to select from - give some filtering values
<form action="$PHP_SELF" method="GET">
Search Term:
<input type="text" name="search_term"><br>
Search By:
<select name="search_by">
<option value="name">printer name</option>
<option value="ipaddr">ip address</option>
<option value="option_Device_Model">Device Model</option>
</select>
<br>
EOF;
displayServerList("all");
echo <<<EOL
Search type:<br>
<input type="radio" name="search_type" value="exact">Exact<br>
<input type="radio" name="search_type" value="fuzzy" checked>Fuzzy<br>
<input type="hidden" name="runme" value="yes">
<input type="submit">
</form>
EOL;
}
elseif ($runme="yes")
{
/// check if there were any options checked for which columns to display
if (isset($columns_vis0))
{
$vis_cols = array();
//var_dump($_REQUEST);
//parse out the visible_at* get vars into an array
foreach ($_REQUEST as $key => $value)
{
if (ereg("columns_vis",$key))
{
array_push($vis_cols, $value);
}
}
}
// if no columns were checked, use the defaults in the config file
else
{
global $default_dis_columns;
//var_dump($default_dis_columns);
$vis_cols = array();
$vis_cols = $default_dis_columns;
}
//var_dump($vis_cols);
$my_printers = new printerDB();
//$printer = array('name'=>$name,'ipaddr'=>$ipaddr);
$results = $my_printers->selectPrinters("$search_by","$search_term","$search_type","$local_server");
//$cols_to_display = array("name","ipaddr","option_Device_Model");
//$cols_to_display = "all";
$cols_to_display = $vis_cols;
//var_dump($my_printers->selectedPrinters);
//$my_printers->sortBy("option_Device_Model");
global $printers_name_map;
displayHashTable($my_printers->selectedPrinters, $cols_to_display, $printers_name_map,"radio", "printerID","action_mod.php");
}
/// user has selected a printer - show modifiable details
elseif ($selected_printer=="yes")
{
}
?>
<p class="regtextbold"> </p>
</td>
</tr>
<tr align="left" valign="top">
<td height="22" align="right" class="regtext" width="2%"> </td>
<td height="22" align="right" class="regtext" width="75%"> This software is
distributed under the <a href="http://www.gnu.org/licenses/gpl.html">GNU
General Public License</a><br>
contact: <a href="mailto:hide@address.com">hide@address.com</a></td>
</tr>
</table>