Esempio n. 1
0
function est_booking_table_filtering()
{
    $screen = get_current_screen();
    global $wp_query;
    if ($screen->post_type == 'booking') {
        $properties = get_property_dropdown_options();
        echo '<select style="width:120px;" name="property_id">';
        echo '<option value="">All Properties</option>';
        foreach ($properties as $value => $name) {
            $selected = (!empty($_GET['property_id']) and $_GET['property_id'] == $value) ? 'selected="selected"' : '';
            echo '<option ' . $selected . ' value="' . $value . '">' . $name . '</option>';
        }
        echo '</select>';
        $arrivals_start = !empty($_GET['arrivals_min']) ? $_GET['arrivals_min'] : '';
        echo '<input type="text" style="width:84px;" placeholder="Arrivals From:" name="arrivals_min" value="' . $arrivals_start . '">';
        $arrivals_end = !empty($_GET['arrivals_max']) ? $_GET['arrivals_max'] : '';
        echo '<input type="text" style="width:84px;" placeholder="Arrivals Until:" name="arrivals_max" value="' . $arrivals_end . '">';
        $departures_start = !empty($_GET['departures_min']) ? $_GET['departures_min'] : '';
        echo '<input type="text" style="width:100px;" placeholder="Departures From:" name="departures_min" value="' . $departures_start . '">';
        $departures_end = !empty($_GET['departures_max']) ? $_GET['departures_max'] : '';
        echo '<input type="text" style="width:100px;" placeholder="Departures Until:" name="departures_max" value="' . $departures_end . '">';
    }
}
    public function options_box_content($post)
    {
        ?>
        	<div id='bshLogo'></div>
        	<div id='optionsContainer'>
        		<div id='menuBackground'></div>

	        	<ul id='bshMenu'>
	        		<li class='active'><?php 
        _e('Booking Details', THEMENAME);
        ?>
</li>
	        		<li><?php 
        _e('Contact Details', THEMENAME);
        ?>
</li>
	        		<li><?php 
        _e('Payment Details', THEMENAME);
        ?>
</li>
	        		<li><?php 
        _e('Help', THEMENAME);
        ?>
</l1>
	        		<li><?php 
        _e('Shortcode Guide', THEMENAME);
        ?>
</l1>
	        		<li><?php 
        _e('Get Support', THEMENAME);
        ?>
</l1>
	        	</ul>
	        	<div id='bshOptions'>
		        	<input id='bshSaveTop' name="save" type="submit" class="button button-primary button-large" id="publish" accesskey="p" value="Update">

	        		<section class='active'>

	        			<div class='option'>
        					<div class='help'>
        						<span class='title'><?php 
        _e('help', THEMENAME);
        ?>
</span>
        						<div class='content'>
        						<?php 
        _e('Specify the number of people staying in your property for this booking', THEMENAME);
        ?>
        						</div>
        					</div>

	        				<label for='_est_guests' class='sectionTitle'><?php 
        _e('Guests', THEMENAME);
        ?>
</label>
	        				<?php 
        $value = get_post_meta($post->ID, '_est_guests', true);
        ?>
		        				<input class='widefat' type='text' id='_est_guests' name='_est_guests' value='<?php 
        echo $value;
        ?>
'>
	        			</div>

	        			<div class='option'>
        					<div class='help'>
        						<span class='title'><?php 
        _e('help', THEMENAME);
        ?>
</span>
        						<div class='content'>
        						<?php 
        _e('Specify the date of arrival for this booking', THEMENAME);
        ?>
        						</div>
        					</div>


	        				<label for='_est_start' class='sectionTitle'><?php 
        _e('Arrival Date', THEMENAME);
        ?>
</label>
	        				<?php 
        $value = get_post_meta($post->ID, '_est_start', true);
        ?>
		        				<input class='widefat' type='text' id='_est_start' name='_est_start' value='<?php 
        echo $value;
        ?>
'>
	        			</div>


	        			<div class='option'>
        					<div class='help'>
        						<span class='title'><?php 
        _e('help', THEMENAME);
        ?>
</span>
        						<div class='content'>
        						<?php 
        _e('Specify the date of departure for this booking', THEMENAME);
        ?>
        						</div>
        					</div>


	        				<label for='_est_end' class='sectionTitle'><?php 
        _e('Departure Date', THEMENAME);
        ?>
</label>
	        				<?php 
        $value = get_post_meta($post->ID, '_est_end', true);
        ?>
		        				<input class='widefat' type='text' id='_est_end' name='_est_end' value='<?php 
        echo $value;
        ?>
'>
	        			</div>

	        			<div class='option'>
        					<div class='help'>
        						<span class='title'><?php 
        _e('help', THEMENAME);
        ?>
</span>
        						<div class='content'>
        						<?php 
        _e('Specify the property to book', THEMENAME);
        ?>
        						</div>
        					</div>


	        				<label for='_est_end' class='sectionTitle'><?php 
        _e('Property', THEMENAME);
        ?>
</label>
	        				<?php 
        $current = get_post_meta($post->ID, '_est_property_id', true);
        $properties = get_property_dropdown_options();
        ?>
		        				<select class='widefat' id='_est_property_id' name='_est_property_id'>
		        					<option value=''>-- Select a Property --</option>
		        					<?php 
        if (!empty($properties)) {
            foreach ($properties as $value => $name) {
                $selected = $value == $current ? 'selected="selected"' : '';
                ?>
										<option <?php 
                echo $selected;
                ?>
 value='<?php 
                echo $value;
                ?>
'><?php 
                echo $name;
                ?>
</option>
		        					<?php 
            }
        }
        ?>
		        				</select>
	        			</div>


	        		</section>

	        		<section>

	        			<div class='option'>
        					<div class='help'>
        						<span class='title'><?php 
        _e('help', THEMENAME);
        ?>
</span>
        						<div class='content'>
        						<?php 
        _e('Specify the name of the booking party', THEMENAME);
        ?>
        						</div>
        					</div>

	        				<label for='_est_name' class='sectionTitle'><?php 
        _e('Full Name', THEMENAME);
        ?>
</label>
	        				<?php 
        $value = get_post_meta($post->ID, '_est_name', true);
        ?>
		        				<input class='widefat' type='text' id='_est_name' name='_est_name' value='<?php 
        echo $value;
        ?>
'>
	        			</div>

	        			<div class='option'>
        					<div class='help'>
        						<span class='title'><?php 
        _e('help', THEMENAME);
        ?>
</span>
        						<div class='content'>
        						<?php 
        _e('Specify the email address of the booking party', THEMENAME);
        ?>
        						</div>
        					</div>


	        				<label for='_est_email' class='sectionTitle'><?php 
        _e('Email', THEMENAME);
        ?>
</label>
	        				<?php 
        $value = get_post_meta($post->ID, '_est_email', true);
        ?>
		        				<input class='widefat' type='text' id='_est_email' name='_est_email' value='<?php 
        echo $value;
        ?>
'>
	        			</div>

	        			<div class='option'>
        					<div class='help'>
        						<span class='title'><?php 
        _e('help', THEMENAME);
        ?>
</span>
        						<div class='content'>
        						<?php 
        _e('Specify the phone number of the booking party', THEMENAME);
        ?>
        						</div>
        					</div>


	        				<label for='_est_phone' class='sectionTitle'><?php 
        _e('Phone', THEMENAME);
        ?>
</label>
	        				<?php 
        $value = get_post_meta($post->ID, '_est_phone', true);
        ?>
		        				<input class='widefat' type='text' id='_est_phone' name='_est_phone' value='<?php 
        echo $value;
        ?>
'>
	        			</div>

	        			<div class='option'>
        					<div class='help'>
        						<span class='title'><?php 
        _e('help', THEMENAME);
        ?>
</span>
        						<div class='content'>
        						<?php 
        _e('Specify any additional notes about this booking', THEMENAME);
        ?>
        						</div>
        					</div>


	        				<label for='_est_notes' class='sectionTitle'><?php 
        _e('Additional Notes', THEMENAME);
        ?>
</label>
	        				<?php 
        $value = get_post_meta($post->ID, '_est_notes', true);
        ?>
		        				<textarea class='widefat' style='height:120px;' id='_est_notes' name='_est_notes'><?php 
        echo $value;
        ?>
</textarea>
	        			</div>


	        		</section>


					<section>

	        			<div class='option'>
        					<div class='help'>
        						<span class='title'><?php 
        _e('help', THEMENAME);
        ?>
</span>
        						<div class='content'>
        						<?php 
        _e('Select weather or not you have received the payment', THEMENAME);
        ?>
        						</div>
        					</div>

	        				<label for='_est_paid' class='sectionTitle'><?php 
        _e('Payment Received?', THEMENAME);
        ?>
</label>
	        				<?php 
        $choices = array('Yes' => 'yes', 'No' => 'no');
        ?>
	        				<ul class='choices'>
		        				<?php 
        $current = get_post_meta($post->ID, '_est_paid', true);
        $i = 1;
        foreach ($choices as $choice => $value) {
            $checked = (!empty($current) and $current == $value or empty($current) and $value == 'no') ? 'checked="checked"' : '';
            ?>
		        				<li>
		        				<input <?php 
            echo $checked;
            ?>
 type='radio' id='_est_paid-<?php 
            echo $i;
            ?>
' name='_est_paid' value='<?php 
            echo $value;
            ?>
'><label for='_est_paid-<?php 
            echo $i;
            ?>
'><?php 
            echo $choice;
            ?>
</label><br>
		        				</li>
		        				<?php 
            $i++;
        }
        ?>
	        				</ul>
	        			</div>

	        			<div class='option'>
        					<div class='help'>
        						<span class='title'><?php 
        _e('help', THEMENAME);
        ?>
</span>
        						<div class='content'>
        						<?php 
        _e('Add the payment ID if you have one', THEMENAME);
        ?>
        						</div>
        					</div>


	        				<label for='_payment_id' class='sectionTitle'><?php 
        _e('Payment ID', THEMENAME);
        ?>
</label>
	        				<?php 
        $value = get_post_meta($post->ID, '_payment_id', true);
        ?>
		        				<input class='widefat' type='text' id='_payment_id' name='_payment_id' value='<?php 
        echo $value;
        ?>
'>
	        			</div>


	        			<div class='option'>
        					<div class='help'>
        						<span class='title'><?php 
        _e('help', THEMENAME);
        ?>
</span>
        						<div class='content'>
        						<?php 
        _e('Add the payment ID if you have one', THEMENAME);
        ?>
        						</div>
        					</div>


	        				<label for='_est_paid_amount' class='sectionTitle'><?php 
        _e('Received Payment', THEMENAME);
        ?>
</label>
	        				<?php 
        $value = get_post_meta($post->ID, '_est_paid_amount', true);
        ?>
		        				<input class='widefat' type='text' id='_est_paid_amount' name='_est_paid_amount' value='<?php 
        echo $value;
        ?>
'>
	        			</div>



	        		</section>




	        		<section class='helpSection'>
	        			<?php 
        _e('
	        				<p>
	        					Posts allow you to create simple blog-like content. They are shown on the main page by default and can be categorized and tagged for better organization. Musico offers a few special options for posts in addition to the numerous shortcodes which will help you format your content.
	        				</p>

							<ul>
								<li>
								Structure
							<ul>
								<li><strong>Layout</strong>: By default the layout of this post is inherited from the default layout which can be changed in the Theme Customizer. If you need a different layout for this post, you can override the default setting.
								</li>
								<li><strong>Post Metadata</strong>: By default posts show meta information like author, tag, categories and so on. If you would not like to show this information for this post, you can enable it with this setting.</li>
								<li><strong>Sidebar</strong>: If you are using a layout with a sidebar the default sidebar will be shown. You can set the default sidebar in the Theme Customizer. If you would like to use a different sidebar on this post, choose one here.
								</li>

							</ul>
							</li>
							</ul>


	        			', THEMENAME);
        ?>
	        		</section>

	        		<section class='helpSection'>
	        			<?php 
        echo bsh_docs_shortcodes();
        ?>
		        	</section>
		        	<section class='helpSection'>
			        	<?php 
        echo bsh_docs_get_support();
        ?>
			   		</section>

	        	</div>
	        	<div class='clear'></div>
	        </div>

        <?php 
    }
<div class="wrap nosubsub">
<div id='est_header'>
<div id="est_booking_page_icon" class="icon32 icon32-posts-property"><br></div><h2><?php 
_e('Booking Calendar', THEMENAME);
?>
</h2>
</div>


<form id='bookingFilters' class="mt22 mb22">
	<select name="property_id">
		<?php 
$properties = get_property_dropdown_options();
echo '<option value="">' . __('All Properties', THEMENAME) . '</option>';
foreach ($properties as $value => $name) {
    $selected = (!empty($_GET['property_id']) and $value == $_GET['property_id']) ? 'selected="selected"' : '';
    ?>
			<option <?php 
    echo $selected;
    ?>
 value='<?php 
    echo $value;
    ?>
'><?php 
    echo $name;
    ?>
</option>
		<?php 
}
?>
	</select>