<?php
##############################################################################
###      Custom function file for SolusVM WHMCS module version 3           ###
##############################################################################
### Reaname this file to custom.php and uncomment the functions you require
### Report any bugs or feature requests for this module to the following link:
### http://developer.soluslabs.com/projects/billing-whmcs
### FULL Descriptions of these functions are located here:
### http://wiki.solusvm.com/index.php/WHMCS_Module_v3#Custom_Configuration
##############################################################################

# function solusvmpro_customclientareaunavailable($params, $cparams)
# {
#   ###########################################################################
#   ### This function allows you to specify a custom message in the client area
#   ### when the vps is suspended or the API fails to return any data.
#   ###########################################################################
#   ################################## CODE ###################################
#   $output = '<table width="100%" cellspacing="0" cellpadding="0" class="frame">
#            <tr><td><table width="100%" border="0" cellpadding="10" cellspacing="0">
#            <tr>
#            <td width="150" class="fieldarea">Status:</td>
#            <td>' . $cparams["displaystatus"] . '</td>
#            </tr>
#            </table>
#            </td>
#            </tr>
#            </table> 
#           ';
#   return $output;
# }

# function solusvmpro_customclientarea($params, $cparams)
# {
#   ###########################################################################
#   ### This function allows you to create a custom the client area.
#   ###########################################################################
#   ################################## CODE ###################################
#   $htmlarray = array();
#   ### Buttons ###
#   if($cparams["displayreboot"]) {
#     $rebootbutton = '<input type="button" style="width: 135px" class="searchinput" value="Reboot" onClick="window.location=\'clientarea.php?action=productdetails&id=' . $params[serviceid] . '&serveraction=custom&a=reboot\'" />';
#   }
#   if($cparams["displayshutdown"]) {
#     $shutdownbutton = '<input type="button" style="width: 135px" class="searchinput" value="Shutdown" onClick="window.location=\'clientarea.php?action=productdetails&id=' . $params[serviceid] . '&serveraction=custom&a=shutdown\'" />';
#   }
#   if($cparams["displayboot"]) {
#     $bootbutton = '<input type="button" style="width: 135px" class="searchinput" value="Boot" onClick="window.location=\'clientarea.php?action=productdetails&id=' . $params[serviceid] . '&serveraction=custom&a=boot\'" />';
#   }
#   if($cparams["displayconsole"]) {
#     $console = '<input type="button" style="width: 135px" class="searchinput" value="Serial Console" onClick="window.open(\'console.php?id=' . $params[serviceid] . '\', \'_blank\',\'width=670,height=500,status=no,location=no,toolbar=no,menubar=no\')" />';
#   }
#   if($cparams["displayvnc"]) {
#     $vnc = '<input type="button" style="width: 135px" class="searchinput" value="VNC" onClick="window.open(\'vnc.php?id=' . $params[serviceid] . '\', \'_blank\',\'width=100,height=50,status=no,location=no,toolbar=no,menubar=no\')" />';
#   }
#   if($cparams["displayrootpassword"]) {
#     $rootpassword = '<input type="button" style="width: 135px" class="searchinput" value="Root Password" onClick="window.open(\'rootpassword.php?id=' . $params[serviceid] . '\', \'_blank\',\'width=400,height=200,status=no,location=no,toolbar=no,menubar=no\')" />';
#   }
#   if($cparams["displayhostname"]) {
#     $hostname = '<input type="button" style="width: 135px" class="searchinput" value="Hostname" onClick="window.open(\'changehostname.php?id=' . $params[serviceid] . '\', \'_blank\',\'width=400,height=200,status=no,location=no,toolbar=no,menubar=no\')" />';
#   }
#   if($cparams["displayconsolepassword"]) {
#     $consolepassword = '<input type="button" style="width: 135px" class="searchinput" value="Console Password" onClick="window.open(\'consolepassword.php?id=' . $params[serviceid] . '\', \'_blank\',\'width=400,height=200,status=no,location=no,toolbar=no,menubar=no\')" />';
#   }
#   if($cparams["displayvncpassword"]) {
#     $vncpassword = '<input type="button" style="width: 135px" class="searchinput" value="VNC Password" onClick="window.open(\'vncpassword.php?id=' . $params[serviceid] . '\', \'_blank\',\'width=400,height=200,status=no,location=no,toolbar=no,menubar=no\')" />';
#   }
#   if($cparams["displaypanelbutton"]) {
#     $cpbutton = '<input type="button" style="width: 135px" class="searchinput" value="Control Panel" onClick="window.open(\'' . $cparams["controlpanellink"] . '\', \'_blank\')" />';
#   }
#   $htmlarray["buttons"] = '<tr><td width="150" class="fieldarea">Options:</td><td align="left">' . $rebootbutton . '' . $shutdownbutton . '' . $bootbutton . '' . $console . '' . $vnc . '' . $rootpassword . '' . $hostname . '' . $consolepassword . '' . $vncpassword . '' . $cpbutton . '</td></tr>';
#   ### Graphs ###
#   if($cparams["displaygraphs"]) {
#     if($cparams["displaytrafficgraph"]) {
#       $htmlarray["trafficgraph"] = '<tr><td width="150" class="fieldarea">Traffic Graph:</td><td align="left"><img src="' . $cparams["trafficgraphurl"] . '" alt="Traffic Graph Unavailable"/></td</tr>';
#     }
#     if($cparams["displayloadgraph"]) {
#       $htmlarray["loadgraph"] = '<tr><td width="150" class="fieldarea">Load Graph:</td><td align="left"><img src="' . $cparams["loadgraphurl"] . '" alt="Load Graph Unavailable"/></td></tr>';
#     }
#     if($cparams["displaymemorygraph"]) {
#       $htmlarray["memorygraph"] = '<tr><td width="150" class="fieldarea">Memory Graph:</td><td align="left"><img src="' . $cparams["memorygraphurl"] . '" alt="Memory Graph Unavailable"/></td></tr>';
#     }
#   }
#  ### Usage Bars ###
#   if($cparams["displaybandwidthbar"]) {
#     $htmlarray["bandwidthbar"] = '<tr><td width="150" class="fieldarea">Bandwidth:</td><td align="left"><div class="bar-container"><span id="bar_text">' . $cparams["bandwidthpercent"] . '%</span><div id="bar_bar" style="width: ' . $cparams["bandwidthpercent"] . '%;background-color: ' . $cparams["bandwidthcolor"] . ';"></div></div>' . $cparams["bandwidthused"] . ' of ' . $cparams["bandwidthtotal"] . ' Used / ' . $cparams["bandwidthfree"] . ' Free</td></tr>';
#   }
#   if($cparams["displaymemorybar"]) {
#     $htmlarray["memorybar"] = '<tr><td width="150" class="fieldarea">Memory:</td><td align="left"><div class="bar-container"><span id="bar_text">' . $cparams["memorypercent"] . '%</span><div id="bar_bar" style="width: ' . $cparams["memorypercent"] . '%;background-color: ' . $cparams["memorycolor"] . ';"></div></div>' . $cparams["memoryused"] . ' of ' . $cparams["memorytotal"] . ' Used / ' . $cparams["memoryfree"] . ' Free</td></tr>';
#   }
#   if($cparams["displayhddbar"]) {
#     $htmlarray["hddbar"] = '<tr><td width="150" class="fieldarea">Disk:</td><td align="left"><div class="bar-container"><span id="bar_text">' . $cparams["hddpercent"] . '%</span><div id="bar_bar" style="width: ' . $cparams["hddpercent"] . '%;background-color: ' . $cparams["hddcolor"] . ';"></div></div>' . $cparams["hddused"] . ' of ' . $cparams["hddtotal"] . ' Used / ' . $cparams["hddfree"] . ' Free</td></tr>';
#   }
#   ### Misc ###
#   if($cparams["displaystatus"]) {
#     $htmlarray["displaystatus"] = '<tr><td width="150" class="fieldarea">Status:</td><td align="left">' . $cparams["displaystatus"] . '</td></tr>';
#   }
#   if($cparams["displayips"]) {
#     $htmlarray["ips"] = '<tr><td width="150" class="fieldarea">IP Address:</td><td align="left">' . $cparams["ipcsv"] . '</td></tr>';
#   }
#   $output = '<style type="text/css">div.bar-container {border: 1px solid #ccc; width: 150px; margin: 2px 5px 2px 0; padding: 1px; float: left; background: white; position:relative;}div.bar-container div {background-color: #ff7021; height: 12px;}div.bar-container span {width:140px;text-align:center;float:left;font: normal 9px Arial,sans-serif;margin-top: 0px;}</style>
#           <span style="text-align: left"><h2>Virtual Server Control</h2></span>
#           <table width="100%" cellspacing="0" cellpadding="0" class="frame">
#		   <tr><td>
#		   <table width="100%" border="0" cellpadding="10" cellspacing="0">
#           ' . $htmlarray["displaystatus"] . '
#           ' . $htmlarray["bandwidthbar"] . '
#	       ' . $htmlarray["memorybar"] . '
#	       ' . $htmlarray["hddbar"] . '
#           ' . $htmlarray["buttons"] . '
#		   ' . $htmlarray["ips"] . '
#		   ' . $htmlarray["trafficgraph"] . '
#		   ' . $htmlarray["memorygraph"] . '
#		   ' . $htmlarray["loadgraph"] . '
#           </table>
#           </td>
#           </tr>
#           </table>
#		  ';
#   return $output;
# }

