56 if (!isset(
$lang) || (empty(
$lang) || (!is_array(
$lang) || (!isset($language) || (empty($language))))))
59 if (!isset($language))
61 require_once
'../system/classes/language.php';
63 $language = new \YAWK\language();
68 $lang = (array) $language->lang;
71 return $lang = $language->inject(
$lang,
"../system/plugins/tourdates/language/");
79 public function getFrontendTable(
$db)
82 if (!
$res =
$db->query(
"SELECT * FROM {plugin_tourdates} WHERE published = '1' ORDER by date"))
84 print \YAWK\alert::draw(
"warning",
"Fehler:",
"Es tut mir leid, die Tabelle konnte nicht abgerufen werden.",
"",
"4200");
90 $html =
"<h3>" .
date(
'Y') .
"</h3>" .
"<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" class=\"table table-responsive\">
93 while ($row = mysqli_fetch_array(
$res)) {
94 $this->
date = $row[1];
95 $this->
band = $row[2];
96 $this->
venue = $row[3];
98 $this->
fburl = $row[5];
99 if (!empty($this->
fburl)) {
100 $this->fbicon =
"<a href=\"$this->fburl\" target=\"_blank\"><img src=\"media/images/fbicon.png\"></a>";
102 $this->fbicon =
" ";
108 $year = $splitDate[
'year'];
109 $this->day = $splitDate[
'day'];
110 $this->month = $splitDate[
'month'];
111 $this->time = $splitDate[
'time'];
121 <td>$this->day. $this->month</td>
124 <td>$this->venue</td>
125 <td>$this->fbicon</td>
142 public function getBackendTable(
$db,
$lang)
144 if (!
$res =
$db->query(
"SELECT * FROM {plugin_tourdates} ORDER by date"))
146 print \YAWK\alert::draw(
"warning",
"Fehler:",
"Es tut mir leid, die Tabelle konnte nicht abgerufen werden.",
"",
"4200");
154 while ($row = mysqli_fetch_array(
$res)) {
156 $this->
date = $row[1];
157 $this->
band = $row[2];
158 $this->
venue = $row[3];
160 $this->
fburl = $row[5];
162 if (!empty($this->
fburl)) {
163 $this->fbicon =
"<a href=\"$this->fburl\" target=\"_blank\"><i class=\"fa fa-facebook-square\"></i></a>";
165 $this->fbicon =
" ";
171 $this->year = $splitDate[
'year'];
172 $this->day = $splitDate[
'day'];
173 $this->month = $splitDate[
'month'];
174 $this->time = $splitDate[
'time'];
184 <td class=\"text-center\">
185 <a title=\"toggle status\" href=\"index.php?plugin=tourdates&pluginpage=tourdates-toggle&id=" . $this->
id .
"\">
186 <span class=\"label label-$pub\">$pubtext</span></a></td>
187 <td>$this->day. $this->month</td>
188 <td><a href=\"index.php?plugin=tourdates&pluginpage=tourdates-edit&id=" . $this->
id .
"\"><div>$this->band</div></a></td>
190 <td>$this->venue</td>
191 <td class=\"text-center\">$this->fbicon</td>
192 <td class=\"text-center\"><a class=\"fa fa-copy\" title=\"" .
$lang[
'TOUR_COPY'] .
"\" href=\"index.php?plugin=tourdates&pluginpage=tourdates-copy&id=" . $this->
id .
"©=true\"></a>
193 <a class=\"fa fa-edit\"title=\"" .
$lang[
'TOUR_EDIT'] .
"\" href=\"index.php?plugin=tourdates&pluginpage=tourdates-edit&id=" . $this->
id .
"\"></a>
194 <a class=\"fa fa-trash-o\" role=\"dialog\" data-confirm=\"Den Termin «" . $this->
date .
" @ " . $this->
venue .
"» wirklich löschen?\"
195 title=\"" .
$lang[
'TOUR_DELETE'] .
"\" href=\"index.php?plugin=tourdates&pluginpage=tourdates-delete&id=" . $this->
id .
"&delete=1\">
216 if (!
$res =
$db->query(
"UPDATE {plugin_tourdates}
218 WHERE id = '" .
$id .
"'"))
220 print \YAWK\alert::draw(
"danger",
"Error",
"Event status could not be toggled.",
"",
"4200");
235 function loadProperties(
$db,
$id)
237 $res =
$db->query(
"SELECT * FROM {plugin_tourdates}
238 WHERE id = '" .
$id .
"'");
239 if ($row = mysqli_fetch_row(
$res)) {
241 $this->
date = $row[1];
242 $this->
band = $row[2];
243 $this->
venue = $row[3];
245 $this->
fburl = $row[5];
254 static function getMaxId(
$db)
257 if (
$res =
$db->query(
"SELECT MAX(id) FROM {plugin_tourdates}"))
259 if ($row = mysqli_fetch_array(
$res)) {
280 if (!
$res =
$db->query(
"DELETE FROM {plugin_tourdates} WHERE id = '" . $this->id .
"'"))
282 print \YAWK\alert::draw(
"danger",
"Error",
"Gig could not be deleted.",
"plugin=tourdates",
"4200");
303 $tourdates = new \YAWK\PLUGINS\TOURDATES\tourdates();
309 if (!
$res =
$db->query(
"INSERT INTO {plugin_tourdates} (id,date,band,venue,published,fburl)
317 print \YAWK\alert::draw(
"danger",
"Error",
"Gig could not be copied!",
"",
"4200");
341 $tourdates = new \YAWK\PLUGINS\TOURDATES\tourdates();
344 $id = self::getMaxId(
$db) + 1;
351 if (!
$res =
$db->query(
"INSERT INTO {plugin_tourdates} (id,date,band,venue,published,fburl)
352 VALUES ('" .
$id .
"',
382 if (!
$res =
$db->query(
"UPDATE {plugin_tourdates}
383 SET date = '" .
$date .
"',
384 band = '" .
$band .
"',
387 WHERE id = '" .
$id .
"'"))
389 print \YAWK\alert::draw(
"danger",
"Error",
"Termin konnte nicht bearbeitet werden.",
"",
"4800");
print $lang['PAGE_ADD_BTN']
if(!isset($blog)) if(!isset($language)||(!isset($lang))) if(!isset($db)) $blog published
Tour Dates Plugin hands you a simple but nice, clean bootstraped & sortable Data Table....
injectLanguageTags($lang, $language)
Inject Language Tags.
static splitDate($date)
split a date to month, day, year and time
static encodeChars($string)
convert german special chars and vowels into legal html