<?php
	include("sms_message_func.php");
	$hddnSmsId = $_SESSION['caller']['args'][1];
	if ($_SESSION['user']['access_level'] < SABLE_ACCESS_MANAGER)
	{
		SableGeneralFunctions::divertFromPage();
	}
	$row = $sableDB->getRow("select * from sms_message where sms_id = ".$hddnSmsId);
?>
<script src="<?php SableGeneralFunctions::printModuleJS('sms_message'); ?>"></script>

<!--// Sms Message -->
<form id="frmSmsMessage" name="frmSmsMessage" autocomplete="on">
	<input type="hidden" value="<?php echo(SableSystem::sableEncode($hddnSmsId)); ?>" id="hddnSmsId" name="hddnSmsId" />
	<div class="forms">
		<div class="container forms-grids">
			<div class="row forms-grid">
				<div class="col-md-12">
					<h3 class="title"><i class="fa fa-edit" aria-hidden="true"></i>&nbsp;Modify Sms Message</h3>
					<p></p>
				</div>
			</div>
			<!--// edtSmsNumber -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtSmsNumber" type="tel" id="edtSmsNumber" onfocus="showHint('edtSmsNumber'); validate_edtSmsNumber();" onblur="hideHint('edtSmsNumber');" placeholder="Number" onkeypress="handleEnter(this, event);" value="<?php echo($row['sms_number']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtSmsNumber">Number</div>
				</div>
			</div>
			<p></p>
			<!-- edtSmsNumber //-->
			<p></p>
			<!--// edtSmsMessage -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtSmsMessage" type="text" id="edtSmsMessage" onfocus="showHint('edtSmsMessage'); validate_edtSmsMessage();" onblur="hideHint('edtSmsMessage');" placeholder="Message" onkeypress="handleEnter(this, event);" value="<?php echo($row['sms_message']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtSmsMessage">Message</div>
				</div>
			</div>
			<p></p>
			<!-- edtSmsMessage //-->
			<p></p>
			<!--// cbSmsSent -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<?php $cbSmsSent = $row['sms_sent']; ?>
					<div class="switch">
					<input name="cbSmsSent" type="checkbox" id="cbSmsSent" class="form-toggle form-toggle-yes-no" onfocus="showHint('cbSmsSent');" onblur="hideHint('cbSmsSent'); validate_cbSmsSent()"  placeholder="Sent" onkeypress="handleEnter(this, event)"<?php if($cbSmsSent) echo("checked='checked'"); ?> />
<label for="cbSmsSent" data-on="Yes" data-off="No"></label>
					</div>
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_cbSmsSent">Sent</div>
				</div>
			</div>
			<p></p>
			<!-- cbSmsSent //-->
			<p></p>
			<!--// edtSmsReply -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtSmsReply" type="text" id="edtSmsReply" onfocus="showHint('edtSmsReply'); validate_edtSmsReply();" onblur="hideHint('edtSmsReply');" placeholder="Reply" onkeypress="handleEnter(this, event);" value="<?php echo($row['sms_reply']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtSmsReply">Reply</div>
				</div>
			</div>
			<p></p>
			<!-- edtSmsReply //-->
			<p></p>
			<!--// edtSmsKey -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtSmsKey" type="text" id="edtSmsKey" onfocus="showHint('edtSmsKey'); validate_edtSmsKey();" onblur="hideHint('edtSmsKey');" placeholder="Key" onkeypress="handleEnter(this, event);" value="<?php echo($row['sms_key']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtSmsKey">Key</div>
				</div>
			</div>
			<p></p>
			<!-- edtSmsKey //-->
			<p></p>
			<!--// selClientId -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<div class="dropdown">
						<select name="selClientId" type="select" id="selClientId" onfocus="showHint('selClientId');" onblur="hideHint('selClientId'); validate_selClientId()" onkeypress="handleEnter(this, event)" placeholder="Client">
<?php echo(SableDBFunctions::getOptions("client", "client_id", "concat(client_name, ' ', client_surname)", $row['client_id'])); ?>
						</select>
					</div>
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_selClientId">Client</div>
				</div>
			</div>
			<p></p>
			<!-- selClientId //-->
			<p></p>
		<!--// buttons -->
			<div class="row forms-grid">
				<div class="col-md-2">
					<input type="button" id="btnCancel" value="Cancel"
					class="submit" onclick="window.location = '<?php SableSystem::printCallPageLink('/sms_message/'); ?>'"/>
				</div>
				<div class="col-md-2 forms-grid">
					<input id="btnOk" type="button" onclick="modifySmsMessage();" value="Update Sms Message" class="submit"/>
				</div>
			</div>
		<!-- buttons //-->
		</div>
	</div>
</form>
<!-- Sms Message //-->
