Bläddra i källkod

moving app/services

markjcrane 6 år sedan
förälder
incheckning
17b36de16a

+ 115 - 0
services/app_config.php

@@ -0,0 +1,115 @@
+<?php
+
+	//application details
+		$apps[$x]['name'] = "Services";
+		$apps[$x]['uuid'] = "35ff1f56-513a-1f6c-a393-955838ff12ee";
+		$apps[$x]['category'] = "System";
+		$apps[$x]['subcategory'] = "";
+		$apps[$x]['version'] = "1.0";
+		$apps[$x]['license'] = "Mozilla Public License 1.1";
+		$apps[$x]['url'] = "http://www.fusionpbx.com";
+		$apps[$x]['description']['en-us'] = "Monitor System Services.";
+		$apps[$x]['description']['ar-eg'] = "";
+		$apps[$x]['description']['de-at'] = "Systemdienste überwachen.";
+		$apps[$x]['description']['de-ch'] = "";
+		$apps[$x]['description']['de-de'] = "Systemdienste überwachen.";
+		$apps[$x]['description']['es-cl'] = "Monitor de Servicios de Sistema";
+		$apps[$x]['description']['es-mx'] = "";
+		$apps[$x]['description']['fr-ca'] = "";
+		$apps[$x]['description']['fr-fr'] = "Contrôler les services du système.";
+		$apps[$x]['description']['he-il'] = "";
+		$apps[$x]['description']['it-it'] = "";
+		$apps[$x]['description']['nl-nl'] = "";
+		$apps[$x]['description']['pl-pl'] = "";
+		$apps[$x]['description']['pt-br'] = "";
+		$apps[$x]['description']['pt-pt'] = "Monitorizar Serviços do Sistema.";
+		$apps[$x]['description']['ro-ro'] = "";
+		$apps[$x]['description']['ru-ru'] = "";
+		$apps[$x]['description']['sv-se'] = "";
+		$apps[$x]['description']['uk-ua'] = "";
+
+	//permission details
+		$y=0;
+		$apps[$x]['permissions'][$y]['name'] = "service_view";
+		$apps[$x]['permissions'][$y]['menu']['uuid'] = "c28f14e9-e5ad-e992-0931-d5f5f0db6a79";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "service_add";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "service_edit";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "service_delete";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+
+	//schema details
+		$y=0;
+		$apps[$x]['db'][$y]['table']['name'] = "v_services";
+		$apps[$x]['db'][$y]['table']['parent'] = "";
+		$z=0;
+		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "id";
+		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "service_id";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "serial";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "integer";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "INT NOT NULL AUTO_INCREMENT";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "service_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "v_id";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "service_name";
+		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "v_service_name";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "service_type";
+		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "v_service_type";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "service_data";
+		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "v_service_data";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "service_cmd_start";
+		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "v_service_cmd_start";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "service_cmd_stop";
+		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "v_service_cmd_stop";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "service_cmd_restart";
+		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "v_service_cmd_restart";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "service_description";
+		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "v_service_description";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+
+?>

+ 424 - 0
services/app_languages.php

