Current File : //root/panel/modules/enableErrorlogs/module.zpm
<div class="zmodule_content panel" id="zmodule_header_<@ ModuleName @>">
    <div class="panel-heading">
        <img src="<@ ModuleIcon @>" width="35" height="35" border="0" alt="<@ ModuleName @>">

        <div class="zmodule_title">
            <@ ModuleName @>
        </div>

        <div class="zmodule_desc" id="zmodule_desc_<@ ModuleName @>"><@ ModuleDesc @></div>

    </div>

<style>
.helpicon {
display: block;
float: right;
border: 1px solid #ccc;
background-color: #f3f3f3;
padding: 5px 10px;
font-size: 12px;
margin-top:-121px;
margin-right:5px;
-webkit-box-shadow: -8px 7px 5px 0px rgba(204,204,204,1);
-moz-box-shadow: -8px 7px 5px 0px rgba(204,204,204,1);
box-shadow: -8px 7px 5px 0px rgba(204,204,204,1);
-webkit-box-shadow: 8px 7px 5px 0px rgba(204,204,204,1);
-moz-box-shadow: 8px 7px 5px 0px rgba(204,204,204,1);
box-shadow: 8px 7px 5px 0px rgba(204,204,204,1);
}

</style>
<div class="helpicon">
<a href="<@ helpicon @>" target="_blank"><img src="etc/styles/CstyleX-master/images/help.png" style="float:left;" ><span style="float:left;margin-top:8px;font-weight:bold;font-size:12px;" >Video Tutorial</span></a>
</div>


<style>
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {display:none;}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #BF0000;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: #008000;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}
span.on-off-text {
    position: relative;
    bottom: 15px;
    margin-left: 6px;
    margin-right: 6px;
    font-size: 16px;
    font-weight: bold;
}
.table thead>tr>th, .table tbody>tr>th, .table thead>tr>td, .table tbody>tr>td 
{
    vertical-align: middle;
}
</style>

    <div id="zform_wrapper">
    </div>	
	<div class="zform_wrapper" style="width:100%">
		<input type="hidden" name="postoperation" Id="postoperation" value="" />
		<table class="table table-striped" style="float:right;">
		    <tr>
        		<td>Apache Error Log</td>
        		<td>	
                    <span class="on-off-text">Off</span>
                    <label class="switch">
                        <input type="checkbox" id="apache_log" <@ ApacheLogStatus @>>
                        <span class="slider round"></span>
                    </label> 
                    <span class="on-off-text">On</span>
	        	</td>
	    	</tr>
    		<tr>
    		    <td>MySQL Error Log</td>
    	    	<td>	
                    <span class="on-off-text">Off</span>
                    <label class="switch">
                        <input type="checkbox" id="mysql_log" <@ MySQLLogStatus @>>
                        <span class="slider round"></span>
                    </label> 
                    <span class="on-off-text">On</span>
	    	    </td>
		    </tr>
            <tr>
                <th><button class="button-loader btn btn-primary" type="submit" name="EnableLog" id="EnableLog" value=""><: Update Settings :></button></th>
                <th></th>
            </tr>
		</table>
	</div>
	<div style="clear:both;">
	</div>
    

</div>
<script type="text/javascript">
    $(document).ready(function()
    {
        $("#EnableLog").click(function() {
            CloseParent(); 
		var apache_log = false;
            var mysql_log = false;
            if ($('#apache_log').is(":checked"))
            {
                apache_log = true;
            }
            if ($('#mysql_log').is(":checked"))
            {
                mysql_log = true;
            }
            $.ajax({
                type: 'POST',
                url: './?module=enableErrorlogs&action=UpdateLogSettings',
                data:{apache_log:apache_log, mysql_log:mysql_log},
                success: function(data)
                {
                    data = $.trim(data);
                    console.log(data);
                    $("#zloader_overlay").hide();
                    $("#zloader").hide();
                    if(data == 'success')
                    {
                        $("#zform_wrapper").prepend('<div class="alert alert-success"><button type="button" Id="close_button" onClick="CloseParent();" class="close" data-dismiss="alert">×</button><p><strong>Success:</strong> Log settings has been changed successfully.</p></div>');
                    }
                    else if(data == 'busy')
                    {
                        $("#zform_wrapper").prepend('<div class="alert alert-danger"><button type="button" Id="close_button" onClick="CloseParent();" class="close" data-dismiss="alert">×</button><p><strong>Failed: </strong> Server is busy Please try after 5 mins.</p></div>');
                    }
                    else
                    {
                        $("#zform_wrapper").prepend('<div class="alert alert-danger"><button type="button" Id="close_button" onClick="CloseParent();" class="close" data-dismiss="alert">×</button><p><strong>Failed: </strong> Log settings update failed.</p></div>');
                    }
                },
                error: function(ts)
                {
                    $("#zloader_overlay").hide();
                    $("#zloader").hide();
                }
            });
        });
    });
        
function validation(val)
{
document.getElementById("upload_id").value=val;
return true;
// return false;
}
</script>
<script type="text/javascript">
function bindvalues(Id)
{
	document.getElementById("postoperation").value=Id;
	return true;
}
function CloseParent()
{
    $("#close_button").parent().hide();
}
</script>
<style>
.btn
{
margin-right: 10px;
}
</style>