<?php 
$submit_url = $file_name."?page=view_mail&action=$action"; 
$status_submit_url = $file_name."?page=view_mail&name=$name"; 

?>
<style>
em{color:red;font-size: 20px;position: absolute;}
</style>

<!--<button data-toggle="collapse" data-target="#date_worked_area" type="button" name="" class="btn btn-primary add_btn_hide_show <?=$add_btn_hide;?>" style="margin:0 0 5px 10px;" >Add</button>

<div class="card <?=$collapse_area;?>" id="date_worked_area">-->
<div class="card-body" >
	<form action="<?php echo $submit_url;?>" method="post" name="add_form" id="add_form">
		<div class="row">
			<div class="col-lg-12 col-sm-12">
				<div class="form-group">
					<label for="First Name" class="control-label">First Name<em>*</em></label>
					<input type="text" id="first_name" name="first_name" class="form-control" value="<?php echo $first_name;?>" placeholder="First Name" required> 
				</div>
				<div class="form-group">
					<label for="Last Name" class="control-label">Last Name</label>
					<input type="text" id="last_name" name="last_name" class="form-control" value="<?php echo $last_name;?>" placeholder="Last Name"> 
				</div>
				<div class="form-group"> 
					<label class="control-label" for="Email">Email<em>*</em></label> 
					<div class=""> 
						<input type="text" id="email" name="email" class="form-control" value="<?php echo $email;?>" placeholder="Email" required>
					</div> 
				</div>
				<div class="form-group">
					<label for="Unsubscribe" class="control-label">Unsubscribe</label><br/>
					 <input type="checkbox" class="flat-red" id="unsubscribe" name="unsubscribe" value="1"  <? echo ($unsubscribe ==1) ? 'checked':''; ?>>
				</div>
				<div class="form-group">
					<label class="control-label" for="Unsubscribe Date">Unsubscribe Date</label>
					<div>
					  <input type="text" class="form-control datepicker" id="unsubscribe_date"
							name="unsubscribe_date" value="<?php echo (isset($unsubscribe_date) && $unsubscribe_date != "") ? utility::getFormatedDate($unsubscribe_date) : ""; ?>" placeholder="DD-MM-YYYY" autocomplete="off">
					</div>
				</div>
			</div>
		    <div class="col-lg-12">
			<input type="hidden" id="id" name="id" value="<?php echo $id;?>">
			<input type="hidden" id="campaign_id" name="campaign_id" value="<?php echo $campaign_id;?>">
			<input type="hidden" id="query_string" name="query_string" value="<?php echo $query_string;?>">
			<input type="hidden" id="source" name="source" value="<?php echo $source;?>">
			<button type="submit" name="add_master_data" id="add_master_data" class="btn btn-primary"><?=$button_value?>
				<i class="fas fa-sync-alt fa-spin" style="display:none;" id="page_load_div"></i>
			</button>
			<!--<button data-toggle="collapse" data-target="#date_worked_area" type="button" name="" class="btn btn-primary cancel_btn <?=$cancel_btn_hide;?>">Cancel</button>-->
		</div>
		
		</div>
	</form>
</div>
<!--</div>-->
<script type="text/javascript">		
$(document).ready(function() {	
	$('#add_form').submit(function(){
		//$(this).addClass('disabled');
		$("#add_master_data").attr("disabled", true);
		$('#page_load_div').show();
		return true;
	});
	
	$('.add_btn_hide_show').click(function(){
		$('.add_btn_hide_show').hide();
		$('.cancel_btn').show();
		$('#listing').hide();
	});
	$('.cancel_btn').click(function(){
		$('.add_btn_hide_show').show();
		$('#listing').show();
	});
	<? if($_REQUEST['add_new_mail']=='1'){ ?>
		$('.add_btn_hide_show').trigger("click");
	<? } ?>
	
});
</script>