@@ -0,0 +1,424 @@
+<?php
+#This file was last reorganized on 19th of September 2017 08:54:24 AM UTC
+
+$text['title-services']['en-us'] = "Services";
+$text['title-services']['ar-eg'] = "";
+$text['title-services']['de-at'] = "Dienste"; //copied from de-de
+$text['title-services']['de-ch'] = "Dienste"; //copied from de-de
+$text['title-services']['de-de'] = "Dienste";
+$text['title-services']['es-cl'] = "Servicios";
+$text['title-services']['es-mx'] = "Servicios"; //copied from es-cl
+$text['title-services']['fr-ca'] = "Services"; //copied from fr-fr
+$text['title-services']['fr-fr'] = "Services";
+$text['title-services']['he-il'] = "";
+$text['title-services']['it-it'] = "Servizi";
+$text['title-services']['nl-nl'] = "";
+$text['title-services']['pl-pl'] = "Serwisy";
+$text['title-services']['pt-br'] = "Serviços"; //copied from pt-pt
+$text['title-services']['pt-pt'] = "Serviços";
+$text['title-services']['ro-ro'] = "Servicii";
+$text['title-services']['ru-ru'] = "Службы";
+$text['title-services']['sv-se'] = "Tjänster";
+$text['title-services']['uk-ua'] = "Служби";
+
+$text['title']['en-us'] = "Service Add";
+$text['title']['ar-eg'] = "";
+$text['title']['de-at'] = "Dienst hinzufügen"; //copied from de-de
+$text['title']['de-ch'] = "Dienst hinzufügen"; //copied from de-de
+$text['title']['de-de'] = "Dienst hinzufügen";
+$text['title']['es-cl'] = "Agregar Servicio";
+$text['title']['es-mx'] = "Agregar Servicio"; //copied from es-cl
+$text['title']['fr-ca'] = "Ajouter Service"; //copied from fr-fr
+$text['title']['fr-fr'] = "Ajouter Service";
+$text['title']['he-il'] = "";
+$text['title']['it-it'] = "Inserire Servizio";
+$text['title']['nl-nl'] = "";
+$text['title']['pl-pl'] = "Dodaj serwis";
+$text['title']['pt-br'] = "Configurações da Conta";
+$text['title']['pt-pt'] = "Adicionar Serviço";
+$text['title']['ro-ro'] = "Adăugare serviciu";
+$text['title']['ru-ru'] = "Служба добавлена";
+$text['title']['sv-se'] = "Lägg Till Tjänst";
+$text['title']['uk-ua'] = "Параметри облікового запису";
+
+$text['message-stopping']['en-us'] = "Stopping Service";
+$text['message-stopping']['ar-eg'] = "";
+$text['message-stopping']['de-at'] = "Dienst beenden"; //copied from de-de
+$text['message-stopping']['de-ch'] = "Dienst beenden"; //copied from de-de
+$text['message-stopping']['de-de'] = "Dienst beenden";
+$text['message-stopping']['es-cl'] = "Servicio de Detención";
+$text['message-stopping']['es-mx'] = "Servicio de Detención"; //copied from es-cl
+$text['message-stopping']['fr-ca'] = "Service de L'arrêt"; //copied from fr-fr
+$text['message-stopping']['fr-fr'] = "Service de L'arrêt";
+$text['message-stopping']['he-il'] = "";
+$text['message-stopping']['it-it'] = "Arresto Servizio";
+$text['message-stopping']['nl-nl'] = "";
+$text['message-stopping']['pl-pl'] = "Zatrzymaj serwis";
+$text['message-stopping']['pt-br'] = "Pausar serviço";
+$text['message-stopping']['pt-pt'] = "A Parar Serviço";
+$text['message-stopping']['ro-ro'] = "Oprire serviciu";
+$text['message-stopping']['ru-ru'] = "Остановка Сервиса";
+$text['message-stopping']['sv-se'] = "Stoppar Tjänst";
+$text['message-stopping']['uk-ua'] = "Зупинка служби";
+
+$text['message-starting']['en-us'] = "Starting Service";
+$text['message-starting']['ar-eg'] = "";
+$text['message-starting']['de-at'] = "Starte Dienst"; //copied from de-de
+$text['message-starting']['de-ch'] = "Starte Dienst"; //copied from de-de
+$text['message-starting']['de-de'] = "Starte Dienst";
+$text['message-starting']['es-cl'] = "Servicio de Inicio";
+$text['message-starting']['es-mx'] = "Servicio de Inicio"; //copied from es-cl
+$text['message-starting']['fr-ca'] = "Démarrage du Service"; //copied from fr-fr
+$text['message-starting']['fr-fr'] = "Démarrage du Service";
+$text['message-starting']['he-il'] = "";
+$text['message-starting']['it-it'] = "Avvio Servizio";
+$text['message-starting']['nl-nl'] = "";
+$text['message-starting']['pl-pl'] = "Załącz serwis";
+$text['message-starting']['pt-br'] = "Inciar serviço";
+$text['message-starting']['pt-pt'] = "A Iniciar Serviço";
+$text['message-starting']['ro-ro'] = "Pornire serviciu";
+$text['message-starting']['ru-ru'] = "Старт Сервиса";
+$text['message-starting']['sv-se'] = "Startar Tjänst";
+$text['message-starting']['uk-ua'] = "Запуск служби";
+
+$text['label-stopped']['en-us'] = "Stopped";
+$text['label-stopped']['ar-eg'] = "";
+$text['label-stopped']['de-at'] = "Beendet"; //copied from de-de
+$text['label-stopped']['de-ch'] = "Beendet"; //copied from de-de
+$text['label-stopped']['de-de'] = "Beendet";
+$text['label-stopped']['es-cl'] = "Detenido";
+$text['label-stopped']['es-mx'] = "Detenido"; //copied from es-cl
+$text['label-stopped']['fr-ca'] = "Arrêtée"; //copied from fr-fr
+$text['label-stopped']['fr-fr'] = "Arrêtée";
+$text['label-stopped']['he-il'] = "";
+$text['label-stopped']['it-it'] = "Fermato";
+$text['label-stopped']['nl-nl'] = "";
+$text['label-stopped']['pl-pl'] = "Zatrzymany";
+$text['label-stopped']['pt-br'] = "Pausado";
+$text['label-stopped']['pt-pt'] = "Parou";
+$text['label-stopped']['ro-ro'] = "Oprit";
+$text['label-stopped']['ru-ru'] = "Остановлено";
+$text['label-stopped']['sv-se'] = "Stoppad";
+$text['label-stopped']['uk-ua'] = "Зупинено";
+
+$text['label-stop_command']['en-us'] = "Stop Command";
+$text['label-stop_command']['ar-eg'] = "";
+$text['label-stop_command']['de-at'] = "Stopp Befehl"; //copied from de-de
+$text['label-stop_command']['de-ch'] = "Stopp Befehl"; //copied from de-de
+$text['label-stop_command']['de-de'] = "Stopp Befehl";
+$text['label-stop_command']['es-cl'] = "Comando para Detener";
+$text['label-stop_command']['es-mx'] = "Comando para Detener"; //copied from es-cl
+$text['label-stop_command']['fr-ca'] = "Comande d'arrêt"; //copied from fr-fr
+$text['label-stop_command']['fr-fr'] = "Comande d'arrêt";
+$text['label-stop_command']['he-il'] = "";
+$text['label-stop_command']['it-it'] = "Comando Arresto";
+$text['label-stop_command']['nl-nl'] = "";
+$text['label-stop_command']['pl-pl'] = "Polecenie: STOP";
+$text['label-stop_command']['pt-br'] = "Comando para pausar";
+$text['label-stop_command']['pt-pt'] = "Comando para Parar";
+$text['label-stop_command']['ro-ro'] = "Comandă oprire";
+$text['label-stop_command']['ru-ru'] = "Команда остановить";
+$text['label-stop_command']['sv-se'] = "Stopp Komando";
+$text['label-stop_command']['uk-ua'] = "Команда для зупинки ";
+
+$text['label-stop']['en-us'] = "Stop";
+$text['label-stop']['ar-eg'] = "";
+$text['label-stop']['de-at'] = "Stopp"; //copied from de-de
+$text['label-stop']['de-ch'] = "Stopp"; //copied from de-de
+$text['label-stop']['de-de'] = "Stopp";
+$text['label-stop']['es-cl'] = "Deténgase";
+$text['label-stop']['es-mx'] = "Deténgase"; //copied from es-cl
+$text['label-stop']['fr-ca'] = "Arrêtez"; //copied from fr-fr
+$text['label-stop']['fr-fr'] = "Arrêtez";
+$text['label-stop']['he-il'] = "";
+$text['label-stop']['it-it'] = "Ferma";
+$text['label-stop']['nl-nl'] = "";
+$text['label-stop']['pl-pl'] = "zatrzymaj nagrywanie";
+$text['label-stop']['pt-br'] = "Parar";
+$text['label-stop']['pt-pt'] = "Pare";
+$text['label-stop']['ro-ro'] = "Oprește";
+$text['label-stop']['ru-ru'] = "Остановить";
+$text['label-stop']['sv-se'] = "Stoppa";
+$text['label-stop']['uk-ua'] = "Зупинити";
+
+$text['label-status']['en-us'] = "Status";
+$text['label-status']['ar-eg'] = "";
+$text['label-status']['de-at'] = "Status"; //copied from de-de
+$text['label-status']['de-ch'] = "Status"; //copied from de-de
+$text['label-status']['de-de'] = "Status";
+$text['label-status']['es-cl'] = "Estado";
+$text['label-status']['es-mx'] = "Estado"; //copied from es-cl
+$text['label-status']['fr-ca'] = "Statut"; //copied from fr-fr
+$text['label-status']['fr-fr'] = "Statut";
+$text['label-status']['he-il'] = "";
+$text['label-status']['it-it'] = "Stato";
+$text['label-status']['nl-nl'] = "";
+$text['label-status']['pl-pl'] = "Status";
+$text['label-status']['pt-br'] = "Estado"; //copied from pt-pt
+$text['label-status']['pt-pt'] = "Estado";
+$text['label-status']['ro-ro'] = "Stare";
+$text['label-status']['ru-ru'] = "Статус";
+$text['label-status']['sv-se'] = "Status";
+$text['label-status']['uk-ua'] = "Стан";
+
+$text['label-start_command']['en-us'] = "Start Command";
+$text['label-start_command']['ar-eg'] = "";
+$text['label-start_command']['de-at'] = "Start Befehl"; //copied from de-de
+$text['label-start_command']['de-ch'] = "Start Befehl"; //copied from de-de
+$text['label-start_command']['de-de'] = "Start Befehl";
+$text['label-start_command']['es-cl'] = "Comando para Iniciar";
+$text['label-start_command']['es-mx'] = "Comando para Iniciar"; //copied from es-cl
+$text['label-start_command']['fr-ca'] = "Commande démarrage"; //copied from fr-fr
+$text['label-start_command']['fr-fr'] = "Commande démarrage";
+$text['label-start_command']['he-il'] = "";
+$text['label-start_command']['it-it'] = "Comando Avvio";
+$text['label-start_command']['nl-nl'] = "";
+$text['label-start_command']['pl-pl'] = "Polecenie: START";
+$text['label-start_command']['pt-br'] = "Comando para iniciar";
+$text['label-start_command']['pt-pt'] = "Comando para Iniciar";
+$text['label-start_command']['ro-ro'] = "Comandă pornire";
+$text['label-start_command']['ru-ru'] = "Команда стартовать";
+$text['label-start_command']['sv-se'] = "Start Komando";
+$text['label-start_command']['uk-ua'] = "Команда для запуску ";
+
+$text['label-start']['en-us'] = "Start";
+$text['label-start']['ar-eg'] = "";
+$text['label-start']['de-at'] = "Start"; //copied from de-de
+$text['label-start']['de-ch'] = "Start"; //copied from de-de
+$text['label-start']['de-de'] = "Start";
+$text['label-start']['es-cl'] = "Comienzo";
+$text['label-start']['es-mx'] = "Comienzo"; //copied from es-cl
+$text['label-start']['fr-ca'] = "Début"; //copied from fr-fr
+$text['label-start']['fr-fr'] = "Début";
+$text['label-start']['he-il'] = "";
+$text['label-start']['it-it'] = "Avvia";
+$text['label-start']['nl-nl'] = "";
+$text['label-start']['pl-pl'] = "Start";
+$text['label-start']['pt-br'] = "Iniciar";
+$text['label-start']['pt-pt'] = "Começo";
+$text['label-start']['ro-ro'] = "Pornește";
+$text['label-start']['ru-ru'] = "Старт";
+$text['label-start']['sv-se'] = "Starta";
+$text['label-start']['uk-ua'] = "Запустити";
+
+$text['label-running']['en-us'] = "Running";
+$text['label-running']['ar-eg'] = "";
+$text['label-running']['de-at'] = "Läuft"; //copied from de-de
+$text['label-running']['de-ch'] = "Läuft"; //copied from de-de
+$text['label-running']['de-de'] = "Läuft";
+$text['label-running']['es-cl'] = "Runcionamiento";
+$text['label-running']['es-mx'] = "Runcionamiento"; //copied from es-cl
+$text['label-running']['fr-ca'] = "Fonctionnement"; //copied from fr-fr
+$text['label-running']['fr-fr'] = "Fonctionnement";
+$text['label-running']['he-il'] = "";
+$text['label-running']['it-it'] = "In Esecuzione";
+$text['label-running']['nl-nl'] = "";
+$text['label-running']['pl-pl'] = "Działa";
+$text['label-running']['pt-br'] = "Em execução";
+$text['label-running']['pt-pt'] = "Funcionamento";
+$text['label-running']['ro-ro'] = "În desfășurare";
+$text['label-running']['ru-ru'] = "Запущено";
+$text['label-running']['sv-se'] = "I Drift";
+$text['label-running']['uk-ua'] = "Запущено";
+
+$text['label-data']['en-us'] = "Data";
+$text['label-data']['ar-eg'] = "";
+$text['label-data']['de-at'] = "Daten"; //copied from de-de
+$text['label-data']['de-ch'] = "Daten"; //copied from de-de
+$text['label-data']['de-de'] = "Daten";
+$text['label-data']['es-cl'] = "Datos";
+$text['label-data']['es-mx'] = "Datos"; //copied from es-cl
+$text['label-data']['fr-ca'] = "Données"; //copied from fr-fr
+$text['label-data']['fr-fr'] = "Données";
+$text['label-data']['he-il'] = "";
+$text['label-data']['it-it'] = "Dati";
+$text['label-data']['nl-nl'] = "";
+$text['label-data']['pl-pl'] = "Dane";
+$text['label-data']['pt-br'] = "Data";
+$text['label-data']['pt-pt'] = "Dados";
+$text['label-data']['ro-ro'] = "Data";
+$text['label-data']['ru-ru'] = "Данные";
+$text['label-data']['sv-se'] = "Data";
+$text['label-data']['uk-ua'] = "Дані";
+
+$text['label-action']['en-us'] = "Action";
+$text['label-action']['ar-eg'] = "";
+$text['label-action']['de-at'] = "Aktion"; //copied from de-de
+$text['label-action']['de-ch'] = "Aktion"; //copied from de-de
+$text['label-action']['de-de'] = "Aktion";
+$text['label-action']['es-cl'] = "Acción";
+$text['label-action']['es-mx'] = "Acción"; //copied from es-cl
+$text['label-action']['fr-ca'] = "Action"; //copied from fr-fr
+$text['label-action']['fr-fr'] = "Action";
+$text['label-action']['he-il'] = "";
+$text['label-action']['it-it'] = "Azione";
+$text['label-action']['nl-nl'] = "";
+$text['label-action']['pl-pl'] = "Operacja";
+$text['label-action']['pt-br'] = "Ação"; //copied from pt-pt
+$text['label-action']['pt-pt'] = "Ação";
+$text['label-action']['ro-ro'] = "Acțiune";
+$text['label-action']['ru-ru'] = "Действие";
+$text['label-action']['sv-se'] = "Åtgärd";
+$text['label-action']['uk-ua'] = "Дія";
+
+$text['header-services']['en-us'] = "Services";
+$text['header-services']['ar-eg'] = "";
+$text['header-services']['de-at'] = "Dienste"; //copied from de-de
+$text['header-services']['de-ch'] = "Dienste"; //copied from de-de
+$text['header-services']['de-de'] = "Dienste";
+$text['header-services']['es-cl'] = "Servicios";
+$text['header-services']['es-mx'] = "Servicios"; //copied from es-cl
+$text['header-services']['fr-ca'] = "Services"; //copied from fr-fr
+$text['header-services']['fr-fr'] = "Services";
+$text['header-services']['he-il'] = "";
+$text['header-services']['it-it'] = "Servizi";
+$text['header-services']['nl-nl'] = "";
+$text['header-services']['pl-pl'] = "Serwisy";
+$text['header-services']['pt-br'] = "Serviços"; //copied from pt-pt
+$text['header-services']['pt-pt'] = "Serviços";
+$text['header-services']['ro-ro'] = "Servicii";
+$text['header-services']['ru-ru'] = "Сервисы";
+$text['header-services']['sv-se'] = "Tjänster";
+$text['header-services']['uk-ua'] = "Служби";
+
+$text['description-type']['en-us'] = "Select the service type.";
+$text['description-type']['ar-eg'] = "";
+$text['description-type']['de-at'] = "Wählen Sie die Art des Dienstes."; //copied from de-de
+$text['description-type']['de-ch'] = "Wählen Sie die Art des Dienstes."; //copied from de-de
+$text['description-type']['de-de'] = "Wählen Sie die Art des Dienstes.";
+$text['description-type']['es-cl'] = "Seleccione el tipo de servicio.";
+$text['description-type']['es-mx'] = "Seleccione el tipo de servicio."; //copied from es-cl
+$text['description-type']['fr-ca'] = "Choisir le type de service."; //copied from fr-fr
+$text['description-type']['fr-fr'] = "Choisir le type de service.";
+$text['description-type']['he-il'] = "";
+$text['description-type']['it-it'] = "Selezionare il tipo di servizio.";
+$text['description-type']['nl-nl'] = "";
+$text['description-type']['pl-pl'] = "Wprowadź rodzaj ustawienia (np. uuid, name, var, dir)";
+$text['description-type']['pt-br'] = "Introduza o tipo de definição (ex:uuid,name,var,dir,etc)";
+$text['description-type']['pt-pt'] = "Seleccione o tipo de serviço.";
+$text['description-type']['ro-ro'] = "Selectați tipul serviciului";
+$text['description-type']['ru-ru'] = "Выберите тип сервиса.";
+$text['description-type']['sv-se'] = "Ange Tjänst-typen.";
+$text['description-type']['uk-ua'] = "Вкажіть тип служби";
+
+$text['description-stop_command']['en-us'] = "Enter the command to stop the service.";
+$text['description-stop_command']['ar-eg'] = "";
+$text['description-stop_command']['de-at'] = "Geben Sie einen Befehl zum Beenden des Dienstes an."; //copied from de-de
+$text['description-stop_command']['de-ch'] = "Geben Sie einen Befehl zum Beenden des Dienstes an."; //copied from de-de
+$text['description-stop_command']['de-de'] = "Geben Sie einen Befehl zum Beenden des Dienstes an.";
+$text['description-stop_command']['es-cl'] = "Ingrese el comando para detener el servicio.";
+$text['description-stop_command']['es-mx'] = "Ingrese el comando para detener el servicio."; //copied from es-cl
+$text['description-stop_command']['fr-ca'] = "Entrer la commande pour arrêter le service."; //copied from fr-fr
+$text['description-stop_command']['fr-fr'] = "Entrer la commande pour arrêter le service.";
+$text['description-stop_command']['he-il'] = "";
+$text['description-stop_command']['it-it'] = "Inserire il comando per fermare il servizio.";
+$text['description-stop_command']['nl-nl'] = "";
+$text['description-stop_command']['pl-pl'] = "Wprowadź polecenie, aby zatrzymać serwis.";
+$text['description-stop_command']['pt-br'] = "Insira o comando para pausar o serviço";
+$text['description-stop_command']['pt-pt'] = "Introduza o comando para parar o serviço.";
+$text['description-stop_command']['ro-ro'] = "Introduceți comanda de oprire a serviciului.";
+$text['description-stop_command']['ru-ru'] = "Введите команду для остановки службы.";
+$text['description-stop_command']['sv-se'] = "Ange kommandot för att stoppa tjänsten.";
+$text['description-stop_command']['uk-ua'] = "Введіть команду, щоб зупинити службу";
+
+$text['description-start_command']['en-us'] = "Enter the command to start the service.";
+$text['description-start_command']['ar-eg'] = "";
+$text['description-start_command']['de-at'] = "Geben Sie einen Befehl zum Starten des Dienstes an."; //copied from de-de
+$text['description-start_command']['de-ch'] = "Geben Sie einen Befehl zum Starten des Dienstes an."; //copied from de-de
+$text['description-start_command']['de-de'] = "Geben Sie einen Befehl zum Starten des Dienstes an.";
+$text['description-start_command']['es-cl'] = "Ingrese el comando para iniciar el servicio.";
+$text['description-start_command']['es-mx'] = "Ingrese el comando para iniciar el servicio."; //copied from es-cl
+$text['description-start_command']['fr-ca'] = "Entrer la commande pour démarrer le service."; //copied from fr-fr
+$text['description-start_command']['fr-fr'] = "Entrer la commande pour démarrer le service.";
+$text['description-start_command']['he-il'] = "";
+$text['description-start_command']['it-it'] = "Inserire il comando per avviare il servizio.";
+$text['description-start_command']['nl-nl'] = "";
+$text['description-start_command']['pl-pl'] = "Wprowadź polecenie, aby uruchomić serwis.";
+$text['description-start_command']['pt-br'] = "Insira o comando para finalizar o serviço";
+$text['description-start_command']['pt-pt'] = "Introduza o comando para arrancar o serviço.";
+$text['description-start_command']['ro-ro'] = "Introduceți comanda de pornire a serviciului";
+$text['description-start_command']['ru-ru'] = "Введите команду для старта службы.";
+$text['description-start_command']['sv-se'] = "Ange kommandot för att starta tjänsten.";
+$text['description-start_command']['uk-ua'] = "Введіть команду, щоб запустити службу";
+
+$text['description-services']['en-us'] = "Shows a list of processes, the status of the process and provides control to start and stop the process.";
+$text['description-services']['ar-eg'] = "";
+$text['description-services']['de-at'] = "Zeigt eine Liste von Prozessen, deren Status und bietet die Möglichkeit, diese Prozesse zu starten und zu stoppen."; //copied from de-de
+$text['description-services']['de-ch'] = "Zeigt eine Liste von Prozessen, deren Status und bietet die Möglichkeit, diese Prozesse zu starten und zu stoppen."; //copied from de-de
+$text['description-services']['de-de'] = "Zeigt eine Liste von Prozessen, deren Status und bietet die Möglichkeit, diese Prozesse zu starten und zu stoppen.";
+$text['description-services']['es-cl'] = "Muestra una lista de los procesos, el estado del proceso y proporciona un control para iniciar y detener el proceso.";
+$text['description-services']['es-mx'] = "Muestra una lista de los procesos, el estado del proceso y proporciona un control para iniciar y detener el proceso."; //copied from es-cl
+$text['description-services']['fr-ca'] = "Affiche une liste des processus, l'état du processus et fournit un contrôle pour démarrer et arrêter le processus."; //copied from fr-fr
+$text['description-services']['fr-fr'] = "Affiche une liste des processus, l'état du processus et fournit un contrôle pour démarrer et arrêter le processus.";
+$text['description-services']['he-il'] = "";
+$text['description-services']['it-it'] = "Mostra una lista di processi. Per ogni processo mostra lo stato e i controlli per avviarlo o fermarlo.";
+$text['description-services']['nl-nl'] = "";
+$text['description-services']['pl-pl'] = "Widok listy procesów, status procesu oraz zapewnienie kontroli, aby uruchomić i zatrzymać proces.";
+$text['description-services']['pt-br'] = "Listar processos, o estado do processo e proporciona um controle para iniciar e parar o processo";
+$text['description-services']['pt-pt'] = "Mostra uma lista de processos, o estado do processo e proporciona um controlo para iniciar e parar o processo.";
+$text['description-services']['ro-ro'] = "";
+$text['description-services']['ru-ru'] = "Показывает список процессов, состояние процесса и обеспечивает контроль запуска и остановки процесса.";
+$text['description-services']['sv-se'] = "Visar en lista med tjänster, statusen på tjänsterna samt ger möjlighet att starta och stoppa tjänsterna.";
+$text['description-services']['uk-ua'] = "Показує список процесів, стан процесу і забезпечує контроль запуску і зупинки процесу.";
+
+$text['description-name']['en-us'] = "Enter the service name.";
+$text['description-name']['ar-eg'] = "";
+$text['description-name']['de-at'] = "Geben Sie den Namen des Dienstes an"; //copied from de-de
+$text['description-name']['de-ch'] = "Geben Sie den Namen des Dienstes an"; //copied from de-de
+$text['description-name']['de-de'] = "Geben Sie den Namen des Dienstes an";
+$text['description-name']['es-cl'] = "Ingrese el nombre del servicio.";
+$text['description-name']['es-mx'] = "Ingrese el nombre del servicio."; //copied from es-cl
+$text['description-name']['fr-ca'] = "Entrer le nom du service."; //copied from fr-fr
+$text['description-name']['fr-fr'] = "Entrer le nom du service.";
+$text['description-name']['he-il'] = "";
+$text['description-name']['it-it'] = "Inserire il nome del servizio.";
+$text['description-name']['nl-nl'] = "";
+$text['description-name']['pl-pl'] = "Wprowadź nazwę";
+$text['description-name']['pt-br'] = "Insira o nome do menu";
+$text['description-name']['pt-pt'] = "Introduza o nome do serviço.";
+$text['description-name']['ro-ro'] = "Introduceți numele serviciului";
+$text['description-name']['ru-ru'] = "Введите имя сервиса.";
+$text['description-name']['sv-se'] = "Ange namn på tjänsten.";
+$text['description-name']['uk-ua'] = "Введіть назву служби";
+
+$text['description-data']['en-us'] = "Enter the service data.";
+$text['description-data']['ar-eg'] = "";
+$text['description-data']['de-at'] = "Geben Sie die Daten für den Dienst ein."; //copied from de-de
+$text['description-data']['de-ch'] = "Geben Sie die Daten für den Dienst ein."; //copied from de-de
+$text['description-data']['de-de'] = "Geben Sie die Daten für den Dienst ein.";
+$text['description-data']['es-cl'] = "Ingrese los datos del servicio.";
+$text['description-data']['es-mx'] = "Ingrese los datos del servicio."; //copied from es-cl
+$text['description-data']['fr-ca'] = "Entrer les données du service."; //copied from fr-fr
+$text['description-data']['fr-fr'] = "Entrer les données du service.";
+$text['description-data']['he-il'] = "";
+$text['description-data']['it-it'] = "Inserire i dati del servizio.";
+$text['description-data']['nl-nl'] = "";
+$text['description-data']['pl-pl'] = "Wprowadź dane serwisu.";
+$text['description-data']['pt-br'] = "Insira os dados do serviço";
+$text['description-data']['pt-pt'] = "Introduza os dados do serviço.";
+$text['description-data']['ro-ro'] = "";
+$text['description-data']['ru-ru'] = "Введите данные службы.";
+$text['description-data']['sv-se'] = "Ange data för tjänsten.";
+$text['description-data']['uk-ua'] = "Введіть дані про службу";
+
+$text['description']['en-us'] = "Shows a list of processes and provides ability to start and stop them.";
+$text['description']['ar-eg'] = "";
+$text['description']['de-at'] = "Zeigt eine Liste der Prozesse und bietet die Möglichkeit diese zu Starten und zu Stoppen."; //copied from de-de
+$text['description']['de-ch'] = "Zeigt eine Liste der Prozesse und bietet die Möglichkeit diese zu Starten und zu Stoppen."; //copied from de-de
+$text['description']['de-de'] = "Zeigt eine Liste der Prozesse und bietet die Möglichkeit diese zu Starten und zu Stoppen.";
+$text['description']['es-cl'] = "Muestra una lista de procesos y permite iniciarlos y detenerlos.";
+$text['description']['es-mx'] = "Muestra una lista de procesos y permite iniciarlos y detenerlos."; //copied from es-cl
+$text['description']['fr-ca'] = "Affiche la liste des processus et permet de les démarrer et les arrêter."; //copied from fr-fr
+$text['description']['fr-fr'] = "Affiche la liste des processus et permet de les démarrer et les arrêter.";
+$text['description']['he-il'] = "";
+$text['description']['it-it'] = "Mostra una lista di processi e fornisce l'abilità di avviarli o fermarli.";
+$text['description']['nl-nl'] = "";
+$text['description']['pl-pl'] = "Lista procesów z możliwością ich rozpoczęcia i zatrzymania.";
+$text['description']['pt-br'] = "Editar informações da conta.";
+$text['description']['pt-pt'] = "Mostra uma lista dos processos e oferece a possibilidade de os arrancar e parar.";
+$text['description']['ro-ro'] = "";
+$text['description']['ru-ru'] = "Показывает список процессов и предоставляет возможность запускать и останавливать их.";
+$text['description']['sv-se'] = "Visar en lista med tjänster samt ger möjlighet att starta och stoppa de.";
+$text['description']['uk-ua'] = "Показує список процесів і забезпечує можливість запуску і зупинки їх.";
+
+?>

