?>

<div class="add-new-address clearfix">
    <p class="add-new-btn"><a href="javascript:void(0)" onclick="$('#modal_modify_service_statement').dialog('open');">+ CHANGE</a></p>
</div>

<!-- section -->

<h4><span>Detailed Services</span></h4>
<!-- add address button -->
<div class="add-new-address clearfix">
    <p class="add-new-btn"><a href="javascript:void(0)" onclick="$('#modal_services').dialog('open');">+ ADD NEW SERVICES</a></p>
</div>

<?php 
$service_idd = get_service_id($_SESSION['provider']['serviceprovider_id']);
$resultt = count($service_idd);
$flag = 0;
while ($resultt > $flag) {
    $services_iddd = get_services_from_id($service_idd[$flag]['service_id']);
    ?>
<!-- address box -->
<div id="div_service_<?php 
    echo $services_iddd[0]['service_id'];
    ?>
" class="address-box-wrap" style="float: left; margin-top: 12px;">
    <div class="address-box"><div class="address-box-inner">
            <p class="address-box-label">Service</p>
            <p class="address-box-value"><?php 
    echo $services_iddd[0]['servicename'];
    ?>
                        $ssl = true;
                        $ssl_id = $y;
                    } else {
                        $ssl = false;
                    }
                }
                $x++;
            }
            // Delete vhosts entry
            unset($a_vhosts[$_GET['id']]);
            // Delete the SSL files and service
            if ($ssl) {
                unlink_if_exists("/var/etc/vhosts-{$ipaddress}-{$port}-ssl.conf");
                unlink_if_exists("/var/etc/cert-vhosts-{$ipaddress}-{$port}.pem");
                unlink_if_exists("/usr/local/etc/rc.d/vhosts-{$ipaddress}-{$port}-ssl.sh");
                $service_id = get_service_id($a_service, 'rcfile', "vhosts-{$ipaddress}-{$port}-ssl.sh");
                if (is_int($service_id)) {
                    exec("kill `cat /var/run/vhosts-{$ipaddress}-{$port}-ssl.pid`");
                    unset($config['installedpackages']['service'][$service_id]);
                }
            }
            write_config();
            header("Location: vhosts_php.php");
            exit;
        }
    }
}
if (isset($id) && $a_vhosts[$id]) {
    $pconfig['host'] = $a_vhosts[$id]['host'];
    $pconfig['ipaddress'] = $a_vhosts[$id]['ipaddress'];
    $pconfig['port'] = $a_vhosts[$id]['port'];
                                                        <?php 
    $counting++;
}
?>
  
                              <p></p>     
                            <?php 
echo '<h4>  </h4>';
?>

							<h5>Services</h5>
                                                     
                                                        <!-- service part-->

                                                        <?php 
$service_idd = get_service_id($provider_idd);
$resultt = count($service_idd);
$flag = 0;
while ($resultt > $flag) {
    $services_iddd = get_services_from_id($service_idd[$flag]['service_id']);
    ?>
							<!-- address box -->
                                                        <div id="div_service_<?php 
    echo $service_idd[$flag]['service_id'];
    ?>
" class="address-box-wrap" style="float: left; margin-top: 12px;">
								<div class="address-box"><div class="address-box-inner">
									<p class="address-box-label"><?php 
    echo $flag + 1;
    ?>
</p>