Компонент Webhosting 1.1 RC6

Статус
В этой теме нельзя размещать новые ответы.

any99

Постоялец
Регистрация
28 Дек 2007
Сообщения
69
Реакции
34
Разработчиком Jonas Brand выпущен очередной кандидат-релиз компонента Webhosting 1.1 RC6. Представленный компонент предназначен для создания и управления сайтами компаний предоставляющих услуги хостинга.

С помощью этого компонента пользователям предоставляется возможность выбора и заказа тарифных планов, доменов и способов оплаты хостинга. Административная часть предоставляет широкие возможности создания различных категорий тарифных планов. Компонент разрабатывается для интегрированной работы с бесплатным программное обеспечение Control-Panel VHCS2 и соответственно его Fork IspCP Omega. Тем не менее, компонент может использоваться и без этой функции. Если режим VHCS2 активен, то заказы непосредственно сохраняются в банке данных VHCS2 и соответственно IspCP Omega и автоматически там активируются.

Домашняя страница проекта

Домашняя страница компонента Webhosting:




 
А есть что-то подобное, что-бы работало с DirectAdmin ?
 
А как быть с языками, есть ли русский?
И насколько надежны эти VHCS2 и соответственно IspCP Omega?
 
эти панели очень нестабильны.
Под системами отличными от дебиана СОВСЕМ нестабильны.
 
Он вроде бксплатный.
 
Он вроде бесплатный.
К сожалению это не так.
Этот сценарий является бесплатным для скачивания и тестирования, однако, как только Вы достигнете 15 счетов в систему, функциональность станет ограниченным, с тем чтобы получить полную функциональность обратно, вам придется приобрести лицензионный ключ.
 
вот и я о ом же. никак не могу найти этот компонентик. хотелось бы поковыряться
 
а дла работы с ISP Manager есть чего или только Clientexec
 
