Changeset 482 for trunk


Ignore:
Timestamp:
Feb 7, 2013, 9:45:02 PM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Pozice zařízení se nyní zadává jako výběr položky ze samostatné tabulky pojmenovaných pozic. To by mělo zjednodušit zadávání pozice nových zařízení a sloučit do jedné značky více zařízení ve ze stejné pozice.
  • Přidáno: Základní datová struktura pro evidenci zaměstnanců.
Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Map/Map.php

    r474 r482  
    6161    while($Link = $DbResult->fetch_assoc())
    6262    {
    63       $DbResult2 = $this->Database->query('SELECT * FROM NetworkDevice WHERE NetworkDevice.Id = (SELECT Device FROM NetworkInterface WHERE NetworkInterface.Id = '.$Link['Interface1'].')');
    64       $DbResult3 = $this->Database->query('SELECT * FROM NetworkDevice WHERE NetworkDevice.Id = (SELECT Device FROM NetworkInterface WHERE NetworkInterface.Id = '.$Link['Interface2'].')');
     63      $DbResult2 = $this->Database->query('SELECT NetworkDevice.Used, MapPosition.Latitude, MapPosition.Longitude FROM NetworkDevice JOIN MapPosition ON MapPosition.Id = NetworkDevice.MapPosition WHERE NetworkDevice.Id = (SELECT NetworkInterface.Device FROM NetworkInterface WHERE NetworkInterface.Id = '.$Link['Interface1'].')');
     64      $DbResult3 = $this->Database->query('SELECT NetworkDevice.Used, MapPosition.Latitude, MapPosition.Longitude FROM NetworkDevice JOIN MapPosition ON MapPosition.Id = NetworkDevice.MapPosition WHERE NetworkDevice.Id = (SELECT NetworkInterface.Device FROM NetworkInterface WHERE NetworkInterface.Id = '.$Link['Interface2'].')');
    6565      if(($DbResult2->num_rows > 0) and ($DbResult3->num_rows > 0))
    6666      {
     
    6868        $Device2 = $DbResult3->fetch_assoc();
    6969        if(($Device1['Used'] == 1) and ($Device2['Used'] == 1))
    70           $Output .= 'new GPolyline([new GLatLng('.$Device1['PositionLatitude'].', '.$Device1['PositionLongitude'].'),new GLatLng('.$Device2['PositionLatitude'].', '.$Device2['PositionLongitude'].')], "#4F4FBF", 3, 0.8), ';
     70          $Output .= 'new GPolyline([new GLatLng('.$Device1['Latitude'].', '.$Device1['Longitude'].'),new GLatLng('.$Device2['Latitude'].', '.$Device2['Longitude'].')], "#4F4FBF", 3, 0.8), ';
    7171      }
    7272    }
     
    9999                    NetworkDevices = [';
    100100
    101     $DbResult = $this->Database->query('SELECT * FROM NetworkDevice WHERE Used=1');
     101    $DbResult = $this->Database->query('SELECT GROUP_CONCAT(NetworkDevice.Name SEPARATOR ",") AS Name, '.
     102      'MapPosition.Latitude AS Latitude, MapPosition.Longitude AS Longitude, MapPosition.Name AS NodeName '.
     103      'FROM NetworkDevice LEFT JOIN MapPosition ON MapPosition.Id = NetworkDevice.MapPosition '.
     104      'WHERE (NetworkDevice.Used=1) AND (NetworkDevice.MapPosition IS NOT NULL) '.
     105      'GROUP BY NetworkDevice.MapPosition');
    102106    while($Device = $DbResult->fetch_assoc())
    103107    {
    104       $Output .= 'new GMarker(new GLatLng('.$Device['PositionLatitude'].', '.$Device['PositionLongitude'].'), {title: "'.$Device['Name'].'", icon:tinyIcon }), ';
     108      $Output .= 'new GMarker(new GLatLng('.$Device['Latitude'].', '.
     109      $Device['Longitude'].'), {title: "'.$Device['NodeName'].': '.$Device['Name'].'", icon:tinyIcon }), ';
    105110    }
    106111    $Output .= '];
  • trunk/finance/manage.php

    r480 r482  
    301301      'FROM MemberPayment JOIN Member ON Member.Id=MemberPayment.Member JOIN Subject '.
    302302      'ON Subject.Id=Member.Subject LEFT JOIN FinanceBillingPeriod ON '.
    303       'FinanceBillingPeriod.Id=Member.BillingPeriodNext';
     303      'FinanceBillingPeriod.Id=Member.BillingPeriodNext WHERE (Member.Blocked = 0)'.
     304      'AND (Member.BillingPeriodNext > 1)';
    304305   
    305306    $DbResult = $this->Database->query('SELECT COUNT(*) FROM ('.$SQL.') AS T');
     
    483484      // Restart traffic shaping
    484485      //$this->Database->update('NetworkConfiguration', 'Id = 3', array('Changed' => 1));     
     486      //flush();
     487      //$this->GenerateBills();
    485488    }
    486489    return($Output);
  • trunk/form_classes.php

    r480 r482  
    396396      'PermanentOnline' => array('Type' => 'Boolean', 'Caption' => 'Běží stále', 'Default' => '0'),
    397397      'Interfaces' => array('Type' => 'TInterfaceList', 'Caption' => 'Rozhraní', 'Default' => ''),
     398      'MapPosition' => array('Type' => 'TMapPosition', 'Caption' => 'Pozice na mapě', 'Default' => '0'),
    398399    ),
    399400  ),
     
    453454    ),
    454455  ),
     456  'MapPosition' => array(
     457    'Title' => 'Pozice na mapě',
     458    'Table' => 'MapPosition',
     459    'Items' => array(
     460      'Name' => array('Type' => 'String', 'Caption' => 'Jméno', 'Default' => ''),
     461      'Latitude' => array('Type' => 'Float', 'Caption' => 'Zeměpisná šířka', 'Default' => '0'),
     462      'Longitude' => array('Type' => 'Float', 'Caption' => 'Zeměpisná výška', 'Default' => '0'),
     463    ),
     464  ),
    455465  'NewPayment' => array(
    456466    'Title' => 'Nová platba',
     
    705715    'Filter' => '1',
    706716  ),
     717  'TMapPosition' => array(
     718    'Type' => 'Reference',
     719    'Table' => 'MapPosition',
     720    'Id' => 'Id',
     721    'Name' => 'Name',
     722    'Filter' => '1',
     723  ),
    707724  'TUser' => array(
    708725    'Type' => 'Reference',
  • trunk/sql/updates/479.sql

    r479 r482  
    11ALTER TABLE SystemVersion CHANGE COLUMN Rev478 Rev479 bit;
    2 
    3 ALTER TABLE `ServiceCustomerRel` ADD `Period` INT NOT NULL
    42
    53CREATE TABLE IF NOT EXISTS `ServiceCustomerRel` (
     
    75  `Service` int(11) NOT NULL,
    86  `Customer` int(11) NOT NULL,
     7  `Period` INT NOT NULL ,
    98  PRIMARY KEY (`Id`),
    109  KEY `Service` (`Service`),
     
    1615  ADD CONSTRAINT `ServiceCustomerRel_ibfk_1` FOREIGN KEY (`Service`) REFERENCES `Service` (`Id`);
    1716
    18 DROP TABLE `ServiceInternet`;
    19 DROP TABLE `ServiceConsumption`;
    20 DROP TABLE `ServiceVPS`;
     17ALTER TABLE `ServiceCustomerRel` DROP FOREIGN KEY `ServiceCustomerRel_ibfk_1` ;
     18
    2119DROP TABLE `Service`;
    2220
Note: See TracChangeset for help on using the changeset viewer.