Пример #1
0
if ($page_nav == "settings") {
    echo ' class="active"';
}
?>
><?php 
echo $lang['settings'];
?>
</a></li>
        <li><a href="logout.php"><?php 
echo $lang['logout'];
?>
</a></li>
    </ul>
    <div id="ip">
        <?php 
showip();
# on the RACHEL-Plus we also show a battery meter
if (is_rachelplus()) {
    echo '
                <script>
                    refreshRate = 1000 * 60 * 1; // one minute on admin page, be conservative
                    function getBatteryInfo() {
                        $.ajax({
                            url: "background.php?getBatteryInfo=1",
                            success: function(results) {
                                //console.log(results);
                                var vert = 0; // shows full charge (each icon down 12px)
                                if      (results.level < 20) { vert = -48; }
                                else if (results.level < 40) { vert = -36; }
                                else if (results.level < 60) { vert = -24; }
                                else if (results.level < 80) { vert = -12; }
Пример #2
0
function ipblock_theme()
{
    global $theme, $globals, $l, $error, $softpanel, $done, $add_list;
    // for ADD
    if (optGET('ajaxadd')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['rec_added'];
            showip();
            return true;
        }
    }
    // For delete
    if (optGET('ajaxdel')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['delete'];
            showip();
            return true;
        }
    }
    softheader($l['<title>']);
    echo '<center>
		<div class="sai_tit"><img src="' . $theme['a_images'] . 'ip_block.gif"  alt=""  />&nbsp;' . $l['lbl_head'] . '</div>
	</center>';
    echo '<form accept-charset="' . $globals['charset'] . '" action="" method="post" name="ipblock" id="editform">
	<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad" style="padding-left:15px; padding-top:15px;" >
		<tr>	
			<td class="sai_head">' . $l['name'] . '</td>		
			<td><input type="text" name="dip" id="dip" size="30"  size="30" /></td>	
		</tr>
		<tr>
			<td colspan="2">
				<p align="center">			
					<input type="hidden" name="add_ip" value="1" />
					<input type="submit" style="cursor:pointer" value="' . $l['submit_button'] . '" name="create_record" class="sai_graybluebut" id="submitip"/> &nbsp;<img id="createmx" src="' . $theme['images'] . 'progress.gif" style="display:none"></center>
				</p>
			</td>
		</tr>
	</table>	
	</form>
	</br></br>
	<center><span class="sai_head" >' . $l['record_table'] . '</span><center><br /><br />';
    echo '<center><div id="showrectab">';
    showip();
    echo '</div></center>
	
	<script language="javascript" type="text/javascript"><!-- // --><![CDATA[	
	$(document).ready(function(){		
				
		// For creating MX Record	
		$("#submitip").click(function(){
			$("#createmx").css("display", "");				
			$.ajax({
				type: "POST",
				url: window.location+"&ajaxadd=1",					
				data: $("#editform").serialize(),
				
				// Checking for error
				success: function(data){
					$("#createmx").css("display", "none");
					var result = data.substring(0,1);
					if(result == "1"){
						$_("dip").value="";						
						var msg = data.substring(1,data.indexOf("<table"));
						var output = data.substring(data.indexOf("<table"));							
						message_box.show_message( "Done ",msg,2);														
						$("#showrectab").html(output);																																
					}
					if(result == "0"){	
						$("#createmx").css("display", "none");
						var msg = data.substring(1);
						message_box.show_message( "Error",msg,1);
					}
				},
				error: function() {
					message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);						
				}															
			});	
			return false;												
		});	
	});	
	// ]]></script>';
    softfooter();
}