<?php 

function create_announcement_cb() {
	?>
	<div class="row">
		<div class="col-md-6 col-md-offset-3">
			<form id="create-announcement-form" method="post" action="contents/plugins/messaging/ajax.php" data-clearform=1 data-callback="getEntries" data-callbackid="#display">
				<?php 
					input(['label' => 'Caption', 'id' => 'caption', 'required' => 'required']);
					textarea(['label' => 'Content', 'id' => 'content', 'required' => 'required'], true);
					do_action("add_db_section_to_form", ['attr' => ['name' => 'db_section_id[]', 'multiple' => 'multiple']]);
				 ?>
				 <div class="row">
				 	<?php do_action("search_query_filter_date_range_only", ['id' => null, 'class' => 'col-md-6']); ?>
				 </div>
				 <div class="row">
				 	<div class="col-md-12">
				 		<?php submit_btn("create_announcement", "Submit", "submit", "btn btn-primary mt-4"); ?>
				 	</div>
				 </div>
			</form>
		</div>
	</div>
	<div class="row">
		<div class="col-md-12">
			<div class="mt-4 mb-4 display" id="display" data-form="#create-announcement-form">
        		<div class="actions" data-deactivate="Deactivate" data-activate="Activate" data-edit="Edit"></div>
        		<div class="action-args" data-deactivate="id" data-activate="id" data-edit="id"></div>
        		<div class="action-callback" data-deactivate="deactivate_post" data-activate="activate_post" data-edit="edit_post"></div>
        		<div class="action-access" data-deactivate="deactivate_post" data-activate="activate_post" data-edit="create_announcement"></div>
        		<div class="action-links" data-deactivate="false" data-activate="false" data-edit="false"></div>
        		<!-- <div class="action-popup" data-edit=<?php echo json_encode(["onreturncb" => "getEntries", "onreturncbid" => "#display", "width" => 800, "height" => 500]) ?>></div> -->
        		<div class="action-condition" data-deactivate='<?php echo json_encode(["status" => "active"]) ?>' data-activate='<?php echo json_encode(["status" => "inactive"]) ?>'></div>
        		<div class="settings" data-type="announcement"></div>
        		<div class="display-result"></div>
        	</div>
		</div>
	</div>
	<?php
	global $post_meta;
	add_page_javascript('app/assets/js/page-scripts/submit.js');
	add_page_javascript('app/assets/js/page-scripts/js-functions.js');
}