예제 #1
0
<?php

global $_wt_options;
if (!current_user_can($_wt_options->options("user_role"))) {
    wp_die(__('Cheatin&#8217; uh?'));
}
# GENERATE LIST
$list = new WT_List();
$list->set_columns('gallery', array('cb' => '<input type="checkbox" />', 'gallery_id-col' => 'ID', 'gallery_name-col' => 'Name', 'gallery_total-col' => 'Total Thumbnails', 'gallery_publish-col' => 'Last Update', 'gallery_event_no-col' => 'Attached To'));
$list->get_results("SELECT SQL_CALC_FOUND_ROWS * FROM " . WORDTOUR_GALLERY . " as g ORDER BY g.gallery_name ASC", $_GET['paged']);
?>
<div class="wrap">
	<h2>Gallery</h2>
</div>

<div style="margin-right:15px;margin-bottom:15px;margin-top:15px;">
	<div class="wordtour-alert wordtour-alert-error" style="margin-left:0px;margin-right:0px;"></div>
		<div class="wordtour-toolbar ui-corner-all" style="margin-left:0px;margin-right:0px;overflow:hidden;">
			<div class="ui-helper-clearfix">
				<div title="Add New Gallery" id="wordtour-button-add"></div>
				<div title="Delete Gallery" id="wordtour-button-delete"></div>
				<div class="navigation tablenav">
					<?php 
