コード例 #1
0
ファイル: edit.php プロジェクト: Ashleyotero/oldest-old
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");
}
コード例 #2
0
ファイル: dialog.php プロジェクト: Ashleyotero/oldest-old
if ($_GET["page"] == "all_states") {
    $states = get_states();
    ?>
	<div class="wordtour-selectable">
		
		<?php 
    foreach ($states as $code => $name) {
        echo "<a class='ui-selectee' href='{$name}'><strong>{$name}</strong></a>";
    }
    ?>
	</div>	
	
<?php 
}
if ($_GET["page"] == "all_venues") {
    $venues = WT_Venue::all();
    $venueObj = new WT_Venue();
    ?>
	<div class="wordtour-selectable">
		<?php 
    foreach ($venues as $value) {
        $venue = $venueObj->db_out($value);
        $address = array();
        if (!empty($venue["venue_city"])) {
            $address[] = $venue["venue_city"];
        }
        if (!empty($venue["venue_state"])) {
            $address[] = $venue["venue_state"];
        }
        if (!empty($venue["venue_country"])) {
            $address[] = $venue["venue_country"];