У меня получилось раскодировать один файл :)
В течении 2 дней доделаю остальное.
PHP:
<?php 
error_reporting(E_ALL &~E_NOTICE);
if( !defined( '_VALID_MOS') &&!defined( '_JEXEC') ) die( 'Direct Acc is not allowed.');
define('_JH_IS_BACKEND',1);
include( dirname(__FILE__).'/j15comp.php');
define('_JHHOST_ADMIN_PATH',$mosConfig_absolute_path ."/administrator/components/com_jhhost/");
define('_JHHOST_FRONT_PATH',$mosConfig_absolute_path ."/components/com_jhhost/");
define('_JHHOST_ADMIN_ENHANCED',$mosConfig_absolute_path ."/administrator/components/com_jhhost_whm/");
define('_JHHOST_PLUGIN_ADMIN',$mosConfig_absolute_path ."/administrator/components/");
global $mosConfig_absolute_path,$mosConfig_admin_template,$mosConfig_live_site;
require_once(_JHHOST_FRONT_PATH .'jhhost.config.php');
require_once(_JHHOST_FRONT_PATH .'jhhost.functions.php');
require_once( $mainframe->getPath( 'admin_html') );
if (file_exists(_JHHOST_FRONT_PATH .'language/'.$mosConfig_lang .'.php')){
require_once(_JHHOST_FRONT_PATH .'/language/'.$mosConfig_lang .'.php');
}else{
require_once(_JHHOST_FRONT_PATH .'language/english.php');
}
$cid = mosGetParam($_REQUEST,'cid',array ( 0 ));
if (!is_array($cid)) {
$cid = array ( 0 );
}
switch ($task) {
case "savesendinv":
$juser = mosGetParam($_POST,'juser','');
if ($juser == -1){
mosRedirect("index2.php?option=com_jhhost&task=addcustomer",_JH_FILL_CUST);
}elseif($juser == 0){
$username = $_REQUEST['username'];
$fullname = $_REQUEST['fullname'];
$password = $_POST['password'];
$email = $_REQUEST['email'];
$add1 = $_POST['add1'];
$add2 = $_POST['add2'];
$state = $_POST['state'];
$country = $_POST['country'];
$zip = $_POST['zip'];
if($username == ''||$fullname == ''||$password == ''||$email == ''){
mosRedirect("index2.php?option=com_jhhost&task=addcustomer",_JH_FILL_ALL);
}else{
$regdate = date("Y-m-d H:i:s");
$thepassword = md5($password);
$database->setQuery("Select count(*) as total from #__users where email = '$email'");
$emailcheck = $database->loadResult();
if($emailcheck >1){
mosRedirect("index2.php?option=com_jhhost&amp;task=addcustomer",_JH_EMAIL_EXISTS);
break;
}
$database->setQuery("Select count(*) from #__users as total  where username = '$username'");
$usercheck = $database->loadResult();
if($usercheck >1){
mosRedirect("index2.php?option=com_jhhost&amp;task=addcustomer",_JH_USERNAME_EXISTS);
break;
}
$database->setQuery("Insert into #__users values('','$fullname','$username','$email','$thepassword','Registered',0,0,18,'$regdate','','','')");
$result = $database->query();
$juser = $database->insertid();
$database->setQuery("Insert into #__core_acl_aro values('','users',$juser,0,'$fullname',0)");
$database->query();
$aid = $database->insertid();
$database->setQuery("Insert into #__core_acl_groups_aro_map values('18','',$aid)");
$database->query();
$database->setQuery("Insert into #__jhhost_address(add1,add2,state,country,zip,juser) values('$add1','$add2','$state','$country','$zip','$juser')");
$database->query();
}
}
$sid = strtotime("NOW");
$period = $_REQUEST['paymentsched'];
$database->setQuery("Insert into #__jhhost_accounts(id,jid,sid,billmd,domainame,package,active,cuser,period) values('','".$juser."','$sid', '".DATE("m")."','Custom Invoice','0','1', '', '$period')");
$database->query();
$database->setQuery("Select * from #__jhhost_accounts where sid='$sid'");
$res = $database->loadObjectList();
$resu = $res[0];
$hpid = $resu->id;
$nextdue = DATE("Y-m-d");
$lines = count($_POST['description']);
$totprice = 0.00;
$x = 0;
while ($x <$lines){
if ($_POST['description'][$x] != ''){
$database->setQuery("Insert into #__jhhost_billing(hid,sid,details,price,period,nextinvdue,packid) values('$hpid','$sid','".$_POST['description'][$x] ."','".$_POST['price'][$x] ."','".$_POST['paymentsched'] ."', '$nextdue','0')");
$database->query();
$totprice += $_POST['price'][$x];
}
$x++;
}
$invtotal = $totprice;
$database->setQuery("Select * from #__jhhost_billing where sid = '{$resu->sid}'");
$result2 = $database->loadObjectList();
foreach ($result2 as $billine) {
$nextdate_array = explode("-",$billine->nextinvdue);
$nextdate_year = $nextdate_array[0];
$nextdate_month = $nextdate_array[1];
$nextdate_day = $nexdate_array[2];
$dueinvoice = 1;
if ($billine->period == 'Y') {
$hostbill = DATE("Y-m-d",strtotime("{$billine->nextinvdue} +1 YEAR"));
}elseif($period == "B") {
$hostbill = DATE("Y-m-d",strtotime("{$billine->nextinvdue}  +6 MONTHS"));
}elseif($period == "Q") {
$hostbill = DATE("Y-m-d",strtotime("{$billine->nextinvdue}  +3 MONTHS"));
}elseif($period == "X"){
$hostbill = '0000-00-00';
}elseif($period == 'M'){
$hostbill = DATE("Y-m-d",strtotime("{$billine->nextinvdue}  +1 MONTHS"));
}
$invoicelines .= '<tr>
      <td width="100" bgcolor="white"><font size="-2" face="Verdana">
        01
      </font></td>
      <td width="30%" bgcolor="white" align="left"><font size="-2" face="Verdana">

      '.$billine->details .'</td>
      
      <td bgcolor="white" width="90"><div align="right"><font size="-2" face="Verdana">
       '.$jhhostConfig['displaycurrency'] .$billine->price .'
      </font></div></td>
    </tr>';
$pricetotal = $pricetotal +$billine->price;
$database->setQuery("update #__jhhost_billing set nextinvdue = '$hostbill' where id = '".$billine->id ."'");
$database->query();
}
if($dueinvoice == 1) {
$database->setQuery("Select * from #__users where id = '".$resu->jid ."'");
$result3 = $database->loadObjectList();
include(_JHHOST_FRONT_PATH .'email/invoice.html.php');
$jhInvoice = str_replace('[INV_COMP_NAME]',$jhhostConfig['hostcompanyname'],$jhInvoice);
$jhInvoice = str_replace('[INV_COMP_SUPPORT_EMAIL]',$jhhostConfig['supportemail'],$jhInvoice);
$jhInvoice = str_replace('[INV_COMP_ACCOUNTS_EMAIL]',$jhhostConfig['accountsemail'],$jhInvoice);
$jhInvoice = str_replace('[INV_COMP_CUST_NAME]',$result3[0]->name .' - '.$resu->domainame ,$jhInvoice);
$invDate = Date("Y-m-d");
$dueDate = DATE("Y-m-d",strtotime("NOW +7 DAYS"));
$jhInvoice = str_replace('[INV_COMP_INV_DUE]',$dueDate,$jhInvoice);
$jhInvoice = str_replace('[INV_COMP_CREATED]',$invDate,$jhInvoice);
$jhInvoice = str_replace(' [INV_COMP_PHONE]',$jhhostConfig['companyphone'],$jhInvoice);
$jhInvoice = str_replace(' [INV_COMP_ADDRESS]',$jhhostConfig['companyaddress'],$jhInvoice);
$database->setQuery("insert into #__jhhost_invoices(invoicetext,dategen,datepaid,payedby,amount,hpid) values('x','".DATE("Y-m-d")."','N','N','$pricetotal','{$resu->id}')");
$database->query();
$invNo = $database->insertid();
$jhInvoice = str_replace('[INV_COMP_INV_NO]',$invNo,$jhInvoice);
$jhInvoice = str_replace(' [INV_COMP_TOTAL_DUE]',$jhhostConfig['displaycurrency'] .' '.number_format($pricetotal,2,'.',''),$jhInvoice);
$jhInvoice = str_replace('[INV_LINES]',$invoicelines,$jhInvoice);
global $mosConfig_live_site;
$payonline = '<a href="'.$mosConfig_live_site .'/index.php?option=com_jhhost&task=invoices'.'">'.JH_LOGIN_TO_PAY .'</a>';
$jhInvoice = str_replace('[INV_COMP_PAYMETHODS]',$payonline ,$jhInvoice);
$database->setQuery("update #__jhhost_invoices set invoicetext='$jhInvoice' where idinv='$invNo'");
$database->query();
mosMail( $jhhostConfig['accountsemail'],$jhhostConfig['hostcompanyname'],$result3[0]->email,$jhhostConfig['hostcompanyname'] .' Invoice: '.$invNo,$jhInvoice,1);
}
mosRedirect("index2.php?option=com_jhhost&amp;task=invoice",_JH_SUCCESS);
break;
case "deleteplugin":
$theplugin = $_POST['plugin'][0];
mosredirect("index2.php?option=com_jhhost&task=listplugins",_JH_SUCCESS);
break;
case "remove":
print_r($_POST);
$thisaction = $_POST['thisoption'];
if($thisaction == 'invoice') {
foreach($cid as $inv) {
$database->setQuery("Delete from #__jhhost_invoices where idinv='$inv'");
$database->query();
}
mosRedirect("index2.php?option=com_jhhost&task=invoice",_JH_SUCCESS);
break;
}
if($thisaction == 'accounts') {
foreach($cid as $acc) {
$database->setQuery("Select * from #__jhhost_accounts as a left join #__jhhost_hpacks as h on a.package = h.id where sid='$acc'");
$result = $database->loadObjectList();
$tuser = $result[0]->cuser;
$cpanpack = $result[0]->cpanelname;
if($cpanpack != ''&&$jhhostConfig['whm_host'] != '') {
$script_URL = "http://{$jhhostConfig['whm_user']}:{$jhhostConfig['whm_pass']}@{$jhhostConfig['whm_host']}:2086/scripts/killacct";
$command = "?domain={$tuser}&user={$tuser}&keepdns=1";
ob_start();
$response = join("",file($script_URL .$command));
ob_end_flush();
$err = 0;
$pos = strrpos($response,"Account Removal Complete!!!...");
if ($pos === false) {
$err = 1;
}
}
$database->setQuery("Delete from #__jhhost_accounts where sid='$acc'");
$database->query();
}
if ($err == 1){
mosRedirect("index2.php?option=com_jhhost&task=accounts",_JH_SUCCESS .', But Cpanel Error');
}else{
mosRedirect("index2.php?option=com_jhhost&task=accounts",_JH_SUCCESS);
}
}
break;
case "about":
JHHOSTHTML::about();
break;
case "savecustomeredit":
$sid = $cid[0];
$billing = $_POST['billing'];
$package = $_POST['package'];
$add1 = $_POST['add1'];
$add2 = $_POST['add2'];
$state = $_POST['state'];
$country = $_POST['country'];
$zip = $_POST['zip'];
$jid = $_POST['jid'];
$database->setQuery("Update #__jhhost_accounts set package='$package', period='$billing' where sid='$sid'");
$database->query();
$database->setQuery("Update #__jhhost_address set add1='$add1', add2='$add2', state='$state',country='$country', zip='$zip' where jid='$jid'");
$database->query();
$database->setQuery("Select * from #__jhhost_hpacks where id='$package'");
$result=$database->loadObjectList();
$pricevar = $result[0]->price;
if ($billing == 'Y') {
if (isset($jhhostConfig['year_disc'])){
$hpprice = $pricevar -($pricevar * ($jhhostConfig['year_disc'] / 100));
}else{
$hpprice = $pricevar;
}
$bilprice = $hpprice * 12;
}elseif($billing == 'B') {
if (isset($jhhostConfig['bi_an_disc'])){
$hpprice = $pricevar -($pricevar * ($jhhostConfig['bi_an_disc'] / 100));
}else{
$hpprice = $pricevar;
}
$bilprice = $hpprice * 6;
}elseif($billing == 'Q') {
if (isset($jhhostConfig['quat_disc'])){
$hpprice = $pricevar -($pricevar * ($jhhostConfig['quat_disc'] / 100));
}else{
$hpprice = $pricevar;
}
$bilprice = $hpprice * 3;
}else{
$bilprice = $priceVar;
}
$database->setQuery("Update #__jhhost_billing set price = '$bilprice' where sid='$sid' and packid > 0");
$database->query();
mosRedirect("index2.php?option=com_jhhost&task=accounts");
break;
case "accountedit":
$database->setQuery("Select * from #__jhhost_accounts as a left join #__jhhost_address as u on a.jid = u.jid where a.sid='{$cid[0]}'");
$result = $database->loadObjectList();
$account = $result[0];
$database->setQuery("Select * from #__jhhost_hpacks where published = 1");
$result=$database->loadObjectList();
foreach($result as $package){
$packs .= '<option value="'.$package->id.'" ';
if ($package->id == $account->package) {
$packs .= ' SELECTED ';
}
$packs .='>'.$package->name.'</option>';
}
JHHOSTHTML::accountedit($account,$packs);
break;
case "savecustomer":
$juser = mosGetParam($_POST,'juser','');
$domainame = mosGetParam($_POST,'domain','');
$domarray = explode(",",$jhhostConfig['alloweddomains']);
$dompricearray = explode(",",$jhhostConfig['alloweddomainsprice']);
$tld = $domarray[$_POST['tld']];
$domprice = $dompricearray[$_POST['tld']];
$domainametld = $domainame .$domarray[$_POST['tld']];
$dominfo = $domainametld ." - ".JH_REG_REN;
if ($domainame == ''){
mosRedirect("index2.php?option=com_jhhost&task=addcustomer",_JH_FILL_ALL);
break;
}
if ($juser == -1){
mosRedirect("index2.php?option=com_jhhost&task=addcustomer",_JH_FILL_CUST);
}elseif($juser == 0){
$username = $_REQUEST['username'];
$fullname = $_REQUEST['fullname'];
$password = $_POST['password'];
$email = $_REQUEST['email'];
$add1 = $_POST['add1'];
$add2 = $_POST['add2'];
$state = $_POST['state'];
$country = $_POST['country'];
$zip = $_POST['zip'];
if($username == ''||$fullname == ''||$password == ''||$email == ''){
mosRedirect("index2.php?option=com_jhhost&task=addcustomer",_JH_FILL_ALL);
}else{
$regdate = date("Y-m-d H:i:s");
$thepassword = md5($password);
$database->setQuery("Select count(*) as total from #__users where email = '$email'");
$emailcheck = $database->loadResult();
if($emailcheck >1){
mosRedirect("index2.php?option=com_jhhost&amp;task=addcustomer",_JH_EMAIL_EXISTS);
break;
}
$database->setQuery("Select count(*) from #__users as total  where username = '$username'");
$usercheck = $database->loadResult();
if($usercheck >1){
mosRedirect("index2.php?option=com_jhhost&amp;task=addcustomer",_JH_USERNAME_EXISTS);
break;
}
$database->setQuery("Insert into #__users values('','$fullname','$username','$email','$thepassword','Registered',0,0,18,'$regdate','','','')");
$result = $database->query();
$juser = $database->insertid();
$database->setQuery("Insert into #__core_acl_aro values('','users',$juser,0,'$fullname',0)");
$database->query();
$aid = $database->insertid();
$database->setQuery("Insert into #__core_acl_groups_aro_map values('18','',$aid)");
$database->query();
$database->setQuery("Insert into #__jhhost_address(add1,add2,state,country,zip,juser) values('$add1','$add2','$state','$country','$zip','$juser')");
$database->query();
}
}
$whmpass = jh_genpassword(8);
$whmuser = jh_genuser(3,$domainametld);
$sid = strtotime("NOW");
$period = $_REQUEST['period'];
$database->setQuery("Insert into #__jhhost_accounts(jid,sid,billmd,domainame,package,active,cuser,period) values('".$juser."','$sid', '".DATE("m")."','$domainametld','{$_POST['package']}','1', '$whmuser', '$period')");
$database->query();
$hpid = $database->insertid();
$domdue = $_POST['domdue'];
if ($domdue == ''||$domdue == 'N'){
$domdue = 'N';
$domprice = '0.00';
$dominfo = $domainametld ." - ".JH_SELF_REG;
}
$database->setQuery("Select * from #__jhhost_hpacks where id='{$_POST['package']}'");
$result = $database->loadObjectList();
$packname = $result[0]->name;
$packprice = $result[0]->price;
$cpanaame = $result[0]->cpanelname;
if ($period == 'Y') {
if (isset($jhhostConfig['year_disc'])){
$hpprice = $packprice -($packprice * ($jhhostConfig['year_disc'] / 100));
}else{
$hpprice = $packprice;
}
$hinvprice = $hpprice * 12;
}elseif($period == "B") {
if (isset($jhhostConfig['bi_an_disc'])){
$hpprice = $packprice -($packprice * ($jhhostConfig['bi_an_disc'] / 100));
}else{
$hpprice = $packprice;
}
$hinvprice = $hpprice * 6;
}elseif($period == "Q") {
if (isset($jhhostConfig['quat_disc'])){
$hpprice = $packprice -($packprice * ($jhhostConfig['quat_disc'] / 100));
}else{
$hpprice = $packprice;
}
$hinvprice = $hpprice * 3;
}else{
if ($jhhostConfig['initbil'] == 'd2d') {
$hostbill = DATE("Y-m-d",strtotime("NOW +1 Months"));
$hinvprice = $packprice;
}elseif($jhhostConfig['initbil'] == 'pro'){
$hostbill = DATE("Y-m-d",strtotime("$endmonthdate"));
$reverse = DATE("d");
$nhp = $packprice / 30;
$tobill = 30 -$reverse;
$hinvprice = $nhp * $tobill;
}else{
if (DATE("d") >15){
$hostbill = DATE("Y-m-d",strtotime("$endmonthdate +1 Months"));
$hinvprice = $packprice;
}else{
$hostbill = DATE("Y-m-d",strtotime("$endmonthdate"));
$hinvprice = $packprice;
}
}
}
$hinvprice = number_format($hinvprice,2,'.','');
$invtotal = $hinvprice +$domprice;
$database->setQuery("Insert into #__jhhost_billing(hid,sid,details,price,period,nextinvdate,packid) values('$hpid','$sid','$dominfo','$domprice','Y', '$domdue','0')");
$database->query();
if($_POST['hostdue'] == ''){
$_POST['hostdue'] = DATE("Y-m-d");
}
$database->setQuery("Insert into #__jhhost_billing(hid,sid,details,price,period,nextinvdate,packid) values('$hpid','$sid','$packname','$hinvprice','{$_POST['paymentsched']}', '{$_POST['hostdue']}','{$_POST['package']}')");
$database->query();
if ($jhhostConfig['whm_host'] &&$cpanaame &&$_POST['cpanelcreate'] == 'yes'){
$script_URL = "http://{$jhhostConfig['whm_user']}:{$jhhostConfig['whm_pass']}@{$jhhostConfig['whm_host']}:2086/scripts/wwwacct";
$command = "?plan={$cpanaame}&domain={$domainame}&username={$whmuser}&password={$whmpass}&contactemail={$email}";
ob_start();
$reply = join("",file($script_URL .$command));
ob_end_flush();
}
get_jhplugins(_JHHOST_PLUGIN_ADMIN,'adminadduser');
mosRedirect("index2.php?option=com_jhhost&task=accounts",_JH_SUCCESS);
break;
case "addcustomer":
$database->setQuery("Select * from #__jhhost_hpacks where published = 1");
$result=$database->loadObjectList();
foreach($result as $package){
$packs .= '<option value="'.$package->id.'">'.$package->name.'</option>';
}
$database->setQuery("Select * from #__users where block=0 order by name asc");
$jusers_array = $database->loadObjectList();
$jusers = '<option value="-1">Select</option>';
$jusers .= '<option value="0">New User</option>';
foreach ($jusers_array as $juser){
$jusers .="<option value='".$juser->id."'>".$juser->name." - ".$juser->email ."</option>";
}
JHHOSTHTML::addcustomer($packs,$jhhostConfig,$jusers);
break;
case "deactivateacc":
$accid = $cid[0];
if ($_POST['suspreason']) {
$database->setQuery("Select * from #__jhhost_accounts as a left join #__users as u on a.jid = u.id where sid='$accid'");
$result=$database->loadObjectList();
$response = jh_suspend($jhhostConfig,$result[0]->cuser,$_POST['suspreason'],$result[0]->email,$result[0]->domainame);
$database->setQuery("Update #__jhhost_accounts set active='0' where sid='$accid'");
$database->query();
get_jhplugins(_JHHOST_PLUGIN_ADMIN,'suspend');
if ($response == 0) {
mosRedirect("index2.php?option=com_jhhost&task=accounts",_JH_SUCCESS);
}else{
mosRedirect("index2.php?option=com_jhhost&task=accounts",_JH_SUCCESS .', but Cpanel Failed');
}
}else{
JHHOSTHTML::deactivateacc($accid);
}
break;
case "upgrade":
$database->setQuery("show columns from #__jhhost_hcats");
$result = $database->loadObjectList();
$tcheck = array();
foreach($result as $check) {
$tcheck[]=$check->Field;
}
if (!in_array("image",$tcheck)){
$database->setQuery("ALTER TABLE `#__jhhost_hcats` ADD `image` VARCHAR( 250 ) NOT NULL ");
$database->query();
}
$database->setQuery("show columns from #__jhhost_accounts");
$result = $database->loadObjectList();
$tcheck = array();
foreach($result as $check) {
$tcheck[]=$check->Field;
}
if (!in_array("period",$tcheck)){
$database->setQuery("ALTER TABLE `#__jhhost_accounts` ADD `period` VARCHAR( 10 ) NOT NULL ");
$database->query();
}
$database->setQuery("show columns from #__jhhost_billing");
$result = $database->loadObjectList();
$tcheck = array();
foreach($result as $check) {
$tcheck[]=$check->Field;
}
if (!in_array("packid",$tcheck)){
$database->setQuery("ALTER TABLE `#__jhhost_billing` ADD `packid` INT(6) NOT NULL ");
$database->query();
}
$database->setQuery("ALTER TABLE `#__jhhost_billing` CHANGE `price` `price` FLOAT( 10, 2 ) NOT NULL ");
$database->query();
$database->setQuery("show columns from #__jhhost_features");
$result = $database->loadObjectList();
$tcheck = array();
foreach($result as $check) {
$tcheck[]=$check->Field;
}
if (!in_array("fprice",$tcheck)){
$database->setQuery("ALTER TABLE `#__jhhost_hpackfeatures` ADD `fprice` FLOAT( 10, 2 ) NOT NULL ");
$database->query();
}
mosRedirect("index2.php?option=com_jhhost",_JH_SUCCESS);
break;
case "markpaid":
$database->setQuery("update #__jhhost_invoices set datepaid = '".DATE("Y-m-d") ."', payedby = 'Manual' where idinv='".$cid[0]."'");
$database->query();
mosRedirect("index2.php?option=com_jhhost&task=invoice",_JH_SUCCESS);
break;
case "markunpaid":
$database->setQuery("update #__jhhost_invoices set datepaid = 'N', payedby = 'N' where idinv='".$cid[0]."'");
$database->query();
mosRedirect("index2.php?option=com_jhhost&task=invoice",_JH_SUCCESS);
break;
case "invoice":
$limit = $mainframe->getUserStateFromRequest("viewlistlimit",'limit',25);
$limitstart = $mainframe->getUserStateFromRequest("view{$option}limitstart",'limitstart',0);
$levellimit = $mainframe->getUserStateFromRequest("view{$option}limit",'levellimit',25);
$search = mosGetParam($_POST,'search','');
$showonly = mosGetParam($_REQUEST,'show','');
if($showonly == 'paid'){
$showonlystr = " where datepaid != 'N'";
}elseif($showonly == 'unpaid'){
$showonlystr = " where datepaid = 'N'";
}else{
$showonlystr = '';
}
$where = '';
if ($search != '') {
$where = " where u.name like '%$search%' or u.email like '%$search%' or a.domainame like '%$search%' or i.idinv like '%$search%' ";
}
$database->setQuery("Select * from #__jhhost_invoices as i left join #__jhhost_accounts as a on i.hpid = a.id left join #__users as u on a.jid = u.id $where $showonlystr order by i.idinv desc");
$result = $database->loadObjectList();
$total = count($result);
require_once ('includes/pageNavigation.php');
$pageNav = new mosPageNav($total,$limitstart,$limit);
$list = array_slice($result,$pageNav->limitstart,$pageNav->limit);
JHHOSTHTML::invoices($list,$pageNav,$search);
break;
case "addinvoice":
$database->setQuery("Select * from #__users where block=0 order by name asc");
$jusers_array = $database->loadObjectList();
$jusers = '<option value="-1">Select</option>';
$jusers .= '<option value="0"';
if ($_POST['juser'] == '0') {$jusers .= " SELECTED";}
$jusers .= '>New User</option>';
foreach ($jusers_array as $juser){
$jusers .="<option value='".$juser->id."'";
if ($_POST['juser'] == $juser->id) {$jusers .= " SELECTED";}
$jusers .= ">".$juser->name." - ".$juser->email ."</option>";
}
JHHOSTHTML::addinvoice($jusers);
break;
case "activateacc":
$accid = $cid[0];
$database->setQuery("Select * from #__jhhost_accounts as a left join #__users as u on a.jid = u.id where sid='$accid'");
$result=$database->loadObjectList();
$result = jh_unsuspend($jhhostConfig,$result[0]->cuser,$result[0]->email,$result[0]->domainame);
$database->setQuery("Update #__jhhost_accounts set active='1' where sid='$accid'");
$database->query();
get_jhplugins(_JHHOST_PLUGIN_ADMIN,'unsuspend');
if($result == 0) {
mosRedirect("index2.php?option=com_jhhost&task=accounts",_JH_SUCCESS);
}else{
mosRedirect("index2.php?option=com_jhhost&task=accounts",_JH_SUCCESS.', but Cpanel Error');
}
break;
case "accounts":
$limit = $mainframe->getUserStateFromRequest("viewlistlimit",'limit',25);
$limitstart = $mainframe->getUserStateFromRequest("view{$option}limitstart",'limitstart',0);
$levellimit = $mainframe->getUserStateFromRequest("view{$option}limit",'levellimit',25);
$search = mosGetParam($_POST,'search','');
$where = '';
if ($search != ''){
$where = " where a.domainame LIKE '%$search%' or u.name LIKE '%$search%' or u.email LIKE '%$search%' ";
}
$database->setQuery("Select * from #__jhhost_accounts as a left join #__users as u on a.jid = u.id $where");
$result = $database->loadObjectList();
$total = count($result);
$database->setQuery("select * from #__jhhost_hpacks order by id asc");
$packs = $database->loadObjectList();
$hpacks = array();
foreach ($packs as $hpack){
$hpacks[$hpack->id] = $hpack->name;
}
require_once ('includes/pageNavigation.php');
$pageNav = new mosPageNav($total,$limitstart,$limit);
$list = array_slice($result,$pageNav->limitstart,$pageNav->limit);
JHHOSTHTML::accounts($list,$pageNav,$hpacks,$search);
break;
case "savepayment":
$class= $_REQUEST['module'];
global $database;
$module_directory = $mosConfig_absolute_path  .'/components/com_jhhost/payment/';
include($module_directory .$class.'.php.lang');
include($module_directory .$class .'.php');
if (class_exists($class)) {
$module = new $class;
$keys =  $module->keys();
foreach ($keys as $key){
$database->setQuery("update #__jhhost_payment set configuration_value='".$_REQUEST[$key]."' where configuration_key='".$key."'");
$database->query();
}
}
mosRedirect('index2.php?option=com_jhhost&task=payment',_JH_SUCCESS);
break;
case "paymentedit":
$class = $_REQUEST['module'];
$module_directory = $mosConfig_absolute_path  .'/components/com_jhhost/payment/';
include($module_directory .$class.'.php.lang');
include($module_directory .$class .'.php');
if (class_exists($class)) {
$module = new $class;
}
JHHOSTHTML::paymentedit($class,$module,$database);
break;
case "paymentinstal":
global $mosConfig_absolute_path,$mosConfig_live_site;
$module_directory = $mosConfig_absolute_path  .'/components/com_jhhost/payment/';
$class=$_REQUEST['module'];
include($module_directory .$class.'.php.lang');
include($module_directory .$class .'.php');
if (class_exists($class)) {
$module = new $class;
$module->install();
mosredirect("index2.php?option=com_jhhost&task=paymentedit&module=$class");
}
break;
case "paymentremove":
global $mosConfig_absolute_path,$mosConfig_live_site;
$module_directory = $mosConfig_absolute_path  .'/components/com_jhhost/payment/';
$class=$_REQUEST['module'];
include($module_directory .$class.'.php.lang');
include($module_directory .$class .'.php');
if (class_exists($class)) {
$module = new $class;
$module->remove();
mosredirect("index2.php?option=com_jhhost&task=payment",_JH_SUCCESS);
}
break;
case "payment":
$paymodules = jh_listpaymentmodules(_JHHOST_FRONT_PATH .'payment/');
JHHOSTHTML::payment($paymodules,_JHHOST_FRONT_PATH .'payment/');
break;
case "edithosting":
$database->setQuery("Select * from #__jhhost_hcats order by name asc");
$catlist=$database->loadObjectList();
$database->setQuery("select * from #__jhhost_hpackfeatures");
$rows = $database->loadObjectList();
$children = array ();
foreach ($rows as $v)
{
$pt = $v->parent;
$list = @$children[$pt] ?$children[$pt] : array ();
array_push($list,$v);
$children[$pt] = $list;
}
$list = jh_TreeRecurse(0,'',array (),$children);
$pid = $cid[0];
$database->setQuery("select * from #__jhhost_hpacks where id='$pid'");
$packagearray = $database->loadObjectList();
$package = $packagearray[0];
$database->setQuery("Select * from #__jhhost_hpackdetails where hid='$pid'");
$result = $database->loadObjectList();
$addons = array();
foreach ($result as $addon){
$addons[$addon->fid] = $addon->hvalue;
}
JHHOSTHTML::edithostings($catlist,$list,$package,$addons);
break;
case "saveedithostings":
$name = $_POST['name'];
$catid = $_POST['ncatid'];
$price = $_POST['price'];
$cpanelname = $_POST['cpanelname'];
$shortdesc = $_POST['shortdesc'];
$hid = $cid[0];
$priceY = $price * 12;
$priceB = $price * 6;
$priceQ = $price * 3;
$database->setQuery("Update #__jhhost_billing set price='$price' where period='M' and packid='$hid'");
$database->query();
$database->setQuery("Update #__jhhost_billing set price='$priceQ' where period='Q' and packid='$hid'");
$database->query();
$database->setQuery("Update #__jhhost_billing set price='$priceB' where period='B' and packid='$hid'");
$database->query();
$database->setQuery("Update #__jhhost_billing set price='$priceY' where period='Y' and packid='$hid'");
$database->query();
$database->setQuery("Update #__jhhost_hpacks set name='$name', price='$price', shortdesc='$shortdesc', cpanelname='$cpanelname', catid='$catid' where id='$hid'");
$database->query();
$database->setQuery("Delete from #__jhhost_hpackdetails where hid='$hid'");
$database->query();
$sql = "insert into  #__jhhost_hpackdetails(hid,fid,hvalue) values";
$ct = 0;
foreach ($_POST as $k =>$v)
{
if (strpos($k,'feat_') === 0)
{
if (!get_magic_quotes_gpc()) {
$v = addslashes($v);
}
if($ct== 1){
$sql .=",";
}
$ct = 1;
$sql .= "('$hid','".substr($k,5)."','$v')";
}
}
$database->setQuery($sql);
$database->query();
get_jhplugins(_JHHOST_PLUGIN_ADMIN,'saveedithostings');
mosRedirect("index2.php?option=com_jhhost&task=hostings",_JH_SUCCESS);
break;
case "savenewhostings":
$name = $_POST['name'];
$catid = $_POST['ncatid'];
$price = $_POST['price'];
$cpanelname = $_POST['cpanelname'];
$shortdesc = $_POST['shortdesc'];
$database->setQuery("Insert into #__jhhost_hpacks(name,price,cpanelname,shortdesc,catid,published) values('$name','$price','$cpanelname','$shortdesc','$catid','0')");
$database->query();
$hid = $database->insertid();
$sql = "Insert into #__jhhost_hpackdetails(hid,fid,hvalue) values";
$ct = 0;
foreach ($_POST as $k =>$v)
{
if (strpos($k,'feat_') === 0)
{
if (!get_magic_quotes_gpc()) {
$v = addslashes($v);
}
if($ct== 1){
$sql .=",";
}
$ct = 1;
$sql .= "('$hid','".substr($k,5)."','$v')";
}
}
$database->setQuery($sql);
$database->query();
get_jhplugins(_JHHOST_PLUGIN_ADMIN,'saveedithostings');
mosRedirect("index2.php?option=com_jhhost&task=hostings",_JH_SUCCESS);
break;
case "newhostings":
$database->setQuery("Select * from #__jhhost_hcats order by name asc");
$catlist=$database->loadObjectList();
$database->setQuery("select * from #__jhhost_hpackfeatures");
$rows = $database->loadObjectList();
$children = array ();
foreach ($rows as $v)
{
$pt = $v->parent;
$list = @$children[$pt] ?$children[$pt] : array ();
array_push($list,$v);
$children[$pt] = $list;
}
$list = mosTreeRecurse(0,'',array (),$children);
JHHOSTHTML::newhostings($catlist,$list);
break;
case "deletehostings":
$cids = implode(',',$cid);
$database->setQuery("DELETE FROM #__jhhost_hpacks WHERE id IN ($cids)");
$database->query();
mosRedirect("index2.php?option=com_jhhost&task=hostings",_JH_SUCCESS);
break;
case "hostpublish":
foreach ($cid as $key){
$database->setQuery("select * from #__jhhost_hpacks where id='$key'");
$result = $database->loadObjectList();
$published = $result[0]->published;
if ($published == 1){
$published = 0;
}else{
$published = 1;
}
$database->setQuery("Update #__jhhost_hpacks set published='$published' where id='$key'");
$database->query();
}
mosRedirect('index2.php?option=com_jhhost&task=hostings',_JH_SUCCESS);
break;
case "hostings":
global $database,$mainframe;
$limit = $mainframe->getUserStateFromRequest("viewlistlimit",'limit',25);
$limitstart = $mainframe->getUserStateFromRequest("view{$option}limitstart",'limitstart',0);
$levellimit = $mainframe->getUserStateFromRequest("view{$option}limit",'levellimit',25);
$catid = isset($_REQUEST['catid'])?$_REQUEST['catid']:'';
$where = '';
if ($catid >0) {
$where = " where catid='$catid' ";
}
$database->setQuery("Select * from #__jhhost_hcats order by name asc");
$catlisting = $database->loadObjectList();
$catlist = array();
foreach($catlisting as $cat){
$catlist[$cat->id] = $cat->name;
}
$database->setQuery("select * from `#__jhhost_hpacks` $where order by name asc");
$hostpacks = $database->loadObjectList();
$total = count($hostpacks);
require_once ($GLOBALS['mosConfig_absolute_path'] .'/administrator/includes/pageNavigation.php');
$pageNav = new mosPageNav($total,$limitstart,$limit);
$list = array_slice($hostpacks,$pageNav->limitstart,$pageNav->limit);
JHHOSTHTML::hostings($list,$pageNav,$catlist,$catid,$catlisting);
break;
case "savecat":
$id = mosGetParam($_POST,'catid',0);
$name = mosGetParam($_POST,'catname','');
$descript = mosGetParam($_POST,'shortdesc','');
$oldimage = mosGetParam($_POST,'oldimage','');
if ($_FILES['nimage']['size'] >0 ) {
$imagename = strtotime("NOW") .$_FILES['nimage']['name'];
$imagename = str_replace(" ","_",$imagename);
$imagename = str_replace("-","_",$imagename);
copy ($_FILES['nimage']['tmp_name'],$mosConfig_absolute_path .'/images/stories/'.$imagename);
}else{
$imagename = $oldimage;
}
if($name == ''){
mosRedirect('index2.php?option=com_jhhost&task=editcat&cid[]='.$id ,_JH_FILL_ALL);
}
if ($id >0) {
$database->setQuery("Update #__jhhost_hcats set name='$name', shortdesc='$descript', image='$imagename' where id='$id'");
$return = _JH_SUCCESS;
}else{
$database->setQuery("Insert into #__jhhost_hcats(name,published,shortdesc,image) values('$name','0','$descript','$imagename')");
$return = _JH_SUCCESS;
}
$database->query();
mosRedirect("index2.php?option=com_jhhost&task=catlist",$return);
break;
case "savenewfeature":
$fid = isset($_POST['fid'])?$_POST['fid']:'';
if($fid >0) {
$database->setQuery("update #__jhhost_hpackfeatures set featname='".$_POST['featname']."', parent='".$_POST['parent']."', showshort = '".$_POST['showshort']."', fprice = '".$_POST['fprice'] ."' where id='$fid'");
}else{
$database->setQuery("insert into #__jhhost_hpackfeatures(featname,parent,showshort,fprice) values('".$_POST['featname']."','".$_POST['parent']."','".$_POST['showshort']."','".$_POST['fprice'] ."')");
}
$database->query();
mosRedirect("index2.php?option=com_jhhost&task=features",_JH_SUCCESS);
break;
case "deletefeature":
$cids = implode(',',$cid);
$database->setQuery("DELETE FROM #__jhhost_hpackfeatures WHERE id IN ($cids)");
$database->query();
$database->setQuery("DELETE FROM #__jhhost_hpackfeatures where parent in ($cids)");
$database->query();
mosRedirect("index2.php?option=com_jhhost&task=features",_JH_SUCCESS);
break;
case "newfeature":
$database->setQuery("Select * from #__jhhost_hpackfeatures where parent = 0");
$parents = $database->loadObjectList();
JHHOSTHTML::newfeature($parents);
break;
case "editfeature":
case "featureedit":
$database->setQuery("Select * from #__jhhost_hpackfeatures where parent = 0");
$parents = $database->loadObjectList();
$database->setQuery("Select * from #__jhhost_hpackfeatures where id='".$cid[0]."'");
$feature = $database->loadObjectList();
$thefeature = $feature[0];
JHHOSTHTML::editfeature($parents,$thefeature);
break;
case "features":
global $database,$mainframe;
$limit = $mainframe->getUserStateFromRequest("viewlistlimit",'limit',25);
$limitstart = $mainframe->getUserStateFromRequest("view{$option}limitstart",'limitstart',0);
$levellimit = $mainframe->getUserStateFromRequest("view{$option}limit",'levellimit',25);
$database->setQuery("select * from #__jhhost_hpackfeatures");
$rows = $database->loadObjectList();
$children = array ();
foreach ($rows as $v)
{
$pt = $v->parent;
$list = @$children[$pt] ?$children[$pt] : array ();
array_push($list,$v);
$children[$pt] = $list;
}
$list = mosTreeRecurse(0,'',array (),$children,max(0,$levellimit -1));
$total = count($list);
require_once ($GLOBALS['mosConfig_absolute_path'] .'/administrator/includes/pageNavigation.php');
$pageNav = new mosPageNav($total,$limitstart,$limit);
$levellist = mosHTML::integerSelectList(1,20,1,'levellimit','size="1" onchange="document.adminForm.submit();"',$levellimit);
$list = array_slice($list,$pageNav->limitstart,$pageNav->limit);
JHHOSTHTML::features($list,$pageNav);
break;
case "deletecat";
global $database;
$cids = implode(',',$cid);
$database->setQuery("DELETE FROM #__jhhost_hcats WHERE id IN ($cids)");
$database->query();
mosRedirect("index2.php?option=com_jhhost&task=catlist",_JH_SUCCESS);
break;
case "addcat":
JHHOSTHTML::addcat(0);
break;
case "editcat":
JHHOSTHTML::addcat($cid[0]);
break;
case "publishcat":
global $database,$my;
foreach ($cid as $key){
$database->setQuery("select * from #__jhhost_hcats where id='$key'");
$result = $database->loadObjectList();
$published = $result[0]->published;
if ($published == '0'){
$published = '1';
}else{
$published = '0';
}
$database->setQuery("Update #__jhhost_hcats set published='$published' where id='$key'");
$database->query();
}
mosRedirect('index2.php?option=com_jhhost&task=catlist',_JH_SUCCESS);
break;
case "saveconfig":
saveconfig();
break;
case "catlist":
$database->setQuery("Select * from #__jhhost_hcats order by name asc");
$result=$database->loadObjectList();
JHHOSTHTML::catlist($result);
break;
case "resendinv";
$database->setQuery("Select * from #__jhhost_invoices as i left join #__jhhost_accounts as a on i.hpid = a.id left join #__users as u on a.jid = u.id where i.idinv = '$cid[0]'");
$result = $database->loadObjectList();
mosMail( $jhhostConfig['accountsemail'],$jhhostConfig['hostcompanyname'],$result[0]->email,$jhhostConfig['hostcompanyname'] .' Invoice: '.$cid[0],$result[0]->invoicetext,1);
mosRedirect("index2.php?option=com_jhhost&task=invoice","Resend Successful");
break;
case "batchinvoice":
jh_docron($database,'weekly');
break;
case "batchinvoicebak":
$datenow = DATE("d");
$datenow = (int)$datenow;
if ($datenow <25 &&$datenow >5){
$database->setQuery("Select * from #__jhhost_invoices as i left join #__jhhost_accounts as a on i.hpid = a.id left join #__users as u on a.jid = u.id where i.datepaid = 'N'");
$result = $database->loadObjectList();
foreach ($result as $sendinv){
mosMail( $jhhostConfig['accountsemail'],$jhhostConfig['hostcompanyname'],$sendinv->email,$jhhostConfig['hostcompanyname'] .' Invoice: '.$sendinv->idinv,$sendinv->invoicetext,1);
}
}
$database->setQuery("select * from #__jhhost_accounts where active='1' order by id asc");
$result = $database->loadObjectList();
foreach ($result as $account) {
$invmonth = DATE("m");
$invyear = DATE("Y");
$dueinvoice = 0;
$invoicelines = '';
$pricetotal = 0.00;
$database->setQuery("Select * from #__jhhost_billing where sid = '{$account->sid}'");
$result2 = $database->loadObjectList();
foreach ($result2 as $billine) {
$nextdate_array = explode("-",$billine->nextinvdue);
$nextdate_year = $nextdate_array[0];
$nextdate_month = $nextdate_array[1];
$nextdate_day = $nexdate_array[2];
if (($nextdate_year == $invyear &&$nextdate_month == $invmonth &&$datenow >= $nextdate_day) ||($nextdate_year == $invyear &&$nextdate_month <$invmonth ) ||($nextdate_year <$invyear &&$nextdate_month == 12 )) {
$dueinvoice = 1;
if ($billine->period == 'Y') {
$hostbill = DATE("Y-m-d",strtotime("{$billine->nextinvdue} +1 YEAR"));
}elseif($period == "B") {
$hostbill = DATE("Y-m-d",strtotime("{$billine->nextinvdue}  +6 MONTHS"));
}elseif($period == "Q") {
$hostbill = DATE("Y-m-d",strtotime("{$billine->nextinvdue}  +3 MONTHS"));
}elseif($period == "X"){
$hostbill = '0000-00-00';
}elseif($period == 'M'){
$hostbill = DATE("Y-m-d",strtotime("{$billine->nextinvdue}  +1 MONTHS"));
}
$invoicelines .= '<tr>

      <td width="100" bgcolor="white"><font size="-2" face="Verdana">
        01
      </font></td>
      <td width="30%" bgcolor="white" align="left"><font size="-2" face="Verdana">
      '.$billine->details .'</td>
      
      <td bgcolor="white" width="90"><div align="right"><font size="-2" face="Verdana">
       '.$jhhostConfig['displaycurrency'] .$billine->price .'
      </font></div></td>
    </tr>';
$pricetotal = $pricetotal +$billine->price;
$database->setQuery("update #__jhhost_billing set nextinvdue = '$hostbill' where id = '".$billine->id ."'");
$database->query();
}
}
if($dueinvoice == 1) {
$database->setQuery("Select * from #__users where id = '".$account->jid ."'");
$result3 = $database->loadObjectList();
include(_JHHOST_FRONT_PATH .'email/invoice.html.php');
$jhInvoice = str_replace('[INV_COMP_NAME]',$jhhostConfig['hostcompanyname'],$jhInvoice);
$jhInvoice = str_replace('[INV_COMP_SUPPORT_EMAIL]',$jhhostConfig['supportemail'],$jhInvoice);
$jhInvoice = str_replace('[INV_COMP_ACCOUNTS_EMAIL]',$jhhostConfig['accountsemail'],$jhInvoice);
$jhInvoice = str_replace('[INV_COMP_CUST_NAME]',$result3[0]->name .' - '.$account->domainame ,$jhInvoice);
$invDate = Date("Y-m-d");
$dueDate = DATE("Y-m-d",strtotime("NOW +7 DAYS"));
$jhInvoice = str_replace('[INV_COMP_INV_DUE]',$dueDate,$jhInvoice);
$jhInvoice = str_replace('[INV_COMP_CREATED]',$invDate,$jhInvoice);
$jhInvoice = str_replace(' [INV_COMP_PHONE]',$jhhostConfig['companyphone'],$jhInvoice);
$jhInvoice = str_replace(' [INV_COMP_ADDRESS]',$jhhostConfig['companyaddress'],$jhInvoice);
$database->setQuery("insert into #__jhhost_invoices(invoicetext,dategen,datepaid,payedby,amount,hpid) values('x','".DATE("Y-m-d")."','N','N','$pricetotal','{$account->id}')");
$database->query();
$invNo = $database->insertid();
$jhInvoice = str_replace('[INV_COMP_INV_NO]',$invNo,$jhInvoice);
$jhInvoice = str_replace(' [INV_COMP_TOTAL_DUE]',$jhhostConfig['displaycurrency'] .' '.number_format($pricetotal,2,'.',''),$jhInvoice);
$jhInvoice = str_replace('[INV_LINES]',$invoicelines,$jhInvoice);
global $mosConfig_live_site;
$payonline = '<a href="'.$mosConfig_live_site .'/index.php?option=com_jhhost&task=invoices'.'">'.JH_LOGIN_TO_PAY .'</a>';
$jhInvoice = str_replace('[INV_COMP_PAYMETHODS]',$payonline,$jhInvoice);
$database->setQuery("update #__jhhost_invoices set invoicetext='$jhInvoice' where idinv='$invNo'");
$database->query();
mosMail( $jhhostConfig['accountsemail'],$jhhostConfig['hostcompanyname'],$result3[0]->email,$jhhostConfig['hostcompanyname'] .' Invoice: '.$invNo,$jhInvoice,1);
}
}
mosRedirect("index2.php?option=com_jhhost&task=invoice","Invoice Automation Completed");
break;
case "listplugins":
JHHOSTHTML::jh_plugins('');
break;
case "showconfig":
JHHOSTHTML::showconfig($jhhostConfig);
break;
get_jhplugins(_JHHOST_PLUGIN_ADMIN,$task);
default:
$database->setQuery("Select count(*) as cat from #__jhhost_hcats");
$cats = $database->loadResult();
$database->setQuery("Select count(*) as pac from #__jhhost_hpacks");
$packs = $database->loadResult();
$database->setQuery("Select count(*) as aac from #__jhhost_accounts where active='1'");
$active = $database->loadResult();
$database->setQuery("Select count(*) as sac from #__jhhost_accounts where active='0'");
$inactive = $database->loadResult();
$database->setQuery("Select count(*) as unp from #__jhhost_invoices where datepaid = 'N'");
$unpaid = $database->loadResult();
JHHOSTHTML::cpanel($cats,$packs,$active,$inactive,$unpaid,$jhversion);
break;
}
function saveconfig(){
$configfile = _JHHOST_FRONT_PATH ."jhhost.config.php";
@chmod($configfile,0766);
if (!is_writable($configfile)) {
mosRedirect("index2.php?option=com_jhhost",'Config File not Writable');
}
$txt = "<?php\n";
foreach ($_POST as $k =>$v)
{
if (strpos($k,'cfg_') === 0)
{
if (!get_magic_quotes_gpc()) {
$v = addslashes($v);
}
$txt .= "\$jhhostConfig['".substr($k,4) ."']='$v';\n";
}
}
$txt .= "?>";
if ($fp = fopen($configfile,"w"))
{
fputs($fp,$txt,strlen($txt));
fclose ($fp);
mosRedirect("index2.php?option=com_jhhost&task=showconfig",_JH_SUCCESS);
}
else {
mosRedirect("index2.php?option=jhhost",'Fatal Error: Config File not found');
}
break;
}

?>
 
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху