* Hooked into single_job_listing_start priority 30
 *
 * @since  1.14.0
 */
if (!get_the_company_name()) {
    return;
}
?>
<div class="company" itemscope itemtype="http://data-vocabulary.org/Organization">
	<?php 
the_company_logo();
?>

	<p class="name">
		<?php 
if ($website = get_the_company_website()) {
    ?>
			<a class="website" href="<?php 
    echo esc_url($website);
    ?>
" itemprop="url" target="_blank" rel="nofollow"><?php 
    _e('Website', 'wp-job-manager');
    ?>
</a>
		<?php 
}
?>
		<?php 
the_company_twitter();
?>
		<?php 
function listable_job_listing_admin_custom_columns($column)
{
    global $post;
    switch ($column) {
        case "listable_job_position":
            echo '<div class="job_position">';
            echo '<a href="' . esc_url(admin_url('post.php?post=' . $post->ID . '&action=edit')) . '" class="tips job_title" data-tip="' . sprintf(esc_html__('ID: %d', 'listable'), $post->ID) . '">' . $post->post_title . '</a>';
            echo '<div class="company">';
            $website = esc_url(get_the_company_website());
            if ($website) {
                the_company_name('<span class="tips" data-tip="' . esc_attr($website) . '"><a href="' . $website . '">', '</a></span>');
            } else {
                the_company_name('<span class="tips" data-tip="' . esc_attr($website) . '">', '</span>');
            }
            echo '</div>';
            echo '</div>';
            break;
        case "listable_job_image":
            $company_logo_ID = listable_get_post_image_id($post->ID);
            $company_logo = '';
            if (!empty($company_logo_ID)) {
                $company_logo = wp_get_attachment_image_src($company_logo_ID);
            }
            if (!empty($company_logo) && (strstr($company_logo[0], 'http') || file_exists($company_logo[0]))) {
                $company_logo = $company_logo[0];
                $company_logo = job_manager_get_resized_image($company_logo, 'thumbnail');
                echo '<img class="company_logo" src="' . esc_attr($company_logo) . '" alt="' . esc_attr(get_the_company_name($post)) . '" />';
            }
            break;
    }
}
    /**
     * Listing URL
     *
     * @since Listify 1.0.0
     *
     * @return void
     */
    public static function the_url()
    {
        global $post;
        $url = get_the_company_website($post->ID);
        if (!$url) {
            return;
        }
        $url = esc_url($url);
        $base = parse_url($url);
        $base = $base['host'];
        ?>
        <div class="job_listing-url">
            <span itemprop="url"><a href="<?php 
        echo $url;
        ?>
" rel="nofollow" target="_blank"><?php 
        echo esc_attr($base);
        ?>
</a></span>
        </div>
    <?php 
    }
 /**
  * custom_columns function.
  *
  * @access public
  * @param mixed $column
  * @return void
  */
 public function custom_columns($column)
 {
     global $post, $job_manager;
     switch ($column) {
         case "job_listing_type":
             $type = get_the_job_type($post);
             if ($type) {
                 echo '<span class="job-type ' . $type->slug . '">' . $type->name . '</span>';
             }
             break;
         case "job_position":
             echo '<div class="job_position">';
             echo '<a href="' . admin_url('post.php?post=' . $post->ID . '&action=edit') . '" class="tips job_title" data-tip="' . sprintf(__('Job ID: %d', 'wp-job-manager'), $post->ID) . '">' . $post->post_title . '</a>';
             echo '<div class="location">';
             if (get_the_company_website()) {
                 the_company_name('<span class="tips" data-tip="' . esc_attr(get_the_company_tagline()) . '"><a href="' . get_the_company_website() . '">', '</a></span> &ndash; ');
             } else {
                 the_company_name('<span class="tips" data-tip="' . esc_attr(get_the_company_tagline()) . '">', '</span> &ndash; ');
             }
             the_job_location($post);
             echo '</div>';
             the_company_logo();
             echo '</div>';
             break;
         case "job_listing_category":
             if (!($terms = get_the_term_list($post->ID, $column, '', ', ', ''))) {
                 echo '<span class="na">&ndash;</span>';
             } else {
                 echo $terms;
             }
             break;
         case "filled":
             if (is_position_filled($post)) {
                 echo '&#10004;';
             } else {
                 echo '&ndash;';
             }
             break;
         case "featured_job":
             if (is_position_featured($post)) {
                 echo '&#10004;';
             } else {
                 echo '&ndash;';
             }
             break;
         case "job_posted":
             echo '<strong>' . date_i18n(__('M j, Y', 'wp-job-manager'), strtotime($post->post_date)) . '</strong><span>';
             echo (empty($post->post_author) ? __('by a guest', 'wp-job-manager') : sprintf(__('by %s', 'wp-job-manager'), '<a href="' . get_edit_user_link($post->post_author) . '">' . get_the_author() . '</a>')) . '</span>';
             break;
         case "job_expires":
             if ($post->_job_expires) {
                 echo '<strong>' . date_i18n(__('M j, Y', 'wp-job-manager'), strtotime($post->_job_expires)) . '</strong>';
             } else {
                 echo '&ndash;';
             }
             break;
         case "job_status":
             echo get_the_job_status($post);
             break;
         case "job_actions":
             echo '<div class="actions">';
             $admin_actions = array();
             if ($post->post_status == 'pending') {
                 $admin_actions['approve'] = array('action' => 'approve', 'name' => __('Approve', 'wp-job-manager'), 'url' => wp_nonce_url(add_query_arg('approve_job', $post->ID), 'approve_job'));
             }
             if ($post->post_status !== 'trash') {
                 $admin_actions['view'] = array('action' => 'view', 'name' => __('View', 'wp-job-manager'), 'url' => get_permalink($post->ID));
                 $admin_actions['edit'] = array('action' => 'edit', 'name' => __('Edit', 'wp-job-manager'), 'url' => get_edit_post_link($post->ID));
                 $admin_actions['delete'] = array('action' => 'delete', 'name' => __('Delete', 'wp-job-manager'), 'url' => get_delete_post_link($post->ID));
             }
             $admin_actions = apply_filters('job_manager_admin_actions', $admin_actions, $post);
             foreach ($admin_actions as $action) {
                 printf('<a class="button tips icon-%s" href="%s" data-tip="%s">%s</a>', sanitize_title($action['name']), esc_url($action['url']), esc_attr($action['name']), esc_attr($action['name']));
             }
             echo '</div>';
             break;
     }
 }
    ?>
											<?php 
    _e('Live-in nanny', 'babysitter');
    ?>
										</li>
									</ul>
								</div>
							</div>
						</div>

						<div class="hr hr__smallest"></div>

						<div class="company">
							<p class="name">
								<a class="website" href="<?php 
    echo get_the_company_website();
    ?>
