コード例 #1
0
ファイル: default.php プロジェクト: rdegennaro/Check-It
        return (str.indexOf("@") > 1);
    }
    
    function allreordering(){
        if(document.orderForm.direction.value=='asc')
            document.orderForm.direction.value='desc';
        else document.orderForm.direction.value='asc';

        document.orderForm.submit();
    }
</script>
    
    <?php 
if (!isset($_REQUEST['userId']) || $_REQUEST['userId'] == $my->id) {
    if (JRequest::getVar('option') == "com_simplemembership") {
        $user = Jfactory::getuser();
        $db = Jfactory::getDBO();
        $query = "SELECT * FROM #__booklibrary_lend AS b WHERE fk_userid = '{$user->id}'";
        $db->setQuery($query);
        $current_user_rent_history_array = $db->loadObjectList();
        $check_for_show_rent_history = 0;
        $option = 'com_booklibrary';
        if (isset($current_user_rent_history_array)) {
            foreach ($current_user_rent_history_array as $temp) {
                if ($temp->fk_userid == $user->id) {
                    $check_for_show_rent_history = 1;
                }
            }
        }
        if ($booklibrary_configuration['cb_mybook']['show'] == '1' && checkAccessBL($booklibrary_configuration['cb_mybook']['registrationlevel'], 'NORECURSE', userGID_BL($my->id), $acl)) {
            echo " <span class='books_button'><a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=' . $option . '&task=show_my_books&tab=showmybooks&Itemid=' . $Itemid . $username . '&user='******'&is_show_data=1' . '#tabs-2') . "'>" . _BOOKLIBRARY_LABEL_CBBOOKS_TT . "</a></span>";
コード例 #2
0
    static function showRentHistory($option, $rows, $pageNav, $params)
    {
        global $my, $Itemid, $mosConfig_live_site, $mainframe, $booklibrary_configuration;
        $session = JFactory::getSession();
        $acl = JFactory::getACL();
        $arr = $session->get("array", "default");
        $doc = JFactory::getDocument();
        $doc->addStyleSheet($mosConfig_live_site . '/components/com_booklibrary/includes/booklibrary.css');
        $doc->addStyleSheet($mosConfig_live_site . '/components/com_booklibrary/includes/custom.css');
        // for 1.6
        $doc->addStyleSheet($mosConfig_live_site . '/components/com_booklibrary/includes/custom.css');
        if ($option == 'com_booklibrary') {
            $user = Jfactory::getuser();
            $db = Jfactory::getDBO();
            $query = "SELECT * FROM #__booklibrary_lend_request AS b WHERE b.status=0";
            $db->setQuery($query);
            $current_user_rent_request_array = $db->loadObjectList();
            $check_for_show_rent_request = 0;
            if (isset($current_user_rent_request_array)) {
                $check_for_show_rent_request = 1;
            }
            if ($booklibrary_configuration['cb_mybook']['show'] == '1' && checkAccessBL($booklibrary_configuration['cb_mybook']['registrationlevel'], 'NORECURSE', userGID_BL($my->id), $acl)) {
                echo "<span class='books_button'><a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=' . $option . '&task=show_my_books&layout=mybooks') . "'>" . _BOOKLIBRARY_LABEL_CBBOOKS_TT . "</a></span>";
            }
            if ($booklibrary_configuration['cb_edit']['show'] == '1' && checkAccessBL($booklibrary_configuration['cb_mybook']['registrationlevel'], 'NORECURSE', userGID_BL($my->id), $acl)) {
                echo " <span class='books_button'><a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=' . $option . '&task=showmybooks&layout=mybooks') . "'>" . _BOOKLIBRARY_LABEL_CBEDIT . "</a></span>";
            }
            if ($booklibrary_configuration['cb_history']['show']) {
                $params->def('show_history', 1);
                $i = checkAccessBL($booklibrary_configuration['cb_history']['registrationlevel'], 'NORECURSE', userGID_BL($my->id), $acl);
                if ($i) {
                    $params->def('show_history_registrationlevel', 1);
                }
                if ($params->get('show_history')) {
                    if ($params->get('show_history_registrationlevel')) {
                        if ($check_for_show_rent_request != 0) {
                            echo " <span class='books_button'>\n\t\t\t\t\t\t\t\t\t\t<a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=com_booklibrary&task=rent_history_books&name=' . $user->name . '&user='******'&is_show_data=1') . "'>" . _BOOKLIBRARY_MY_LEND_HISTORY . "</a></span>";
                        }
                        //echo "<div style=\" border:1px solid black; padding: 10px; text-align:center; \">you dont have rent_history_lable</div>";
                    }
                }
            }
            if ($booklibrary_configuration['cb_rent']['show']) {
                $params->def('show_rent', 1);
                $i = checkAccessBL($booklibrary_configuration['cb_rent']['registrationlevel'], 'NORECURSE', userGID_BL($my->id), $acl);
                if ($i) {
                    $params->def('show_rent_registrationlevel', 1);
                }
                if ($params->get('show_rent')) {
                    if ($params->get('show_rent_registrationlevel')) {
                        if ($check_for_show_rent_request != 0) {
                            echo " <span class='books_button'><a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=' . $option . '&task=rent_requests_cb_books&is_show_data=1') . "'>" . _BOOKLIBRARY_LEND_REQUESTS . "</a></span>";
                        }
                    }
                }
            }
            ?>
            <style type="text/css">
                .row0 {background-color:#F9F9F9;}
            </style><br/><br/><br/><?php 
        }
        ?>
        <?php 
        //---------------------------------------------------------------------------- view
        //echo " <span class='books_button'><a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=com_booklibrary&task=show_my_books&layout=mybooks') . "'>" . _BOOKLIBRARY_LABEL_CBBOOKS_TT . "</a></span>";
        ?>

        <?php 
        if ($rows) {
            ?>
            <form class="g" action="index.php" method="get" name="adminForm" id="adminForm">
                <table cellpadding="4" cellspacing="0" border="0" width="100%" class="basictable my_table my_table-bordered
                       my_table-hover bl_all_categories_show_my_book_lend_history">
                    <tr>
                        <th align = "center" width="30">#</th>         
                        <th align = "center" class="title" width="5%" nowrap="nowrap"><?php 
            echo _BOOKLIBRARY_LABEL_BOOKID;
            ?>
</th>
                        <th align = "center" class="title" width="40%" nowrap="nowrap"><?php 
            echo _BOOKLIBRARY_LABEL_TITLE;
            ?>
</th>
                        <th align = "center" class="title" width="20%" nowrap="nowrap"><?php 
            echo _BOOKLIBRARY_ORDER_LEND_FROM;
            ?>
</th>
                        <th align = "center" class="title" width="20%" nowrap="nowrap"><?php 
            echo _BOOKLIBRARY_ORDER_LEND_UNTIL;
            ?>
</th>
                        <th align = "center" class="title" width="20%" nowrap="nowrap"><?php 
            echo _BOOKLIBRARY_SHOW_LEND_RETURN;
            ?>
</th>
                    </tr>


                    <?php 
            $numb = 0;
            //echo "<br/><pre>". print_r($rows,true)."</pre>";exit;
            for ($i = 0, $n = count($rows); $i < $n; $i++) {
                $row = $rows[$i];
                $book = $row->id;
                $title = $row->title;
                $numb++;
                ?>
                        <tr>	
                            <td align="center"><?php 
                echo $numb;
                ?>
</td>
                            <td align="center"><?php 
                echo $row->bookid;
                ?>
</td>
                            <td align="center"><?php 
                echo $row->title;
                ?>
</td>
                            <td align="center"><?php 
                echo $row->lend_from;
                ?>
</td>
                            <td align="center"><?php 
                echo $row->lend_until;
                ?>
</td>
                            <td align="center"><?php 
                echo $row->lend_return;
                ?>
</td>
                        </tr>
            <?php 
            }
            ?>

                    <tr class="for_paginator">
                        <td colspan="6" align="center" id="pagenavig">
                            <?php 
            $paginations = $arr;
            if ($paginations && $pageNav->total > $pageNav->limit) {
                echo $pageNav->getPagesLinks();
            }
            ?>
                        </td>
                    </tr>
                </table>
            </form> <?php 
        }
        //else echo "<div style=\"text-align:center;\">HISTORY IS EMPTY</div>"
        ?>
        <?php 
    }