+ 28 - 0
services/app_menu.php

@@ -0,0 +1,28 @@
+<?php
+
+	$y=0;
+	$apps[$x]['menu'][$y]['title']['en-us'] = "Services";
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "Dienste";
+	$apps[$x]['menu'][$y]['title']['de-de'] = "Dienste";
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "Servicios";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = "Services";
+	$apps[$x]['menu'][$y]['title']['he-il'] = "";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "Servizi";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = "Serwisy";
+	$apps[$x]['menu'][$y]['title']['pt-br'] = "Serviços";
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "Serviços";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "Servicii";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = "Службы";
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "Tjänster";
+	$apps[$x]['menu'][$y]['title']['uk-ua'] = "Служби";
+	$apps[$x]['menu'][$y]['uuid'] = "c28f14e9-e5ad-e992-0931-d5f5f0db6a79";
+	$apps[$x]['menu'][$y]['parent_uuid'] = "0438b504-8613-7887-c420-c837ffb20cb1";
+	$apps[$x]['menu'][$y]['category'] = "internal";
+	$apps[$x]['menu'][$y]['path'] = "/app/services/services.php";
+	$apps[$x]['menu'][$y]['groups'][] = "superadmin";
+
+?>

+ 227 - 0
services/resources/classes/lib_win.php

