<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only parameters no nonce required.
$job_id = ! empty( $_GET['p_id'] ) ? absint( $_GET['p_id'] ) : 0;

if ( empty( $job_id ) || ! gigneo_validate_post_author( $job_id ) ) {
	gigneo_not_found( 'job_proposal' );
	return;
}

$job = get_post( $job_id );

if ( ! isset( $job->post_type ) || 'gigneo_job' !== $job->post_type ) {
	gigneo_not_found( 'job_proposal' );

	return;
}

$date_format = get_option( 'date_format' );
$time_format = get_option( 'time_format' );

$args = array(
	'p_id'        => $job_id,
	'date_format' => $date_format,
	'time_format' => $time_format,
);


?>
<div class="gn-job-proposal">
	<?php gigneo_load_template( 'dashboard/job/parts/proposal/info', true, $args ); ?>
	<?php gigneo_load_template( 'dashboard/job/parts/proposal/list', true, $args ); ?>
</div>