/** * The function showBooks seems to be the main "Books" screen on admin side of Joomla **/ static function showBooks($option, $rows_book, &$clist, &$lendlist, &$userlist, &$publist, &$search, &$pageNav, &$sort_arr, $search_for_list, $order_let) { global $my, $mosConfig_live_site, $session; global $mainframe, $templateDir, $doc; // for J 1.6 $doc->addScript($mosConfig_live_site . '/components/com_booklibrary/includes/functions.js'); $doc->addStyleSheet($mosConfig_live_site . '/components/com_booklibrary/includes/booklibrary.css'); $html = "<div class='book_manager_caption' ><img src='./components/com_booklibrary/images/cfg.png' alt ='Config' />" . _BOOKLIBRARY_SHOW . "</div>"; $app = JFactory::getApplication(); $app->JComponentTitle = $html; $script_content = ''; // for J 1.6 $script_content .= "function before_print_check() \n"; $script_content .= " { \n"; $script_content .= " var add = document.getElementsByName('bid[]'); \n"; $script_content .= " var count=0; \n"; $script_content .= " for(var i=0;i<add.length;i++) \n"; $script_content .= " { \n"; $script_content .= " if(add[i].checked) \n"; $script_content .= " { \n"; $script_content .= " count++; \n"; $script_content .= " break; \n"; $script_content .= " } \n"; $script_content .= " } \n"; $script_content .= " if(count == 0) \n"; $script_content .= " {\n"; $script_content .= " alert('Please choose some books'); \n"; $script_content .= " exit; \n"; $script_content .= " } \n"; $script_content .= " else \n"; $script_content .= " {\n"; $script_content .= " document.adminForm.target = '_blank' ; \n"; $script_content .= " document.adminForm.task.value='print_books'; \n"; $script_content .= " document.adminForm.submit(); \n"; $script_content .= " }\n"; $script_content .= "}\n"; $doc->addScriptDeclaration($script_content); ?> <form id="adminForm" action="index.php" method="post" name="adminForm" class="bl_admin_books"> <table class="admin10" cellpadding="4" cellspacing="0" border="0" width="100%"> <tr> <!--<td width="30%"> <img src="./components/com_booklibrary/images/cfg.png" align="right" alt="Config" /> </td>--> <?php if (version_compare(JVERSION, "3.0.0", "ge")) { ?> <table class="admin11" width="100%"> <tr> <td> <div class="btn-group pull-right hidden-phone"> <label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC'); ?> </label> <?php echo $pageNav->getLimitBox(); ?> </div> </td> </tr> </table> <?php } ?> <td width="68%" class="book_manager_caption" valign='bottom' ></td> <!--******** begin add for button print in Manager Books *******************--> <!--****** end add for button print in Manager Books *******************--> </tr> </table> <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist my_table bl_admin_books_top_table_with_search_ans_orders"> <!-- added search by field back - 20150818 - Ralph deGennaro --> <tr> <td><label><?php echo _BOOKLIBRARY_SHOW_SEARCH; ?> </label></td> <td> <input type="text" name="search" value="<?php echo $search; ?> " class="inputbox" /> </td> <td> <label><?php echo _BOOKLIBRARY_SHOW_SEARCH_FOR; ?> </label> </td> <td> <?php echo $search_for_list; ?> <input class="my_btn" type="submit" name="go" value="<?php echo _BOOKLIBRARY_SHOW_SEARCH_GO; ?> " > </td> </tr> <tr> <td><?php echo $publist; ?> </td> <td><?php echo $lendlist; ?> </td> <td><?php echo $userlist; ?> </td> <td><?php echo $clist; ?> </td> </tr> </table> <?php /* if(version_compare(JVERSION, '3.0', 'lt')) echo 'onClick="checkAll('.count( $rows_book ).');"'; else echo 'onClick="Joomla.checkAll(this);"'; */ ?> <table cellpadding="4" cellspacing="0" border="0" width="100%" class="my_table my_table-bordered my_table-hover adminlist bl_admin_books_main_table"> <tr> <th width="4%"> <input type="checkbox" name="toggle" value="" onClick="Joomla.checkAll(this);" /> </th> <th width="4%">id</th> <th width="8%" align = "center" class="title" nowrap="nowrap"> <?php echo _BOOKLIBRARY_LABEL_BOOKID; ?> </th> <th width="12%" align = "center" class="title" nowrap="nowrap"> <?php echo HTML_booklibrary::sort_head(_BOOKLIBRARY_LABEL_ISBN, 'isbn', $sort_arr); ?> </th> <!-- added dewey decimal code - 20150818 - Ralph deGennaro --> <th width="12%" align = "center" class="title" nowrap="nowrap"> <?php echo HTML_booklibrary::sort_head(_BOOKLIBRARY_LABEL_DDCCODE, 'ddccode', $sort_arr); ?> </th> <th width="12%" align = "center" class="title" nowrap="nowrap"> <?php echo HTML_booklibrary::sort_head(_BOOKLIBRARY_LABEL_TITLE, 'title', $sort_arr); ?> </th> <!--<th align = "center" class="title" width="5%" nowrap="nowrap" colspan="2"> <?php echo _BOOKLIBRARY_LABEL_LINE; ?> </th>--> <!-- don't need informationFrom - 20150820 - Ralph deGennaro --> <!-- <th width="12%" align = "center" class="title" nowrap="nowrap"> <?php echo _BOOKLIBRARY_LABEL_FETCH_INFO; ?> </th> --> <th width="12%" align = "center" class="title" nowrap="nowrap"> <?php echo HTML_booklibrary::sort_head(_BOOKLIBRARY_LABEL_CATEGORY, 'category', $sort_arr); ?> </th> <th width="8%" align = "center" class="title" nowrap="nowrap"> <?php echo HTML_booklibrary::sort_head_let($order_let); ?> </th> <th width="8%" align = "center" class="title" nowrap="nowrap"> <?php echo _BOOKLIBRARY_LABEL_HITS; ?> </th> <!-- don't need user - 20150820 - Ralph deGennaro --> <!-- <th width="12%" align = "center" class="title" nowrap="nowrap"> <?php echo _BOOKLIBRARY_LABEL_TYPE_USER; ?> </th> --> <th width="8%" align = "center" class="title" nowrap="nowrap"> <?php echo _BOOKLIBRARY_LABEL_PUBLIC; ?> </th> <th width="8%" align = "center" class="title" nowrap="nowrap"> <?php echo _BOOKLIBRARY_LABEL_APPROVED; ?> </th> <!-- add two columns for lendee info - 20150820 - Ralph deGennaro --> <th width="12%" align = "center" class="title" nowrap="nowrap"> <?php echo _BOOKLIBRARY_LABEL_LENDEECODE; ?> </th> <th width="12%" align = "center" class="title" nowrap="nowrap"> <?php echo _BOOKLIBRARY_LABEL_LENDEEFULLNAME; ?> </th> </tr> <?php for ($i = 0, $n = count($rows_book); $i < $n; $i++) { $row = $rows_book[$i]; ?> <tr class="row<?php echo $i % 2; ?> "> <td align="left"> <?php if ($row->checked_out && $row->checked_out != $my->id) { ?> <?php } else { echo mosHTML::idBox($i, $row->id, $row->checked_out && $row->checked_out != $my->id, 'bid'); } ?> </td> <td align = "center" ><?php echo $row->id; ?> </td> <td align = "center"><?php echo $row->bookid; ?> </td> <td align="center"> <a href="#edit" onClick="return listItemTask('cb<?php echo $i; ?> ','edit')"> <?php echo $row->isbn; ?> </a> </td> <!-- added dewey decimal code - 20150818 - Ralph deGennaro --> <td align="center"> <a href="#edit" onClick="return listItemTask('cb<?php echo $i; ?> ','edit')"> <?php echo $row->ddccode; ?> </a> </td> <td align="left"> <a href="#edit" onClick="return listItemTask('cb<?php echo $i; ?> ','edit')"> <?php echo $row->title; ?> </a> </td> <!-- don't need informationFrom - 20150820 - Ralph deGennaro --> <!-- <td align="center"> <?php echo mosBooklibraryWS::getWsNameById($row->informationFrom); ?> </td> --> <td align = "center"><?php echo $row->category; ?> </td> <td align = "center" style="text-align:center;"> <?php if ($row->lend_from == null) { ?> <a class="my_btn my_btn-success" href="javascript: void(0);" onClick="return listItemTask('cb<?php echo $i; ?> ','lend')"> <img style="vertical-align:middle;" src="<?php echo $mosConfig_live_site; ?> /components/com_booklibrary/images/next.png"/> </a> <?php } else { ?> <a class="my_btn my_btn-warning" href="javascript: void(0);" onClick="return listItemTask('cb<?php echo $i; ?> ','lend_return')"> <img style="vertical-align:middle;" src="<?php echo $mosConfig_live_site; ?> /components/com_booklibrary/images/back.png"/> </a> <?php } ?> </td> <td align = "center"><?php echo $row->hits; ?> </td> <?php //print_r($row);exit; ?> <!-- don't need user - 20150820 - Ralph deGennaro --> <!-- <td align="center"><?php echo $row->owner_name; ?> </td> --> <?php $task = $row->published ? 'unpublish' : 'publish'; $alt = $row->published ? 'Unpublish' : 'Publish'; $img = $row->published ? 'ok.png' : 'remove.png'; $task1 = $row->approved ? 'unapprove' : 'approve'; $alt1 = $row->approved ? 'Unapproved' : 'Approved'; $img1 = $row->approved ? 'ok.png' : 'remove.png'; ?> <td align="center"> <a href="javascript: void(0);" onClick="return listItemTask('cb<?php echo $i; ?> ','<?php echo $task; ?> ')"> <?php if (version_compare(JVERSION, "1.6.0", "lt")) { ?> <img src="<?php echo $mosConfig_live_site . "/components/com_booklibrary/images/" . $img; ?> " border="0" alt="<?php echo $alt; ?> " /> <?php } else { ?> <img src="<?php echo $mosConfig_live_site . "/components/com_booklibrary/images/" . $img; ?> " border="0" alt="<?php echo $alt; ?> " /> <?php } ?> </a> </td> <td align="center"> <a href="javascript: void(0);" onClick="return listItemTask('cb<?php echo $i; ?> ','<?php echo $task1; ?> ')"> <?php if (version_compare(JVERSION, "1.6.0", "lt")) { ?> <img src="<?php echo $mosConfig_live_site . "/components/com_booklibrary/images/" . $img1; ?> " border="0" alt="<?php echo $alt1; ?> " /> <?php } else { ?> <img src="<?php echo $mosConfig_live_site . "/components/com_booklibrary/images/" . $img1; ?> " border="0" alt="<?php echo $alt1; ?> " /> <?php } ?> </td> <!-- add two columns for lendee info - 20150820 - Ralph deGennaro --> <td align = "center"><?php echo $row->lendeecode; ?> </td> <td align = "center"><?php echo $row->lendeefullname; ?> </td> </tr> <?php } //end for ?> <tr class="for_paginator"> <td colspan = "14"><?php echo $pageNav->getListFooter(); ?> </td> </tr> </table> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> </form> <?php }
?> "> <?php echo _BOOKLIBRARY_LABEL_FETCHED_SUBCATEGORIES . " : " . $params->get('category_name'); ?> </div> <?php positions_bl($params->get('singlecategory08')); ?> <?php HTML_booklibrary::listCategories($params, $categories, $catid, $tabclass, $currentcat); echo '<table class="basictable bl_bl_single_category_intresting_back_button" width="100%"><tr><td width="60%"></td><td>'; mosHTML::BackButton($params, $hide_js); echo '</td></tr></table>'; } positions_bl($params->get('singlecategory09')); ?> <!-- Add item Begin --> <?php //print_r($params->get('show_addbook'));exit; // Add item end --> $option = JRequest::getVar('option', 'com_booklibrary'); if ($params->get('show_input_add_suggest') && $option == 'com_booklibrary') { HTML_booklibrary::showSuggestion($params, 2, $catid, $Itemid); } positions_bl($params->get('singlecategory11')); ?> <div style="text-align: center;"><a href="http://ordasoft.com" style="font-size: 10px;">Powered by OrdaSoft!</a></div>
function editLanguageManager($section = '', $uid = 0) { global $database, $my, $acl, $booklibrary_configuration; global $mosConfig_absolute_path, $mosConfig_live_site; $row = new mosBooklibrary_language($database); // for 1.6 // load the row from the db table $row->load($uid); $query = "SELECT * FROM #__booklibrary_const WHERE id = " . $row->fk_constid; $database->setQuery($query); $const = $database->loadObject(); $lists['const'] = $const->const; $lists['sys_type'] = $const->sys_type; $query = "SELECT title FROM #__booklibrary_languages WHERE id = " . $row->fk_languagesid; $database->setQuery($query); $language = $database->loadResult(); $lists['languages'] = $language; HTML_booklibrary::editLanguageManager($row, $lists); }
static function rent_history($option) { global $database, $my, $Itemid, $booklibrary_configuration, $mainframe, $mosConfig_list_limit; PHP_booklibrary::addTitleAndMetaTags(); // $menu = new mosMenu($database); // $menu->load( $Itemid ); // $params = new mosParameters( $menu->params ); if (version_compare(JVERSION, '3.0', 'lt')) { $menu = new JTableMenu($database); // for 1.6 $menu->load($Itemid); $params = new mosParameters($menu->params); } else { $menu = new JTableMenu($database); $menu->load($Itemid); $params = new JRegistry(); $params->loadString($menu->params); } $database->setQuery("SELECT id FROM #__menu WHERE link='index.php?option=com_booklibrary'"); if ($database->loadResult() != $Itemid) { $params->def('wrongitemid', '1'); } if ($my->email == null) { echo "\n <script type=\"text/JavaScript\" language = \"JavaScript\">\n alert('You cannot view My Books that were not authorizated!');\n window.history.go(-1);\n </script>"; exit; } $limit = $booklibrary_configuration['page']['items']; $limitstart = mosGetParam($_REQUEST, 'limitstart', 0); $database->setQuery("SELECT count(*) FROM #__booklibrary_lend AS l" . "\nLEFT JOIN #__booklibrary AS a ON a.id = l. fk_bookid" . "\nWHERE l.fk_userid = '{$my->id}'"); $total = $database->loadResult(); echo $database->getErrorMsg(); $pageNav = new JPagination($total, $limitstart, $limit); // for J 1.6 $query = "SELECT l.*,a.* FROM #__booklibrary_lend AS l" . "\nLEFT JOIN #__booklibrary AS a ON a.id = l. fk_bookid " . "\nWHERE l.fk_userid = '" . $my->id . "' LIMIT {$pageNav->limitstart},{$pageNav->limit};"; $database->setQuery($query); $books = $database->loadObjectList(); HTML_booklibrary::showRentHistory($option, $books, $pageNav, $params); }
static function showInsertSubCategory($id, $cat_all, $params, $tabclass, $Itemid, $deep) { global $g_item_count, $booklibrary_configuration, $mosConfig_live_site; $deep++; for ($i = 0; $i < count($cat_all); $i++) { if ($id == $cat_all[$i]->parent_id && $cat_all[$i]->display == 1) { $g_item_count++; $link = 'index.php?option=com_booklibrary&task=showCategory&catid=' . $cat_all[$i]->id . '&Itemid=' . $Itemid; ?> <table class="basictable bl_bl_all_categories_list_categories_in_table" width="100%" border="0" cellspacing="0" cellpadding="0"> <tr class="<?php echo $tabclass[$g_item_count % 2]; ?> "> <td width="1%" style="vertical-align:text-top;"> <?php if ($deep != 1) { $jj = $deep; while ($jj--) { echo " "; } echo " "; //|_"; ?> <img class="arrow_symbol" src="./components/com_booklibrary/images/arrow.png"/> <?php } ?> </td> <td width="9%"> <?php if ($params->get('show_cat_pic') && $cat_all[$i]->image != "") { ?> <img src="./images/stories/<?php echo $cat_all[$i]->image; ?> " alt="picture for subcategory" height="48" width="48" /> <?php } else { ?> <img src="<?php echo $mosConfig_live_site; ?> /components/com_booklibrary/images/folder.png" alt="picture for subcategory" height="48" width="48" /> <?php } ?> </td> <td class="bl_single_category_list_subcategories_link" width="74%"> <a href="<?php echo sefRelToAbs($link); ?> " class="category<?php echo $params->get('pageclass_sfx'); ?> "> <?php echo $cat_all[$i]->title; ?> </a> </td> <td align="left" width="10%" style="text-align:center;"> <?php if ($cat_all[$i]->books == '') { echo "0"; } else { echo $cat_all[$i]->books; } ?> </td> </tr> </table> <?php if ($GLOBALS['subcategory_show']) { HTML_booklibrary::showInsertSubCategory($cat_all[$i]->id, $cat_all, $params, $tabclass, $Itemid, $deep); } } //end if ($id == $cat_all[$i]->parent_id) } //end for(...) }
alt="Search" border="0" /> <?php echo _BOOKLIBRARY_LABEL_SEARCH; ?> </a--> </td> </tr> </table> </div> <?php } ?> <form class="bl_table_list_all_categories" id="adminForm" action="index.php" method="post" name="adminForm"> <?php HTML_booklibrary::listCategories($params, $categories, $catid, $tabclass, $currentcat); positions_bl($params->get('allcategories07')); ?> <table class="basictable bl_bl_all_categories_some_intresting_table_with_button" width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="50%"> </td> <td width="50%"> <?php mosHTML::BackButton($params, $hide_js); ?> </td> </tr> </table> </form>