@@ -0,0 +1,227 @@
+<?php
+
+if(!defined('WIN32_ERROR_ACCESS_DENIED')) define('WIN32_ERROR_ACCESS_DENIED',0x00000005);
+if(!defined('WIN32_ERROR_CIRCULAR_DEPENDENCY')) define('WIN32_ERROR_CIRCULAR_DEPENDENCY',0x00000423);
+if(!defined('WIN32_ERROR_DATABASE_DOES_NOT_EXIST')) define('WIN32_ERROR_DATABASE_DOES_NOT_EXIST',0x00000429);
+if(!defined('WIN32_ERROR_DEPENDENT_SERVICES_RUNNING')) define('WIN32_ERROR_DEPENDENT_SERVICES_RUNNING',0x0000041B);
+if(!defined('WIN32_ERROR_DUPLICATE_SERVICE_NAME')) define('WIN32_ERROR_DUPLICATE_SERVICE_NAME',0x00000436);
+if(!defined('WIN32_ERROR_FAILED_SERVICE_CONTROLLER_CONNECT')) define('WIN32_ERROR_FAILED_SERVICE_CONTROLLER_CONNECT',0x00000427);
+if(!defined('WIN32_ERROR_INSUFFICIENT_BUFFER')) define('WIN32_ERROR_INSUFFICIENT_BUFFER',0x0000007A);
+if(!defined('WIN32_ERROR_INVALID_DATA')) define('WIN32_ERROR_INVALID_DATA',0x0000000D);
+if(!defined('WIN32_ERROR_INVALID_HANDLE')) define('WIN32_ERROR_INVALID_HANDLE',0x00000006);
+if(!defined('WIN32_ERROR_INVALID_LEVEL')) define('WIN32_ERROR_INVALID_LEVEL',0x0000007C);
+if(!defined('WIN32_ERROR_INVALID_NAME')) define('WIN32_ERROR_INVALID_NAME',0x0000007B);
+if(!defined('WIN32_ERROR_INVALID_PARAMETER')) define('WIN32_ERROR_INVALID_PARAMETER',0x00000057);
+if(!defined('WIN32_ERROR_INVALID_SERVICE_ACCOUNT')) define('WIN32_ERROR_INVALID_SERVICE_ACCOUNT',0x00000421);
+if(!defined('WIN32_ERROR_INVALID_SERVICE_CONTROL')) define('WIN32_ERROR_INVALID_SERVICE_CONTROL',0x0000041C);
+if(!defined('WIN32_ERROR_PATH_NOT_FOUND')) define('WIN32_ERROR_PATH_NOT_FOUND',0x00000003);
+if(!defined('WIN32_ERROR_SERVICE_ALREADY_RUNNING')) define('WIN32_ERROR_SERVICE_ALREADY_RUNNING',0x00000420);
+if(!defined('WIN32_ERROR_SERVICE_CANNOT_ACCEPT_CTRL')) define('WIN32_ERROR_SERVICE_CANNOT_ACCEPT_CTRL',0x00000425);
+if(!defined('WIN32_ERROR_SERVICE_DATABASE_LOCKED')) define('WIN32_ERROR_SERVICE_DATABASE_LOCKED',0x0000041F);
+if(!defined('WIN32_ERROR_SERVICE_DEPENDENCY_DELETED')) define('WIN32_ERROR_SERVICE_DEPENDENCY_DELETED',0x00000433);
+if(!defined('WIN32_ERROR_SERVICE_DEPENDENCY_FAIL')) define('WIN32_ERROR_SERVICE_DEPENDENCY_FAIL',0x0000042C);
+if(!defined('WIN32_ERROR_SERVICE_DISABLED')) define('WIN32_ERROR_SERVICE_DISABLED',0x00000422);
+if(!defined('WIN32_ERROR_SERVICE_DOES_NOT_EXIST')) define('WIN32_ERROR_SERVICE_DOES_NOT_EXIST',0x00000424);
+if(!defined('WIN32_ERROR_SERVICE_EXISTS')) define('WIN32_ERROR_SERVICE_EXISTS',0x00000431);
+if(!defined('WIN32_ERROR_SERVICE_LOGON_FAILED')) define('WIN32_ERROR_SERVICE_LOGON_FAILED',0x0000042D);
+if(!defined('WIN32_ERROR_SERVICE_MARKED_FOR_DELETE')) define('WIN32_ERROR_SERVICE_MARKED_FOR_DELETE',0x00000430);
+if(!defined('WIN32_ERROR_SERVICE_NO_THREAD')) define('WIN32_ERROR_SERVICE_NO_THREAD',0x0000041E);
+if(!defined('WIN32_ERROR_SERVICE_NOT_ACTIVE')) define('WIN32_ERROR_SERVICE_NOT_ACTIVE',0x00000426);
+if(!defined('WIN32_ERROR_SERVICE_REQUEST_TIMEOUT')) define('WIN32_ERROR_SERVICE_REQUEST_TIMEOUT',0x0000041D);
+if(!defined('WIN32_ERROR_SHUTDOWN_IN_PROGRESS')) define('WIN32_ERROR_SHUTDOWN_IN_PROGRESS',0x0000045B);
+if(!defined('WIN32_NO_ERROR')) define('WIN32_NO_ERROR',0x00000000);
+
+if(function_exists('win32_query_service_status')){
+
+	class win_service{
+		private static $service_state = array(
+			//Service Status Constants
+			WIN32_SERVICE_CONTINUE_PENDING =>'CONTINUE_PENDING',
+			WIN32_SERVICE_PAUSE_PENDING    =>'PAUSE_PENDING',
+			WIN32_SERVICE_PAUSED           =>'PAUSED',
+			WIN32_SERVICE_RUNNING          =>'RUNNING',
+			WIN32_SERVICE_START_PENDING    =>'START_PENDING',
+			WIN32_SERVICE_STOP_PENDING     =>'STOP_PENDING',
+			WIN32_SERVICE_STOPPED          =>'STOPPED',
+		);
+
+		private static $win_error = array(
+			WIN32_NO_ERROR                                    => 'NO_ERROR',
+			WIN32_ERROR_ACCESS_DENIED                         => 'ACCESS_DENIED',
+			WIN32_ERROR_CIRCULAR_DEPENDENCY                   => 'CIRCULAR_DEPENDENCY',
+			WIN32_ERROR_DATABASE_DOES_NOT_EXIST               => 'DATABASE_DOES_NOT_EXIST',
+			WIN32_ERROR_DEPENDENT_SERVICES_RUNNING            => 'DEPENDENT_SERVICES_RUNNING',
+			WIN32_ERROR_DUPLICATE_SERVICE_NAME                => 'DUPLICATE_SERVICE_NAME',
+			WIN32_ERROR_FAILED_SERVICE_CONTROLLER_CONNECT     => 'FAILED_SERVICE_CONTROLLER_CONNECT',
+			WIN32_ERROR_INSUFFICIENT_BUFFER                   => 'INSUFFICIENT_BUFFER',
+			WIN32_ERROR_INVALID_DATA                          => 'INVALID_DATA',
+			WIN32_ERROR_INVALID_HANDLE                        => 'INVALID_HANDLE',
+			WIN32_ERROR_INVALID_LEVEL                         => 'INVALID_LEVEL',
+			WIN32_ERROR_INVALID_NAME                          => 'INVALID_NAME',
+			WIN32_ERROR_INVALID_PARAMETER                     => 'INVALID_PARAMETER',
+			WIN32_ERROR_INVALID_SERVICE_ACCOUNT               => 'INVALID_SERVICE_ACCOUNT',
+			WIN32_ERROR_INVALID_SERVICE_CONTROL               => 'INVALID_SERVICE_CONTROL',
+			WIN32_ERROR_PATH_NOT_FOUND                        => 'PATH_NOT_FOUND',
+			WIN32_ERROR_SERVICE_ALREADY_RUNNING               => 'SERVICE_ALREADY_RUNNING',
+			WIN32_ERROR_SERVICE_CANNOT_ACCEPT_CTRL            => 'SERVICE_CANNOT_ACCEPT_CTRL',
+			WIN32_ERROR_SERVICE_DATABASE_LOCKED               => 'SERVICE_DATABASE_LOCKED',
+			WIN32_ERROR_SERVICE_DEPENDENCY_DELETED            => 'SERVICE_DEPENDENCY_DELETED',
+			WIN32_ERROR_SERVICE_DEPENDENCY_FAIL               => 'SERVICE_DEPENDENCY_FAIL',
+			WIN32_ERROR_SERVICE_DISABLED                      => 'SERVICE_DISABLED',
+			WIN32_ERROR_SERVICE_DOES_NOT_EXIST                => 'SERVICE_DOES_NOT_EXIST',
+			WIN32_ERROR_SERVICE_EXISTS                        => 'SERVICE_EXISTS',
+			WIN32_ERROR_SERVICE_LOGON_FAILED                  => 'SERVICE_LOGON_FAILED',
+			WIN32_ERROR_SERVICE_MARKED_FOR_DELETE             => 'SERVICE_MARKED_FOR_DELETE',
+			WIN32_ERROR_SERVICE_NO_THREAD                     => 'SERVICE_NO_THREAD',
+			WIN32_ERROR_SERVICE_NOT_ACTIVE                    => 'SERVICE_NOT_ACTIVE',
+			WIN32_ERROR_SERVICE_REQUEST_TIMEOUT               => 'SERVICE_REQUEST_TIMEOUT',
+			WIN32_ERROR_SHUTDOWN_IN_PROGRESS                  => 'SHUTDOWN_IN_PROGRESS'
+		);
+
+		private static function val2val($val,$map,$default){
+			if(isset($map[$val])) return $map[$val];
+			return $default;
+		}
+
+		var $status;
+		var $last_error;
+		var $name;
+		var $description;
+		var $machine;
+
+		function win_service($srvname, $machine=null){
+			$this->name = $srvname;
+			$this->machine = $machine;
+			$this->status = null;
+			$this->last_error = WIN32_NO_ERROR;
+		}
+
+		function refresh_status(){
+			$status = win32_query_service_status($this->name,$this->machine);
+			if(is_array($status)){
+				$this->status = (object)$status;
+				$this->last_error = WIN32_NO_ERROR;
+				return true;
+			}
+			$this->status = null;
+			$last_error = $status;
+			return false;
+		}
+
+		function start(){
+			$this->last_error = win32_start_service($this->name, $this->machine);
+			return ($this->last_error === WIN32_NO_ERROR) or ($this->last_error === WIN32_ERROR_SERVICE_ALREADY_RUNNING);
+		}
+
+		function stop(){
+			$this->last_error = win32_stop_service($this->name, $this->machine);
+			return $this->last_error === WIN32_NO_ERROR;
+		}
+
+		function last_error($as_string = true){
+			if($as_string){
+				return self::val2val(
+					$this->last_error, self::$win_error, $this->last_error
+				);
+			}
+			return $this->last_error;
+		}
+
+		function state($as_string = true){
+			if((!$this->status)and(!$this->refresh_status())) return false;
+			if($as_string){
+				return self::val2val(
+					$this->status->CurrentState, self::$service_state, 'UNKNOWN'
+				);
+			}
+			return $this->status->CurrentState;
+		}
+
+		function pid(){
+			if((!$this->status)and(!$this->refresh_status())) return false;
+			return $this->status->ProcessId;
+		}
+
+	}
+
+}
+
+if(function_exists('reg_open_key')){
+
+	class win_reg_key{
+
+		private static $HK = array(
+			HKEY_CLASSES_ROOT   => "HKCR",
+			HKEY_CURRENT_USER   => "HKCU",
+			HKEY_LOCAL_MACHINE  => "HKLM",
+			HKEY_USERS          => "HKU",
+			HKEY_CURRENT_CONFIG => "HKCC",
+		);
+
+		function __construct($haiv, $key){
+			$this->h = $haiv;
+			$this->k = $key;
+			$this->r = reg_open_key($this->h, $this->k);
+			$this->shell = new COM('WScript.Shell');
+			if(!$this->shell){
+				throw new Exception("Cannot create shell object.");
+			}
+			if(!$this->r){
+				throw new Exception("Cannot access registry.");
+			}
+			$this->path = self::$HK[$this->h] . '\\' . $this->k;
+		}
+
+		function __destruct(){
+			if($this->r){
+				reg_close_key($this->r);
+				$this->r = false;
+			}
+		}
+
+		function keys(){
+			return reg_enum_key($this->r);
+		}
+
+		function values($as_hash = false){
+			$values = reg_enum_value($this->r);
+			if(!$as_hash) return $values;
+			$result = Array();
+			foreach($values as $key){
+				$result[$key] = reg_get_value($this->r, $key);
+			}
+			return $result;
+		}
+
+		function value($key){
+			return reg_get_value($this->r, $key);
+		}
+
+		function exists($key){
+			$v = $this->value($key);
+			if($v === NULL)  return false;
+			if($v === false) return false;
+			return true;
+		}
+
+		private function write_raw($key, $type, $value){
+			return reg_set_value($this->r, $key, $type, $value);
+		}
+
+		function write_dword($key, $value){
+			return $this->write_raw($key, REG_DWORD, $value);
+		}
+
+		function write_string($key, $value){
+			return $this->write_raw($key, REG_SZ, $value);
+		}
+
+		function remove_value($key){
+			if(!$this->exists($key)) return;
+			$key = $this->path . '\\' . $key;
+			$this->shell->RegDelete($key);
+		}
+
+	}
+
+}

