<?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);
$selClientId  = $sableDB->getValue("select concat(client_name, ' ', client_surname) from `client` where client_id = '".$row["client_id"]."'");
?>
<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-eye" aria-hidden="true"></i>&nbsp;View 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"readonly 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"readonly 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']?"Yes":"No"; ?>
					<input name="cbSmsSent" type="text" id="cbSmsSent"readonly value="<?php echo($cbSmsSent); ?>" >
				</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"readonly 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"readonly 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">
					<input name="selClientId" type="text" id="selClientId"readonly value="<?php echo($selClientId); ?>" >
				</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="editSmsMessage('<?php echo(SableSystem::sableEncode($hddnSmsId)); ?>')" value="Modify Sms Message" class="submit"/>
				</div>
			</div>
		<!-- buttons //-->
		</div>
	</div>
</form>
<!-- Sms Message //-->