if ($list->is_paging()) {
    ?>
						<div class="tablenav-pages">
							<?php 
    $list->render_paging();
    ?>
						</div>
					<?php 
예제 #2
0
{
    $sql = array();
    if (!empty($_GET["artist"])) {
        $sql[] = "track_artist_id = {$_GET['artist']}";
    }
    if (count($sql) > 0) {
        return " WHERE " . implode(" AND ", $sql);
    }
    return "";
}
$dbQuery = array("artists" => WT_Artist::all());
# GENERATE LIST
$list = new WT_List();
$list->set_columns('events', array('cb' => '', 'album_id-col' => 'ID', 'album_title-col' => 'Title', 'album_artist' => 'Artist', 'album_label' => 'Label'));
# GENERATE LIST
$list = new WT_List();
$list->set_columns('events', array('cb' => '', 'track_id-col' => 'ID', 'track_title-col' => 'Title', 'track_albums' => 'Albums', 'track_artist' => 'Artist', 'track_label' => 'Label'));
$list->get_results("SELECT SQL_CALC_FOUND_ROWS * FROM " . WORDTOUR_TRACKS . " as t LEFT JOIN " . WORDTOUR_ARTISTS . " as a ON a.artist_id = t.track_artist_id " . get_query_mode_sql() . " ORDER BY t.track_title ASC", $_GET['paged']);
?>

<div class="wrap">
	<h2>Tracks</h2>
</div>

<form method="get" action="<?php 
echo admin_url("admin.php");
?>
">
	<input type="hidden" name="page" value="<?php 
echo $page;
?>
예제 #3
0
function render_edit_rows_page(&$event_id, &$page)
{
    global $wpdb, $wt_msg;
    $dbQuery = array("all" => "SELECT count(*) FROM " . WORDTOUR_EVENTS . " AS e", "published" => "SELECT count(*) FROM " . WORDTOUR_EVENTS . " AS e  WHERE e.event_published = 1", "upcoming" => "SELECT count(*) FROM " . WORDTOUR_EVENTS . " AS e WHERE e.event_published = 1 AND e.event_start_date >= CURDATE()", "archive" => "SELECT count(*) FROM " . WORDTOUR_EVENTS . " AS e WHERE e.event_published = 1 AND e.event_start_date < CURDATE()", "unpublished" => "SELECT count(*) FROM " . WORDTOUR_EVENTS . " AS e WHERE e.event_published = 0", "artists" => WT_Artist::all(), "tour" => WT_Tour::all(), "status" => get_all_status(), "venues" => WT_Venue::all(), "date" => $wpdb->get_results("SELECT \n\t\t\t\t\t\t\t\t\t\t  DISTINCT YEAR(event_start_date) AS year,\n\t\t\t\t\t\t\t\t\t\t  MONTH(event_start_date) AS month, \n\t\t\t\t\t\t\t\t\t\t  MONTHNAME(event_start_date) AS month_name \n\t\t\t\t\t\t\t\t\t\t  FROM " . WORDTOUR_EVENTS . " WHERE event_published = 1 ORDER BY event_start_date DESC", "ARRAY_A"));
    # GENERATE LIST
    $list = new WT_List();
    $list->set_columns('events', array('event_check' => '', 'event_id' => 'ID', 'event_date' => 'Date', 'event_location' => 'Location', 'event_status' => 'Status', 'artist' => 'Artist', 'artists' => 'Additional Artists', 'tour' => 'Tour', 'extra_info' => '&nbsp;'));
    $list->get_results("SELECT SQL_CALC_FOUND_ROWS * \n\t\tFROM " . WORDTOUR_EVENTS . " AS e LEFT JOIN " . WORDTOUR_VENUES . " AS v \n\t\tON e.event_venue_id = v.venue_id \n\t\tLEFT JOIN " . WORDTOUR_EVENTS_META . " AS m \n\t\tON e.event_meta_id = m.meta_id\n\t\tLEFT JOIN " . WORDTOUR_ARTISTS . " AS a\n\t\tON e.event_artist_id = a.artist_id\n\t\tLEFT JOIN " . WORDTOUR_TOUR . " AS t\n\t\tON e.event_tour_id = t.tour_id    \n\t\t " . get_query_mode_sql() . "     \n\t\tORDER BY e.event_start_date DESC,e.id,e.event_is_headline", $_GET['paged']);
    global $_wt_options;
    ?>

<div class="wrap">
	<h2>Events</h2>
</div>

<ul class="subsubsub" style='float:none;'>
	<?php 
    link_query_html("all", "All", admin_url("admin.php?page={$page}"), "event_date", $dbQuery["all"], 0);
    link_query_html("published", "Published", admin_url("admin.php?page={$page}"), "event_date", $dbQuery["published"], 1);
    link_query_html("upcoming", "Upcoming", admin_url("admin.php?page={$page}"), "event_date", $dbQuery["upcoming"], 0);
    link_query_html("archive", "Archive", admin_url("admin.php?page={$page}"), "event_date", $dbQuery["archive"], 0);
    link_query_html("unpublished", "Unpublished", admin_url("admin.php?page={$page}"), "event_date", $dbQuery["unpublished"], 0, 0);
    ?>
</ul>


<form method="get" action="<?php 
    echo admin_url("admin.php?page={$page}");
    ?>
">
	<input type="hidden" name="page" value="<?php 
    echo $page;
    ?>
"></input>
	<input type="hidden" name="event_date" value="<?php 
    echo $_GET["event_date"];
    ?>
"></input>
	<select name="date">
		<option value="">Show All Dates</option>
		<?php 
    foreach ($dbQuery["date"] as $date) {
        echo "<option " . ($date["year"] . $date["month"] == $_GET["date"] ? "selected" : "") . " value=\"" . $date["year"] . $date["month"] . "\">" . $date["month_name"] . " " . $date["year"] . "</option>";
    }
    ?>
	</select>
	<?php 
    echo generate_select_html('', 'venue', array_associate_val_to_key($dbQuery["venues"], "venue_id", "venue_name"), $_GET["venue"], array("value" => "", "text" => "Show All Venues"));
    echo generate_select_html('', 'status', $dbQuery["status"], $_GET["status"], array("value" => "", "text" => "Show All Status"));
    echo generate_select_html('', 'artist', array_associate_val_to_key($dbQuery["artists"], "artist_id", "artist_name"), $_GET["artist"], array("value" => "", "text" => "Show All Artists"));
    echo generate_select_html('', 'tour', array_associate_val_to_key($dbQuery["tour"], "tour_id", "tour_name"), $_GET["tour"], array("value" => "", "text" => "Show All Tour"));
    ?>
 
	<input class="button-secondary" type="submit" value="Filter"/>
</form>		




<div style="margin-right:15px;margin-bottom:15px;margin-top:15px;">
	<div class="wordtour-alert wordtour-alert-error" style="margin-left:0px;margin-right:0px;"></div>
	
	<div class="wordtour-toolbar ui-corner-all" style="margin-left:0px;margin-right:0px;overflow:hidden;">
		<div class="ui-helper-clearfix">
			<div title="Add New Event" id="wordtour-button-add"></div>
			<div title="Delete Event" id="wordtour-button-delete"></div>
			<div class="navigation tablenav">
				<?php 
    if ($list->is_paging()) {
        ?>
					<div class="tablenav-pages">
						<?php 
        $list->render_paging();
        ?>
					</div>
				<?php 
    }
    ?>
			</div>	
		</div>
	</div>
	<?php 
    $list->render("events-list", "event_rows");
}
예제 #4
0
}
global $_wt_options;
$page = getQueryString("page");
$action = getQueryString("action");
$venue_id = getQueryString("venue_id");
if ($action === "new") {
    include 'venue.php';
    exit;
} else {
    if ($action === "edit" && !empty($venue_id)) {
        include 'venue.php';
        exit;
    }
}
# GENERATE LIST
$list = new WT_List();
$list->set_columns('venues', array('cb' => '', 'venue_id-col' => 'ID', 'venue_order-col' => 'Order', 'venue_name-col' => 'Name', 'venue_event_number-col' => 'Number of events', 'venue_address-col' => 'Address', 'venue_city-col' => 'City', 'venue_state-col' => 'State', 'venue_country-col' => 'Country'));
$list->get_results("SELECT SQL_CALC_FOUND_ROWS * FROM " . WORDTOUR_VENUES . " ORDER BY venue_name", $_GET['paged']);
?>

