<?php	

    $cip_object = json_decode(get_option('aow_cip_object'),true);

	$cip_closure_status = get_option('aow_temp_closure');

	$cip_closure_message = get_option('aow_temp_closure_msg');

?>

<ul class="subsubsub">

<li><a href="<?php echo admin_url('admin.php?page=aow-cip-info'); ?>"><strong>Overview</strong></a> |</li>

<li><a href="<?php echo admin_url('admin.php?page=aow-cip-hours'); ?>">Hours</a></li>

    </ul><br /><br />

    <hr />

<h2>Overview</h2>



<p>This plugin allows retrieving and displaying the following clinic information:</p>



<p>

<form action="<?php echo admin_url('admin.php?page=aow-cip-info'); ?>" method="post">

<label for='hub_id'>Clinic ID</label><br />

<input type="text" name="clinic_id" value="<?php echo isset($clinic_id) ? $clinic_id : 0; ?>" <?php if (isset($clinic_id) && $clinic_id > 0): ?> disabled <?php endif; ?> /> &nbsp;<?php if (isset($clinic_id) && $clinic_id > 0): ?>

<a href="javascript:void(0);" onClick="javascript:editID(this);">Edit ID</a>

<?php endif; ?>

<br /><br />

<input class="button" type="submit" name="submit_btn" value="Update" />

</form>

<br /><?php

if ($clinic_id > 0): ?>
<a href="<?php echo admin_url('admin.php?page=aow-cip-info&push_cip='.$clinic_id); ?>" target="_blank">Request latest CIP</a><br />
<a href="<?php echo admin_url('admin.php?page=aow-cip-info&push_cip='.$clinic_id.'&check_error=true'); ?>" target="_blank">Check latest CIP for errors</a>
<?php endif; ?>



<br />

Current CIP created: <?php echo $cip_object['SnapshotCreationDate']; ?></br>

Clinic currently under temporary closure?: <?php echo $cip_closure_status ? 'True' : 'False'; ?></br>

Clinic closure message: <?php echo $cip_closure_message; ?></br>

</p>



<br />

<ul class='plugin_list'>

<li>Clinic Hours (<a href="<?php echo admin_url('admin.php?page=aow-cip-hours'); ?>">settings</a>)</li>

</ul>



<script type="text/javascript">

function editID(obj)

{

jQuery(document).ready(function(e) {

	if (jQuery(obj).text() == "Edit ID")

	{

		jQuery("input[name='clinic_id']").removeAttr("disabled");

		jQuery(obj).text("Disable ID");

	} else if (jQuery(obj).text() == "Disable ID") {

		jQuery("input[name='clinic_id']").attr("disabled","disabled");

		jQuery(obj).text("Edit ID");

	}



});

}

</script>



<style type="text/css">

ul.plugin_list

{

	list-style:disc;	

}

</style>