function getSideMenu($menuTypeID) { switch ($menuTypeID) { case 0: //logged out $menu = loggedOutMenu(); break; case 1: //logged in $menu = loggedInMenu(); break; case 2: //course home (lesson tools) $menu = lessonToolsMenu(); break; case 3: // admin tools $menu = adminMenu(); break; case 4: // custom tools $menu = customMenu(); break; case 5: // tools when embedded in tinymce $menu = pickerMenu(); break; } return $menu; }
function smarty_function_menu($params, &$smarty) { if ($params['admin']) { return adminMenu($params, $smarty); } else { return frontendMenu($params, $smarty); } }
function setCharts() { global $SUBS, $PARAM, $MSG; global $tbl_1d_charts, $tbl_1d_kino_charts, $tbl_1d_videodvd_charts, $tbl_1d_films, $tbl_1d_videodvd; global $MONTHS, $MONTHS2; // check chart length $query = "SELECT Length, Type\n\t\tFROM {$tbl_1d_charts}\n\t\tORDER BY ID = " . dbQuote($PARAM['PLACES']) . " DESC "; $result = runQuery($query, 'setCharts()', 'GET_CHART_LENGTH_AND_TYPE'); if ($row = db_fetch_row($result)) { $max = $row[0]; $type = $row[1]; } else { adminMenu(); return; } //iztriwane if ($PARAM['Delete'] == 1) { reset($PARAM); $Films = '0'; while (list($k, $v) = each($PARAM)) { if (ereg('^c_([0-9]+)$', $k, $R)) { $Films .= ",{$R['1']}"; } } //get chart type $query = "SELECT Type\n\t\t\tFROM {$tbl_1d_charts}\n\t\t\tWHERE ID = " . dbQuote($PARAM['PLACES']); $result = runQuery($query, 'setCharts()', 'GET_CHART_TYPE2'); if ($row = db_fetch_row($result)) { $type = $row[0]; } else { $SUBS['ERROR'] = $MSG[20008]; } switch ($type) { case 'videodvd': $query = "DELETE FROM {$tbl_1d_videodvd_charts} WHERE ID IN ({$Films})"; break; case 'kino': $query = "DELETE FROM {$tbl_1d_kino_charts} WHERE ID IN ({$Films})"; break; } if ($Films == '0') { $SUBS['ERROR'] = $MSG[20008]; } if ($SUBS['ERROR']) { $SUBS['ERROR'] = fileParse('_admin_error.htmlt'); } else { runQuery($query, 'setCharts()', 'DEL_CHART_RECORDS'); $SUBS['COMMAND'] = $PARAM['cmd'] . "&err=20030&WHEN=" . $PARAM['WEEK'] . "&WEEK=" . $PARAM['WEEK'] . "&WHERE=" . $PARAM['WHERE'] . "&PLACES=" . $PARAM['PLACES']; printPage('_admin_done.htmlt'); return; } } //add chart record if ($PARAM['Add'] == 1) { $SUBS['ERROR'] = ''; if ($PARAM['NO'] == '') { //poziciya w klasaciyata $SUBS['ERROR'] = $MSG[20097]; } if ($SUBS['ERROR'] == '' && !is_numeric($PARAM['NO'])) { $SUBS['ERROR'] = $MSG[20099]; } //poziciyata dali e cefira if ($SUBS['ERROR'] == '' && $PARAM['NO'] > $max) { $SUBS['ERROR'] = $MSG[20099]; } //poziciyata dali e po-golyama ot poziciite w klasaciyata if ($SUBS['ERROR'] == '' && $PARAM['NO'] < 0) { $SUBS['ERROR'] = $MSG[20099]; } //poziciyata dali e po-malka ot nula //tipa na filma switch ($PARAM['TYPE']) { case 'list': //list if ($SUBS['ERROR'] == '' && $PARAM['FILMS'] == 0) { $SUBS['ERROR'] = $MSG[20026]; } $film = $PARAM['FILMS']; break; case 'raw': //raw if ($SUBS['ERROR'] == '' && $PARAM['FILM'] == '') { $SUBS['ERROR'] = $MSG[20027]; } $film = $PARAM['FILM']; break; default: if ($SUBS['ERROR'] == '') { $SUBS['ERROR'] = $MSG[20028]; } } switch ($type) { case 'kino': if ($SUBS['ERROR'] == '' && $PARAM['WEEKS'] == '') { $SUBS['ERROR'] = $MSG[20098]; } //sedmici w klasaciyata if ($SUBS['ERROR'] == '' && !is_numeric($PARAM['WEEKS'])) { $SUBS['ERROR'] = $MSG[20100]; } //sedmicite dali sa cefira if ($SUBS['ERROR'] == '' && $PARAM['SCREENS'] == '') { $SUBS['ERROR'] = $MSG[20101]; } //ekrani na klasaciyata if ($SUBS['ERROR'] == '' && !is_numeric($PARAM['SCREENS'])) { $SUBS['ERROR'] = $MSG[20102]; } //ekranite dali sa cefira if ($SUBS['ERROR'] == '' && $PARAM['BO'] == '') { $SUBS['ERROR'] = $MSG[20103]; } //sedmichen prihod na klasaciyata /*if (($SUBS['ERROR'] =='' ) && (!is_numeric($PARAM['BO']))) $SUBS['ERROR'] = $MSG[20104]; //sedmichen prihod dali sa cefira*/ if ($SUBS['ERROR'] == '' && $PARAM['CBO'] == '') { $SUBS['ERROR'] = $MSG[20105]; } //obscht prihod na klasaciyata /*if (($SUBS['ERROR'] =='' ) && (!is_numeric($PARAM['CBO']))) $SUBS['ERROR'] = $MSG[20106]; //obscht prihod dali sa cefira*/ break; case 'videodvd': if ($SUBS['ERROR'] == '' && $PARAM['WEEKS'] == '') { $SUBS['ERROR'] = $MSG[20098]; } //sedmici w klasaciyata if ($SUBS['ERROR'] == '' && !is_numeric($PARAM['WEEKS'])) { $SUBS['ERROR'] = $MSG[20100]; } //sedmicite dali sa cefira break; } if ($SUBS['ERROR'] == '') { if ($PARAM['id'] == '') { switch ($type) { case 'videodvd': $query = "INSERT INTO {$tbl_1d_videodvd_charts} (\n\t\t\t\t\t\t\t\tChartID,\n\t\t\t\t\t\t\t\tNo,\n\t\t\t\t\t\t\t\tType,\n\t\t\t\t\t\t\t\tFilm,\n\t\t\t\t\t\t\t\tWeeks,\n\t\t\t\t\t\t\t\ttsWhen\n\t\t\t\t\t\t\t\t) VALUES (\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['PLACES']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['NO']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['TYPE']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($film) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['WEEKS']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['WEEK']) . " )"; break; case 'kino': $query = "INSERT INTO {$tbl_1d_kino_charts} (\n\t\t\t\t\t\t\t\tChartID,\n\t\t\t\t\t\t\t\tNo,\n\t\t\t\t\t\t\t\tType,\n\t\t\t\t\t\t\t\tFilm,\n\t\t\t\t\t\t\t\tBoxOffice,\n\t\t\t\t\t\t\t\tcumBoxOffice,\n\t\t\t\t\t\t\t\tWeeks,\n\t\t\t\t\t\t\t\tScreens,\n\t\t\t\t\t\t\t\ttsWhen\n\t\t\t\t\t\t\t\t) VALUES (\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['PLACES']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['NO']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['TYPE']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($film) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['BO']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['CBO']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['WEEKS']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['SCREENS']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['WEEK']) . " )"; break; } } else { switch ($type) { case 'videodvd': $query = "UPDATE {$tbl_1d_videodvd_charts} SET\n\t\t\t\t\t\t\t\tChartID = " . dbQuote($PARAM['PLACES']) . ",\n\t\t\t\t\t\t\t\tNo = " . dbQuote($PARAM['NO']) . ",\n\t\t\t\t\t\t\t\tType = " . dbQuote($PARAM['TYPE']) . ",\n\t\t\t\t\t\t\t\tFilm = " . dbQuote($film) . ",\n\t\t\t\t\t\t\t\tWeeks = " . dbQuote($PARAM['WEEKS']) . ",\n\t\t\t\t\t\t\t\ttsWhen = " . dbQuote($PARAM['WEEK']) . " \n\t\t\t\t\t\t\tWHERE ID = " . dbQuote($PARAM['id']); break; case 'kino': $query = "UPDATE {$tbl_1d_kino_charts} SET\n\t\t\t\t\t\t\t\tChartID = " . dbQuote($PARAM['PLACES']) . ",\n\t\t\t\t\t\t\t\tNo = " . dbQuote($PARAM['NO']) . ",\n\t\t\t\t\t\t\t\tType = " . dbQuote($PARAM['TYPE']) . ",\n\t\t\t\t\t\t\t\tFilm = " . dbQuote($film) . ",\n\t\t\t\t\t\t\t\tBoxOffice = " . dbQuote($PARAM['BO']) . ",\n\t\t\t\t\t\t\t\tcumBoxOffice = " . dbQuote($PARAM['CBO']) . ",\n\t\t\t\t\t\t\t\tWeeks = " . dbQuote($PARAM['WEEKS']) . ",\n\t\t\t\t\t\t\t\tScreens = " . dbQuote($PARAM['SCREENS']) . ",\n\t\t\t\t\t\t\t\ttsWhen = " . dbQuote($PARAM['WEEK']) . " \n\t\t\t\t\t\t\tWHERE ID = " . dbQuote($PARAM['id']); break; } } $result = runQuery($query, 'setCharts()', 'SAVE_CHART'); $SUBS['COMMAND'] = $PARAM['cmd'] . "&err=20107&PLACES=" . $PARAM['PLACES'] . "&WHEN=" . $PARAM['WEEK'] . "&WEEK=" . $PARAM['WEEK']; printPage('_admin_done.htmlt'); return; } else { $SUBS['ERROR'] = fileParse('_admin_error.htmlt'); } } ////----[Mrasnika's] Edition 12.10.2002 if ($PARAM['WHEN']) { $PARAM['Year1'] = date('Y', $PARAM['WHEN']); $PARAM['Month1'] = date('m', $PARAM['WHEN']); $PARAM['Day1'] = date('d', $PARAM['WHEN']); } else { if ($PARAM['Day1'] && $PARAM['Month1'] && $PARAM['Year1']) { $PARAM['WHEN'] = 1 + strToTime($PARAM['Day1'] . ' ' . $MONTHS2[$PARAM['Month1']] . ' ' . $PARAM['Year1']); } else { $PARAM['WHEN'] = getNextWeek(); } } $SUBS['PREV'] = week($PARAM['WHEN']) - 518400; $SUBS['NEXT'] = week($PARAM['WHEN']) + 1026800; //show charts records switch ($type) { case 'kino': $query = "SELECT\t{$tbl_1d_kino_charts}.ID,\n\t\t\t\tChartID,\n\t\t\t\tNo,\n\t\t\t\tType,\n\t\t\t\tFilm,\n\t\t\t\tBoxOffice,\n\t\t\t\tcumBoxOffice,\n\t\t\t\tWeeks,\n\t\t\t\tScreens,\n\t\t\t\ttsWhen,\n\t\t\t\t\n\t\t\t\t{$tbl_1d_films}.Title,\n\t\t\t\t{$tbl_1d_films}.OriginalTitle\n\n\t\t\t\tFROM {$tbl_1d_kino_charts}\n\t\t\t\tLEFT JOIN {$tbl_1d_films}\n\t\t\t\t\tON {$tbl_1d_kino_charts}.Type = 'list'\n\t\t\t\t\t\tAND {$tbl_1d_films}.ID = {$tbl_1d_kino_charts}.Film\n\t\t\t\tWHERE {$tbl_1d_kino_charts}.ChartID = " . dbQuote($PARAM['PLACES']) . "\n\t\t\t\t\tAND {$tbl_1d_kino_charts}.tsWhen >= " . week($PARAM['WHEN']) . "\n\t\t\t\t\tAND {$tbl_1d_kino_charts}.tsWhen <= (" . week($PARAM['WHEN']) . "+604799)\n\t\t\t\tORDER BY {$tbl_1d_kino_charts}.No,\n\t\t\t\t\t{$tbl_1d_kino_charts}.BoxOffice"; break; case 'videodvd': $query = "SELECT\t{$tbl_1d_videodvd_charts}.ID,\n\t\t\t\tChartID,\n\t\t\t\tNo,\n\t\t\t\tType,\n\t\t\t\tFilm,\n\t\t\t\tWeeks,\n\t\t\t\tWeeks,\n\t\t\t\tWeeks,\n\t\t\t\tWeeks,\n\t\t\t\ttsWhen,\n\t\t\t\t\n\t\t\t\t{$tbl_1d_films}.Title,\n\t\t\t\t{$tbl_1d_films}.OriginalTitle\n\n\t\t\t\tFROM {$tbl_1d_videodvd_charts}\n\t\t\t\tLEFT JOIN {$tbl_1d_films}\n\t\t\t\t\tON {$tbl_1d_videodvd_charts}.Type = 'list'\n\t\t\t\t\t\tAND {$tbl_1d_films}.ID = {$tbl_1d_videodvd_charts}.Film\n\t\t\t\tWHERE {$tbl_1d_videodvd_charts}.ChartID = " . dbQuote($PARAM['PLACES']) . "\n\t\t\t\t\tAND {$tbl_1d_videodvd_charts}.tsWhen >= " . week($PARAM['WHEN']) . "\n\t\t\t\t\tAND {$tbl_1d_videodvd_charts}.tsWhen <= (" . week($PARAM['WHEN']) . "+604799)\n\t\t\t\tORDER BY {$tbl_1d_videodvd_charts}.No "; break; } $result = runQuery($query, 'setCharts()', 'GET_CHART_RECORDS'); while ($row = db_fetch_row($result)) { $SUBS['CHECK'] = $row[0]; $SUBS['CHARTID'] = $row[1]; $SUBS['NO2'] = sprintf("%02d", $row[2]); if ($row[3] == 'list') { if ($row[10]) { $SUBS['TITLE'] = htmlEncode($row[10]); } else { $SUBS['TITLE'] = htmlEncode($row[11]); } $SUBS['MOVIE'] = $SUBS['ACTION'] . "?cmd=insertfilm&ID={$row['4']}"; } else { $SUBS['TITLE'] = htmlEncode($row[4]); $SUBS['MOVIE'] = "javascript:alert('{$MSG['20031']}')"; } $SUBS['PRATI'] = $row[9]; switch ($type) { case 'kino': $SUBS['BO2'] = $row[5]; $SUBS['CBO2'] = $row[6]; $SUBS['SCREENS2'] = $row[8]; $SUBS['WEEKS2'] = $row[7]; $SUBS['SHOWCHARTS'] .= fileParse('_admin_charts_row.htmlt'); break; case 'videodvd': $SUBS['WEEKS2'] = $row[7]; $SUBS['SHOWCHARTS'] .= fileParse('_admin_charts_row2.htmlt'); break; } if ($PARAM['Add'] != 1 && $PARAM['id'] == $row[0]) { //load form $PARAM['PLACES'] = $row[1]; $PARAM['TYPE'] = $row[3]; if ($row[3] != 'list') { $PARAM['FILM'] = $row[4]; } else { $PARAM['FILMS'] = htmlEncode($row[4]); } $PARAM['WEEK'] = $row[9]; $PARAM['NO'] = $row[2]; switch ($type) { default: //kino $PARAM['BO'] = $row[5]; $PARAM['CBO'] = $row[6]; $PARAM['WEEKS'] = $row[7]; $PARAM['SCREENS'] = $row[8]; } } } //get charts $SUBS['CHARTS'] = $PARAM['PLACES']; $query = "SELECT ID, Title\n \t\tFROM {$tbl_1d_charts}"; $result = runQuery($query, 'setCharts()', 'GET_CHARTS'); while ($row = db_fetch_row($result)) { ////----[Mrasnika's] Edition 12.10.2002 // if ($row[0] == $PARAM['chartid']) // $SUBS['CHARTS'] .= "<OPTION value=\"$row[0]\" SELECTED>".htmlEncode($row[1]); // else $SUBS['CHARTS'] .= "<OPTION value=\"$row[0]\">".htmlEncode($row[1]); if (!$s1) { //store default chart $s1 = $row[0]; $s2 = $row[1]; } if ($row[0] == $PARAM['PLACES']) { $SUBS['CHARTTITLE'] = htmlEncode($row[1]); } if ($row[0] == $PARAM['PLACES']) { $SUBS['PLACES'] .= "<OPTION value=\"{$row['0']}\" SELECTED>" . htmlEncode($row[1]); } else { $SUBS['PLACES'] .= "<OPTION value=\"{$row['0']}\">" . htmlEncode($row[1]); } } if (!$SUBS['CHARTTITLE']) { //no default chart $SUBS['CHARTS'] = $s1; $SUBS['CHARTTITLE'] = htmlEncode($s2); } //get oldest week switch ($type) { default: //kino $query = "SELECT\tmin({$tbl_1d_kino_charts}.tsWhen)\n\t\t\t\tFROM\t{$tbl_1d_kino_charts}\n\t\t\t\tGROUP BY {$tbl_1d_kino_charts}.ChartID\n\t\t\t\tORDER BY {$tbl_1d_kino_charts}.ChartID=" . dbQuote($PARAM['PLACES']) . " DESC"; $result = runQuery($query, 'setCharts()', 'GET_OLDEST_WEEK_KINO'); if ($row = db_fetch_row($result)) { $span = $row[0]; } break; case 'videodvd': //videodvd $query = "SELECT\tmin({$tbl_1d_videodvd_charts}.tsWhen)\n\t\t\t\tFROM\t{$tbl_1d_videodvd_charts}"; $result = runQuery($query, 'setCharts()', 'GET_OLDEST_WEEK_VIDEO'); if ($row = db_fetch_row($result)) { $span = $row[0]; } break; } if (!$span) { $span = getNextWeek(); } ////----[Mrasnika's] Edition 12.10.2002 // $SUBS['WEEK'] = getWeeks($PARAM['WEEK']); // $SUBS['WHEN'] = getWeeks($PARAM['WHEN']); //compatibility if (!$PARAM['WHEN']) { //no date applied if (!$PARAM['Day1'] || !$PARAM['Month1'] || !$PARAM['Year1']) { $PARAM['WHEN'] = getNextWeek(); $PARAM['Year1'] = date('Y', $PARAM['WHEN']); $PARAM['Month1'] = date('m', $PARAM['WHEN']); $PARAM['Day1'] = date('d', $PARAM['WHEN']); } else { $PARAM['WHEN'] = 1 + strToTime($PARAM['Day1'] . ' ' . $MONTHS2[$PARAM['Month1']] . ' ' . $PARAM['Year1']); } } else { //load date form $PARAM['Year1'] = date('Y', $PARAM['WHEN']); $PARAM['Month1'] = date('m', $PARAM['WHEN']); $PARAM['Day1'] = date('d', $PARAM['WHEN']); } if ($span > $PARAM['WHEN']) { //ima data, no e po-malka ot naj-starata klasaciya $SUBS['COMMAND'] = $PARAM['cmd'] . "&WHEN={$span}&PLACES=" . $PARAM['PLACES']; printPage('_admin_done.htmlt'); return; } $Year2 = 1 + date('Y', max($PARAM['WHEN'], time())); $Year1 = date('Y', $span); for ($i = $Year1; $i <= $Year2; $i++) { if ($i == $PARAM['Year1']) { $SUBS['YEAR1'] .= "<OPTION value=\"{$i}\" selected>{$i}"; } else { $SUBS['YEAR1'] .= "<OPTION value=\"{$i}\">{$i}"; } } for ($i = 1; $i <= 12; $i++) { if ($i == $PARAM['Month1']) { $SUBS['MONTH1'] .= "<OPTION value=\"{$i}\" selected>" . $MONTHS[$i]; } else { $SUBS['MONTH1'] .= "<OPTION value=\"{$i}\">" . $MONTHS[$i]; } } for ($i = 1; $i <= 31; $i++) { if ($i == $PARAM['Day1']) { $SUBS['DAY1'] .= "<OPTION value=\"{$i}\" selected>" . sprintf('%02d', $i); } else { $SUBS['DAY1'] .= "<OPTION value=\"{$i}\">" . sprintf('%02d', $i); } } $SUBS['WEEK'] = $PARAM['WHEN']; $SUBS['DISPLAYWEEK'] = displayWeek($SUBS['WEEK']); //get films switch ($type) { case 'kino': $query = "SELECT\t{$tbl_1d_films}.ID,\n\t\t\t\tTitle,\n\t\t\t\tOriginalTitle\n\t\t\tFROM {$tbl_1d_films}\n\t\t\tLEFT JOIN {$tbl_1d_videodvd}\n\t\t\t\tON {$tbl_1d_videodvd}.FilmID = {$tbl_1d_films}.ID\n\t\t\tWHERE\t{$tbl_1d_videodvd}.ID IS NULL\n\t\t\tGROUP BY {$tbl_1d_films}.ID\n\t\t\tORDER BY OriginalTitle !='' DESC, Title='' DESC"; break; case 'videodvd': $query = "SELECT\t{$tbl_1d_films}.ID, Title\n\t\t\tFROM {$tbl_1d_films}\n\t\t\tLEFT JOIN {$tbl_1d_videodvd}\n\t\t\t\tON {$tbl_1d_videodvd}.FilmID = {$tbl_1d_films}.ID\n\t\t\tWHERE\t{$tbl_1d_videodvd}.ID IS NOT NULL\n\t\t\tGROUP BY {$tbl_1d_films}.ID\n\t\t\tORDER BY Title DESC"; break; } $result = runQuery($query, 'setCharts()', 'GET_FILMS'); while ($row = db_fetch_row($result)) { //fix titles if (!$row[1]) { $row[1] = $row[2]; } if ($PARAM['FILMS'] == $row[0]) { ////----[Mrasnika's] Edition 12.10.2002 // $SUBS['FILM'] .= "\n<option value=\"$row[0]\" selected>".htmlEncode("$row[1] $row[2] "); // else $SUBS['FILM'] .= "\n<option value=\"$row[0]\">".htmlEncode("$row[1] $row[2] "); $SUBS['FILM'] .= "\n<option value=\"{$row['0']}\" selected>" . htmlEncode($row[1]); } else { $SUBS['FILM'] .= "\n<option value=\"{$row['0']}\">" . htmlEncode($row[1]); } } // display $SUBS['TYPE' . strToUpper($PARAM['TYPE'])] = ' checked '; $SUBS['FILM2'] = htmlEncode($PARAM['FILM']); $SUBS['NO'] = htmlEncode($PARAM['NO']); switch ($type) { default: //kino $SUBS['WEEKS'] = htmlEncode($PARAM['WEEKS']); $SUBS['SCREENS'] = htmlEncode($PARAM['SCREENS']); $SUBS['BO'] = htmlEncode($PARAM['BO']); $SUBS['CBO'] = htmlEncode($PARAM['CBO']); $SUBS['DISPLAYCHART'] = fileParse("_admin_charts_kino.htmlt"); break; case 'videodvd': //video & dvd $SUBS['WEEKS'] = htmlEncode($PARAM['WEEKS']); $SUBS['DISPLAYCHART'] = fileParse("_admin_charts_videodvd.htmlt"); break; } $SUBS['ID'] = htmlEncode($PARAM['id']); if ($PARAM['err'] != '' && $SUBS['ERROR'] == '') { $SUBS['ERROR'] = $MSG[$PARAM['err']]; $SUBS['ERROR'] = fileParse('_admin_error.htmlt'); } printPage('_admin_charts.htmlt'); }
if (!isset($_GET['id'])) { $_SESSION['err'] = 'Missing value for id'; session_commit(); header('Location: index.php'); return; } $id = $db->quote($_GET['id']); $sql = "SELECT name,email,password,id, lkey FROM LTI_Users WHERE id={$id}"; $q = $db->query($sql); $row = $q->fetch(); if (!$row) { $_SESSION['error'] = 'Bad value for id'; header('Location: index.php'); return; } adminMenu(); flashMessages(); $n = htmlentities($row[0]); $e = htmlentities($row[1]); $p = htmlentities($row[2]); $id = htmlentities($row[3]); $l = htmlentities($row[4]); echo <<<_END <p>Edit User</p> <form method="post"> <p>Name: <input type="text" name="name" value="{$n}"></p> <p>Account: <input type="text" name="lkey" value="{$l}"></p> <p>Email: <input type="text" name="email" value="{$e}"></p>
function categoryDelete($categoryID = '') { global $cat_table,$ent_table,$xoopsConfig,$xoopsModuleConfig,$xoopsModule,$xoopsGTicket,$MYDIRNAME; $xoopsDB =& Database::getInstance(); $myts =& MyTextSanitizer::getInstance(); $result = $xoopsDB -> query( "SELECT categoryID, name FROM $cat_table WHERE categoryID = '$categoryID'" ); if ( !$xoopsDB -> getRowsNum( $result ) ) { redirect_header( "index.php", 2, constant("_AM_{$MYDIRNAME}_NOCAT") ); } list( $categoryID, $name ) = $xoopsDB -> fetchrow( $result ); xoops_cp_header(); adminMenu(0, constant("_AM_{$MYDIRNAME}_CATS")." » ".constant("_AM_{$MYDIRNAME}_DELETE")); include('./mymenu.php'); echo "<br />\n"; $name = $myts -> htmlSpecialChars($name); xoops_confirm(array('op' => 'delcat', 'categoryID' => $categoryID, 'ok' => 1, 'name' => $name ) + $xoopsGTicket->getTicketArray( __LINE__ ), 'category.php', constant("_AM_{$MYDIRNAME}_DELETETHISCAT") . "<br /><br />" . $name, constant("_AM_{$MYDIRNAME}_DELETE") ); xoops_cp_footer(); }
*/ // XOOPS2 - Xwords 0.44 // WEBMASTER @ KANPYO.NET, 2006. include( "./admin_header.php" ); include_once( XOOPS_ROOT_PATH . '/class/pagenav.php' ); $startentry = !empty( $_GET['startentry'] ) ? intval( $_GET['startentry'] ) : 0; $startcat = !empty( $_GET['startcat'] ) ? intval( $_GET['startcat'] ) : 0; $startsub = !empty( $_GET['startsub'] ) ? intval( $_GET['startsub'] ) : 0; $datesub = !empty( $_GET['datesub'] ) ? intval( $_GET['datesub'] ) : 0; $entryID = !empty( $_GET['entryID'] ) ? intval( $_GET['entryID'] ) : 0; xoops_cp_header(); adminMenu(0, constant("_AM_{$MYDIRNAME}_INDEX")); include('./mymenu.php'); $result01 = $xoopsDB -> query( "SELECT COUNT(*) FROM $cat_table" ); list( $totalcategories ) = $xoopsDB -> fetchRow( $result01 ); $result02 = $xoopsDB -> query( "SELECT COUNT(*) FROM $ent_table WHERE submit = '0' AND request = '0'" ); list( $totalpublished ) = $xoopsDB -> fetchRow( $result02 ); $result03 = $xoopsDB -> query( "SELECT COUNT(*) FROM $ent_table WHERE submit = '1'" ); list( $totalsubmitted ) = $xoopsDB -> fetchRow( $result03 ); $result04 = $xoopsDB -> query( "SELECT COUNT(*) FROM $ent_table WHERE request = '1'" ); list( $totalrequested ) = $xoopsDB -> fetchRow( $result04 ); echo "<fieldset style='margin:1em 0em 0em 0em;border:1px solid #778;'><legend style='font-weight: bold; color: #900;'>" . constant("_AM_{$MYDIRNAME}_INVENTORY") . "</legend>"; echo "<div style='padding: 12px;'>\n" . constant("_AM_{$MYDIRNAME}_TOTALENTRIES") . " <b>".intval($totalpublished)."</b> | "; if ($xoopsModuleConfig['multicats'] == 1) {
} $eventHandler = xoops_getmodulehandler('event', 'extcal'); $eventHandler->deleteEvent($_POST['event_id']); redirect_header("event.php", 3, _AM_EXTCAL_EVENT_DELETED, false); } else { xoops_cp_header(); adminMenu(3); $hiddens = array('event_id' => $_GET['event_id'], 'form_delete' => '', 'confirm' => 1); xoops_confirm($hiddens, 'event.php?op=delete', _AM_EXTCAL_CONFIRM_DELETE_EVENT, _DELETE, 'event.php'); xoops_cp_footer(); } break; case 'default': default: xoops_cp_header(); adminMenu(3); $eventHandler = xoops_getmodulehandler('event', 'extcal'); $events = $eventHandler->objectToArray($eventHandler->getNewEvent(10, 0, true), array('cat_id')); $eventHandler->formatEventsDate($events, 'd/m/Y'); echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _AM_EXTCAL_APPROVED_EVENT . '</legend>'; echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _AM_EXTCAL_INFORMATION . '</legend>'; echo '<img src="../images/edit.gif" style="vertical-align:middle;" /> ' . _AM_EXTCAL_INFO_EDIT . '<br />'; echo '<img src="../images/delete.gif" style="vertical-align:middle;" /> ' . _AM_EXTCAL_INFO_DELETE; echo '</fieldset><br />'; echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _MD_EXTCAL_SUBMITED_EVENT . '</legend>'; echo '<table class="outer" style="width:100%;">'; echo '<tr style="text-align:center;">'; echo '<th>#</th>'; echo '<th>' . _AM_EXTCAL_CATEGORY . '</th>'; echo '<th>' . _AM_EXTCAL_TITLE . '</th>'; echo '<th>' . _AM_EXTCAL_START_DATE . '</th>';
$profile->setVar('baby_photo', $baby_photo); } if (file_exists(XOOPS_ROOT_PATH . $midlife_photo)) { $profile->setVar('midlife_photo', $midlife_photo); } if (file_exists(XOOPS_ROOT_PATH . $elderly_photo)) { $profile->setVar('elderly_photo', $elderly_photo); } if (file_exists(XOOPS_ROOT_PATH . $current_photo)) { $profile->setVar('current_photo', $current_photo); } if ($profileshandler->insert($profile, true)) { redirect_header('index.php?op=profiles&id=' . $profile->getVar('member_id'), 3, 'Profile Item Updated Successfully'); } else { redirect_header('index.php?op=profiles&id=' . $profile->getVar('member_id'), 3, 'Profile Item Updated Unsuccessfully'); } } else { redirect_header('index.php', 3, 'Profile Item Updated Unsuccessfully'); } exit; break; } break; default: adminMenu(0); sel_categories_form(); sel_sibblings_form(); sel_members_form(); } footer_adminMenu(); xoops_cp_footer();
exit; break; case "listmods": xoops_cp_header(); adminMenu(3); import_spidersmods_list(); footer_adminMenu(); echo chronolabs_inline(false); xoops_cp_footer(); exit; break; default: case "list": xoops_cp_header(); adminMenu(1); import_spiders_list(); footer_adminMenu(); echo chronolabs_inline(false); xoops_cp_footer(); exit; break; case "import": xoops_cp_header(); adminMenu(4); compair_spiders_form(); import_spiders_form(); footer_adminMenu(); echo chronolabs_inline(false); xoops_cp_footer(); exit; }
xoops_confirm($hiddens, 'cat.php?op=modify', _AM_EXTCAL_CONFIRM_DELETE_CAT, _DELETE, 'cat.php'); xoops_cp_footer(); } else { if (isset($_POST['confirm']) && $_POST['confirm'] == 1) { $catHandler = xoops_getmodulehandler('cat', 'extcal'); $catHandler->deleteCat($_POST['cat_id']); redirect_header("cat.php", 3, _AM_EXTCAL_CAT_DELETED, false); } } } } break; case 'default': default: xoops_cp_header(); adminMenu(2); $catHandler = xoops_getmodulehandler('cat', 'extcal'); $cats = $catHandler->getAllCat($xoopsUser, 'all'); echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _AM_EXTCAL_EDIT_OR_DELETE_CATEGORY . '</legend>'; $form = new XoopsThemeForm(_AM_EXTCAL_EDIT_OR_DELETE_CATEGORY, 'mod_cat', 'cat.php?op=modify', 'post', true); $catSelect = new XoopsFormSelect(_AM_EXTCAL_CATEGORY, 'cat_id'); foreach ($cats as $cat) { $catSelect->addOption($cat->getVar('cat_id'), $cat->getVar('cat_name')); } $form->addElement($catSelect, true); $button = new XoopsFormElementTray(''); $button->addElement(new XoopsFormButton("", "form_modify", _EDIT, "submit"), false); $button->addElement(new XoopsFormButton("", "form_delete", _DELETE, "submit"), false); $form->addElement($button, false); $form->display(); echo '</fieldset><br />';
if( ! empty( $_POST['submit'] ) ) { if ( ! $xoopsGTicket->check() ) { redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors()); } include( "mygroupperm.php" ) ; redirect_header( XOOPS_URL."/modules/".$xoopsModule->dirname()."/admin/myblocksadmin.php$query4redirect" , 1 , _MD_AM_DBUPDATED ); } xoops_cp_header() ; //adminMenu(4, _AM_XWORDS_BLOCKS); $MYDIRNAME = strtoupper(basename( dirname( dirname( __FILE__ ) ) )); adminMenu(4, constant("_AM_{$MYDIRNAME}_BLOCKS")); if( file_exists( './mymenu.php' ) ) include( './mymenu.php' ) ; //echo "<h3 style='text-align:left;'>$target_mname</h3>\n" ; if( ! empty( $block_arr ) ) { // echo "<h4 style='text-align:left;'>"._AM_BADMIN."</h4>\n" ; echo "\n<fieldset style='margin:1em 0em 0em 0em;border:1px solid #778;'><legend style='font-weight: bold; color: #900;'>"._AM_BADMIN."</legend><br />\n" ; list_blocks() ; echo "</fieldset><br />\n" ; } list_groups() ; xoops_cp_footer() ;
<?php include '../../../include/cp_header.php'; include '../../../class/xoopsformloader.php'; include 'function.php'; function extgalleryLastVersion() { return @file_get_contents("http://www.zoullou.net/extcal.version"); } function isUpToDate() { $version = extgalleryLastVersion(); return $GLOBALS['xoopsModule']->getVar('version') >= $version; } xoops_cp_header(); adminMenu(1); $catHandler = xoops_getmodulehandler('cat', 'extcal'); $eventHandler = xoops_getmodulehandler('event', 'extcal'); echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _AM_EXTCAL_MODULE_ADMIN_SUMMARY . '</legend>'; echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _AM_EXTCAL_UPDATE_INFO . '</legend>'; if (!extgalleryLastVersion()) { echo "<span style=\"color:black; font-weight:bold;\">" . _AM_EXTCAL_CHECK_UPDATE_ERROR . "</span>"; } else { if (!isUpToDate()) { echo "<h3 style=\"color:red;\">" . _AM_EXTCAL_UPDATE_KO . "</h3>"; } else { echo "<span style=\"color:green;\">" . _AM_EXTCAL_UPDATE_OK . "</span>"; } } echo '</fieldset>'; echo '<br />';
function entryz() { include_once( XOOPS_ROOT_PATH . '/class/pagenav.php' ); global $cat_table,$ent_table,$xoopsConfig,$xoopsModuleConfig,$xoopsModule,$MYDIRNAME; $xoopsDB =& Database::getInstance(); $myts =& MyTextSanitizer::getInstance(); $startsub = !empty( $_GET['startsub'] ) ? intval( $_GET['startsub'] ) : 0; $entryID = !empty( $_GET['entryID'] ) ? intval($_GET['entryID']) : 0; xoops_cp_header(); adminMenu(0, constant("_AM_{$MYDIRNAME}_AUTHORIZE")); include('./mymenu.php'); /* -- Code to show submitted entries -- */ echo "<fieldset style='margin:1em 0em 0em 0em;border:1px solid #778;'><legend style='font-weight: bold; color: #900;'>" . constant("_AM_{$MYDIRNAME}_SHOWSUBMISSIONS") . "</legend><br />"; echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'>"; echo "<tr>"; echo "<td width='40' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ENTRYID") . "</b></td>"; if ($xoopsModuleConfig['multicats'] == 1) { echo "<td width='20%' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ENTRYCATNAME") . "</b></td>"; $colspan = 6; } else { $colspan = 5; } echo "<td class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ENTRYTERM") . "</b></td>"; echo "<td width='90' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_SUBMITTER") . "</b></td>"; echo "<td width='90' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ENTRYCREATED") . "</b></td>"; echo "<td width='60' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ACTION") . "</b></td>"; echo "</tr>"; $resultS1 = $xoopsDB -> query("SELECT COUNT(*) FROM $ent_table WHERE submit = '1'"); list( $numrows ) = $xoopsDB -> fetchRow( $resultS1 ); if ( $numrows > 0 ) // That is, if there ARE submitted entries in the system { $sql = "SELECT e.entryID, e.categoryID, e.term, e.uid, e.datesub, c.name FROM $ent_table e LEFT JOIN $cat_table c ON e.categoryID = c.categoryID WHERE submit = '1' ORDER BY datesub DESC"; $resultS2 = $xoopsDB -> query( $sql, $xoopsModuleConfig['perpage'], $startsub ); while ( list( $entryID, $categoryID, $term, $uid, $created, $name ) = $xoopsDB -> fetchrow( $resultS2 ) ) { $sentby = xoops_getLinkedUnameFromId(intval($uid)); $entryID = intval($entryID); $categoryID = intval($categoryID); $catname = $myts -> htmlSpecialChars( $name ); $term = $myts -> htmlSpecialChars( $term ); $created = formatTimestamp( $created, 's' ); $modify = "<a href='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/admin/submissions.php?op=mod&entryID=" . $entryID . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/edit.gif' border='0' width='20' height='20' alt='".constant("_AM_{$MYDIRNAME}_EDITSUBM")."' /></a>"; $delete = "<a href='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/admin/submissions.php?op=del&entryID=" . $entryID . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/delete.gif' border='0' width='20' height='20' alt='".constant("_AM_{$MYDIRNAME}_DELETESUBM")."' /></a>"; echo "<tr>"; echo "<td class='head' align='center'> $entryID </td>"; if ($xoopsModuleConfig['multicats'] == 1) { echo "<td class='even' align='left'> $catname </td>"; } echo "<td class='even' align='left'> $term </td>"; echo "<td class='even' align='center'> $sentby </td>"; echo "<td class='even' align='center'> $created </td>"; echo "<td class='even' align='center'> $modify $delete </td>"; echo "</tr>"; } } else // that is, $numrows = 0, therez no columns yet { echo "<tr>"; echo "<td class='head' align='center' colspan='".$colspan."'>".constant("_AM_{$MYDIRNAME}_NOSUBMISSYET")."</td>"; echo "</tr>"; } echo "</table>"; $pagenav = new XoopsPageNav( $numrows, $xoopsModuleConfig['perpage'], $startsub, 'startsub', 'entryID =' . $entryID ); echo "<div style='text-align:right;'>" . $pagenav -> renderNav() . "</div>"; echo "</fieldset>"; echo "<br />"; /* -- Code to show requested entries -- */ echo "<fieldset style='margin:1em 0em 0em 0em;border:1px solid #778;'><legend style='font-weight: bold; color: #900;'>" . constant("_AM_{$MYDIRNAME}_SHOWREQUESTS") . "</legend><br />"; echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'>"; echo "<tr>"; echo "<td width='40' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ENTRYID") . "</b></td>"; echo "<td class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ENTRYTERM") . "</b></td>"; echo "<td width='90' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_SUBMITTER") . "</b></td>"; echo "<td width='90' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ENTRYCREATED") . "</b></td>"; echo "<td width='60' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ACTION") . "</b></td>"; echo "</tr>"; $resultS2 = $xoopsDB -> query( "SELECT COUNT(*) FROM $ent_table WHERE request = '1'" ); list( $numrowsX ) = $xoopsDB -> fetchRow( $resultS2 ); if ( $numrowsX > 0 ) // That is, if there ARE unauthorized articles in the system { $sql4 = "SELECT entryID, term, uid, datesub FROM $ent_table WHERE request = '1' ORDER BY datesub DESC"; $resultS4 = $xoopsDB -> query( $sql4, $xoopsModuleConfig['perpage'], $startsub ); while ( list( $entryID, $term, $uid, $created) = $xoopsDB -> fetchrow( $resultS4 ) ) { $sentby = xoops_getLinkedUnameFromId(intval($uid)); $entryID = intval($entryID); $term = $myts -> htmlSpecialChars( $term ); $created = formatTimestamp( $created, 's' ); $modify = "<a href='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/admin/submissions.php?op=mod&entryID=" . $entryID . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/edit.gif' border='0' width='20' height='20' alt='".constant("_AM_{$MYDIRNAME}_EDITSUBM")."' /></a>"; $delete = "<a href='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/admin/submissions.php?op=del&entryID=" . $entryID . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/delete.gif' border='0' width='20' height='20' alt='".constant("_AM_{$MYDIRNAME}_DELETESUBM")."' /></a>"; echo "<tr>"; echo "<td class='head' align='center'> $entryID </td>"; echo "<td class='even' align='left'> $term </td>"; echo "<td class='even' align='center'> $sentby </td>"; echo "<td class='even' align='center'> $created </td>"; echo "<td class='even' align='center'> $modify $delete </td>"; echo "</tr>"; } } else // that is, $numrows = 0, therez no columns yet { echo "<tr>"; echo "<td class='head' align='center' colspan='5'>".constant("_AM_{$MYDIRNAME}_NOREQSYET")."</td>"; echo "</tr>"; } echo "</table>"; $pagenav = new XoopsPageNav( $numrows, $xoopsModuleConfig['perpage'], $startsub, 'startsub', 'entryID =' . $entryID ); echo "<div style='text-align:right;'>" . $pagenav -> renderNav() . "</div>"; echo "</fieldset>"; echo "<br />"; xoops_cp_footer(); }
function entryDelete($entryID = '') { global $cat_table,$ent_table,$xoopsConfig,$xoopsModuleConfig,$xoopsModule,$xoopsGTicket,$MYDIRNAME; $xoopsDB =& Database::getInstance(); $myts =& MyTextSanitizer::getInstance(); $entryID = !empty( $_GET['entryID'] ) ? intval($_GET['entryID']) : ''; $result = $xoopsDB -> query( "SELECT entryID, term FROM $ent_table WHERE entryID = '$entryID'" ); if ( !$xoopsDB -> getRowsNum( $result ) ) { redirect_header( "index.php", 2, constant("_AM_{$MYDIRNAME}_NOENTRY") ); } list( $entryID, $term ) = $xoopsDB -> fetchrow( $result ); xoops_cp_header(); adminMenu(0, constant("_AM_{$MYDIRNAME}_ENTRIES")." » ".constant("_AM_{$MYDIRNAME}_DELETE")); include('./mymenu.php'); echo "<br />\n"; $term = $myts -> htmlSpecialChars($term); xoops_confirm(array('op' => 'delentry', 'entryID' => $entryID, 'ok' => 1, 'term' => $term ) + $xoopsGTicket->getTicketArray( __LINE__ ), 'entry.php', constant("_AM_{$MYDIRNAME}_DELETETHISENTRY") . "<br /><br />" . $term, constant("_AM_{$MYDIRNAME}_DELETE") ); xoops_cp_footer(); }