# function solusvmpro_hostname($params)
# {
#   ###########################################################################
#   ### This function allows you to randomly create a hostname when a virtual
#   ### server is ordered, if no hostname is specified.
#   ###########################################################################
#   ################################## CODE ###################################
#   $serviceid = $params["serviceid"];
#   $clientsdetails = $params["clientsdetails"];
#   if(!empty($params[domain])) {
#     $currentHost = $params[domain] {
#       strlen($params[domain]) - 1}
#     ;
#     if(!strcmp($currentHost, ".")) {
#       $newHost = substr($params[domain], 0, -1);
#       mysql_real_escape_string($newHost);
#       mysql_query("UPDATE tblhosting SET `domain` = '$newHost' WHERE `id` = '$serviceid'");
#     } else {
#       $newHost = $params[domain];
#     }
#   } else {
#     $newHost = "vps" . $serviceid . $clientsdetails['id'] . ".EXAMPLEDOMAIN.COM";
#   }
#   return $newHost;
# }

# function solusvmpro_username($params)
# {
#   ###########################################################################
#   ### This function allows you to create a random username for the solusvm
#   ### login. This is handy if you want seperate accounts for all virtual
#   ### servers.
#   ###########################################################################
#   ################################## CODE ###################################
#   $uniqueCod = md5(uniqid(mt_rand(), true));
#   $uniqueCod = substr($uniqueCod, 1, 5);
#   $uname = "USER" . $serviceid . $uniqueCod;
#   return $uname;
# }

