<?php
/****************************************************************************
This script was developed by Indigo Scripts
Title: Indigo eHostWorx
Version: 2
Homepage: www.indigoscripts.com
Copyright 2005 Indigo Scripts and its owners.
All rights reserved.

THIS COPYRIGHT INFORMATION MUST REMAIN INTACT AND MAY NOT BE MODIFIED IN ANY WAY

When you purchased this script you agreed to accept the terms
of this Agreement. This Agreement is a legal contract, which
specifies the terms of the license and warranty limitation between
you and 'Indigo Scripts'. You should carefully read the following
terms and conditions before installing or using this software.
Unless you have a different license agreement obtained from
'Indigo Scripts', installation or use of this 
software indicates your acceptance of the license and warranty
limitation terms contained in this Agreement.
If you do not agree to the terms of this Agreement, promptly delete
and destroy all copies of the Software.

Versions of the Software
Only one licenced copy of this software may be used on one web site.
		
License to Redistribute
Distributing the software and/or documentation with other products
(commercial or otherwise) by any means without prior written 
permission from 'Indigo Scripts' is forbidden.
All rights to the software and documentation not expressly
granted under this Agreement are reserved to 'Indigo Scripts'.
	
Disclaimer of Warranty
THIS SOFTWARE AND ACCOMPANYING DOCUMENTATION ARE PROVIDED "AS IS" 
AND WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY 
OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED.   BECAUSE OF THE 
VARIOUS HARDWARE AND SOFTWARE ENVIRONMENTS INTO WHICH THIS SOFTWARE 
MAY BE USED, NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS 
OFFERED.  THE USER MUST ASSUME THE ENTIRE RISK OF USING THIS 
PROGRAM.  ANY LIABILITY OF 'INDIGO SCRIPTS' WILL BE LIMITED 
EXCLUSIVELY TO PRODUCT REPLACEMENT OR REFUND OF PURCHASE PRICE.
IN NO CASE SHALL 'INDIGO SCRIPTS' OR IT'S OWNERS BE LIABLE FOR 
ANY INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS, INCLUDING, 
WITHOUT LIMITATION, LOST PROFITS OR THE INABILITY TO USE EQUIPMENT 
OR ACCESS DATA, WHETHER SUCH DAMAGES ARE BASED UPON A BREACH OF 
EXPRESS OR IMPLIED WARRANTIES, BREACH OF CONTRACT, NEGLIGENCE, 
STRICT TORT, OR ANY OTHER LEGAL THEORY. THIS IS TRUE EVEN IF 
'INDIGO SCRIPTS' OR IT'S OWNERS IS ADVISED OF THE POSSIBILITY OF SUCH 
DAMAGES. IN NO CASE WILL 'INDIGO SCRIPTS' OR IT'S OWNERS LIABILITY EXCEED 
THE AMOUNT OF THE LICENSE FEE ACTUALLY PAID BY LICENSEE TO 'INDIGO SCRIPTS' 
OR OWNERS.

Warning: This program is protected by copyright law and is registered with 
the United States Copyright Office. Unauthorized reproduction or distribution 
of this program, or any portion of it, may result in severe civil and criminal 
penalties, and will be prosecuted to the maximum extent possible under the law.

For more information about this script or other scripts please visit
http://www.indigoscripts.com

Thank you for purchasing our script.
If you have any suggestions or ideas please direct them to info@indigoscripts.com
****************************************************************************/

####################################
session_start();
include $_SERVER['DOCUMENT_ROOT'].'/hostworx/includes/config.php';
include $_SERVER['DOCUMENT_ROOT'].'/hostworx/includes/default.css';
include $_SERVER['DOCUMENT_ROOT'].'/hostworx/admin/auth.php';
require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
include $_SERVER['DOCUMENT_ROOT'].'/hostworx/includes/constants.php';
$id = $_GET['id'];
$edit = $_GET['edit'];
####################################



?>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> 
<?PHP

if ($edit == tru) {$x = '&edit=tru';}

