Current File : //root/panel/modules/ssl/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>
	<div id="zform_wrapper">

				<@ Result @>
	</div>			
	<% if isDeleteDomain %>
		<div class="zform_wrapper alert alert-danger">
			<h2><: Delete :>: <@ CurrentDomain @>?</h2>
			<p><: Please confirm that you want to delete SSL for this domain. :></p>
				<table class="none" cellpadding="0" cellspacing="0">
					<tr>
						<td colspan="2" align="right">
							<input type="hidden" Id="inDelete" name="inDelete" value="<@ CurrentID @>">
							<button class="button-loader delete btn btn-danger" type="submit" id="DelSSL" onclick="DelSSL()" ><: Delete :></button>
							<button class="button-loader btn btn-default" type="button" onclick="window.location.href='./?module=ssl';return false;"><: Cancel :></button>
						</td>
					</tr>
				</table>
			<@ CSFR_Tag @>
		</div>
	<% endif %>
	
	<% if isRenewalDomain %>
		<div class="zform_wrapper alert alert-danger">
			<h2><: Renewal :>: <@ CurrentDomain @>?</h2>
			<p><: Please confirm that you want to renewal this domain. :></p>
				<table class="none" cellpadding="0" cellspacing="0">
					<tr>
						<td colspan="2" align="right">
							<input type="hidden" Id="inRenewal" name="inRenewal" value="<@ CurrentID @>">
							<button class="button-loader delete btn btn-danger" type="submit" id="RenewalSSL" onclick="RenewalSSL()" ><: Renewal :></button>
							<button class="button-loader btn btn-default" type="button" onclick="window.location.href='./?module=ssl';return false;"><: Cancel :></button>
						</td>
					</tr>
				</table>
            <@ CSFR_Tag @>
		</div>
    <% endif %>
		
	<div class="zgrid_wrapper" Id="zgrid_wrapper">
        
    </div>
				
    
    <div class="zgrid_wrapper">
        <table class="none" width="100%" cellborder="0" cellspacing="0">
            <tr valign="top">
                <td>
                    <h2><: Create a SSL Certificate :></h2>
                        <table class="table table-striped">
                            <tr>
                                <th nowrap="nowrap"><: Email Address :>:</th>
								<td style="padding-top: 2px;"> <@ EmailList @> </td>
                            </tr>
                            <tr>
                                <th nowrap="nowrap"><: Domain :>:</th>
                                <td style="padding-top: 2px;">
                                    <select name="inDomain" id="inDomain">
                                        <option value="" selected="selected">-- <: Select a domain :> --</option>
                                        <% loop DomainList %>
                                        <option value="<& domain &>"><& domain &></option>
                                        <% endloop %>
                                    </select>
                                </td>
								<td><b>Note :</b> SSL Installed for Your all active domains. If you want reinstall delete the domain and install.</td>
                            </tr>
                            <tr>
                                <th><button class="button-loader btn btn-primary" type="submit" name="CreateSSL" id="CreateSSL" value="inCreate"><: Create :></button></th>
                                <td></td>
                                <td></td>
                            </tr>
                        </table>
                        <@ CSFR_Tag @>                 
                </td>
            </tr>
        </table>
    </div>
    
</div> 
<div>

                  
                       <p><b>Tutorial:</b></p>
                       <a href="https://www.hostingraja.in/hr-panel/11171-hr-panel/3201-content" target="_blank">How to redirect from HTTP to HTTPS ?</a><br/>
					   <a href="https://www.hostingraja.in/hr-panel/11171-hr-panel/3200-content" target="_blank">How to redirect from HTTP to HTTPS in Magento ?</a><br/>
                       <a href="https://www.hostingraja.in/hr-panel/11171-hr-panel/3197-content" target="_blank">How to redirect from HTTP to HTTPS in WordPress ?</a><br/>
                       <a href="https://www.hostingraja.in/hr-panel/11171-hr-panel/3198-content" target="_blank">How to redirect from HTTP to HTTPS in Joomla site ?</a><br/>
                       <a href="https://www.hostingraja.in/hr-panel/11171-hr-panel/3199-content" target="_blank">How to redirect from HTTP to HTTPS in OpenCart ?</a><br/>
 




</div>
<script type="text/javascript">
function DelSSL()
{

$("#zloader_overlay").show();
$("#zloader").show();
var inDelete;
inDelete=$("#inDelete").val();
//alert(inDelete);
$.ajax({
            url: './?module=ssl&action=DeleteSslDomain',
			type:'post',
            data: {inDelete:inDelete},
            success: function(data) {
$('#close_button').trigger("click");
$.ajax({
		type: 'POST',
		url: './?module=ssl&action=SslList',
		success: function(data) {
		$("#zgrid_wrapper").html(data);
		},
		error: function(ts) { 
		console.log(ts.responseText);

		}
		});
$(".zform_wrapper").hide();
$("#zform_wrapper").prepend('<div class="alert alert-block alert-info"><button type="button" Id="close_button" onClick="CloseParent();" class="close" data-dismiss="alert">×</button><p><strong>Success:</strong> SSL Certificate successfully Deleted .</p></div>');  
$("#zloader_overlay").hide();
$("#zloader").hide();
window.location='./?module=ssl';
},
 error: function(ts) { 
console.log(ts.responseText);
$("#zloader_overlay").hide();
$("#zloader").hide();

 }
        });
return false;
}
</script>