# function solusvmpro_AdminLink($params)
# {
#   ###########################################################################
#   ### This function allows you to create a direct login link to your admincp
#   ### from the server list in whmcs
#   ###########################################################################
#   ################################## CODE ###################################
#   $code = '<form action="https://' . $params["serverip"] . ':5656/admincp/login.php" method="post" target="_blank">
#             <input type="hidden" name="username" value="ADMINUSERNAME" />
#             <input type="hidden" name="password" value="ADMINPASSOWRD" />
#             <input type="submit" name="Submit" value="Login" />
#             </form>
#			';
#   return $code;
# }

# function solusvmpro_create_one($params)
# {
# }

# function solusvmpro_create_two($params)
# {
# }

# function solusvmpro_create_three($params)
# {
# }

# function solusvmpro_create_four($params)
# {
# }

# function solusvmpro_create_five($params)
# {
# }

# function solusvmpro_terminate_pre($params)
# {
# }

# function solusvmpro_terminate_post_success($params)
# {
# }

# function solusvmpro_terminate_post_error($params)
# {
# }

# function solusvmpro_suspend_pre($params)
# {
# }

# function solusvmpro_suspend_post_success($params)
# {
# }

# function solusvmpro_suspend_post_error($params)
# {
# }

# function solusvmpro_unuspend_pre($params)
# {
# }

# function solusvmpro_unsuspend_post_success($params)
# {
# }

# function solusvmpro_unsuspend_post_error($params)
# {
# }

# function solusvmpro_changepackage_pre($params)
# {
# }

# function solusvmpro_changepackage_post_success($params)
# {
# }

# function solusvmpro_changepackage_post_error($params)
# {
# }
?>