$SQL = "SELECT * from HOSTINGPACKAGES WHERE ID='$id'";
$result = mysql_query( $SQL );
while( $row = mysql_fetch_array( $result ) ) 
{
$id = $row["ID"];
$name = $row["NAME"];
$whmname = $row["WHMNAME"];
$monthly = $row["MONTHLY"];
$quarterly = $row["QUARTERLY"];
$semiannually = $row["SEMIANNUALLY"];
$annually = $row["ANNUALLY"];
$twoyears = $row["2YEARS"];
$freetrial = $row["FREETRIAL"];

$isfree = $row["ISFREE"];
$reply = $row["REPLY"];
$subject = $row["SUBJECT"];
$message = $row["MESSAGE"];
$digit = $row["DIGIT"];
$period = $row["PERIOD"];
$isreseller = $row["ISRESELLER"];
}
?> 
<form name="form1" method="post" action="function.php?which=HOSTINGPACKAGES&return=hostingpackages<?php echo $x; ?>&t1=WHMNAME&t2=NAME&t3=ISFREE&t4=MONTHLY&t5=QUARTERLY&t6=SEMIANNUALLY&t7=ANNUALLY&t8=2YEARS&t9=FREETRIAL&t10=DIGIT&t11=PERIOD&t12=SUBJECT&t13=REPLY&t14=MESSAGE&t15=ISRESELLER&id=<?php echo $id; ?>"> 
  <br> 
  <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" bordercolor="#F9F9F9" width="90%" align="center"> 
    <tr bgcolor="#CCCCCC" valign="middle"> 
      <td valign="middle" width="50%" bgcolor="#F9F9F9"> <table width="50%" border="0" cellspacing="0" cellpadding="0"> 
          <tr> 
            <td bgcolor="#eeeeee" nowrap><font color="#000000"><b>Existing Hosting Plans</b></font></td> 
          </tr> 
        </table></td> 
    </tr> 
  </table> 
  <table border="0" cellspacing="1" cellpadding="5" bgcolor="#CCCCCC" bordercolor="#F9F9F9" width="90%" align="center"> 
    <tr bgcolor="#FFFFFF" valign="middle"> 
      <td valign="middle"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> 
          <tr valign="top"> 
            <td bgcolor="#eeeeee" width="5%">&nbsp; </td> 
            <td width="85%"> <table cellspacing="5" cellpadding="0" border="0" bordercolor="#FFFFFF" bgcolor="#FFFFFF" width="95%" align="center"> 
                <?PHP

$SQL = "SELECT * from HOSTINGPACKAGES ORDER BY NAME ASC";
$result = mysql_query( $SQL );
while( $row = mysql_fetch_array( $result ) ) {
$id2 = $row["ID"];
$cname = $row["NAME"];
$cwhmname = $row["WHMNAME"];

?> 
                <tr> 
                  <td bgcolor="#F9F9F9" width="50%"> <b> <?php echo $cname;?> </b> </td> 
                  <td bgcolor="#F9F9F9" width="50%"><b> <?php echo $cwhmname;?> </b></td> 
                  <td width="24" bgcolor="#F9F9F9"> <div align="center"><a href="hostingpackages.php?edit=tru&id=<?php echo $id2; ?>"><img src="edit.jpg" width="12" height="17" border="0"></a></div></td> 
                  <td width="24" bgcolor="#FCFCFC"> <div align="center"><a href="delete.php?id=<?php echo $id2; ?>&type=HOSTINGPACKAGES&return=hostingpackages"><img src="trash.jpg" width="14" height="17" border="0"></a></div></td> 
                </tr> 
                <?php } ?> 
              </table> 
              <?php if (empty($cname)) { echo 'You have no hosting plans, create one below'; } ?> </td> 
            <td width="10%" bgcolor="#F9F9F9" valign="bottom">&nbsp; </td> 
          </tr> 
        </table></td> 
    </tr> 
  </table> 
  <br> 
  <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" bordercolor="#F9F9F9" width="90%" align="center"> 
    <tr bgcolor="#CCCCCC" valign="middle"> 
      <td valign="middle" width="50%" bgcolor="#F9F9F9"> <table width="50%" border="0" cellspacing="0" cellpadding="0"> 
          <tr> 
            <td bgcolor="#eeeeee" nowrap><font color="#000000"><b>Package Selection</b></font></td> 
          </tr> 
        </table></td> 
    </tr> 
  </table> 
  <table border="0" cellspacing="1" cellpadding="5" bgcolor="#CCCCCC" bordercolor="#F9F9F9" width="90%" align="center"> 
    <tr bgcolor="#FFFFFF" valign="middle"> 
      <td valign="middle"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> 
          <tr valign="top"> 
            <td bgcolor="#eeeeee" width="5%">&nbsp; </td> 
            <td width="85%"> <table border="0" cellspacing="5" cellpadding="0" bgcolor="#FFFFFF" bordercolor="#F9F9F9" align="center" width="95%"> 
                <tr valign="middle" bgcolor="#F9F9F9"> 
                  <td valign="middle"> <div align="left"><font color="#333333"><a href="#"><img src="question.jpg" width="15" height="15" onMouseUp="MM_popupMsg('Select the WHM package to use with this plan.\r\rNote - These are created in WHM (yourdomain.com/whm/)\r\rNote - You must configure your eHostWorx settings before this will work')" border="0"></a></font></div></td> 
                  <td bgcolor="#F9F9F9" width="35%"> <div align="left"><font color="#666666"><b> Package</b></font></div></td> 
                  <td width="65%"> <select name="1"> 
                      <option selected> <?php echo $whmname; ?> </option> 
                      <?php