<div class="wrap">
	<h2>Venues</h2>
</div>

<div style="margin-right:15px;margin-bottom:15px;margin-top:15px;">
	<div class="wordtour-alert wordtour-alert-error" style="margin-left:0px;margin-right:0px;"></div>
		<div class="wordtour-toolbar ui-corner-all" style="margin-left:0px;margin-right:0px;overflow:hidden;">
			<div class="ui-helper-clearfix">
				<div title="Add New Venue" id="wordtour-button-add"></div>
				<div title="Delete Venue" id="wordtour-button-delete"></div>
				<div class="navigation tablenav">
예제 #5
0
            case "pending":
                $comment_approved = "0";
                break;
        }
        $query[] = "comment_approved=" . $comment_approved;
    }
}
$total_pending = $wpdb->get_row("SELECT COUNT(*) as total FROM " . WORDTOUR_COMMENTS . " WHERE comment_approved=0", "ARRAY_A");
if ($total_pending) {
    $total_pending = $total_pending["total"];
}
if (count($query)) {
    $query = "WHERE " . implode(" AND ", $query);
}
# GENERATE LIST
$list = new WT_List();
$list->set_columns('comments', array('cb' => '<input type="checkbox" />', 'comment_author' => 'Author', 'comment_content' => 'Content', 'event_id' => 'In Response To'));
$list->get_results("SELECT SQL_CALC_FOUND_ROWS * \n\t\tFROM " . WORDTOUR_COMMENTS . "           \n\t\t{$query} ORDER BY comment_event_id", $_GET['paged']);
?>


<div class="wrap">
	<h2>Edit Comments
		 <?php 
