<?php 

function sms_list_cb() {
	$roles = get_system_roles();
	// $groups = get_contact_groups();
	$recipients = array();
	if(_count($roles)) {
		foreach ($roles as $role_name => $role_slug) {
			$recipients = array_merge($recipients, [strtoupper($role_name) => get_select_options_from_user(['role' => $role_slug, 'status' => 'active'])]);
		}
	}
	?>
	<div class="row">
		<div class="col-md-5">
			<div class="card">
                <div class="card-header">
                    <strong class="card-title">New Messaging List</strong>
                </div>
                <div class="card-body">
                	<form method="post" id="new_list_form" action="contents/plugins/messaging/ajax.php" data-allow-enter-button="1" data-clearform="1" data-callback="refreshSMSlist" data-callbackid="#sms-list">
		        		<?php 
		        		selectgrp(['label' => 'Receivers', 'id' => 'receivers', 'name' => 'receivers[]', 'class' => 'standardSelect', "tabindex"=>"1", 'multiple' => 'multiple', 'required' => 'required'], $recipients);
		        		input(['label' => 'Name of List', 'id' => 'name', 'required' => 'required']); 
		        		alert(); submit_btn('new_sms_list', '<i class="fas fa-save"></i> Save');
		        		 ?>
		        	</form>
                </div>
            </div>
		</div>
		<div class="col-md-7">
			<div class="card">
                <div class="card-header">
                    <strong class="card-title">Manage Custom List</strong>
                </div>
                <div class="card-body">
                	<div class="table-responsive" id="sms-list">
						<table id="bootstrap-datatable-export" class="table">
							<thead>
								<tr>
									<th>SN</th>
									<th>List Name</th>
									<th>Action</th>
								</tr>
							</thead>
							<tbody></tbody>
						</table>
					</div>
                </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');
	add_page_javascript('contents/plugins/messaging/js/js-functions.js');
}