" itemprop="url"><?php 
    _e('Website', 'babysitter');
    ?>
</a>
								<?php 
    the_company_twitter();
    ?>
							</p>
							<?php 
    the_company_tagline('<p class="tagline">', '</p>');
    ?>
						</div>
					</div>
    /**
     * Listing URL
     *
     * @since Listify 1.0.0
     *
     * @return void
     */
    public static function the_url()
    {
        global $post;
        $url = get_the_company_website($post->ID);
        if (!$url) {
            return;
        }
        $url = esc_url($url);
        $base = parse_url($url);
        $base = $base['host'];
        ?>
        <div class="job_listing-url">
        
            <span itemprop="url"><a href="<?php 
        echo $url;
        ?>
" rel="nofollow" target="_blank"><?php 
        echo esc_attr($base);
        ?>
</a></span>
        </div>
        <a href="http://maps.google.com/maps?saddr=Current+Location&daddr=<?php 
        echo urlencode($post->geolocation_lat . ',' . $post->geolocation_long);
        ?>
">show on google maps</a>
    <?php 
    }
    /**
     * widget function.
     *
     * @see WP_Widget
     * @access public
     * @param array $args
     * @param array $instance
     * @return void
     */
    function widget($args, $instance)
    {
        if ($this->get_cached_widget($args)) {
            return;
        }
        ob_start();
        extract($args);
        $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : '', $instance, $this->id_base);
        echo $before_widget;
        ?>

		<?php 
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>

		<ul class="company-social">
			<?php 
        do_action('job_listing_company_social_before');
        ?>

			<?php 
        if (get_the_company_website()) {
            ?>
			<li><a href="<?php 
            echo get_the_company_website();
            ?>
" target="_blank" itemprop="url">
				<i class="icon-link"></i>
				<?php 
            _e('Website', 'jobify');
            ?>
			</a></li>
			<?php 
        }
        ?>

			<?php 
        if (get_the_company_twitter()) {
            ?>
			<li><a href="http://twitter.com/<?php 
            echo get_the_company_twitter();
            ?>
">
				<i class="icon-twitter"></i>
				<?php 
            _e('Twitter', 'jobify');
            ?>
			</a></li>
			<?php 
        }
        ?>

			<?php 
        if (jobify_get_the_company_facebook()) {
            ?>
			<li><a href="http://facebook.com/<?php 
            echo jobify_get_the_company_facebook();
            ?>
">
				<i class="icon-facebook"></i>
				<?php 
            _e('Facebook', 'jobify');
            ?>
			</a></li>
			<?php 
        }
        ?>

			<?php 
        if (jobify_get_the_company_gplus()) {
            ?>
			<li><a href="http://plus.google.com/<?php 
            echo jobify_get_the_company_gplus();
            ?>
">
				<i class="icon-gplus"></i>
				<?php 
            _e('Google+', 'jobify');
            ?>
			</a></li>
			<?php 
        }
        ?>

			<?php 
        if (jobify_get_the_company_linkedin()) {
            ?>
			<li><a href="http://linkedin.com/company/<?php 
            echo jobify_get_the_company_linkedin();
            ?>
">
				<i class="icon-linkedin"></i>
				<?php 
            _e('LinkedIn', 'jobify');
            ?>
			</a></li>
			<?php 
        }
        ?>

			<?php 
        do_action('job_listing_company_social_after');
        ?>
		</ul>

		<?php 
        echo $after_widget;
        $content = apply_filters('jobify_widget_job_company_social', ob_get_clean(), $instance, $args);
        echo $content;
        $this->cache_widget($args, $content);
    }