if (isset($title)) {
    ?>
		 <span>
		  <?php 
    echo "on \"{$title}\"";
    ?>
		</span>
예제 #6
0
    wp_die(__('Cheatin&#8217; uh?'));
}
$page = getQueryString("page");
$action = getQueryString("action");
$artist_id = getQueryString("artist_id");
if ($action === "new") {
    include 'artist.php';
    exit;
} else {
    if ($action === "edit" && !empty($artist_id)) {
        include 'artist.php';
        exit;
    }
}
# GENERATE LIST
$list = new WT_List();
$list->set_columns('events', array('cb' => '', 'artist_id-col' => 'ID', 'artist_order-col' => 'Order', 'artist_name-col' => 'Name', 'artist_track-col' => 'Tracks', 'artist_album-col' => 'Albums', 'artist_event_no-col' => 'Events'));
$list->get_results("SELECT SQL_CALC_FOUND_ROWS * FROM " . WORDTOUR_ARTISTS . " as a ORDER BY a.artist_order,a.artist_name ASC", $_GET['paged']);
?>

<div class="wrap">
	<h2>Artists</h2>
</div>

<div style="margin-right:15px;margin-bottom:15px;margin-top:15px;">
	<div class="wordtour-alert wordtour-alert-error" style="margin-left:0px;margin-right:0px;"></div>
		<div class="wordtour-toolbar ui-corner-all" style="margin-left:0px;margin-right:0px;overflow:hidden;">
			<div class="ui-helper-clearfix">
				<div title="Add New Artist" id="wordtour-button-add"></div>
				<div title="Delete Artist" id="wordtour-button-delete"></div>
				<div class="navigation tablenav">
예제 #7
0
    }
}
function get_query_mode_sql()
{
    $sql = array();
    if (!empty($_GET["artist"])) {
        $sql[] = "album_artist_id = {$_GET['artist']}";
    }
    if (count($sql) > 0) {
        return " WHERE " . implode(" AND ", $sql);
    }
    return "";
}
$dbQuery = array("artists" => WT_Artist::all());
# GENERATE LIST
$list = new WT_List();
$list->set_columns('events', array('cb' => '', 'album_id-col' => 'ID', 'album_order-col' => 'Order', 'album_title-col' => 'Title', 'album_artist' => 'Artist', 'album_label' => 'Label'));
$list->get_results("SELECT SQL_CALC_FOUND_ROWS * FROM " . WORDTOUR_ALBUMS . " as al LEFT JOIN " . WORDTOUR_ARTISTS . " as a ON a.artist_id = al.album_artist_id " . get_query_mode_sql() . " ORDER BY al.album_title ASC", $_GET['paged']);
?>

<div class="wrap">
	<h2>Albums</h2>
</div>

<form method="get" action="<?php 
echo admin_url("admin.php");
?>
">
	<input type="hidden" name="page" value="<?php 
echo $page;
?>
예제 #8
0
    wp_die(__('Cheatin&#8217; uh?'));
}
$page = getQueryString("page");
$action = getQueryString("action");
$tour_id = getQueryString("tour_id");
if ($action === "new") {
    include 'tour.php';
    exit;
} else {
    if ($action === "edit" && !empty($tour_id)) {
        include 'tour.php';
        exit;
    }
}
# GENERATE LIST
$list = new WT_List();
$list->set_columns('tour', array('cb' => '', 'tour_id-col' => 'ID', 'tour_order-col' => 'ORDER', 'tour_name-col' => 'Name', 'tour_event_no-col' => 'Number of Events'));
$list->get_results("SELECT SQL_CALC_FOUND_ROWS * FROM " . WORDTOUR_TOUR . " ORDER BY tour_order,tour_name", $_GET['paged']);
?>
<div class="wrap">
	<h2>Tour</h2>
</div>

<div style="margin-right:15px;margin-bottom:15px;margin-top:15px;">
	<div class="wordtour-alert wordtour-alert-error" style="margin-left:0px;margin-right:0px;"></div>
		<div class="wordtour-toolbar ui-corner-all" style="margin-left:0px;margin-right:0px;overflow:hidden;">
			<div class="ui-helper-clearfix">
				<div title="Add New Tour" id="wordtour-button-add"></div>
				<div title="Delete Tour" id="wordtour-button-delete"></div>
				<div class="navigation tablenav">
					<?php