+ 90 - 0
services/root.php

@@ -0,0 +1,90 @@
+<?php
+/*
+	FusionPBX
+	Version: MPL 1.1
+
+	The contents of this file are subject to the Mozilla Public License Version
+	1.1 (the "License"); you may not use this file except in compliance with
+	the License. You may obtain a copy of the License at
+	http://www.mozilla.org/MPL/
+
+	Software distributed under the License is distributed on an "AS IS" basis,
+	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+	for the specific language governing rights and limitations under the
+	License.
+
+	The Original Code is FusionPBX
+
+	The Initial Developer of the Original Code is
+	Mark J Crane <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2008-2012
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
+
+// make sure the PATH_SEPARATOR is defined
+	umask(2);
+	if (!defined("PATH_SEPARATOR")) {
+		if (strpos($_ENV["OS"], "Win") !== false) {
+			define("PATH_SEPARATOR", ";");
+		} else {
+			define("PATH_SEPARATOR", ":");
+		}
+	}
+
+	if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
+
+	// make sure the document_root is set
+	$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
+	if(PHP_SAPI == 'cli'){
+		chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
+		$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
+		$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
+		if (file_exists('/project_root.php')) {
+			$path = '/';
+		} else {
+			$i    = 1;
+			$path = '';
+			while ($i < count($dirs)) {
+				$path .= '/' . $dirs[$i];
+				if (file_exists($path. '/project_root.php')) {
+					break;
+				}
+				$i++;
+			}
+		}
+		$_SERVER["DOCUMENT_ROOT"] = $path;
+	}else{
+		$_SERVER["DOCUMENT_ROOT"]   = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
+	}
+	$_SERVER["DOCUMENT_ROOT"]   = realpath($_SERVER["DOCUMENT_ROOT"]);
+// try to detect if a project path is being used
+	if (!defined('PROJECT_PATH')) {
+		if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
+			define('PROJECT_PATH', '/fusionpbx');
+		} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
+			define('PROJECT_PATH', '');
+		} else {
+			$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
+			$i    = 1;
+			$path = $_SERVER["DOCUMENT_ROOT"];
+			while ($i < count($dirs)) {
+				$path .= '/' . $dirs[$i];
+				if (file_exists($path. '/project_root.php')) {
+					break;
+				}
+				$i++;
+			}
+			if(!file_exists($path. '/project_root.php')){
+				die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
+			}
+			$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
+			define('PROJECT_PATH', $project_path);
+		}
+		$_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
+		set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
+	}
+
+?>

+ 60 - 0
services/service_delete.php

@@ -0,0 +1,60 @@
+<?php
+/*
+	FusionPBX
+	Version: MPL 1.1
+
+	The contents of this file are subject to the Mozilla Public License Version
+	1.1 (the "License"); you may not use this file except in compliance with
+	the License. You may obtain a copy of the License at
+	http://www.mozilla.org/MPL/
+
+	Software distributed under the License is distributed on an "AS IS" basis,
+	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+	for the specific language governing rights and limitations under the
+	License.
+
+	The Original Code is FusionPBX
+
+	The Initial Developer of the Original Code is
+	Mark J Crane <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2008-2012
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
+require_once "root.php";
+require_once "resources/require.php";
+require_once "resources/check_auth.php";
+if (permission_exists('service_delete')) {
+	//access granted
+}
+else {
+	echo "access denied";
+	exit;
+}
+
+//add multi-lingual support
+	$language = new text;
+	$text = $language->get();
+
+//get the id
+	if (count($_GET)>0) {
+		$id = check_str($_GET["id"]);
+	}
+
+//delete the data
+	if (strlen($id)>0) {
+		$sql = "delete from v_services ";
+		$sql .= "where service_uuid = '$id' ";
+		$prep_statement = $db->prepare(check_sql($sql));
+		$prep_statement->execute();
+		unset($sql);
+	}
+
+//redirect the user
+	message::add($text['message-delete']);
+	header("Location: services.php");
+	return;
+
+?>

+ 295 - 0
services/service_edit.php

@@ -0,0 +1,295 @@
+<?php
+/*
+	FusionPBX
+	Version: MPL 1.1
+
+	The contents of this file are subject to the Mozilla Public License Version
+	1.1 (the "License"); you may not use this file except in compliance with
+	the License. You may obtain a copy of the License at
+	http://www.mozilla.org/MPL/
+
+	Software distributed under the License is distributed on an "AS IS" basis,
+	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+	for the specific language governing rights and limitations under the
+	License.
+
+	The Original Code is FusionPBX
+
+	The Initial Developer of the Original Code is
+	Mark J Crane <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2008-2018
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+	James Rose <[email protected]>
+*/
+require_once "root.php";
+require_once "resources/require.php";
+require_once "resources/check_auth.php";
+if (permission_exists('service_add') || permission_exists('service_edit')) {
+	//access granted
+}
+else {
+	echo "access denied";
+	exit;
+}
+
+//add multi-lingual support
+	$language = new text;
+	$text = $language->get();
+
+//action add or update
+	if (isset($_REQUEST["id"])) {
+		$action = "update";
+		$service_uuid = check_str($_REQUEST["id"]);
+	}
+	else {
+		$action = "add";
+	}
+
+//get http post and set it to php variables
+	if (count($_POST)>0) {
+		$service_name = check_str($_POST["service_name"]);
+		$service_type = check_str($_POST["service_type"]);
+		$service_data = check_str($_POST["service_data"]);
+		$service_cmd_start = check_str($_POST["service_cmd_start"]);
+		$service_cmd_stop = check_str($_POST["service_cmd_stop"]);
+		$service_description = check_str($_POST["service_description"]);
+	}
+
+if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
+
+	$msg = '';
+	if ($action == "update") {
+		$service_uuid = check_str($_POST["service_uuid"]);
+	}
+
+	//check for all required data
+		//if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
+		if (strlen($service_name) == 0) { $msg .= "Please provide: Name<br>\n"; }
+		//if (strlen($service_type) == 0) { $msg .= "Please provide: Type<br>\n"; }
+		//if (strlen($service_data) == 0) { $msg .= "Please provide: Data<br>\n"; }
+		//if (strlen($service_cmd_start) == 0) { $msg .= "Please provide: Start Command<br>\n"; }
+		//if (strlen($service_cmd_stop) == 0) { $msg .= "Please provide: Stop Command<br>\n"; }
+		//if (strlen($service_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
+		if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
+			require_once "resources/header.php";
+			require_once "resources/persist_form_var.php";
+			echo "<div align='center'>\n";
+			echo "<table><tr><td>\n";
+			echo $msg."<br />";
+			echo "</td></tr></table>\n";
+			persistformvar($_POST);
+			echo "</div>\n";
+			require_once "resources/footer.php";
+			return;
+		}
+
+	//add or update the database
+		if ($_POST["persistformvar"] != "true") {
+			if ($action == "add" && permission_exists('service_add')) {
+				$service_uuid = uuid();
+				$sql = "insert into v_services ";
+				$sql .= "(";
+				$sql .= "domain_uuid, ";
+				$sql .= "service_uuid, ";
+				$sql .= "service_name, ";
+				$sql .= "service_type, ";
+				$sql .= "service_data, ";
+				$sql .= "service_cmd_start, ";
+				$sql .= "service_cmd_stop, ";
+				$sql .= "service_description ";
+				$sql .= ")";
+				$sql .= "values ";
+				$sql .= "(";
+				$sql .= "'$domain_uuid', ";
+				$sql .= "'$service_uuid', ";
+				$sql .= "'$service_name', ";
+				$sql .= "'$service_type', ";
+				$sql .= "'$service_data', ";
+				$sql .= "'$service_cmd_start', ";
+				$sql .= "'$service_cmd_stop', ";
+				$sql .= "'$service_description' ";
+				$sql .= ")";
+				$db->exec(check_sql($sql));
+				unset($sql);
+
+				message::add($text['message-add']);
+				header("Location: services.php");
+				return;
+			} //if ($action == "add")
+
+			if ($action == "update" && permission_exists('service_edit')) {
+				$sql = "update v_services set ";
+				$sql .= "service_name = '$service_name', ";
+				$sql .= "service_type = '$service_type', ";
+				$sql .= "service_data = '$service_data', ";
+				$sql .= "service_cmd_start = '$service_cmd_start', ";
+				$sql .= "service_cmd_stop = '$service_cmd_stop', ";
+				$sql .= "service_description = '$service_description' ";
+				$sql .= "where service_uuid = '$service_uuid' ";
+				// $sql .= "and domain_uuid = '$domain_uuid'";
+				$db->exec(check_sql($sql));
+				unset($sql);
+
+				message::add($text['message-update']);
+				header("Location: services.php");
+				return;
+			} //if ($action == "update")
+		} //if ($_POST["persistformvar"] != "true")
+} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
+
+//pre-populate the form
+	if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
+		$service_uuid = $_GET["id"];
+		$sql = "select * from v_services ";
+		$sql .= "where service_uuid = '$service_uuid' ";
+		$prep_statement = $db->prepare(check_sql($sql));
+		$prep_statement->execute();
+		$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+		foreach ($result as &$row) {
+			$domain_uuid = $row["domain_uuid"];
+			$service_name = $row["service_name"];
+			$service_type = $row["service_type"];
+			$service_data = $row["service_data"];
+			$service_cmd_start = $row["service_cmd_start"];
+			$service_cmd_stop = $row["service_cmd_stop"];
+			$service_description = $row["service_description"];
+			break; //limit to 1 row
+		}
+		unset ($prep_statement);
+	}
+
+//show the header
+	require_once "resources/header.php";
+
+//begin the content
+	echo "<form method='post' name='frm' action=''>\n";
+	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	echo "<tr>\n";
+	if ($action == "add") {
+		echo "<td align='left' width='30%' nowrap><b>".$text['title']."</b></td>\n";
+	}
+	if ($action == "update") {
+		echo "<td align='left' width='30%' nowrap><b>Service Edit</b></td>\n";
+	}
+	echo "<td width='70%' align='right'>";
+	echo "	<input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='services.php'\" value='".$text['button-back']."'>";
+	echo "	<input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+	echo "<tr>\n";
+	echo "<td align='left' colspan='2'>\n";
+	echo $text['description']."<br /><br />\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	echo "<tr>\n";
+	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
+	echo "	".$text['label-name']."\n";
+	echo "</td>\n";
+	echo "<td class='vtable' align='left'>\n";
+	echo "	<input class='formfld' type='text' name='service_name' maxlength='255' value=\"".escape($service_name)."\">\n";
+	echo "<br />\n";
+	echo $text['description-name']."\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	echo "<tr>\n";
+	echo "<td class='vncell' valign='top' align='left' nowrap>\n";
+	echo "	".$text['label-type']."\n";
+	echo "</td>\n";
+	echo "<td class='vtable' align='left'>\n";
+	echo "	<select class='formfld' name='service_type'>\n";
+	echo "	<option value=''></option>\n";
+	if ($service_type == "pid" || $service_type == "pid_file") {
+		echo "	<option value='pid' selected='selected'>pid</option>\n";
+	}
+	else {
+		echo "	<option value='pid'>pid</option>\n";
+	}
+	//if ($service_type == "php") {
+	//	echo "	<option value='php' selected='selected'>php</option>\n";
+	//}
+	//else {
+	//	echo "	<option value='php'>php</option>\n";
+	//}
+	if ($service_type == "file") {
+		echo "	<option value='file' selected='selected'>file</option>\n";
+	}
+	else {
+		echo "	<option value='file'>file</option>\n";
+	}
+	if ($service_type == "svc") {
+		echo "	<option value='svc' selected='selected'>svc</option>\n";
+	}
+	else {
+		echo "	<option value='svc'>svc</option>\n";
+	}
+	echo "	</select>\n";
+	echo "<br />\n";
+	echo $text['description-type']."\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	echo "<tr>\n";
+	echo "<td class='vncell' valign='top' align='left' nowrap>\n";
+	echo "	".$text['label-data']."\n";
+	echo "</td>\n";
+	echo "<td class='vtable' align='left'>\n";
+	echo "	<input class='formfld' type='text' name='service_data' maxlength='255' value=\"" .  htmlspecialchars($service_data) . "\">\n";
+	//echo "	<textarea class='formfld' name='service_data' rows='4'>$service_data</textarea>\n";
+	echo "<br />\n";
+	echo $text['description-data']."\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	echo "<tr>\n";
+	echo "<td class='vncell' valign='top' align='left' nowrap>\n";
+	echo "	".$text['label-start_command']."\n";
+	echo "</td>\n";
+	echo "<td class='vtable' align='left'>\n";
+	echo "	<input class='formfld' type='text' name='service_cmd_start' maxlength='255' value=\"" .  htmlspecialchars($service_cmd_start) . "\">\n";
+	echo "<br />\n";
+	echo $text['description-start_command']."\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	echo "<tr>\n";
+	echo "<td class='vncell' valign='top' align='left' nowrap>\n";
+	echo "	".$text['label-stop_command']."\n";
+	echo "</td>\n";
+	echo "<td class='vtable' align='left'>\n";
+	echo "	<input class='formfld' type='text' name='service_cmd_stop' maxlength='255' value=\"" .  htmlspecialchars($service_cmd_stop) . "\">\n";
+	echo "<br />\n";
+	echo $text['description-stop_command']."\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	echo "<tr>\n";
+	echo "<td class='vncell' valign='top' align='left' nowrap>\n";
+	echo "	".$text['label-description']."\n";
+	echo "</td>\n";
+	echo "<td class='vtable' align='left'>\n";
+	echo "	<textarea class='formfld' name='service_description' rows='4'>".escape($service_description)."</textarea>\n";
+	echo "<br />\n";
+	echo $text['description-description']."\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+	echo "	<tr>\n";
+	echo "		<td colspan='2' align='right'>\n";
+	if ($action == "update") {
+		echo "		<input type='hidden' name='service_uuid' value='".escape($service_uuid)."'>\n";
+	}
+	echo "			<br>";
+	echo "			<input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
+	echo "		</td>\n";
+	echo "	</tr>";
+	echo "</table>";
+	echo "<br><br>";
+	echo "</form>";
+
+//show the footer
+	require_once "resources/footer.php";
+?>

