<?php // echo "<pre>"; print_r($businessLink); echo"</pre>"; ?>

<div class="ddbw prettyform">

	<hr class="col _1t1" >

	<div class="col _1t1">
		<input	placeholder="<?php _e('Contact Information Title', 'ddbusinesswidget'); ?>" 
				class="ddbw-title" 
				id="<?php echo $this->get_field_id('widgetTitle'); ?>" 
				name="<?php echo $this->get_field_name('widgetTitle'); ?>" 
				type="text" value="<?php echo $widgetTitle; ?>">
	</div>

	<div class="col _4t8">
		<input	placeholder="<?php _e('Name', 'ddbusinesswidget'); ?>" 
				class="ddbw-name" 
				id="<?php echo $this->get_field_id('businessName'); ?>" 
				name="<?php echo $this->get_field_name('businessName'); ?>" 
				type="text" value="<?php echo $businessName; ?>">
	</div>

	<div class="col _4t8">
		<input	placeholder="<?php _e('Link to contact / find us page.', 'ddbusinesswidget'); ?>" 
				class="ddbw-link" 
				id="<?php echo $this->get_field_id('businessLink'); ?>" 
				name="<?php echo $this->get_field_name('businessLink'); ?>" 
				type="text" value="<?php echo $businessLink; ?>">
	</div>

	<div class="col _2t8">
		<input	placeholder="<?php _e('Street', 'ddbusinesswidget'); ?>" 
				class="ddbw-street" 
				id="<?php echo $this->get_field_id('businessAddressStreet'); ?>" 
				name="<?php echo $this->get_field_name('businessAddressStreet'); ?>" 
				type="text" value="<?php echo $businessAddressStreet; ?>">
	</div>

	<div class="col _2t8">
		<input	placeholder="<?php _e('Postal Code', 'ddbusinesswidget'); ?>" 
				class="ddbw-postal" 
				id="<?php echo $this->get_field_id('businessAddressPostalCode'); ?>" 
				name="<?php echo $this->get_field_name('businessAddressPostalCode'); ?>" 
				type="text" value="<?php echo $businessAddressPostalCode; ?>">
	</div>

	<div class="col _2t8">
		<input	placeholder="<?php _e('City', 'ddbusinesswidget'); ?>" 
				class="ddbw-locality" 
				id="<?php echo $this->get_field_id('businessAddressLocality'); ?>" 
				name="<?php echo $this->get_field_name('businessAddressLocality'); ?>" 
				type="text" value="<?php echo $businessAddressLocality; ?>">
	</div>

	<div class="col _2t8">
		<input	placeholder="<?php _e('Region', 'ddbusinesswidget'); ?>" 
				class="ddbw-region" 
				id="<?php echo $this->get_field_id('businessAddressRegion'); ?>" 
				name="<?php echo $this->get_field_name('businessAddressRegion'); ?>" 
				type="text" value="<?php echo $businessAddressRegion; ?>">
	</div>

	<div class="col _4t8">
		<input	placeholder="<?php _e('Phone Prefix', 'ddbusinesswidget'); ?>" 
				class="ddbw-phone-prefix" 
				id="<?php echo $this->get_field_id('businessPhonePrefix'); ?>" 
				name="<?php echo $this->get_field_name('businessPhonePrefix'); ?>" 
				type="text" value="<?php echo $businessPhonePrefix; ?>">
	</div>

	<div class="col _4t8">
		<input	placeholder="<?php _e('Phonenumber', 'ddbusinesswidget'); ?>" 
				class="ddbw-phone" 
				id="<?php echo $this->get_field_id('businessPhone'); ?>" 
				name="<?php echo $this->get_field_name('businessPhone'); ?>" 
				type="text" value="<?php echo $businessPhone; ?>">
	</div>

	<div class="col _4t8">
		<input	placeholder="<?php _e('Faxnumber Prefix', 'ddbusinesswidget'); ?>" 
				class="ddbw-fax-prefix" 
				id="<?php echo $this->get_field_id('businessFaxNumberPrefix'); ?>" 
				name="<?php echo $this->get_field_name('businessFaxNumberPrefix'); ?>" 
				type="text" value="<?php echo $businessFaxNumberPrefix; ?>">
	</div>

	<div class="col _4t8">
		<input	placeholder="<?php _e('Faxnumber', 'ddbusinesswidget'); ?>" 
				class="ddbw-fax" 
				id="<?php echo $this->get_field_id('businessFaxNumber'); ?>" 
				name="<?php echo $this->get_field_name('businessFaxNumber'); ?>" 
				type="text" value="<?php echo $businessFaxNumber; ?>">
	</div>

	<div class="col _4t8">
		<input	placeholder="<?php _e('Email Prefix', 'ddbusinesswidget'); ?>" 
				class="ddbw-mail-prefix" 
				id="<?php echo $this->get_field_id('businessMailPrefix'); ?>" 
				name="<?php echo $this->get_field_name('businessMailPrefix'); ?>" 
				type="text" value="<?php echo $businessMailPrefix; ?>">
	</div>

	<div class="col _4t8">
		<input	placeholder="<?php _e('Email', 'ddbusinesswidget'); ?>" 
				class="ddbw-mail" 
				id="<?php echo $this->get_field_id('businessMail'); ?>" 
				name="<?php echo $this->get_field_name('businessMail'); ?>"
				type="text" value="<?php echo $businessMail; ?>">
	</div>		

	<div class="col _4t8">
		<input	placeholder="<?php _e('Website Prefix', 'ddbusinesswidget'); ?>" 
				class="ddbw-url-prefix" 
				id="<?php echo $this->get_field_id('businessUrlPrefix'); ?>" 
				name="<?php echo $this->get_field_name('businessUrlPrefix'); ?>" 
				type="text" value="<?php echo $businessUrlPrefix; ?>">
	</div>

	<div class="col _4t8">
		<input	placeholder="<?php _e('Website URL', 'ddbusinesswidget'); ?>" 
				class="ddbw-url" 
				id="<?php echo $this->get_field_id('businessUrl'); ?>" 
				name="<?php echo $this->get_field_name('businessUrl'); ?>" 
				type="text" value="<?php echo $businessUrl; ?>">
	</div>

	<div class="col _1t1">
		<div class="col _1t8">
			<input 	class="checkbox ddbw-create-contact-links"
					type="checkbox" <?php checked( $createContactLinks ); ?> 
					id="<?php echo $this->get_field_id( 'createContactLinks' ); ?>" 
					name="<?php echo $this->get_field_name( 'createContactLinks' ); ?>">
		</div>
		<div class="col _7t8">
			<label title="<?php _e('Create links for contact fields.', 'ddbusinesswidget'); ?>" for="<?php echo $this->get_field_id( 'createContactLinks' ); ?>"><?php _e('Create links for contact fields.', 'ddbusinesswidget'); ?></label>
		</div>
	</div>

	<hr class="col _1t1" >

	<div class="col _1t1">
		<input	placeholder="<?php _e('Opening Hours Title', 'ddbusinesswidget'); ?>" 
				class="ddbw-title" 
				id="<?php echo $this->get_field_id('businessOpeningHoursTitle'); ?>" 
				name="<?php echo $this->get_field_name('businessOpeningHoursTitle'); ?>" 
				type="text" value="<?php echo $businessOpeningHoursTitle; ?>">
	</div>

	<!-- Count the openening hours fields -->
	<input 	class="ddbw-count"
			type="hidden"
			id="<?php echo $this->get_field_id('businessOpeningHoursCount'); ?>" 
			name="<?php echo $this->get_field_name('businessOpeningHoursCount'); ?>"
			value="<?php echo $businessOpeningHoursCount; ?>">
	
	<?php 
		$n = 0; // counter for individual ids
		foreach ( $businessOpeningHours as $id => $entry ) {
	?>

	<div 	id="businessOpeningEntry<?php echo $n; ?>" 
			class="ddbw-day"
			fieldid="<?php echo $this->get_field_id( '' ); ?>" 
			fieldname="<?php echo $this->get_field_name( '' ); ?>">

		<input 	class="ddbw-id"
				type="hidden"
				id="<?php echo $this->get_field_id('businessOpeningHoursID' . $n); ?>" 
				name="<?php echo $this->get_field_name('businessOpeningHoursID' . $n); ?>"
				value="ddbw-oh<?php echo $n; ?>">
		
		<div class="col _3t8">
			<select class="ddbw-weekday1" 
					id="<?php echo $this->get_field_id('businessOpeningHoursDayOne' . $n); ?>" 
					name="<?php echo $this->get_field_name('businessOpeningHoursDayOne' . $n); ?>">

				<option value="" selected="selected"><?php _e('', 'ddbusinesswidget'); ?></option>
				<option value="1mo" <?php selected( $entry['day1'], "1mo" ); ?>><?php _e('Monday', 'ddbusinesswidget'); ?></option>
				<option value="2tu" <?php selected( $entry['day1'], "2tu" ); ?>><?php _e('Tuesday', 'ddbusinesswidget'); ?></option>
				<option value="3we" <?php selected( $entry['day1'], "3we" ); ?>><?php _e('Wednesday', 'ddbusinesswidget'); ?></option>
				<option value="4th" <?php selected( $entry['day1'], "4th" ); ?>><?php _e('Thursday', 'ddbusinesswidget'); ?></option>
				<option value="5fr" <?php selected( $entry['day1'], "5fr" ); ?>><?php _e('Friday', 'ddbusinesswidget'); ?></option>
				<option value="6sa" <?php selected( $entry['day1'], "6sa" ); ?>><?php _e('Saturday', 'ddbusinesswidget'); ?></option>
				<option value="7su" <?php selected( $entry['day1'], "7su" ); ?>><?php _e('Sunday', 'ddbusinesswidget'); ?></option>

			</select>
		</div>
		
		<div class="col _3t8">
			<select class="ddbw-weekday2" 
					id="<?php echo $this->get_field_id('businessOpeningHoursDayTwo' . $n); ?>" 
					name="<?php echo $this->get_field_name('businessOpeningHoursDayTwo' . $n); ?>">

				<option value="" selected="selected">- </option>
				<option value="1mo" <?php selected( $entry['day2'], "1mo" ); ?>>- <?php _e('Monday', 'ddbusinesswidget'); ?></option>
				<option value="2tu" <?php selected( $entry['day2'], "2tu" ); ?>>- <?php _e('Tuesday', 'ddbusinesswidget'); ?></option>
				<option value="3we" <?php selected( $entry['day2'], "3we" ); ?>>- <?php _e('Wednesday', 'ddbusinesswidget'); ?></option>
				<option value="4th" <?php selected( $entry['day2'], "4th" ); ?>>- <?php _e('Thursday', 'ddbusinesswidget'); ?></option>
				<option value="5fr" <?php selected( $entry['day2'], "5fr" ); ?>>- <?php _e('Friday', 'ddbusinesswidget'); ?></option>
				<option value="6sa" <?php selected( $entry['day2'], "6sa" ); ?>>- <?php _e('Saturday', 'ddbusinesswidget'); ?></option>
				<option value="7su" <?php selected( $entry['day2'], "7su" ); ?>>- <?php _e('Sunday', 'ddbusinesswidget'); ?></option>

			</select>
		</div>
		
		<div class="col _1t8">
			<!-- TODO: input type time -->
			<input	placeholder="<?php _e('From', 'ddbusinesswidget'); ?>" 
					class="ddbw-time-start"
					id="<?php echo $this->get_field_id( 'businessOpeningHoursTimeStart' . $n ); ?>" 
					name="<?php echo $this->get_field_name( 'businessOpeningHoursTimeStart' . $n ); ?>"
					type="text"
					value="<?php echo $entry['start']; ?>">
		</div>
		
		<div class="col _1t8">
			<!-- TODO: input type time -->
			<input 	placeholder="<?php _e('To', 'ddbusinesswidget'); ?>" 
					class="ddbw-time-end"
					id="<?php echo $this->get_field_id( 'businessOpeningHoursTimeEnd' . $n ); ?>" 
					name="<?php echo $this->get_field_name( 'businessOpeningHoursTimeEnd' . $n ); ?>"
					type="text"
					value="<?php echo $entry['end']; ?>">
		</div>
		
		<div class="col _5t8">
			<input 	placeholder="<?php _e('Custom Entry Text', 'ddbusinesswidget'); ?>" 
					class="ddbw-custom"
					id="<?php echo $this->get_field_id( 'businessOpeningHoursCustom' . $n ); ?>" 
					name="<?php echo $this->get_field_name( 'businessOpeningHoursCustom' . $n ); ?>"
					type="text"
					value="<?php echo $entry['custom']; ?>">
		</div>

		<div class="col _1t8 squaredThree">
			<input 	class="checkbox ddbw-line-break" 
					type="checkbox" <?php checked( $entry['linebreak'] ); ?>
					id="<?php echo $this->get_field_id( 'businessOpeningHoursLineBreak' . $n ); ?>" 
					name="<?php echo $this->get_field_name( 'businessOpeningHoursLineBreak' . $n ); ?>">
			<label title="<?php _e('Set Linebreak', 'ddbusinesswidget'); ?>" for="<?php echo $this->get_field_id( 'businessOpeningHoursLineBreak' . $n ); ?>"></label>
		</div>
		
		<div class="col _1t8">
			<button onclick="add_openinghour(this); return false;" class="ddbw-add" <?php echo $n == ( $businessOpeningHoursCount - 1 ) ? '' : 'disabled'; ?>>+</button>
		</div>

		<div class="col _1t8">
			<button onclick="remove_openinghour(this); return false;" class="ddbw-remove">-</button>
		</div>

	</div>

	<?php $n++; } ?>

	<div class="col _1t1">
		<div class="col _1t8">
			<input 	class="checkbox ddbw-sum-opening-hours" 
					type="checkbox" <?php checked( $sumOpeningHours ); ?> 
					id="<?php echo $this->get_field_id( 'sumOpeningHours' ); ?>" 
					name="<?php echo $this->get_field_name( 'sumOpeningHours' ); ?>">
		</div>
		<div class="col _7t8">
			<label title="<?php  _e('Summarize Opening Hours', 'ddbusinesswidget'); ?>" for="<?php echo $this->get_field_id( 'sumOpeningHours' ); ?>"><?php _e('Summarize Opening Hours', 'ddbusinesswidget'); ?></label>
		</div>
	</div>

	<div class="col _1t1">
		<div class="col _1t8">
			<input 	class="checkbox ddbw-shorten-days"
					type="checkbox" <?php checked( $shortenOpeningHours ); ?> 
					id="<?php echo $this->get_field_id( 'shortenOpeningHours' ); ?>" 
					name="<?php echo $this->get_field_name( 'shortenOpeningHours' ); ?>">
		</div>
		<div class="col _7t8">
			<label title="<?php _e('Shorten Day Names', 'ddbusinesswidget'); ?>" for="<?php echo $this->get_field_id( 'shortenOpeningHours' ); ?>"><?php _e('Shorten Day Names', 'ddbusinesswidget'); ?></label>
		</div>
	</div>

	<hr class="col _1t1" >

	<div class="col _1t1">
		<input	placeholder="<?php _e('Additional Information Title', 'ddbusinesswidget'); ?>" 
				class="ddbw-title" 
				id="<?php echo $this->get_field_id('additionalInformationTitle'); ?>" 
				name="<?php echo $this->get_field_name('additionalInformationTitle'); ?>" 
				type="text" value="<?php echo $additionalInformationTitle; ?>">
	</div>

	<div class="col _1t1">
		<textarea placeholder="<?php _e('Additional Information', 'ddbusinesswidget'); ?>" 
				class="ddbw-textfield" 
				id="<?php echo $this->get_field_id('additionalInformation'); ?>" 
				name="<?php echo $this->get_field_name('additionalInformation'); ?>"
		><?php echo $additionalInformation; ?></textarea>
	</div>

	<hr class="col _1t1" >

</div>