<?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"]."'");
	$reply = $sableDB->getRow("select * from sms_message__reply 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-envelope-open-text" aria-hidden="true"></i>&nbsp;View SMS Reply</h3>
					<p></p>
				</div>
			</div>
			<!--// selClientId -->
			<div class="row forms-grid">
				<div class="col-md-8 forms-grid">
					<input name="selClientId" type="text" id="selClientId"readonly value="<?php echo($selClientId); ?>" >
					<label for="selClientId" class="fieldHint hintUnder" id="hint_selClientId">Client</label>
				</div>
				<div class="col-md-4 forms-grid">
					<input name="edtSmsNumber" type="tel" id="edtSmsNumber"readonly value="<?php echo($row['sms_number']); ?>" >
					<label for="edtSmsNumber" class="fieldHint hintUnder" id="hint_edtSmsNumber">Number</label>
				</div>
			</div>
			<p></p>
			<!-- selClientId //-->
			<p></p>
			<!--// edtSmsMessage -->
			<div class="row forms-grid">
				<div class="col-md-12 forms-grid">
					<input name="edtSmsMessage" type="text" id="edtSmsMessage"readonly value="<?php echo($row['sms_message']); ?>" >
					<label for="edtSmsMessage" class="fieldHint hintUnder" id="hint_edtSmsMessage">Message</label>
				</div>
			</div>
			<p></p>
			<!-- edtSmsMessage //-->
			<p></p>
			<!--// edtSmsReply -->
			<div class="row forms-grid">
				<div class="col-md-12 forms-grid">
					<input name="edtSmsReply" type="text" id="edtSmsReply"readonly value="<?php echo($reply['sms_message']); ?>" >
					<label for="edtSmsReply" class="fieldHint hintUnder" id="hint_edtSmsReply">Reply</label>
				</div>
			</div>
			<p></p>
			<!-- edtSmsReply //-->
			<p></p>
			<!--// edtSmsTimestamp -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtSmsTimestamp" type="text" id="edtSmsTimestamp"readonly value="<?php echo($reply['sms_timestamp']); ?>" >
					<label for="edtSmsTimestamp" class="fieldHint hintUnder" id="hint_edtSmsTimestamp">Date &amp; Time</label>
				</div>
			</div>
			<p></p>
			<!-- edtSmsTimestamp //-->
			<p></p>

		<!--// buttons -->
			<div class="row forms-grid">
				<div class="col-md-2">
					<input type="button" id="btnCancel" value="Cancel"
					class="Back" onclick="window.location = '<?php SableSystem::printCallPageLink('/sms_message/'); ?>'"/>
				</div>
			</div>
		<!-- buttons //-->
		</div>
	</div>
</form>
<!-- Sms Message //-->
