_db = $config->get_db(); $this->set_table($t); } public function isDate($value) { if (!$value) { return false; } try { new \DateTime($value); return true; } catch (\Exception $e) { return false; } } public function set_table($table) { $this->_table = $table; if (SITE == 'Admin') $this->_form = new Forms($this->_table, $this->_table, "y","y","y"); else $this->_form = new Forms($this->_table, $this->_table, "n","n","n"); } public function doPDFjoin() { $str = "
doPDFjoin"; if (!$this->isDate($_REQUEST['startdate'])) exit(); if (!$this->isDate($_REQUEST['enddate'])) exit(); $str .= $_REQUEST['startdate']; $str .= " "; $str .= $_REQUEST['enddate']; $str .= " "; $str .= $_REQUEST['Name']; $sql = "SELECT * FROM ".$this->_table. " WHERE Filename LIKE '%.pdf' AND to_days(PubDate) >= to_days('".$_REQUEST['startdate']."') AND to_days(PubDate) <= to_days('".$_REQUEST['enddate']."') "; if (isset($_REQUEST['Name']) && $_REQUEST['Name'] != '') $sql .= "AND Name LIKE ?"; // $sql .= "AND Name LIKE '%".$_REQUEST['Name']."%' "; $sql .= "ORDER BY PubDate"; $this->_db->prepare($sql); if (isset($_REQUEST['Name']) && $_REQUEST['Name'] != '') $this->_db->bind_param("s","%".$_REQUEST['Name']."%"); $this->_db->execute(); if (! $result = $this->_db->get_result()) { die('There was an error running the query ' . $sql . '[' . $this->_db->error . ']'); } // if (! $result = $this->_db->query($sql)) { // die('There was an error running the query ' . $sql . '[' . $this->_db->error . ']'); // } $rows = $result->fetch_all(); $str .= $v['hoort.ID'] . " " . $v['hoort.Filename'] . "
"; $outfile = "/web1/hoort/spool/merged.pdf"; $gs = '/usr/bin/pdfjoin'; $args = "--a4paper --no-landscape --rotateoversize 'false' --outfile '{$outfile}' "; foreach ($rows as $row => $v) { $thefile = "/web1/hoort/spool/".$v['hoort.ID'].".pdf"; if (file_exists($thefile)) { $args .= "'".$thefile."' "; } } exec("$gs $args"); $str .= "Merged PDF"; $str .= "
"; return $str; } public function PDFjoin() { $str = "
PDFjoin"; $str .= "
"; $str .= ""; $str .= ""; $str .= ""; $str .= " "; $str .= ""; $str .= "
Start:
End:
Name: "; $str .= " "; $str .= "
 
"; $str .= "
"; $str .= "
"; return $str; } public function edit() { $str = $this->_form->edit(); return $str; } public function detail() { $str = $this->_form->detail(); return $str; } public function listing($p, $s, $f) { $str =""; $str .= $this->_form->listing_head($this->_table); $str .= "
"; $l = new Lists($this->_table); $str .= $l->list_cols(); $str .= ""; // $filter = new Filter(); // $options = $filter->get_filters($parent); $str .= $this->_form->listing($p, $s, ""); // $str .= "Filter:
"; $str .= "
"; $str .= $this->_form->listing_tail(); return $str; } public function view($p, $s, $f) { $str =""; $str .= $this->_form->listing_head($this->_table); $str .= "
"; $str .= $this->_form->listing($p, $s, $f); $str .= "Search "; $str .= ""; $str .= ""; $str .= "
".$this->_table_name.""; $str .= ""; foreach ($fields as $key => $info) { if ($key != "ID") { if ($key == 'Filename' ) { if ($row[$this->_table.".".$key] != "") { $str .= ""; //$str .= ""; } else { continue; } } elseif ($key == 'url') { if ($row[$this->_table.".".$key] != "") { $str .= ""; //$str .= ""; } else { continue; } } elseif ($key == 'youtubeCode') { if ($row[$this->_table.".".$key] != "") { $str .= ""; //$str .= ""; } else { continue; } } else { $str .= ""; $str .= $this->_form->show_field($info, $key, $row[$this->_table.".".$key]); $str .= ""; } } } $str .= "


"; $str .= "
See the PDF"; $str .= "


"; $str .= "
See ".$row[$this->_table.".".$key]." for more information

"; $str .= "


"; $str .= "
http://www.youtube.com/embed/".$row[$this->_table.".".$key]."

"; $str .= "
"; $str .= ""; $str .= "
"; $str .= ""; } return ($str); } public function delete() { $str = $this->_form->delete(); return $str; } public function add() { $fields = $this->_form->get_fields(0); $str = "
"; $str .= "
".$this->_table.""; $str .= "

".ucfirst($this->_table_name)."

"; $str .= ""; $str .= ""; $str .= ""; foreach ($fields as $key => $info) { if ($key != "ID") { $str .= ""; if ($key == "Filename" ) { $str .= ""; } } $str .= "
KeyValue
"; $str .= $key; $str .= ""; $str .= ""; } else { $str .= $this->_form->input_field($info, $key, ''); } $str .= "
"; $str .= ""; if ($this->_form->_add_allowed) $str .= ""; $str .= "
"; $str .= "
"; return ($str); } public function save() { $str = ""; $_REQUEST['Filename'] = $_FILES['Filename']['name']; $id = $this->_form->save(); $str .= $this->_form->upload_file($id,'Filename'); return $str; } } ?>
Fatal error: Uncaught Error: Class 'hoort' not found in /web1/hoort/includes/navigation.php:102 Stack trace: #0 /web1/hoort/includes/setup.php(39): Navigation->go() #1 /web1/hoort/index.php(8): include('/web1/hoort/inc...') #2 {main} thrown in /web1/hoort/includes/navigation.php on line 102