";
$text .= "";
if (is_array($options)){
foreach(array_keys($options) as $o){
if ($current == $o){ $s = "selected"; }
else { $s = ''; }
$text .= "";
}
}
$text .= "";
$this->filters[] = $text;
}
/**
* Creates a Date Form using JS calendar functions
*
* @param array $current current Date
* @param boolean $useTime if the date should also show the time selection
*/
function dateForm($current=array(), $useTime = false){
if (count($current) == 1){ $startOnly = true; }
if ($useTime == true){
if ($current[0] != ''){ $current[0] .= " 00:00"; }
else { $current[0] = date("m/d/Y") . " 00:00"; }
if ($current[1] != ''){ $current[1] .= " 23:59"; }
else { $current[1] = date("m/d/Y") . " 23:59"; }
}
$text .= "";
$text .= "";
$text .= "";
$text .= "\r\n";
if ($startOnly){
$text .= "Date: ";
$text .= " ";
$text .= "
";
$text .= "";
}
else {
$text .= "Date from: ";
$text .= " ";
$text .= "
";
$text .= " to ";
$text .= " ";
$text .= "
";
$text .= "";
}
$this->dateFormText = $text;
}
/**
* Adds a sort form to the list
*
* @param mixed $headers
* @param mixed $current
*/
function createOrderForm($headers, $current=''){
$text = "";
$this->filters[] = $text;
}
/**
* Exports the list results to file. Right now only to a CSV
*
* @param mixed $type type of file
* @param array $headers array of column headers
* @param array $rows array of the data rows
* @param mixed $fileName export file name
*/
function export($type, $headers, $rows, $fileName){
if ($type == "csv"){
$header1 = "Content-Type: text/csv;";
$header2 = "Content-Disposition: attachment; filename=$fileName" . ".csv";
$delimit = ",";
}
if (is_array($headers) && count($headers) > 0){
foreach($headers as $h){
$text .= strtoupper($h) . $delimit;
}
$text = substr($text, 0, -(strlen($delimit))) . "\r\n";
}
foreach($rows as $r){
$row = '';
foreach($r as $item){
$row .= $item . $delimit;
}
$row = substr($row, 0, -(strlen($delimit))) . "\r\n";
$text .= $row;
}
header($header1);
header($header2);
print($text);
exit();
}
/**
* Actuall starts the list
*
* @param array $headers
* @param mixed $link
* @param mixed $order
* @param mixed $sort
* @param mixed $rows
* @param mixed $limit
* @param mixed $number
* @param mixed $hidden
*/
function startList($headers, $link, $order, $sort, $rows, $limit, $number, $hidden=''){
if (is_array($hidden)){
foreach(array_keys($hidden) as $hide){
$h .= "\r\n";
}
}
if ($this->search){
//if ($this->searchLink){ $searchAction = $this->searchLink; }
//else { $searchAction = $link; }
$text .= "