Example #1
0
$thead[] = Table::addTHeadCell('View', false);
$table->addHeader($thead);
$module_query = $mySQL_r->prepare("SELECT `id`, `name`, `city`, `county`, `map` FROM `location` ORDER BY `county` ASC, `city` ASC");
$module_query->execute();
$module_query->bind_result($id, $name, $city, $county, $map);
$module_query->store_result();
while ($module_query->fetch()) {
    $row = array();
    if ($this->accessAdminPage(2) || $this->inGroup(2, true)) {
        $row['select'] = Table::addCell('<input class="locations_check" type="checkbox" value="' . $id . '" name="location[]" />');
    }
    $row[] = Table::addCell($id);
    $row[] = Table::addCell($name, 'i_' . $id);
    $row[] = Table::addCell($city);
    $row[] = Table::addCell($county);
    $row[] = Table::addCell(Form::toggleLink($this, $map, '', '', array('s' => array('i' => 'ok'), 'f' => array('i' => 'remove'))));
    if ($this->accessAdminPage(2)) {
        $row[] = Table::addCell('<a href="/admin/location/edit/' . $id . '"><span class="' . B_ICON . ' ' . B_ICON . '-edit"></span></a>');
    }
    $row[] = Table::addCell('<a href="/location/' . $id . '" target="_blank"><span class="' . B_ICON . ' ' . B_ICON . '-new-window"></span></a>');
    $table->addRow($row);
}
$table->build();
print $table->getTable();
?>
<script type="text/javascript">
$(function() {
	$("#selectAll").click(function(){
		$(".locations_check").prop('checked', this.checked);
		if(this.checked){
			$(".location_need_check").removeClass("disabled");
Example #2
0
        $perms .= substr($perm, 1, 1) == 1 ? 'w' : '-';
        $perms .= ':';
        $perms .= substr($perm, 2, 1) == 1 ? 'r' : '-';
        $perms .= substr($perm, 3, 1) == 1 ? 'w' : '-';
        $perms .= ':';
        $perms .= substr($perm, 4, 1) == 1 ? 'r' : '-';
        $perms .= substr($perm, 5, 1) == 1 ? 'w' : '-';
        $perm = $perms;
        unset($perms);
        $row = array();
        if ($this->accessAdminPage(3) || $this->accessAdminPage(4)) {
            $row['check'] = Table::addCell('<input class="articles_check" type="checkbox" value="' . $id . '" name="article[]" />');
        }
        $row['id'] = Table::addCell($id);
        $row['title'] = Table::addCell($title, 'i_' . $id);
        $row['pub'] = Table::addCell(Form::toggleLink($this, $publish, '', 3, array('s' => array('h' => 'Click to unpublish article.', 'i' => 'eye-open', 'u' => '/action/news/articles_unpublish?a=' . $id, 'c' => 'processData(this.href);return false;'), 'f' => array('h' => 'Click to publish article.', 'i' => 'eye-close', 'u' => '/action/news/article_publish?a=' . $id, 'c' => 'processData(this.href);return false;'))));
        $row['perm'] = Table::addCell('<code>' . $perm . '</code>');
        $row['user'] = Table::addCell($user);
        $row['group'] = Table::addCell($group);
        $row['revs'] = Table::addCell($revs);
        $row['hits'] = Table::addCell($hits);
        if ($this->accessAdminPage(2)) {
            $row['Edit'] = Table::addCell('<a href="article_edit/' . $id . '"><span class="' . B_ICON . ' ' . B_ICON . '-edit"></span></a>');
        }
        if ($this->accessAdminPage(4)) {
            $row['preview'] = Table::addCell('<a href="article_preview/' . $aid . '" target="_blank" id="aid_' . $id . '"><span class="' . B_ICON . ' ' . B_ICON . '-new-window"></span></a>');
        }
        $articles->addRow($row);
    }
}
$articles->build();
Example #3
0
}
if ($this->accessAdminPage(63)) {
    $thead['delete'] = Table::addTHeadCell('Delete');
}
$menu->addHeader($thead);
$menu_query = $mySQL_r->prepare("SELECT `MID`, `position`, `PID`, `title`, `dropdown`, `divider`\nFROM `core_menu`\nLEFT JOIN `core_pages`\nON `core_pages`.`id`=`PID`\nWHERE `parent`<=>NULL\nORDER BY `position` ASC");
$menu_query->bind_result($MID, $position, $PID, $title, $dropdown, $divider);
$menu_query->execute();
$menu_query->store_result();
$rown = 1;
while ($menu_query->fetch()) {
    $row['pos'] = Table::addCell($position);
    $row['ID'] = Table::addCell($MID);
    $row['page'] = Table::addCell($PID);
    $row['title'] = Table::addCell($title);
    $row['dropdown'] = Table::addCell(Form::toggleLink($this, $dropdown, '', '', array('s' => array('i' => 'ok'), 'f' => array('i' => 'remove'))));
    if ($this->accessAdminPage(42)) {
        if ($rown == 1) {
            $row['up'] = Table::addCell('');
        } else {
            $row['up'] = Table::addCell('<a href="#" onclick="processData(\'/action/core/menu_up/' . $MID . '\')"><span class="' . B_ICON . ' ' . B_ICON . '-chevron-up"></span></a>');
        }
        if ($rown == $menu_query->num_rows) {
            $row['down'] = Table::addCell('');
        } else {
            $row['down'] = Table::addCell('<a href="#" onclick="processData(\'/action/core/menu_down/' . $MID . '\')"><span class="' . B_ICON . ' ' . B_ICON . '-chevron-down"></span></a>');
        }
    }
    if ($this->accessAdminPage(42)) {
        $row['edit'] = Table::addCell('<a href="menu_edit/' . $MID . '/"><span class="' . B_ICON . ' ' . B_ICON . '-edit"></span></a>');
    }
Example #4
0
}
$user_view->addHeader($thead);
$user_query = $mySQL_r->prepare("SELECT `id`, CONCAT(`f_name`, ' ', `s_name`), `username`,`email`,`core_users`.`en`,`act_b`,`name` FROM `core_users` LEFT JOIN `core_groups` ON `core_users`.`p_group`=`core_groups`.`GID`");
$user_query->execute();
$user_query->bind_result($user_id, $name, $username, $email, $enabled, $activated, $group);
$user_query->store_result();
while ($user_query->fetch()) {
    if ($this->accessAdminPage(3) || $this->inGroup(3, true)) {
        $row['select'] = Table::addCell('<input class="users_check" type="checkbox" value="' . $user_id . '" name="user[]" />');
    }
    $row['ID'] = Table::addCell($user_id);
    $row['name'] = Table::addCell($name, 'i_' . $user_id);
    $row['username'] = Table::addCell($username);
    $row['email'] = Table::addCell($email);
    $row['en'] = Table::addCell(Form::toggleLink($this, $enabled, '', 3, array('s' => array('h' => 'Click to disable user.', 'i' => 'ok-sign', 'u' => '/action/user/user_disable?u=' . $user_id, 'c' => 'processData(this.href);return false;'), 'f' => array('h' => 'Click to enable user.', 'i' => 'ban-circle', 'u' => '/action/user/user_enable?u=' . $user_id, 'c' => 'processData(this.href);return false;'))));
    $row['act'] = Table::addCell(Form::toggleLink($this, $activated, '', 3, array('s' => array('i' => 'ok-sign'), 'f' => array('i' => 'ban-circle'))));
    $row['group'] = Table::addCell($group);
    if ($this->accessAdminPage(3)) {
        $row['edit'] = Table::addCell('<a href="user_edit/' . $user_id . '"><span class="' . B_ICON . ' ' . B_ICON . '-edit"></span></a>');
    }
    $user_view->addRow($row);
}
$user_view->build();
print $user_view->getTable();
?>
        <script type="text/javascript">
$(function() {
	$("#selectAll").click(function(){
		$(".users_check").prop('checked', this.checked);
		if(this.checked){
			$(".user_need_check").removeClass("disabled");
Example #5
0
if ($this->accessAdminPage(13)) {
    $thead['Edit'] = Table::addTHeadCell('Edit', false);
}
$group_view->addHeader($thead);
$group_query = $mySQL_r->prepare("\nSELECT `core_groups`.`GID`, `name`, `desc`, COUNT(`PID`), `en`, `type`\nFROM `core_groups`\nLEFT JOIN `core_gpage` ON `core_gpage`.`GID`=`core_groups`.`GID` GROUP BY `core_groups`.`GID`\n");
$group_query->execute();
$group_query->bind_result($GID, $g_name, $desc, $pages, $enabled, $type);
$groups = array();
while ($group_query->fetch()) {
    if ($this->accessAdminPage(13) || $this->inGroup(13, true)) {
        $row['select'] = Table::addCell('<input class="groups_check" type="checkbox" value="' . $GID . '" name="group[]" />');
    }
    $row['ID'] = Table::addCell($GID);
    $row['name'] = Table::addCell($g_name, 'i_' . $GID);
    $row['desc'] = Table::addCell($desc);
    $row['en'] = Table::addCell(Form::toggleLink($this, $enabled, '', 6, array('s' => array('h' => 'Click to disable group.', 'i' => 'ok-sign', 'u' => '/action/user/group_disable?g' . $GID, 'c' => 'processData(this.href);return false;'), 'f' => array('h' => 'Click to enable group.', 'i' => 'ban-circle', 'u' => '/action/user/group_enable?g=' . $GID, 'c' => 'processData(this.href);return false;'))));
    $row['np'] = Table::addCell($pages);
    if ($type == 'p') {
        $row['t'] = Table::addCell('<abbr title="Primary Group">P</abbr>');
    } else {
        $row['t'] = Table::addCell('<abbr title="Secondary Group">S</abbr>');
    }
    if ($this->accessAdminPage(13)) {
        $row['edit'] = Table::addCell('<a href="group_edit/' . $GID . '"><span class="' . B_ICON . ' ' . B_ICON . '-edit"></span></a>');
    }
    $group_view->addRow($row);
}
$group_view->build();
print $group_view->getTable();
?>
        <script type="text/javascript">
Example #6
0
if ($user->accessPage(53)) {
    print '            <th></th>' . PHP_EOL;
}
?>
          </thead>
          <tbody>
<?php 
$event_query = $mySQL['r']->prepare("SELECT `ID`,`title`,`location`,`starts`,`ends`,`enable` FROM `news_events` ORDER BY `ID`");
$event_query->execute();
$event_query->bind_result($ID, $title, $location, $starts, $ends, $enabled);
$event_query->store_result();
while ($event_query->fetch()) {
    print '            <tr>' . PHP_EOL;
    print '              <td>' . $ID . '</td>' . PHP_EOL;
    print '              <td><span class="hidden">' . $enabled . '</span>';
    print Form::toggleLink($enabled, '', 53, array('s' => array('h' => 'Click to unpublish event.', 'i' => 'eye-open', 'u' => '/act/enable?cat=' . $page->getSubCat() . '&mode=event&i=' . $ID . '&m=0"'), 'f' => array('h' => 'Click to publish event.', 'i' => 'eye-close', 'u' => '/act/enable?cat=' . $page->getSubCat() . '&mode=event&i=' . $ID . '&m=1"')));
    print '</td>' . PHP_EOL;
    print '              <td>' . $title . '</td>' . PHP_EOL;
    if (substr($location, 0, 1) == '%' && substr($location, -1, 1) == '%') {
        $loca = new Location($mySQL);
        $loca->getLocation(substr($location, 1, -1));
        print '              <td>' . $loca->name . '</td>' . PHP_EOL;
    } else {
        print '              <td>' . $location . '</td>' . PHP_EOL;
    }
    print '              <td>' . date("d/m/Y H:i", strtotime($starts)) . '</td>' . PHP_EOL;
    print '              <td>' . date("d/m/Y H:i", strtotime($ends)) . '</td>' . PHP_EOL;
    if ($user->accessPage(53)) {
        print '              <td><a href="event_edit?e=' . $ID . '">Edit <span class="' . B_ICON . ' ' . B_ICON . '-pencil"></span></a></td>' . PHP_EOL;
    }
    print '            </tr>' . PHP_EOL;