You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.3 KiB
HTML

<%+header%>
<h2 name="content"><%:Smstools3: Send Message%></h2>
<script type="text/javascript" src="<%=resource%>/xhr.js?v=git-20.294.76110-ad9a60a"></script>
<script type="text/javascript">//<![CDATA[
reading = 0;
function sendsms()
{
if ( reading > 0 )
{
return false;
}
var s = document.getElementById("sendto").value;
//document.getElementById('rding').innerHTML=s.length;
if ( s.length == 0 )
{
alert("<%:You must enter a phone number!%>");
return false;
}
s = s.trim();
if ( isNaN(s) == true )
{
alert("<%:Invalid phone number!%>");
return false;
}
var num = s.concat(" ");
num = num.substr(0, 20);
var t = document.getElementById("txtmessage").value;
<% tl =%> t
if ( t.length == 0 )
{
alert("<%:Message is blank!%>");
return false;
}
if ( t.length > 160 )
{
t = t.substr(0, 160);
}
num = num.concat(t);
XHR.get('<%=luci.dispatcher.build_url("admin", "modem", "push_sms")%>',
{ set: num },
function()
{
alert("<%:Message sent.%>");
}
);
}
function newsms()
{
if ( reading > 0 )
{
return false;
}
document.getElementById('sendmsg').style.display="table";
document.getElementById('sendtxt').style.display="table";
document.getElementById('sendbtn').style.display="table";
document.getElementById("sendto").value="";
document.getElementById("txtmessage").value="";
return false;
}
//]]></script>
<fieldset class="cbi-section">
<table id="sendmsg" width="600" border="0" style="display:table;">
<tr>
<td width="15%"><div align="left"><strong><%:Send To%> :</strong></div></td>
<td width="70%"><input type="number" name="sendto" id="sendto" maxlength="20"></input></td>
<td width="15%">&nbsp;</td>
</tr>
</table>
<br />
<table id="sendtxt" width="700" border="0" style="display:table;">
<tr>
<td width="100%">
<textarea type="message" name="txtmessage" id="txtmessage" rows="6" style="width: 600px;" maxlength="160"></textarea>
</td>
</tr>
</table>
<table id="sendbtn" width="550" border="0" style="display:table;">
<tr>
<td width="17%"><br /><input type="button" id="sendbtn" class="cbi-button cbi-button-apply" value="<%:Push%>" onclick="return sendsms()" /></td>
<td width="13%">&nbsp;</td>
<td width="70%">&nbsp;</td>
</tr>
</table>
</fieldset>
<%+footer%>