<?php 

function send_bulk_sms_cb() {
	global $post_meta;
	global $app;
	$exclude = $temp = ["software_engineer"];
	foreach ($temp as $key => $value) {
		$exclude[] = "All ".get_role_name($value)."(s)";
	}
	?>
	<style type="text/css">
		#counter {
			color: #ce9055;
			font-size: 0.8em;
			padding-left: 20px;
			display: inline-block;
		}
	</style>
	<div class="row">
		<div class="col-md-6">
			<div class="panel panel-custom bg-white">
			    <div class="panel-heading">
			        <h1>Bulk SMS</h1>
			    </div>
		        <div class="panel-body instruction">
		        	<form method="post" id="send_bulk_sms_form" action="contents/plugins/messaging/ajax.php" data-allow-enter-button="1" data-clearform=1>
		        		<!-- <div id="display-receivers" data-btn="#submit"></div> -->
		        		<?php 
		        		do_action("add_sms_list_to_form", ["id" => "receivers", "exclude" => $exclude]);
		        		dynamic_select(['label' => 'More Numbers <small>Seperate with semi-colons</small>', 'id' => 'numbers', 'name' => 'numbers[]'], ['type' => 'phone_number', 'status' => 'active', 'user_id' => $app->user_meta['id']], ';', 'contact', 'contact', array(), 'contacts');
		        		input(['label' => 'Sender', 'id' => 'sender', 'maxlength' => 11, 'value' => get_option('sms_sender'), 'data-noclear' => true]); 
		        		textarea(['label' => 'Message <span id="counter"></span>', 'id' => 'msg', 'rows' => 8], false);
		        		submit_btn('send_bulk_sms', 'Send <i class="fa fa-location-arrow"></i>');
		        		 ?>
		        	</form>
				</div>
			</div>
		</div>
	</div>
	<?php
	$post_meta['plugin_name'] = messaging::$plugin_name;
	add_page_javascript('app/assets/js/page-scripts/submit.js');
	add_page_javascript('contents/plugins/messaging/js/send-bulk-sms.js');
	add_page_javascript('contents/plugins/messaging/js/js-functions.js');
	// add_page_javascript('contents/plugins/messaging/js/get-receipients.js');
}