+ 292 - 0
services/services.php

@@ -0,0 +1,292 @@
+<?php
+/*
+	FusionPBX
+	Version: MPL 1.1
+
+	The contents of this file are subject to the Mozilla Public License Version
+	1.1 (the "License"); you may not use this file except in compliance with
+	the License. You may obtain a copy of the License at
+	http://www.mozilla.org/MPL/
+
+	Software distributed under the License is distributed on an "AS IS" basis,
+	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+	for the specific language governing rights and limitations under the
+	License.
+
+	The Original Code is FusionPBX
+
+	The Initial Developer of the Original Code is
+	Mark J Crane <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2008-2018
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
+
+//includes
+require_once "root.php";
+require_once "resources/require.php";
+require_once "resources/check_auth.php";
+
+//check permissions
+if (permission_exists('service_view')) {
+	//access granted
+}
+else {
+	echo "access denied";
+	exit;
+}
+
+global $IS_WINDOWS;
+
+if ($IS_WINDOWS == null) {
+	if (stristr(PHP_OS, 'WIN')) { $IS_WINDOWS = true; } else { $IS_WINDOWS = false; }
+}
+
+$HAS_WIN_SVC = false;
+if($IS_WINDOWS){
+	require_once "resources/classes/lib_win.php";
+	$HAS_WIN_SVC = class_exists('win_service');
+}
+
+//add multi-lingual support
+	$language = new text;
+	$text = $language->get();
+
+require_once "resources/header.php";
+$document['title'] = $text['title-services'];
+require_once "resources/paging.php";
+
+$order_by = check_str($_GET["order_by"]);
+$order = check_str($_GET["order"]);
+
+if (strlen($_GET["a"]) > 0) {
+	$service_uuid = check_str($_GET["id"]);
+	$sql = "select * from v_services ";
+	$sql .= "where service_uuid = '$service_uuid' ";
+	$prep_statement = $db->prepare(check_sql($sql));
+	$prep_statement->execute();
+	$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+	foreach ($result as &$row) {
+		$domain_uuid = $row["domain_uuid"];
+		$service_name = $row["service_name"];
+		$service_type = $row["service_type"];
+		$service_data = $row["service_data"];
+		$service_cmd_start = $row["service_cmd_start"];
+		$service_cmd_stop = $row["service_cmd_stop"];
+		$service_description = $row["service_description"];
+	}
+	unset ($prep_statement);
+
+	if($service_type == 'svc'){
+		if($HAS_WIN_SVC){
+			$svc = new win_service($service_data);
+			if ($_GET["a"] == "stop") {
+				$_SESSION["message"] = $text['message-stopping'].': '.$service_name;
+				$svc->stop();
+			}
+			if ($_GET["a"] == "start") {
+				$_SESSION["message"] = $text['message-starting'].': '.$service_name;
+				$svc->start();
+			}
+		}
+	}
+	else {
+		if ($_GET["a"] == "stop") {
+			$_SESSION["message"] = $text['message-stopping'].': '.$service_name;
+			shell_exec($service_cmd_stop);
+		}
+		if ($_GET["a"] == "start") {
+			$_SESSION["message"] = $text['message-starting'].': '.$service_name;
+			shell_exec($service_cmd_start);
+		}
+	}
+	header("Location: services.php");
+	return;
+}
+
+//get the service count
+$sql = "select * from v_services ";
+if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
+$prep_statement = $db->prepare(check_sql($sql));
+$prep_statement->execute();
+$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+$num_rows = count($result);
+unset ($prep_statement, $result, $sql);
+
+//paging
+$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
+$param = "";
+$page = $_GET['page'];
+if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
+list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
+$offset = $rows_per_page * $page;
+
+//get the service data
+$sql = "select * from v_services ";
+if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
+$sql .= " limit $rows_per_page offset $offset ";
+$prep_statement = $db->prepare(check_sql($sql));
+$prep_statement->execute();
+$services = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+unset ($prep_statement, $sql);
+
+//set the row style
+$c = 0;
+$row_style["0"] = "row_style0";
+$row_style["1"] = "row_style1";
+
+
+//check if a process is running
+function is_process_running($pid) {
+	$status = shell_exec( 'ps -p ' . $pid );
+	$status_array = explode ("\n", $status);
+	if (strlen(trim($status_array[1])) > 0) {
+		return true;
+	}
+	else {
+		return false;
+	}
+}
+
+//show the table content
+echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>\n";
+echo "<tr>\n";
+echo "<td width='50%' align='left' nowrap='nowrap'><b>".$text['header-services']."</b></td>\n";
+echo "<td width='50%' align='right'>&nbsp;</td>\n";
+echo "</tr>\n";
+echo "<tr>\n";
+echo "<td align='left' colspan='2'>\n";
+echo $text['description-services']."<br /><br />\n";
+echo "</td>\n";
+echo "</tr>\n";
+echo "</tr></table>\n";
+
+echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+echo "<tr>\n";
+echo th_order_by('service_name', $text['label-name'], $order_by, $order);
+echo "<th>".$text['label-status']."</th>\n";
+echo "<th>".$text['label-action']."</th>\n";
+echo th_order_by('service_description', $text['label-description'], $order_by, $order);
+echo "<td class='list_control_icons'>";
+if (permission_exists('service_add')) {
+	echo "<a href='service_edit.php' alt='add'>$v_link_label_add</a>";
+}
+echo "</td>\n";
+echo "</tr>\n";
+
+if (is_array($services)) {
+	foreach($services as $row) {
+		$tr_link = (permission_exists('service_edit')) ? "href='service_edit.php?id=".escape($row[service_uuid])."'" : null;
+		echo "<tr ".$tr_link.">\n";
+		echo "	<td valign='top' class='".$row_style[$c]."'>";
+		if (permission_exists('service_edit')) {
+			echo "<a href='service_edit.php?id=".escape($row[service_uuid])."'>".escape($row[service_name])."</a>";
+		}
+		else {
+			echo escape($row[service_name]);
+		}
+		echo "	</td>\n";
+		echo "	<td valign='top' class='".$row_style[$c]."'>\n";
+		$service_running = false;
+
+		if ($row[service_type] == "svc") {
+			if ($HAS_WIN_SVC) {
+				$service_data = $row[service_data];
+				$svc = new win_service($service_data);
+				$svc_state = $svc->state() or $svc->last_error();
+				if(!$svc_state){
+					$svc_state = 'NOT_INSTALL';
+				}
+				$service_running = (($svc_state == 'RUNNING') || ($svc_state == 'START_PENDING'));
+
+				echo "<strong>$svc_state</strong>";
+
+				echo "</td>\n";
+				echo "	<td valign='top' class='".$row_style[$c]."'>\n";
+				if ($svc_state == 'NOT_INSTALL') {
+					echo "<strong>$svc_state</strong>";
+				}
+				else {
+					if ($service_running) {
+						echo "		<a href='services.php?id=".escape($row[service_uuid])."&a=stop' alt='stop'>".$text['label-stop']."</a>";
+					}
+					else {
+						echo "		<a href='services.php?id=".escape($row[service_uuid])."&a=start' alt='start'>".$text['label-start']."</a>";
+					}
+				}
+			}
+			else{
+				echo "<strong>UNSUPPORT</strong>";
+				echo "</td>\n";
+				echo "	<td valign='top' class='".$row_style[$c]."'>\n";
+				echo "<strong>UNSUPPORT</strong>";
+			}
+		}
+		else {
+			if ($row[service_type] == "pid" || $row[service_type] == "pid_file") {
+				$pid = file_get_contents($row[service_data]);
+				$service_running = is_process_running($pid);
+			}
+			if ($row[service_type] == "file") {
+				$service_data = $row[service_data];
+				$service_running = file_exists($service_data);
+			}
+
+			if ($service_running) {
+				echo "<strong>".$text['label-running']."</strong>";
+			}
+			else {
+				echo "<strong>".$text['label-stopped']."</strong>";
+			}
+
+			echo "</td>\n";
+			echo "	<td valign='top' class='".$row_style[$c]."'>\n";
+			if ($service_running) {
+				echo "		<a href='services.php?id=".escape($row[service_uuid])."&a=stop' alt='stop'>".$text['label-stop']."</a>";
+			}
+			else {
+				echo "		<a href='services.php?id=".escape($row[service_uuid])."&a=start' alt='start'>".$text['label-start']."</a>";
+			}
+		}
+
+		echo "</td>\n";
+		echo "	<td valign='top' class='row_stylebg'>".escape($row[service_description])."&nbsp;</td>\n";
+		echo "	<td class='list_control_icons'>";
+		if (permission_exists('service_edit')) {
+			echo "<a href='service_edit.php?id=".escape($row[service_uuid])."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
+		}
+		if (permission_exists('service_delete')) {
+			echo "<a href='service_delete.php?id=".escape($row[service_uuid])."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
+		}
+		echo "	</td>\n";
+		echo "</tr>\n";
+		if ($c==0) { $c=1; } else { $c=0; }
+	} //end foreach
+	unset($sql, $services);
+} //end if results
+
+echo "<tr>\n";
+echo "<td colspan='5' align='left'>\n";
+echo "	<table width='100%' cellpadding='0' cellspacing='0'>\n";
+echo "	<tr>\n";
+echo "		<td width='33.3%' nowrap>&nbsp;</td>\n";
+echo "		<td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
+echo "		<td class='list_control_icons'>";
+if (permission_exists('service_add')) {
+	echo 		"<a href='service_edit.php' alt='add'>$v_link_label_add</a>";
+}
+echo "		</td>\n";
+echo "	</tr>\n";
+echo "	</table>\n";
+echo "</td>\n";
+echo "</tr>\n";
+
+echo "</table>";
+echo "<br><br>";
+
+//include the footer
+require_once "resources/footer.php";
+
+?>