$accts = listpkgs($host,$user,$rak, 0);
foreach ($accts as $label => $content) { 

echo "<option>$label</option>"; 
}
?> 
                    </select> </td> 
                </tr> 
                <tr valign="middle" bgcolor="#F9F9F9"> 
                  <td valign="middle"><b><font color="#333333"><a href="#"><img src="question.jpg" width="15" height="15" onMouseUp="MM_popupMsg('This is the name that your visitors will see for this hosting plan.\r\rExample(s) : \rBasic\rStandard\rPremium')" border="0"></a></font></b></td> 
                  <td bgcolor="#F9F9F9" width="35%"><b><font color="#666666">Package Title</font></b> </td> 
                  <td width="65%"> <input type="text" name="2" value="<?php echo $name; ?>" size="30"> </td> 
                </tr> 
                <tr valign="middle" bgcolor="#F9F9F9"> 
                  <td valign="middle"><b><font color="#333333"><a href="#"><img src="question.jpg" width="15" height="15" onMouseUp="MM_popupMsg('Select : \&quot;Reseller\&quot; to create a reseller package.\r\rNOTE - This option is only available to hosts with root access. Web hosts using a reseller account may NOT create reseller accounts of thier own.')" border="0"></a></font></b></td> 
                  <td bgcolor="#F9F9F9" width="35%"><b><font color="#666666">Reseller Privileges</font></b></td> 
                  <td width="65%"><b> 
                    <select name="15"> 
                      <option selected> <?php echo $isreseller; ?> </option> 
                      <option value="Standard">Standard</option> 
                      <option value="Reseller">Reseller</option> 
                    </select> 
                    </b></td> 
                </tr> 
              </table></td> 
            <td width="10%" bgcolor="#F9F9F9" valign="bottom">&nbsp; </td> 
          </tr> 
        </table></td> 
    </tr> 
  </table> 
  <br> 
  <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" bordercolor="#F9F9F9" width="90%" align="center"> 
    <tr bgcolor="#CCCCCC" valign="middle"> 
      <td valign="middle" width="50%" bgcolor="#F9F9F9"> <table width="50%" border="0" cellspacing="0" cellpadding="0"> 
          <tr> 
            <td bgcolor="#eeeeee" nowrap><font color="#000000"><b>Package Pricing </b> | Do NOT include <?php echo $cs; ?> symbol in price | Correct format : 0.00</font></td> 
          </tr> 
        </table></td> 
    </tr> 
  </table> 
  <table border="0" cellspacing="1" cellpadding="5" bgcolor="#CCCCCC" bordercolor="#F9F9F9" width="90%" align="center"> 
    <tr bgcolor="#FFFFFF" valign="middle"> 
      <td valign="middle"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> 
          <tr valign="top"> 
            <td bgcolor="#eeeeee" width="5%">&nbsp; </td> 
            <td width="85%"> <table border="0" cellspacing="5" cellpadding="0" bgcolor="#FFFFFF" bordercolor="#F9F9F9" align="center" width="95%"> 
                <tr valign="middle" bgcolor="#F9F9F9"> 
                  <td valign="middle"><b><font color="#333333"><a href="#"><img src="question.jpg" width="15" height="15" onMouseUp="MM_popupMsg('If you select \&quot;Yes\&quot; this plan will be available free of charge.')" border="0"></a></font></b></td> 
                  <td bgcolor="#F9F9F9" width="35%"> <b><font color="#666666">Is Free Hosting Plan?</font> </b></td> 
                  <td width="66%"><b> 
                    <select name="3"> 
                      <option selected> <?php echo $isfree; ?> </option> 
                      <option>No</option> 
                      <option>Yes</option> 
                    </select> 
                    </b></td> 
                </tr> 
                <tr valign="middle" bgcolor="#F9F9F9"> 
                  <td valign="middle"><b><font color="#333333"><a href="#"><img src="question.jpg" width="15" height="15" onMouseUp="MM_popupMsg('If not free, the cost of this plan per month.\r\rIf you do not wish to include this billing option, leave the field blank.')" border="0"></a></font></b></td> 
                  <td bgcolor="#F9F9F9" width="35%"> <b><font color="#666666">Per Month</font> </b></td> 
                  <td width="66%"><b> 
                    <input type="text" name="4" value="<?php echo $monthly; ?>" size="30"> 
                    </b></td> 
                </tr> 
                <tr valign="middle" bgcolor="#F9F9F9"> 
                  <td valign="middle"><b><font color="#333333"><a href="#"><img src="question.jpg" width="15" height="15" onMouseUp="MM_popupMsg('If not free, the cost of this plan per quarter.\r\rIf you do not wish to include this billing option, leave the field blank.')" border="0"></a></font></b></td> 
                  <td bgcolor="#F9F9F9" width="35%"><b><font color="#666666">Quarterly</font> </b></td> 
                  <td width="66%"><b> 
                    <input type="text" name="5" value="<?php echo $quarterly; ?>" size="30"> 
                    </b></td> 
                </tr> 
                <tr valign="middle" bgcolor="#F9F9F9"> 
                  <td valign="middle"><b><font color="#333333"><a href="#"><img src="question.jpg" width="15" height="15" onMouseUp="MM_popupMsg('If not free, the cost of this plan per half year.\r\rIf you do not wish to include this billing option, leave the field blank.')" border="0"></a></font></b></td> 
                  <td bgcolor="#F9F9F9" width="35%"><b><font color="#666666">Semi Annually</font> </b></td> 
                  <td width="66%"><b> 
                    <input type="text" name="6" value="<?php echo $semiannually; ?>" size="30"> 
                    </b></td> 
                </tr> 
                <tr valign="middle" bgcolor="#F9F9F9"> 
                  <td valign="middle"><b><font color="#333333"><a href="#"><img src="question.jpg" width="15" height="15" onMouseUp="MM_popupMsg('If not free, the cost of this plan per year.\r\rIf you do not wish to include this billing option, leave the field blank.')" border="0"></a></font></b></td> 
                  <td bgcolor="#F9F9F9" width="35%"><b><font color="#666666">Annually</font> </b></td> 
                  <td width="66%"><b> 
                    <input type="text" name="7" value="<?php echo $annually; ?>" size="30"> 
                    </b></td> 
                </tr> 
                <tr valign="middle" bgcolor="#F9F9F9"> 
                  <td valign="middle" height="37"><b><font color="#333333"><a href="#"><img src="question.jpg" width="15" height="15" onMouseUp="MM_popupMsg('If not free, the cost of this plan per 2 years.\r\rIf you do not wish to include this billing option, leave the field blank.')" border="0"></a></font></b></td> 
                  <td height="37" bgcolor="#F9F9F9" width="35%"><b><font color="#666666">Two Years</font> </b></td> 
                  <td bgcolor="#F9F9F9" width="66%" height="37"><b> 
                    <input type="text" name="8" value="<?php echo $twoyears; ?>" size="30"> 
                    </b></td> 
                </tr> 
                <tr valign="middle" bgcolor="#F9F9F9"> 
                  <td valign="middle"><b><font color="#333333"><a href="#"><img src="question.jpg" width="15" height="15" onMouseUp="MM_popupMsg('Select :\r\rYes - (Offer a free trial period with this hosting plan, then specify the length of this trial period)\r\rNo - (No free trial for this plan, leave additional fields blank)')" border="0"></a></font></b></td> 
                  <td bgcolor="#F9F9F9" width="35%"> <b><font color="#666666">Free Trial?</font> </b></td> 
                  <td width="66%"><b> 
                    <select name="9"> 
                      <option selected> <?php echo $freetrial; ?> </option> 
                      <option>No</option> 
                      <option>Yes</option> 
                    </select> 
                    -
                    <select name="10"> 
                      <option> <?php echo $digit; ?> </option> 
                      <option value="1">1</option> 
                      <option value="2">2</option> 
                      <option value="3">3</option> 
                      <option value="4">4</option> 
                      <option value="5">5</option> 
                      <option value="6">6</option> 
                      <option value="7">7</option> 
                      <option value="8">8</option> 
                      <option value="9">9</option> 
                      <option value="10">0</option> 
                      <option value="11">11</option> 
                      <option value="12">12</option> 
                      <option value="13">13</option> 
                      <option value="14">14</option> 
                      <option value="15">15</option> 
                      <option value="16">16</option> 
                      <option value="17">17</option> 
                      <option value="18">18</option> 
                      <option value="19">19</option> 
                      <option value="20">20</option> 
                      <option value="21">21</option> 
                      <option value="2">22</option> 
                      <option value="23">23</option> 
                      <option value="24">24</option> 
                      <option value="25">25</option> 
                      <option value="26">26</option> 
                      <option value="27">27</option> 
                      <option value="28">28</option> 
                      <option value="29">29</option> 
                      <option value="30">30</option> 
                    </select> 
                    -
                    <select name="11"> 
                      <option selected> <?php echo $period; ?> </option> 
                      <option value="D">Day(s)</option> 
                      <option value="W">Week(s)</option> 
                      <option value="M">Month(s)</option> 
                      <option value="Y">Year(s)</option> 
                    </select> 
                    </b></td> 
                </tr> 
              </table></td> 
            <td width="10%" bgcolor="#F9F9F9" valign="bottom">&nbsp; </td> 
          </tr> 
        </table></td> 
    </tr> 
  </table> 
  <br> 
  <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" bordercolor="#F9F9F9" width="90%" align="center"> 
    <tr bgcolor="#CCCCCC" valign="middle"> 
      <td valign="middle" width="50%" bgcolor="#F9F9F9"> <table width="50%" border="0" cellspacing="0" cellpadding="0"> 
          <tr> 
            <td bgcolor="#eeeeee" nowrap><b>Email Message</b></td> 
          </tr> 
        </table></td> 
    </tr> 
  </table> 
  <table border="0" cellspacing="1" cellpadding="5" bgcolor="#CCCCCC" bordercolor="#F9F9F9" width="90%" align="center"> 
    <tr bgcolor="#FFFFFF" valign="middle"> 
      <td valign="middle"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> 
          <tr valign="top"> 
            <td bgcolor="#eeeeee" width="5%">&nbsp; </td> 
            <td width="85%"> <table border="0" cellspacing="5" cellpadding="0" bgcolor="#FFFFFF" bordercolor="#F9F9F9" align="center" width="95%"> 
                <tr valign="middle" bgcolor="#F9F9F9"> 
                  <td valign="middle"><b><font color="#333333"><a href="#"><img src="question.jpg" width="15" height="15" onMouseUp="MM_popupMsg('This email message will be delivered when your client completes a purchase.\r\rEnter the email subject line here.')" border="0"></a></font></b></td> 
                  <td bgcolor="#F9F9F9" width="35%"> <b><font color="#666666">Subject</font></b></td> 
                  <td width="66%"><b> 
                    <input type="text" name="12" value="<?php echo $subject; ?>" size="30"> 
                    </b></td> 
                </tr> 
                <tr valign="middle" bgcolor="#F9F9F9"> 
                  <td valign="middle"><b><font color="#333333"><a href="#"><img src="question.jpg" width="15" height="15" onMouseUp="MM_popupMsg('This email message will be delivered when your client completes a purchase.\r\rEnter the email reply to address here.')" border="0"></a></font></b></td> 
                  <td bgcolor="#F9F9F9" width="35%"> <b><font color="#666666">Reply</font></b></td> 
                  <td width="66%"><b> 
                    <input type="text" name="13" value="<?php echo $reply; ?>" size="30"> 
                    </b></td> 
                </tr> 
                <tr valign="middle" bgcolor="#F9F9F9"> 
                  <td valign="middle"><b><font color="#333333"><a href="#"><img src="question.jpg" width="15" height="15" onMouseUp="MM_popupMsg('This email message will be delivered when your client completes a purchase.\r\rEnter the email message body here.')" border="0"></a></font></b></td> 
                  <td bgcolor="#F9F9F9" width="35%"><b><font color="#666666">Body</font></b></td> 
                  <td width="66%"><b> 
                    <textarea name="14" cols="30" rows="8"><?php echo $message; ?></textarea> 
                    </b></td> 
                </tr> 
              </table></td> 
            <td width="10%" bgcolor="#F9F9F9" valign="bottom"> <div align="center"> 
                <input type="submit" name="Apply" value="Apply"> 
              </div></td> 
          </tr> 
        </table></td> 
    </tr> 
  </table> 
</form> 
</body>
</html>
