friseurteam init commit
This commit is contained in:
commit
30c3731b7b
13
api.php
Normal file
13
api.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
require_once 'system/autoload.inc.php'; //SYSTEM Classes
|
||||
\SYSTEM\system::register_errorhandler_dbwriter();
|
||||
\SYSTEM\system::register_errorhandler_jsonoutput();
|
||||
require_once 'friseurteam/autoload.inc.php'; //Project Classes
|
||||
|
||||
require_once 'config.php';
|
||||
\SYSTEM\system::start($friseurteam_config);
|
||||
\SYSTEM\system::include_ExceptionShortcut();
|
||||
\SYSTEM\system::include_ResultShortcut();
|
||||
|
||||
echo \SYSTEM\API\api::run('\SYSTEM\API\verify','api_friseurteam',array_merge($_POST,$_GET));
|
||||
new \SYSTEM\LOG\COUNTER("API was called sucessfully.");
|
||||
18
config.php
Normal file
18
config.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
$friseurteam_config = array( array(config_ids::SYS_CONFIG_ERRORREPORTING, E_ALL | E_STRICT),
|
||||
array(config_ids::SYS_CONFIG_PATH_BASEURL, 'http://mojotrollz.eu/web/friseurteam/'),
|
||||
array(config_ids::SYS_CONFIG_PATH_BASEPATH, '/home/web/webdir/webcraft/'),
|
||||
array(config_ids::SYS_CONFIG_DB_TYPE, SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE_MYS),
|
||||
array(config_ids::SYS_CONFIG_DB_HOST, '127.0.0.1'),
|
||||
array(config_ids::SYS_CONFIG_DB_PORT, ''),
|
||||
array(config_ids::SYS_CONFIG_DB_USER, 'mojotrolls_mysql'),
|
||||
array(config_ids::SYS_CONFIG_DB_PASSWORD, 'dajsabeaisvd345'),
|
||||
array(config_ids::SYS_CONFIG_DB_DBNAME, 'host_friseurteam'),
|
||||
array(config_ids::SYS_SAI_CONFIG_NAVIMG, '/web/system/sai/page/img/logo.png'),//not working, cuz paths are not set yet! \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/default_page/img/logo.png')),
|
||||
array(config_ids::SYS_SAI_CONFIG_BASEURL, 'http://mojotrollz.eu/web/friseurteam/sai.php?'),
|
||||
array(config_ids::SYS_SAI_CONFIG_TITLE, 'webcraft - Admin Area'),
|
||||
array(config_ids::SYS_SAI_CONFIG_COPYRIGHT, '<a href="http://mojotrollz.eu/web/friseurteam/" target="_blank">webcraft</a>, © WebCraft Media 2013'),
|
||||
array(config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL, 'system/'),
|
||||
array(config_ids::SYS_CONFIG_LANGS, array('deDE', 'enUS')),
|
||||
array(config_ids::SYS_CONFIG_DEFAULT_LANG, 'deDE'));
|
||||
//array(config_ids::WEBCRAFT_BILLING_TOKEN, 'DANUBEdhasda3afdsjadfa3'));
|
||||
2
friseurteam/api/autoload.inc.php
Normal file
2
friseurteam/api/autoload.inc.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
9
friseurteam/autoload.inc.php
Normal file
9
friseurteam/autoload.inc.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
require_once dirname(__FILE__).'/path/autoload.inc.php';
|
||||
require_once dirname(__FILE__).'/page/autoload.inc.php';
|
||||
require_once dirname(__FILE__).'/config/autoload.inc.php';
|
||||
require_once dirname(__FILE__).'/dbd/autoload.inc.php';
|
||||
require_once dirname(__FILE__).'/api/autoload.inc.php';
|
||||
require_once dirname(__FILE__).'/sai/autoload.inc.php';
|
||||
require_once dirname(__FILE__).'/sai/register_modules.php';
|
||||
require_once dirname(__FILE__).'/files/autoload.inc.php';
|
||||
2
friseurteam/config/autoload.inc.php
Normal file
2
friseurteam/config/autoload.inc.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
4
friseurteam/config/config_ids.php
Normal file
4
friseurteam/config/config_ids.php
Normal file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
class config_ids extends \SYSTEM\CONFIG\config_ids {
|
||||
const WEBCRAFT_BILLING_TOKEN = 1000;
|
||||
}
|
||||
3
friseurteam/dbd/autoload.inc.php
Normal file
3
friseurteam/dbd/autoload.inc.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/qq','DBD');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/tbl','DBD');
|
||||
7
friseurteam/dbd/sql/webcraft_api.sql
Normal file
7
friseurteam/dbd/sql/webcraft_api.sql
Normal file
@ -0,0 +1,7 @@
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (0, 0, 0, -1, NULL, 'call', NULL);
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1, 0, 0, 0, NULL, 'action', NULL);
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10, 0, 2, 1, 'customer', 'token', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (11, 0, 2, 1, 'billing', 'token', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (12, 0, 2, 1, 'bill', 'token', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (13, 0, 2, 1, 'bill', 'ID', 'UINT');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (14, 0, 2, 1, 'project', 'token', 'STRING');
|
||||
2
friseurteam/dbd/sql/webcraft_page.sql
Normal file
2
friseurteam/dbd/sql/webcraft_page.sql
Normal file
@ -0,0 +1,2 @@
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (0, 1, 0, -1, NULL, 'page', NULL);
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1, 1, 2, 0, 'details', 'projectid', 'UINT');
|
||||
6
friseurteam/dbd/tbl/locale_string.php
Normal file
6
friseurteam/dbd/tbl/locale_string.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class locale_string extends \SYSTEM\DBD\system_locale_string {
|
||||
const CATEGORY_FRISEURTEAM_TEXT = 1;
|
||||
}
|
||||
3
friseurteam/files/autoload.inc.php
Normal file
3
friseurteam/files/autoload.inc.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
require_once dirname(__FILE__).'/register_files.php';
|
||||
2
friseurteam/files/register_files.php
Normal file
2
friseurteam/files/register_files.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
\SYSTEM\FILES\files::registerFolder(dirname(__FILE__).'/how_to/','how_to');
|
||||
3
friseurteam/page/autoload.inc.php
Normal file
3
friseurteam/page/autoload.inc.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_page','');
|
||||
65
friseurteam/page/default_page/default_page.css
Normal file
65
friseurteam/page/default_page/default_page.css
Normal file
@ -0,0 +1,65 @@
|
||||
.halfCircleRight{
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 38%;
|
||||
bottom: 50%;
|
||||
height:50px;
|
||||
width:25px;
|
||||
border-radius: 90px 0 0 90px;
|
||||
background-color: #333333;
|
||||
display: table;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
#navigation-right-wrapper {
|
||||
box-shadow: 0px 0px 20px black;
|
||||
//background-color: rgb(244, 244, 244);
|
||||
background-color: gray;
|
||||
width: 38%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
z-index: 2;
|
||||
//display: none;
|
||||
opacity: 0.98;
|
||||
}
|
||||
|
||||
.halfCircleLeft{
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
left: 62%;
|
||||
bottom: 50%;
|
||||
height:50px;
|
||||
width:25px;
|
||||
border-radius: 0 90px 90px 0;
|
||||
background-color: #333333;
|
||||
display: table;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
#navigation-left-wrapper {
|
||||
box-shadow: 0px 0px 20px black;
|
||||
//background-color: rgb(244, 244, 244);
|
||||
background-color: gray;
|
||||
width: 62%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
z-index: 2;
|
||||
//display: none;
|
||||
opacity: 0.98;
|
||||
}
|
||||
|
||||
body{
|
||||
margin: 0;
|
||||
padding-top: 40px;
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
#map {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
bottom: 30px;
|
||||
top: 40px;
|
||||
}
|
||||
209
friseurteam/page/default_page/default_page.js
Normal file
209
friseurteam/page/default_page/default_page.js
Normal file
@ -0,0 +1,209 @@
|
||||
$(document).ready(function() {
|
||||
drawmap();
|
||||
drawmarker();
|
||||
$('#toggle-sidebar').click(function(){
|
||||
toggleSidebar();});
|
||||
$('#toggle-mainbar').click(function(){
|
||||
toggleMainbar();});
|
||||
loadPageDetails(3);
|
||||
|
||||
$('#webcraft_nav a').click(function(){
|
||||
loadPage($(this).attr('page'));});
|
||||
|
||||
$('#footer a').click(function(){
|
||||
loadPage($(this).attr('page'));});
|
||||
});
|
||||
|
||||
var popupStore = {};
|
||||
|
||||
var map;
|
||||
var osm;
|
||||
var cycle;
|
||||
var markers;
|
||||
|
||||
// Position und Zoomstufe der Karte
|
||||
var lon = 8.672434;
|
||||
var lat = 49.398752;
|
||||
var zoom = 7;
|
||||
|
||||
var map_div = 'map';
|
||||
var map_lang = 'de';
|
||||
|
||||
function drawmarker(){
|
||||
$.ajax({ type :'GET',
|
||||
url : 'http://www.webcraft-media.de/api.php?call=map&action=markers',
|
||||
success : function(data) {
|
||||
if(!data || !data['status']){
|
||||
alert('Fail');
|
||||
return;
|
||||
}
|
||||
data = data['result'];
|
||||
for (var i in data) {
|
||||
addMarker(markers, parseFloat(data[i]['lon']), parseFloat(data[i]['lat']), parseInt(data[i]['ID']));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function drawmap() {
|
||||
OpenLayers.Lang.setCode(map_lang);
|
||||
map = new OpenLayers.Map(map_div, {
|
||||
projection: new OpenLayers.Projection("EPSG:900913"),
|
||||
displayProjection: new OpenLayers.Projection("EPSG:4326"),
|
||||
controls: [
|
||||
new OpenLayers.Control.Navigation(),
|
||||
new OpenLayers.Control.LayerSwitcher(),
|
||||
new OpenLayers.Control.PanZoomBar(),
|
||||
],
|
||||
//maxExtent:
|
||||
// new OpenLayers.Bounds(-20037508.34,-20037508.34,
|
||||
// 20037508.34, 20037508.34),
|
||||
numZoomLevels: 18,
|
||||
maxResolution: 156543,
|
||||
units: 'meters'
|
||||
});
|
||||
|
||||
|
||||
osm = new OpenLayers.Layer.OSM.Mapnik("Mapnik");
|
||||
cycle = new OpenLayers.Layer.OSM.CycleMap("Cycle Map");
|
||||
|
||||
markers = new OpenLayers.Layer.Markers("Websites", { projection: new OpenLayers.Projection("EPSG:4326"),
|
||||
visibility: true, displayInLayerSwitcher: false, hover: true });
|
||||
|
||||
map.addLayers([ cycle, osm, markers]);
|
||||
jumpTo(lon, lat, zoom);
|
||||
}
|
||||
|
||||
function jumpTo(lon, lat, zoom) {
|
||||
var x = Lon2Merc(lon);
|
||||
var y = Lat2Merc(lat);
|
||||
map.setCenter(new OpenLayers.LonLat(x, y), zoom);
|
||||
return false;
|
||||
}
|
||||
function Lon2Merc(lon) {
|
||||
return 20037508.34 * lon / 180;
|
||||
}
|
||||
|
||||
function Lat2Merc(lat) {
|
||||
var PI = 3.14159265358979323846;
|
||||
lat = Math.log(Math.tan( (90 + lat) * PI / 360)) / (PI / 180);
|
||||
return 20037508.34 * lat / 180;
|
||||
}
|
||||
|
||||
function addMarker(layer, lon, lat, projectid) {
|
||||
|
||||
var ll = new OpenLayers.LonLat(Lon2Merc(lon), Lat2Merc(lat));
|
||||
var feature = new OpenLayers.Feature(layer, ll);
|
||||
feature.closeBox = true;
|
||||
//feature.popupClass = OpenLayers.Class(OpenLayers.Popup.FramedCloud, {minSize: new OpenLayers.Size(300, 180)} );
|
||||
//feature.data.popupContentHTML = popupContentHTML;
|
||||
//feature.data.overflow = "hidden";
|
||||
|
||||
var marker = new OpenLayers.Marker(ll);
|
||||
marker.feature = feature;
|
||||
|
||||
/*var markerClick = function(evt) {
|
||||
/*if (this.popup == null) {
|
||||
this.popup = this.createPopup(this.closeBox);
|
||||
map.addPopup(this.popup);
|
||||
this.popup.show();
|
||||
} else {
|
||||
this.popup.toggle();
|
||||
}
|
||||
console.log(popupStore);
|
||||
OpenLayers.Event.stop(evt);
|
||||
};*/
|
||||
|
||||
var markerHover = function(evt){
|
||||
loadPageDetails(projectid);
|
||||
showSidebar();
|
||||
}
|
||||
|
||||
//marker.events.register('featurehighlighted', null, markerHover);
|
||||
marker.events.register("mouseover", feature, markerHover);
|
||||
|
||||
layer.addMarker(marker);
|
||||
//map.addPopup(feature.createPopup(feature.closeBox));
|
||||
}
|
||||
|
||||
function getCycleTileURL(bounds) {
|
||||
var res = this.map.getResolution();
|
||||
var x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));
|
||||
var y = Math.round((this.maxExtent.top - bounds.top) / (res * this.tileSize.h));
|
||||
var z = this.map.getZoom();
|
||||
var limit = Math.pow(2, z);
|
||||
|
||||
if (y < 0 || y >= limit)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = ((x % limit) + limit) % limit;
|
||||
|
||||
return this.url + z + "/" + x + "/" + y + "." + this.type;
|
||||
}
|
||||
}
|
||||
|
||||
function showSidebar() {
|
||||
$('#toggle-sidebar i').removeClass('icon-chevron-left').addClass('icon-chevron-right');
|
||||
$('#navigation-right-wrapper').show(350);
|
||||
//$('#navigation-right-wrapper').animate({right: '200px'}, 'slow');
|
||||
$('#toggle-sidebar').animate({right: '38%'}, 'slow');
|
||||
}
|
||||
|
||||
/*
|
||||
* Hides the left navigation bar with a slide effect
|
||||
*/
|
||||
function hideSidebar() {
|
||||
$('#toggle-sidebar i').removeClass('icon-chevron-right').addClass('icon-chevron-left');
|
||||
$('#navigation-right-wrapper').hide(350);
|
||||
//$('#navigation-right-wrapper').animate({right: '-200px'}, 'slow');
|
||||
$('#toggle-sidebar').animate({right: '0px'}, 'slow');
|
||||
}
|
||||
|
||||
function toggleSidebar() {
|
||||
if($('#navigation-right-wrapper').is(':visible')){
|
||||
hideSidebar();
|
||||
} else {
|
||||
showSidebar();}
|
||||
}
|
||||
|
||||
function loadPageDetails(projectid){
|
||||
$('#navigation-right-wrapper').load('./?page=details&projectid='+projectid);
|
||||
}
|
||||
|
||||
function loadPage(page){
|
||||
$('#navigation-left-wrapper').load('./?page='+page,function(){
|
||||
switch(page){
|
||||
case 'start':
|
||||
showSidebar();
|
||||
showMainbar();
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showMainbar() {
|
||||
$('#toggle-mainbar i').removeClass('icon-chevron-right').addClass('icon-chevron-left');
|
||||
$('#navigation-left-wrapper').show(350);
|
||||
//$('#navigation-right-wrapper').animate({right: '200px'}, 'slow');
|
||||
$('#toggle-mainbar').animate({left: '62%'}, 'slow');
|
||||
}
|
||||
|
||||
/*
|
||||
* Hides the left navigation bar with a slide effect
|
||||
*/
|
||||
function hideMainbar() {
|
||||
$('#toggle-mainbar i').removeClass('icon-chevron-left').addClass('icon-chevron-right');
|
||||
$('#navigation-left-wrapper').hide(350);
|
||||
//$('#navigation-right-wrapper').animate({right: '-200px'}, 'slow');
|
||||
$('#toggle-mainbar').animate({left: '0px'}, 'slow');
|
||||
}
|
||||
|
||||
function toggleMainbar() {
|
||||
if($('#navigation-left-wrapper').is(':visible')){
|
||||
hideMainbar();
|
||||
} else {
|
||||
showMainbar();}
|
||||
}
|
||||
21
friseurteam/page/default_page/default_page.php
Normal file
21
friseurteam/page/default_page/default_page.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
class default_page extends SYSTEM\PAGE\Page {
|
||||
public static function js(){
|
||||
return '<script type="text/javascript" src="'.\SYSTEM\WEBPATH(new PLIB(),'jquery/jquery-1.9.1.min.js').'"></script>
|
||||
<script type="text/javascript" src="http://www.openlayers.org/api/OpenLayers.js"></script>
|
||||
<script type="text/javascript" src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js"></script>
|
||||
<script type="text/javascript" src="'.\SYSTEM\WEBPATH(new PPAGE(),'default_page/default_page.js').'"></script>';
|
||||
}
|
||||
public function html() {
|
||||
$vars = array();
|
||||
$vars['js'] = self::js();
|
||||
$vars['css'] = self::css();
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(\DBD\locale_string::CATEGORY_FRISEURTEAM_TEXT));
|
||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PPAGE(),'default_page/webcraft.tpl'), $vars);
|
||||
}
|
||||
|
||||
public static function css(){
|
||||
return '<link rel="stylesheet" href="'.\SYSTEM\WEBPATH(new PPAGE(),'default_page/default_page.css').'" type="text/css" />';
|
||||
}
|
||||
}
|
||||
47
friseurteam/page/default_page/webcraft.tpl
Normal file
47
friseurteam/page/default_page/webcraft.tpl
Normal file
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>WebCraft-Media</title>
|
||||
${js}
|
||||
${css}
|
||||
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
|
||||
<link href="css/special.css" rel="stylesheet" media="screen">
|
||||
</head>
|
||||
<body>
|
||||
<div class="navbar navbar-inverse navbar-fixed-top" id="webcraft_nav">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="brand" style="" href="#" page="start">WebCraft-Media</a>
|
||||
<!-- <a class="brand" href="#"><img src="http://mojotrollz.eu/web/system/sai/modules/saistart_sys_sai/img/logo_sai.png"></a>-->
|
||||
<div class="nav-collapse collapse">
|
||||
<ul class="nav">
|
||||
<li><a href="#" page="services">Dienstleistungen</a></li>
|
||||
<li><a href="#" page="company">Das Unternehmen</a></li>
|
||||
<li><a href="#" page="contact">Kontakt</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="navigation-left-wrapper" style="background: url(http://www.webcraft-media.de/api.php?call=files&cat=how_to&id=background.png) repeat-x;">${default_start}</div>
|
||||
<div class="halfCircleLeft" id="toggle-mainbar">
|
||||
<i class="icon-chevron-left icon-white" style="margin-right: 12px; margin-top: 60%; color: #d6d6d6"></i>
|
||||
</div>
|
||||
<div id="map"></div>
|
||||
<div id="navigation-right-wrapper"></div>
|
||||
<div class="halfCircleRight" id="toggle-sidebar">
|
||||
<i class="icon-chevron-right icon-white" style="margin-left: 8px; margin-top: 60%; color: #d6d6d6"></i>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<div class="navbar navbar-inverse navbar-fixed-bottom" style="height: 30px; text-align: right; padding-top: 7px; padding-right: 10px;">
|
||||
<a href="#" page="inprint">Impressum</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
6
friseurteam/page/page_friseurteam.php
Normal file
6
friseurteam/page/page_friseurteam.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
class page_friseurteam extends \SYSTEM\API\api_default {
|
||||
public static function default_page(){
|
||||
return new default_page();}
|
||||
}
|
||||
5
friseurteam/path/PAPI.php
Normal file
5
friseurteam/path/PAPI.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class PAPI extends \SYSTEM\PATH {
|
||||
public static function getPath(){
|
||||
return \SYSTEM\C_ROOT.'webcraft/api/'.\SYSTEM\C_SUBPATH;}
|
||||
}
|
||||
5
friseurteam/path/PLIB.php
Normal file
5
friseurteam/path/PLIB.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class PLIB extends \SYSTEM\PATH {
|
||||
public static function getPath(){
|
||||
return \SYSTEM\C_ROOT.'lib/'.\SYSTEM\C_SUBPATH;}
|
||||
}
|
||||
5
friseurteam/path/PPAGE.php
Normal file
5
friseurteam/path/PPAGE.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class PPAGE extends \SYSTEM\PATH {
|
||||
public static function getPath(){
|
||||
return \SYSTEM\C_ROOT.'webcraft/page/'.\SYSTEM\C_SUBPATH;}
|
||||
}
|
||||
2
friseurteam/path/autoload.inc.php
Normal file
2
friseurteam/path/autoload.inc.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
2
friseurteam/sai/autoload.inc.php
Normal file
2
friseurteam/sai/autoload.inc.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/saimod_webcraft_billing_satelite','');
|
||||
2
friseurteam/sai/register_modules.php
Normal file
2
friseurteam/sai/register_modules.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
\SYSTEM\SAI\sai::register('saimod_webcraft_billing_satelite');
|
||||
@ -0,0 +1,3 @@
|
||||
td.customer_details {
|
||||
font-weight: bold;
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
function init_saimod_webcraft_billing_satelite() {
|
||||
$('#billingtab a').click(function (e) {e.preventDefault(); $(this).tab('show');});
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
class saimod_webcraft_billing_satelite extends \SYSTEM\SAI\SaiModule {
|
||||
public static function sai_mod_saimod_webcraft_billing_satelite(){
|
||||
$token = \SYSTEM\CONFIG\config::get(config_ids::WEBCRAFT_BILLING_TOKEN);
|
||||
$billing = json_decode(file_get_contents('http://mojotrollz.eu/web/webcraft/api.php?call=billing&action=billing&token='.$token),true);
|
||||
$project = json_decode(file_get_contents('http://mojotrollz.eu/web/webcraft/api.php?call=billing&action=project&token='.$token),true);
|
||||
$customer = json_decode(file_get_contents('http://mojotrollz.eu/web/webcraft/api.php?call=billing&action=customer&token='.$token),true);
|
||||
|
||||
$vars = array('content_project' => '');
|
||||
if($project['status']){
|
||||
foreach($project['result'] as $row){
|
||||
$row['customer_company'] = $row['customer_company'] == "" ? $row['customer_company'] = "" : $row['customer_company'] .= " - ";
|
||||
$vars['content_project'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_webcraft_billing_satelite/saimod_webcraft_billing_satelite_content_project.tpl'), $row);}
|
||||
}
|
||||
|
||||
$vars['content_billing'] = '';
|
||||
if($billing['status']){
|
||||
foreach($billing['result'] as $row){
|
||||
$row['pdf_link'] = './sai.php?sai_mod=saimod_webcraft_billing_satelite&action=getpdf&billid='.$row['ID'];
|
||||
$row['state'] = $row['payed_date'] == "0000-00-00 00:00:00" ? "important" : "success";
|
||||
$vars['content_billing'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_webcraft_billing_satelite/saimod_webcraft_billing_satelite_content_billing.tpl'), $row);}
|
||||
}
|
||||
|
||||
if($customer['status']){
|
||||
$vars = array_merge($vars,$customer['result']);}
|
||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_webcraft_billing_satelite/saimod_webcraft_billing_satelite.tpl'), $vars);}
|
||||
|
||||
public static function sai_mod_saimod_webcraft_billing_satelite_action_getpdf($billid){
|
||||
$token = \SYSTEM\CONFIG\config::get(config_ids::WEBCRAFT_BILLING_TOKEN);
|
||||
header("Content-type: application/pdf");
|
||||
return file_get_contents('http://mojotrollz.eu/web/webcraft/api.php?call=billing&action=bill&token='.$token.'&ID='.$billid);}
|
||||
|
||||
public static function html_li_menu(){return '<li><a href="#" saimenu="saimod_webcraft_billing_satelite">Rechnungen</a></li><li class="divider"></li>';}
|
||||
public static function right_public(){return false;}
|
||||
public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
|
||||
public static function sai_mod_saimod_webcraft_billing_satelite_flag_js(){
|
||||
return \SYSTEM\LOG\JsonResult::toString(
|
||||
array( \SYSTEM\WEBPATH(new PSAI(),'saimod_webcraft_billing_satelite/saimod_webcraft_billing_satelite.js')));}
|
||||
public static function sai_mod_saimod_webcraft_billing_satelite_flag_css(){
|
||||
return \SYSTEM\LOG\JsonResult::toString(
|
||||
array( \SYSTEM\WEBPATH(new PSAI(),'saimod_webcraft_billing_satelite/saimod_webcraft_billing_satelite.css')));}
|
||||
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
<h4>Verwaltung</h4>
|
||||
<hr>
|
||||
<div class="tabbable">
|
||||
<ul class="nav nav-tabs" id="billingtab">
|
||||
<li class="active"><a href="#tab_billing">Rechnungen</a></li>
|
||||
<li><a href="#tab_project">Projekte</a></li>
|
||||
<li><a href="#tab_customer">Kundeninformation</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tab_billing">
|
||||
<table class="table table-hover table-condensed sai_table" style="overflow: auto;">
|
||||
<tr>
|
||||
<th>Rechnungsnummer</th>
|
||||
<th>Projekt</th>
|
||||
<th>Datum</th>
|
||||
<th>PDF</th>
|
||||
<th>Betrag</th>
|
||||
<th>Bezahlt am</th>
|
||||
</tr>
|
||||
${content_billing}
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab-pane" id="tab_project">
|
||||
<table class="table table-hover table-condensed sai_table" style="overflow: auto;">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Nutzer</th>
|
||||
<th>Firma</th>
|
||||
<th>seit</th>
|
||||
<th>URL</th>
|
||||
<th>Serverpfad</th>
|
||||
<th>token</th>
|
||||
</tr>
|
||||
${content_project}
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab-pane" id="tab_customer">
|
||||
<table class="table table-hover table-condensed sai_table" style="overflow: auto;">
|
||||
<tr>
|
||||
<td class="customer_details">Nutzer ID</td>
|
||||
<td>${ID}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="customer_details">Firma</td>
|
||||
<td>${company}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="customer_details">Vorname</td>
|
||||
<td>${name}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="customer_details">Nachname</td>
|
||||
<td>${name_last}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="customer_details">Addresse</td>
|
||||
<td>${address}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="customer_details">Beigetreten</td>
|
||||
<td>${join}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,8 @@
|
||||
<tr>
|
||||
<td>${ID}</td>
|
||||
<td>${project_name}</td>
|
||||
<td>${date}</td>
|
||||
<td><a href="${pdf_link}" target="_blank">PDF</a></td>
|
||||
<td>${balance} €</td>
|
||||
<td><span class="badge badge-${state}">${payed_date}</span></td>
|
||||
</tr>
|
||||
@ -0,0 +1,9 @@
|
||||
<tr>
|
||||
<td>${ID}</td>
|
||||
<td>${customer_company}${customer_name} ${customer_name_last}</td>
|
||||
<td>${name}</td>
|
||||
<td>${date}</td>
|
||||
<td><a href="${url}" target="_blank">${url}</a></td>
|
||||
<td>${path}</td>
|
||||
<td>${token}</td>
|
||||
</tr>
|
||||
@ -0,0 +1,2 @@
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5300, 42, 0, 0, 'saimod_webcraft_billing', 'action', NULL);
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5301, 42, 2, 3, 'getpdf', 'billid', 'UINT');
|
||||
13
index.php
Normal file
13
index.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
require_once 'system/autoload.inc.php'; //SYSTEM Classes
|
||||
\SYSTEM\system::register_errorhandler_dbwriter();
|
||||
\SYSTEM\system::register_errorhandler_jsonoutput();
|
||||
require_once 'friseurteam/autoload.inc.php'; //Project Classes
|
||||
|
||||
require_once 'config.php';
|
||||
\SYSTEM\system::start($friseurteam_config);
|
||||
\SYSTEM\system::include_ExceptionShortcut();
|
||||
\SYSTEM\system::include_ResultShortcut();
|
||||
|
||||
echo \SYSTEM\API\api::run('\SYSTEM\API\verify', 'page_friseurteam', array_merge($_POST,$_GET), 1, false, true)->html();
|
||||
new \SYSTEM\LOG\COUNTER("Page was called sucessfully.");
|
||||
13
sai.php
Normal file
13
sai.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
require_once 'system/autoload.inc.php'; //SYSTEM Classes
|
||||
SYSTEM\system::register_errorhandler_dbwriter(); //write errors to database (must be first errorhandler to register)
|
||||
SYSTEM\system::register_errorhandler_jsonoutput(); //print errors as json to caller
|
||||
require_once 'webcraft/autoload.inc.php'; //Project Classes
|
||||
|
||||
require_once 'config.php'; //Server config
|
||||
SYSTEM\system::start($friseurteam_config); //Start System time + config
|
||||
SYSTEM\system::include_ExceptionShortcut(); //allow ERROR() instead of \SYSTEM\LOG\ERROR()
|
||||
SYSTEM\system::include_ResultShortcut(); //allow JsonResult() instead of \SYSTEM\LOG\JsonResult()
|
||||
|
||||
$sai = new SYSTEM\SAI\saigui();
|
||||
echo $sai->html();
|
||||
1
system
Submodule
1
system
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 9c10bfc1be6c74930d6f572ed88ce53fbbf4af6a
|
||||
Reference in New Issue
Block a user