<script type="text/javascript">
function RenewalSSL()
{

	$("#zloader_overlay").show();
	$("#zloader").show();
	var inRenewal;
	inRenewal=$("#inRenewal").val();
	$.ajax({
				url: './?module=ssl&action=RenewalSslDomain',
				type:'post',
				data: {inRenewal:inRenewal},
				success: function(data) {
					$('#close_button').trigger("click");
					$.ajax({
							type: 'POST',
							url: './?module=ssl&action=SslList',
							success: function(data) {
								$("#zgrid_wrapper").html(data);
							},
							error: function(ts) { 
							console.log(ts.responseText);

							}
					});
					console.log (data);
					data=data.replace("\n","");
					if(data=="DONE")
					{
						$('#close_button').trigger("click");
						$("#zform_wrapper").prepend('<div class="alert alert-block alert-info"><button type="button" Id="close_button" onClick="CloseParent();" class="close" data-dismiss="alert">×</button><p><strong>Success:</strong> SSL Certificate successfully Renewed. Its take 10-15 minutes for reflect.</p></div>');  
						$("#zloader_overlay").hide();
						$("#zloader").hide();
						window.location='./?module=ssl';
					}
				},
				error: function(ts) { 
					console.log(ts.responseText);
					$("#zloader_overlay").hide();
					$("#zloader").hide();

				}
	});
	return false;
}
</script>


<script type="text/javascript">
    $(document).ready(function(){
	
		$.ajax({
		type: 'POST',
		url: './?module=ssl&action=SslList',
		success: function(data) {
		$("#zgrid_wrapper").html(data);
		},
		error: function(ts) { 
		console.log(ts.responseText);

		}
		});

        $("#CreateSSL").click(function(){
		$("#zloader_overlay").show();
		$("#zloader").show();

		var inDomain=$("#inDomain option:selected").val();
		var sslbutton = document.getElementById("CreateSSL");
		sslbutton.disabled = "true";
		ajax_call(inDomain,function(st)
		{
		  sslbutton.disabled = "false";
		});
		$.ajax({ 

		type: 'POST',
		url: './?module=ssl&action=CreateSSL',
		data:{inDomain:inDomain},
		success: function(data) {
		console.log (data);
			data=data.replace("\n","");
			if(data=="BADPOINTING")
			{
				CloseParent();
				
				$("#zform_wrapper").prepend('<div class="alert alert-block alert-info" style="display: block !important;"><button type="button" Id="close_button" onClick="CloseParent();" class="close" data-dismiss="alert">×</button><p><strong>Failed:</strong> Your Domain name is not pointing to the IP.</p></div>');
				$("#zloader_overlay").hide();
				$("#zloader").hide();
				$("#CreateSSL").removeAttr("disabled");
				return false;
			} 
		
	if(data=="HTTPCODEERR")
			{
				CloseParent();
				
				$("#zform_wrapper").prepend('<div class="alert alert-block alert-info" style="display: block !important;"><button type="button" Id="close_button" onClick="CloseParent();" class="close" data-dismiss="alert">×</button><p><strong>Failed:</strong> Your website not working properly. Kindly update your website that should given a http code as 200</p></div>');
				$("#zloader_overlay").hide();
				$("#zloader").hide();
				$("#CreateSSL").removeAttr("disabled");
				return false;
			} 
					
			if(data=="SOCKETERR")
			{
			CloseParent();
			$("#zform_wrapper").prepend('<div class="alert alert-block alert-info" style="display: block !important;"><button type="button" Id="close_button" onClick="CloseParent();" class="close" data-dismiss="alert">×</button><p><strong>Failed:</strong> Server Busy, Please try after sometimes.</p></div>');
			$("#zloader_overlay").hide();
			$("#zloader").hide();
			$("#CreateSSL").removeAttr("disabled");
			return false;
			}
			
			$('#close_button').trigger("click");

		$.ajax({
		type: 'POST',
		url: './?module=ssl&action=SslList',
		success: function(data) {
		$("#zgrid_wrapper").html(data);
		
		$.ajax({

		url : './?module=ssl&action=SslSock',
		type : 'POST',
		data:{inDomain:inDomain},
		success : function (result) {
		console.log (result);
		},
		error : function () {
		console.log ('error');
		}

		});
		
		
		
		$("#zloader_overlay").hide();
		$("#zloader").hide();

		},
		error: function(ts) { 
		console.log(ts.responseText);

		}
		});
		},
		error: function(ts) { 
		console.log(ts.responseText);
		$("#zloader_overlay").hide();
		$("#zloader").hide();

		}
		}); 
//xhr.abort();

});
});
function CloseParent()
{
$("#close_button").parent().hide();
}

function ajax_call(domain,callback)
{
	function  real_ajax()
	{

	 var xhttp = new XMLHttpRequest();
	  xhttp.onreadystatechange = function() {
		if (this.readyState == 4 && this.status == 200) {
		try 
		{
			 var jd = JSON.parse(this.responseText);
			if(jd.status == 1)
			{
				callback(true);
			}
			else
			{
				setTimeout(function(){ real_ajax();},60000);
			}
		}
		catch(err) {
			console.log("Error in server");
		}
		
		}
	  };
	  xhttp.open("POST", "./?module=ssl&action=SSLButtonDisable", true);
	   xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
       xhttp.send("dom_detail="+encodeURIComponent(domain));

	}
	real_ajax();
}

function showLog()
{
	 $.ajax({

     url : './?module=ssl&action=showLogcontent',
     type : 'POST',
	 
     success : function (result) {
		$("#zform_wrapper").html(result).addClass('alert alert-block alert-info');
		
	 },
     error : function () {
        console.log ('error');
     }

   }); 
return false;
}
</script>