add all files

This commit is contained in:
Rucus
2026-02-17 09:29:34 -06:00
parent b8c8d67c67
commit 782d203799
21925 changed files with 2433086 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
FusionCharts ASP.NET Export Handler
=========================================
This folder contains exported images. Please make sure to set IUSR user read/write permission into this folder.

View File

@@ -0,0 +1 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FCExporter.aspx.cs" Inherits="FCExporter" validateRequest="false" %>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\vx.x\Config
-->
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<!-- <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
-->
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<!-- <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
-->
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings />
<connectionStrings />
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<customErrors allowNestedErrors="true" mode="Off" />
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<pages validateRequest="false">
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx" />
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpModules>
<httpRuntime executionTimeout="999999" maxRequestLength="2000000000" requestValidationMode="2.0" />
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5" />
<providerOption name="WarnAsError" value="false" />
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5" />
<providerOption name="OptionInfer" value="true" />
<providerOption name="WarnAsError" value="false" />
</compiler>
</compilers>
</system.codedom>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<remove name="ScriptModule" />
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated" />
<remove name="ScriptHandlerFactory" />
<remove name="ScriptHandlerFactoryAppServices" />
<remove name="ScriptResource" />
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -0,0 +1,74 @@
FusionCharts ASP.NET Export Handler
=====================================
What is FusionCharts .NET export handler?
-----------------------------------------
FusionCharts Suite XT uses JavaScript to generate charts in the browser, using SVG and VML (for older IE). If you need
to export the charts as images or PDF, you need a server-side helper library to convert the SVG to image/PDF. These
export handlers allow you to take the SVG from FusionCharts charts and convert to image/PDF.
How does the export handler work?
---------------------------------
- A chart is generated in the browser. When the export to image or PDF button is clicked, the chart generates the SVG string
to represent the current state and sends to the export handler. The export handler URL is configured via chart attributes.
- The export handler accepts the SVG string along with chart configuration like chart type, width, height etc., and uses
SharpVectors library to convert to image or PDF.
- The export handler either writes the image or PDF to disk, based on the configuration provided by chart, or streams it
back to the browser.
Requirements
------------
- .NET Framework 3.5 or higher
Installation
------------
- Unzip the 'asp-net-export-handler.zip' in your IIS wwwroot folder (e.g. C:\inetpub\wwwroot)
- Add an application in your server and set physical path to the above folder
- Set the URL of 'FCExporter.aspx' from the above web application into the chart's 'exportHandler' attribute
- Make sure 'IUSR' has proper read/write permission in the 'Exported_Images' folder
- FusionCharts' export request contains some XML data, which is restricted in .NET 4 or above. You may need to add the following configuration in your 'web.config' file:
<system.web>
<httpRuntime requestValidationMode="2.0"/>
</system.web>
Licensing
---------
FUSIONCHARTS:
Copyright (c) FusionCharts Technologies LLP
License Information at <http://www.fusioncharts.com/license>
SHARPVECTORS:
The SharpVectors software modified and redistributed herein is covered under the New BSD License (BSD),
and is subject to the following conditions from that license:
Copyright (c) 2010, SharpVectorGraphics
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of SharpVectorGraphics nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SharpVectors source code is available from https://sharpvectors.codeplex.com/

View File

@@ -0,0 +1 @@
<%@ Page Language="VB" AutoEventWireup="true" CodeFile="FCExporter.aspx.vb" Inherits="FCExporter" validateRequest="false" %>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<system.web>
<compilation debug="true" strict="false" explicit="true">
<assemblies>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx" />
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpModules>
<httpRuntime executionTimeout="999999" maxRequestLength="2000000000" requestValidationMode="2.0" />
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5" />
<providerOption name="WarnAsError" value="false" />
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5" />
<providerOption name="OptionInfer" value="true" />
<providerOption name="WarnAsError" value="false" />
</compiler>
</compilers>
</system.codedom>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<remove name="ScriptModule" />
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated" />
<remove name="ScriptHandlerFactory" />
<remove name="ScriptHandlerFactoryAppServices" />
<remove name="ScriptResource" />
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -0,0 +1,82 @@
FusionCharts ASP.NET Export Handler
==================================
What is FusionCharts .NET export handler?
-----------------------------------------
FusionCharts Suite XT uses JavaScript to generate charts in the browser, using SVG and VML (for older IE). If you need to export the charts as images or PDF, you need a server-side helper library to convert the SVG to image/PDF. These export handlers allow you to take the SVG from FusionCharts charts and convert to image/PDF.
How does the export handler work?
---------------------------------
- A chart is generated in the browser. When the export to image or PDF button is clicked, the chart generates the SVG string to represent the current state and sends to the export handler. The export handler URL is configured via chart attributes.
- The export handler accepts the SVG string along with chart configuration like chart type, width, height etc., and uses SharpVectors library to convert to image or PDF.
- The export handler either writes the image or PDF to disk, based on the configuration provided by chart, or streams it back to the browser.
Version
----
4.0.0
Requirements
-----------
* .NET Framework 3.5 or higher
Installation
--------------
* Unzip the **production/asp-net-export-handler.zip** in your IIS wwwroot folder (e.g. C:\inetpub\wwwroot)
* Add an application in your server and set physical path to the above folder
* Set the URL of **FCExporter.aspx** from the above web application into the chart's **exportHandler** attribute
* Make sure **IUSR** has proper read/write permission in the **Exported_Images** folder
* FusionCharts' export request contains some XML data, which is restricted in .NET 4 or above. You may need to add the following configuration in your 'web.config' file:
```
<system.web>
<httpRuntime requestValidationMode="2.0"/>
</system.web>
```
* JS error is thrown during svg export if any image, present in same domain, is used in chart. You may need to add the following configuration in your 'web.config' file:
```
<system.web>
<httpRuntime executionTimeout="999999" maxRequestLength="2000000000" requestValidationMode="2.0" />
</system.web>
```
License
-------
**FUSIONCHARTS:**
Copyright (c) FusionCharts Technologies LLP
License Information at [http://www.fusioncharts.com/license](http://www.fusioncharts.com/license)
**SHARPVECTORS:**
The SharpVectors software modified and redistributed herein is covered under the New BSD License (BSD),
and is subject to the following conditions from that license:
Copyright (c) 2010, SharpVectorGraphics
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of SharpVectorGraphics nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SharpVectors source code is available from [https://sharpvectors.codeplex.com/](https://sharpvectors.codeplex.com/)

View File

@@ -0,0 +1,110 @@
FusionCharts J2EE Export Handler
==================================
What is FusionCharts J2EE export handler?
FusionCharts Suite XT uses JavaScript to generate charts in the browser, using SVG and VML (for older IE). If you need
to export the charts as images or PDF, you need a server-side helper library to convert the SVG to image/PDF. These
export handlers allow you to take the SVG from FusionCharts charts and convert to image/PDF.
How does the export handler work?
- A chart is generated in the browser. When the export to image or PDF button is clicked, the chart generates the SVG
string to represent the current state and sends to the export handler. The export handler URL is configured via chart
attributes.
- The export handler accepts the SVG string along with chart configuration like chart type, width, height etc., and uses
InkScape & ImageMagick library to convert to image or PDF.
- The export handler either writes the image or PDF to disk, based on the configuration provided by chart, or streams it
back to the browser.
Version
=======
3.0
Requirements
============
Inkscape:
Inkscape is an open source vector graphics editor. What sets Inkscape apart is its use of Scalable Vector Graphics
(SVG), an open XML-based W3C standard, as the native format. Inkscape has a powerful command line interface and can
be used in scripts for a variety of tasks, such as exporting and format conversions. For details, refer to the
following page.
http://inkscape.org/doc/inkscape-man.html
ImageMagick:
ImageMagick is a free and open-source software suite for displaying, converting, and editing raster image and vector
image files. The software mainly consists of a number of command-line interface utilities for manipulating images.
For further details, please refer to the the following page.
http://www.imagemagick.org/
Installation
============
* You should have a Windows/Linux based server with Administrative facility to install softwares. This is particularly
important, if you are using a shared hosting service.
* Both Inkscape and ImageMagick need to be installed in order to make the whole system work. Please visit to
the respective sites and follow the instructions on installation.
* Edit web.xml and add the following servlet mapping in your application's web.xml :
<servlet>
<display-name>FCExporter</display-name>
<servlet-name>FCExporter</servlet-name>
<servlet-class>com.fusioncharts.exporter.servlet.FCExporter</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>FCExporter</servlet-name>
<url-pattern>/JSP/ExportExample/FCExporter</url-pattern>
</servlet-mapping>
* Modify the URL-pattern as per your application needs.
* Specify the xml attribute exportHandler='FCExporter' assuming that the jsp rendering the chart is present in /JSP/ExportExample folder
* Configuration of the folder where the generated image is to be saved in server is to be set in fusioncharts_export.properties file inside the Classes directory.
* Configuration of Inkscape and ImageMagick path(Only for Windows Environment) : Open fusioncharts_export.properties file present in the Classes directory and make changes in the following values there:
********************************fusioncharts_export.properties*************************************
#Please specify the path to a folder with write permissions relative to web application root
#The exported image/PDF files would be saved here(for Linux based server SAVEPATH should be changed to relative or absolute path accordingly)
SAVEPATH=/JSP/ExportExample/ExportedImages/
#This constant HTTP_URI stores the HTTP reference to
#the folder where exported charts will be saved.
#Please enter the HTTP representation of that folder
#in this constant e.g., http://www.yourdomain.com/images/
HTTP_URI=http://localhost:8081/ExportHandler/JSP/ExportExample/ExportedImages/
#OVERWRITEFILE sets whether the export handler would overwrite an existing file
#the newly created exported file. If it is set to false the export handler would
#not overwrite. In this case if INTELLIGENTFILENAMING is set to true the handler
#would add a suffix to the new file name. The suffix is a randomly generated UUID.
#Additionally, you can add a timestamp or random number as additional prefix.
FILESUFFIXFORMAT=TIMESTAMP
OVERWRITEFILE=false
INTELLIGENTFILENAMING=true
#Set the path of Inkscape here(Only for Windows)
INKSCAPE_PATH=C:\\Program Files (x86)\\Inkscape
#Set the path of ImageMagick here(Only for Windows)
IMAGEMAGICK_PATH=C:\\Program Files\\ImageMagick-6.9.0-Q16
*********************************************************************************************
License
-------
FUSIONCHARTS:
Copyright (c) FusionCharts Technologies LLP
License Information at http://www.fusioncharts.com/license
Known Issues / limitations:
---------------------------
* When we export to an SVG file. The file renders correctly in browsers, but may not render properly in other image
softwares.
* If the chart has any external images as in logo, background or in anchors they will not get exported in the exported
image.
* The whole system is configured for Windows/Linux based server.

View File

@@ -0,0 +1,746 @@
<?php
/**
*
* FusionCharts Exporter is a PHP script that handles
* FusionCharts (since v3.1) Server Side Export feature.
* This in conjuncture with other resource PHP scripts would
* process FusionCharts Export Data POSTED to it from FusionCharts
* and convert the data to image or PDF and subsequently save to the
* server or response back as http response to client side as download.
*
* Starting FusionCharts XT (v3.3) it is capable of exporting JavaScript charts.
*
* This script is named as "FusionCharts Export Handler - main module"
*
* @author FusionCharts
* @description FusionCharts Exporter (Server-Side - PHP)
* @version 3.3 [ 31 December 2012 ]
*
*/
/**
* Copyright (c) 2016 Infosoft Global Private Limited
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* ChangeLog / Version History:
* ----------------------------
*
* 3.3 [ 31 December 2012 ]
* - Support Export of JavaScript chart (SVG) to allowed export formats
* via batik-rasterizer Java library
*
*
* 3.2 [ 4 September 2010 ]
* - background color was turning black in a few linux distro - fixed .
* The original code is kept commneted. (FCExporter_IMG.php - line: 277)
*
* 2.0 [ 12 February 2009 ]
* - Integrated with new Export feature of FusionCharts 3.1
* - can save to server side directory
* - can provide download or open in popup window
* - can report back to chart
* - can save as PDF/JPG/PNG/GIF
*
* 1.0 [ 16 August 2007 ]
* - can process chart data to jpg image and response back to client side as download.
*
*/
/**
* Copyright (c) 2016 InfoSoft Global Private Limited. All Rights Reserved.
*
*/
/**
* GENERAL NOTES
* -------------
*
* Chart would POST export data (which consists of encoded image data stream,
* width, height, background color and various other export parameters like
* exportFormat, exportFileName, exportAction, exportTargetWindow) to this script.
*
* The script would process this data using appropriate resource files and build
* export binary (PDF/image)
*
* It either saves the binary as file to a server side directory or push it as
* Download to client side.
*
*
*
*/
/**
* @requires FCExporter_REL2IMG.php: Export Flash charts to PNG/JPG
* FCExporter_REL2IMG.php: Export Flash charts to PDF
* FCExporter_REL2IMG.php: Export JavaScript charts to all formats
*
* Java 1.3+ & Apache Batik rasterizer class: Export JavaScript charts
* (http://xmlgraphics.apache.org/batik/)
*
*
* Details
* -------
* Only one export resource would be included at one time.
*
* The resource files would have these things as common:
*
* a) a constant - MIMETYPES that would have a string
* containing semicolon separated key value pairs.
* Each key can be a format name specified in the
* HANDLER_ASSOCIATIONS constant. The associated value
* would be the mimetype for the specified format.
*
* e.g. define("MIMETYPES","jpg=image/jpeg;jpeg=image/jpeg;png=image/png;gif=image/gif");
*
*
* b) a constant - EXTENSIONS that again contain a string of
* semicolon separated key value pair. Each key would again be the
* format name and the extension would be the file extension.
*
* e.g. define("EXTENSIONS","jpg=jpg;jpeg=jpg;png=png;gif=gif");
*
*
* c) a function - exportProcessor ( $stream , $meta )
* It would take the FusionCharts exncoded image string as $stream &
* an associative array $meta containging width, height and bgColor keys.
*
* The function would return an object of mixed type which would contain
* the processed binary/relevant export object.
*
*
* d) a function - exportOutput ( $exportObj, $exportSettings, $quality=1 )
* It would take the processed export object and other export setting as parameter.
* Moreover, it would take an optional parameter - $quality (in scale of 0 to 1).
* By Default, the $quality is passed as 1 (best quality)
*
* The function would return the file path on success or return false on failure.
*
* [ The other code in the resource file can be anything that support this architecture ]
*
*/
// =============================================================================
// == Constants and Variables ==
// =============================================================================
// USERS are to EDIT the values of the following constants.
/* ----------------------- EXPORT PATH & URI -------------------------------- */
/**
* IMPORTANT: You need to change the location of folder where
* the exported chart images/PDFs will be saved on your
* server. Please specify the path to a folder with
* write permissions in the constant SAVE_PATH below.
*
* Please provide the path as per PHP path conventions. You can use relative or
* absolute path.
* Examples: './' , '/users/me/images/' , './myimages'
*
* For Windows servers you can ALSO use \\ as path separator too. e.g. c:\\php\\mysite\\
*/
define("SAVE_PATH", "ExportedImages/");
/**
* IMPORTANT: This constant HTTP_URI stores the HTTP reference to
* the folder where exported charts will be saved.
* Please enter the HTTP representation of that folder
* in this constant e.g., http://www.yourdomain.com/images/
*/
define("HTTP_URI", "ExportedImages/");
// ==============================================================================
// Users are recommended NOT to perform any editing beyond this point. ==
// ==============================================================================
/* ------------------------- EXPORT RESOURCES -------------------------------- */
// This constant defines the name of the export handler script file
// The name is appended with a suffix (from constant HANDLER_ASSOCIATIONS)
define("EXPORT_HANDLER", "FCExporter_");
// This constant lists all the currently supported export formats
// and related export handler file suffix.
// e.g. for JPEG the suffix is
define("HANDLER_ASSOCIATIONS", "RLE:PDF=PDF;JPEG=IMG;JPG=IMG;PNG=IMG;GIF=IMG|SVG:SVG=ALL;PDF=ALL;JPEG=ALL;JPG=ALL;PNG=ALL;GIF=ALL");
// default mime types
define( "MIME_TO_FORMAT", "image/jpg=jpg;image/jpeg=jpg;image/gif=gif;image/png=png;application/pdf=pdf;image/svg+xml=svg" );
// Path where the export handler files are located
// Please note that the resource path should be relative to
// FCExporter.php file's directory
// By default the path is "./Resources/"
define("RESOURCE_PATH", "Resources/");
/* ---------------------------- Export Settings ------------------------------- */
/**
* OVERWRITEFILE sets whether the export handler would overwrite an existing file
* the newly created exported file. If it is set to false the export handler would
* not overwrite. In this case if INTELLIGENTFILENAMING is set to true the handler
* would add a suffix to the new file name. The suffix is a randomly generated UUID.
* Additionally, you add a timestamp or random number as additional suffix.
*
*/
define("OVERWRITEFILE", false);
define("INTELLIGENTFILENAMING", true);
define("FILESUFFIXFORMAT", "TIMESTAMP"); // value can be either 'TIMESTAMP' or 'RANDOM'
// List the default exportParameter values taken if not provided by chart
$defaultParameterValues = array(
"exportfilename" => "FusionCharts",
"exportaction" => "download",
"exporttargetwindow" => "_self",
"exportformat" => "PNG"
);
// Stores server notices if any as string [ to be send back to chart after save ]
$notices = "";
// =============================================================================
// == processing ==
// =============================================================================
/**
* Retrieve export data from POST Request sent by chart
* Parse the Request stream into export data readable by this script
*
* Store export data into an array containing keys 'stream' (contains encoded
* image data) ; 'meta' ( contains an array with 'width', 'height' and 'bgColor' keys) ;
* and 'parameters' ( array of all export parameters from chart as keys, like - exportFormat,
* exportFileName, exportAction etc.)
*/
$exportRequestStream = $_POST;
$exportData = parseExportRequestStream($exportRequestStream);
/**
* Get the name of the export resource (php file) as per export format
* Dynamically include the resource. The resource would process the data
* and perform all export related tasks
*/
$exporterResource = getExporter($exportData ['parameters'] ["exportformat"], $exportData ["streamtype"]);
// if resource is not found terminate with error report
if (!@include( $exporterResource )) {
raise_error(404, true);
}
/*
* Pass export stream and meta values to the export processor &
* get back the export binary
*/
$exportObject = exportProcessor($exportData ['stream'], $exportData ['meta'], $exportData ['parameters']);
/*
* Send the export binary to output module which would either save to a server directory
* or send the export file to download. Download terminates the process while
* after save the output module sends back export status
*/
$exportedStatus = outputExportObject($exportObject, $exportData ['parameters']);
/*
* Build Appropriate Export Status and send back to chart by flushing the
* procesed status to http response. This returns status back to chart.
* [ This is not applicable when Download action took place ]
*/
flushStatus($exportedStatus, $exportData ['meta']);
// =============================================================================
// == terminate process ==
// =============================================================================
#################################################################################
## ##
## FUNCTION DECLARATION ##
## ##
#################################################################################
#### ------------------------ INPUT STREAM -------------------------------- ####
/**
* Parses POST stream from chart and builds an array containing
* export data and parameters in a format readable by other functions.
*
* @param $exportRequestStream All POST data (array) from chart
* @return An array of processed export data and parameters
*/
function parseExportRequestStream($exportRequestStream) {
// Check for SVG
$exportData ['streamtype'] = strtoupper(@$exportRequestStream ['stream_type']);
// backward compatible SVG stream type detection
if (!$exportData ['streamtype']) {
if (@$exportRequestStream ['svg']) {
$exportData ['streamtype'] = "SVG";
}
else {
$exportData ['streamtype'] = "RLE";
}
}
// get string of compressed/encoded image data
// halt with error message if stream is not found
$exportData ['stream'] = (string)@$exportRequestStream ['stream']
or $exportData ['stream'] = (string)@$exportRequestStream ['svg'] // backward compatible
or raise_error(100, true);
// get all export related parameters and parse to validate and process these
// add notice if 'parameters' is not retrieved. In that case default values would be taken
if (!@$exportRequestStream['parameters'])
raise_error(102);
// parse parameters
$exportData ['parameters'] = parseExportParams(@$exportRequestStream ['parameters'], @$exportRequestStream);
$exportData ['parameters'] ["exportformat"] = strtoupper(@$exportData ['parameters'] ["exportformat"]);
// get width and height of the chart
// halt with error message if width/height is/are not retrieved
$exportData ['meta']['width'] = (int) @$exportRequestStream ['meta_width']
or $exportData ['meta']['width'] = (int) @$exportRequestStream ['width'] // backward compatible
or raise_error(101);
$exportData ['meta']['height'] = (int) @$exportRequestStream ['meta_height']
or raise_error(101);
// get background color of chart
// add notice if background color is not retrieved
$exportData ['meta']['bgColor'] = @$exportRequestStream ['meta_bgColor'];
// chart DOMId
$exportData ['meta']['DOMId'] = @$exportRequestStream ['meta_DOMId'];
// return collected and processed data
return $exportData;
}
/**
* Parse export 'parameters' string into an associative array with key => value elements.
* Also sync default values from $defaultparameterValues array (global)
* @param $strParams A string with parameters (key=value pairs) separated by | (pipe)
* @return An associative array of key => value pairs
*/
function parseExportParams($strParams, $exportRequestStream = array()) {
// get global definition of default parameter values
global $defaultParameterValues;
// split string into associative array of [export parameter name => value ]
$params = bang($strParams, array("|", "="));
$exportFilename = @$params['exportfilename'];
$exportFormat = @$params['exportformat'];
// backward compatible setting to get filename
if (!$exportFilename) {
$exportFilename = (string)@$exportRequestStream["filename"];
if ($exportFilename) {
$params['exportfilename'] = $exportFilename;
}
}
// backward compatible setting to get exportFormat through mimetype
if (!$exportFormat) {
$mimeType = strtolower((string)@$exportRequestStream["type"]);
$mimeList = bang( @MIME_TO_FORMAT );
$exportFormat = $mimeList[$mimeType];
if ($exportFormat) {
$params['exportformat'] = $exportFormat;
}
else {
$params['exportformat'] = 'png';
}
}
if (is_array($defaultParameterValues)) {
// sync with default values
$params = $params + $defaultParameterValues;
}
// return parameters' array
return $params;
}
/**
* Builds and returns a path of the Export Resource PHP file needed to
* export the chart to the format specified as parameter.
* @param $strFormat (string) export format specified form chart
* @return A path (string) containing the Export Resource PHP file
* the for specified format
*/
function getExporter($strFormat, $streamtype = "RLE") {
// get array of [format => handler suffix ] from HANDLER_ASSOCIATIONS
$associationCluster = bang(HANDLER_ASSOCIATIONS, array('|', ':'), true);
$associations = bang(@$associationCluster[$streamtype], array(";", "="), true);
// validate and decide on proper suffix form the $associations array
// if not found take the format as suffix of the Export Resource
$exporterSuffix = (@$associations [$strFormat]);
if (!$exporterSuffix) {
$exporterSuffix = strtoupper($strFormat);
}
// build Export Resource PHP file path
// Add resource path (constant), Export handler (constant) and export suffix
$path = RESOURCE_PATH . EXPORT_HANDLER . strtoupper($streamtype) . "2{$exporterSuffix}.php";
return $path;
}
#### ------------------------ OUTPUT EXPORT FILE -------------------------------- ####
/**
* Checks whether the export action is download or save.
* If action is 'download', send export parameters to 'setupDownload' function.
* If action is not-'download', send export parameters to 'setupServer' function.
* In either case it gets exportSettings and passes the settings along with
* processed export binary (image/PDF) to the output handler function if the
* export settings return a 'ready' flag set to 'true' or 'download'. The export
* process would stop here if the action is 'download'. In the other case,
* it gets back success status from output handler function and returns it.
*
* @param $exportObj An export binary/object of mixed type (image/PDF)
* @param $exportParams An array of export parameters
* @return export success status ( filename if success, false if not)
*/
function outputExportObject($exportObj, $exportParams) {
// checks whether the export action is 'download'
$isDownload = strtolower($exportParams ["exportaction"]) == "download";
// dynamically call 'setupDownload' or 'setupServer' as per export action
// pass export paramters and get back export settings in an array
$exportActionSettings = call_user_func('setup' . ($isDownload ? 'Download' : 'Server'), $exportParams['exportfilename'], $exportParams['exportformat'], $exportParams['exporttargetwindow']
);
// check whether export setting gives a 'ready' flag to true/'download'
// and call output handler
// return status back (filename if success, false if not success )
return ( @$exportActionSettings ['ready'] ? exportOutput($exportObj, $exportActionSettings, 1) : false );
}
/**
* Flushes exported status message/or any status message to the chart or the output stream on error
* It parses the exported status through parser function parseExportedStatus,
* builds proper response string using buildResponse function and flushes the response
* string to the output stream and terminates the program.
* @param $status exported status ( false if failed/error, filename as string if success)
* $meta array containing meta descriptions of the chart like width, height
* $msg custom message to be added as statusMessage
*
*/
function flushStatus($status, $meta, $msg = '') {
die(buildResponse(parseExportedStatus($status, $meta, $msg)));
}
/**
* Parses the exported status and builds an array of export status information. As per
* status it builds a status array which contains statusCode (0/1), statusMesage, fileName,
* width, height, DOMId and notice in some cases.
* @param $status exported status ( false if failed/error, filename as stirng if success)
* $meta array containing meta descriptions of the chart like width, height and DOMId
* $msg custom message to be added as statusMessage
* @return array of status information
*/
function parseExportedStatus($status, $meta, $msg = '') {
// get global 'notice' variable
global $notices;
global $exportData;
// add notice
if ($notices)
$arrStatus [] = "notice=" . @$notices;
// Add DOMId
$arrStatus [] = "DOMId=" . @$meta["DOMId"];
// add file URI , width and height when status success
// provide 0 as width and height on failure
$arrStatus [] = "height=" . ( @$status ? @$meta ['height'] : 0 );
$arrStatus [] = "width=" . ( @$status ? @$meta ['width'] : 0 );
$arrStatus [] = "fileName=" . ( @$status ? ( preg_replace('/([^\/]$)/i', '${1}/', HTTP_URI) . @$status ) : "" );
// add status message . Priority 1 is a custom message if provided
$arrStatus [] = "statusMessage=" . ( trim(@$msg) ? @$msg :
( $status ? "success" : "failure" ));
// add statusCode to 1 on success
$arrStatus [] = "statusCode=" . ( @$status ? "1" : "0" );
// return status information
return $arrStatus;
}
/**
* Builds response from an array of status information. Each value of the array
* should be a string which is one [key=value ] pair. This array are either joined by
* a & to build a querystring (to pass to chart) or joined by a HTML <BR> to show neat
* and clean status informaton in Browser window if download fails at the processing stage.
*
* @param $arrMsg Array of string containing status data as [key=value ]
* @return A string to be written to output stream
*/
function buildResponse($arrMsg) {
// access global variable to get export action
global $exportData;
// check whether export action is download. If so the response output would be at browser
// i.e. the output format would be HTML
$isHTML = ( ( $exportData ['parameters']['exportaction'] ) != null ? (strtolower(
$exportData ['parameters']['exportaction']) == "download" ) : true );
// If the output format is not HTML then start building a quertstring hence start with a &
$msg = ( $isHTML ? "" : "&" );
// join all status data from array using & or <BE> as per export action
// Joining with & would convert the string into a querystring as each element already contains
// key=value.
$msg .= implode(( $isHTML ? "<BR>" : "&"), $arrMsg);
// return response
return $msg;
}
/**
* check server permissions and settings and return ready flag to exportSettings
* @param $exportFile Name of the new file to be created
* @param $exportType Export type
* @param $target target window where the download would happen [ Not required here ]
* @return An array containing exportSettings and ready flag
*/
function setupServer($exportFile, $exportType, $target = "_self") {
// get extension related to specified type
$ext = '.' . getExtension(strtolower($exportType));
// set export type
$retServerStatus ['type'] = $exportType;
// assume that server is ready
$retServerStatus['ready'] = true;
// process SAVE_PATH : the path where export file would be saved
// add a / at the end of path of / is absent at the end
$path = preg_replace('/([^\/]$)/i', '${1}/', SAVE_PATH);
// check whether directory exists
// raise error and halt execution if directory does not exists
$fe = file_exists(realpath($path)) or raise_error(" Server Directory does not exist.", true);
// check if directory is writable or not
$dirWritable = is_writable(realpath($path));
// build filepath
$retServerStatus ['filepath'] = realpath($path) . '/' . $exportFile . $ext;
// check whether file exists
if (!file_exists($retServerStatus ['filepath'])) {
// need to create a new file if does not exists
// need to check whether the directory is writable to create a new file
if ($dirWritable) {
// if directory is writable return with ready flag
return $retServerStatus;
} else {
// if not writable halt and raise error
raise_error(403, true);
}
}
// add notice that file exists
raise_error(" File already exists.");
//if overwrite is on return with ready flag
if (OVERWRITEFILE) {
// add notice while trying to overwrite
raise_error(" Export handler's Overwrite setting is on. Trying to overwrite.");
// see whether the existing file is writable
// if not halt raising error message
$iw = is_writable($retServerStatus ['filepath']) or
raise_error(" Overwrite forbidden. File cannot be overwritten.", true);
// if writable return with ready flag
return $retServerStatus;
}
// raise error and halt execution when overwrite is off and intelligent naming is off
if (!INTELLIGENTFILENAMING)
raise_error(" Export handler's Overwrite setting is off. Cannot overwrite.", true);
raise_error(" Using intelligent naming of file by adding an unique suffix to the exising name.");
// Intelligent naming
// generate new filename with additional suffix
$retServerStatus ['filepath'] = realpath($path) . '/' . $exportFile . "_" . generateIntelligentFileId() . $ext;
// return intelligent file name with ready flag
// need to check whether the directory is writable to create a new file
if ($dirWritable) {
// if directory is writable return with ready flag
// add new filename notice
raise_error(" The filename has changed to " . basename($retServerStatus ['filepath']) . '.');
return $retServerStatus;
} else {
// if not writable halt and raise error
raise_error(403, true);
}
// in any unknown case the export should not execute
$retServerStatus ['ready'] = false;
raise_error(" Not exported due to unknown reasons.");
return $retServerStatus;
}
/**
* setup download headers and return ready flag to exportSettings
* @param $exportFile Name of the new file to be created
* @param $exportType Export type
* @param $target target window where the download would happen (_self/_blank/_parent/_top/window name)
* @return An array containing exportSettings and ready flag
*/
function setupDownload($exportFile, $exportType, $target = "_self") {
$exportType = strtolower($exportType);
// get mime type list parsing MIMETYPES constant declared in Export Resource PHP file
$mimeList = bang(@MIMETYPES);
// get the associated extension for the export type
$ext = getExtension($exportType);
// set content-type header
header('Content-type:' . $mimeList [$exportType]);
// set content-disposition header
// when target is _self the type is 'attachment'
// when target is other than self type is 'inline'
// NOTE : you can comment this line in order to replace present window (_self) content with the image/PDF
header('Content-Disposition: ' . ( strtolower($target == "_self") ? "attachment" : "inline" ) . '; filename="' . $exportFile . '.' . $ext . '"');
// return exportSetting array. Ready should be set to download
return array('ready' => 'download', "type" => $exportType);
}
/**
* gets file extension checking the export type.
* @param $exportType (string) export format
* @return file extension as string
*/
function getExtension($exportType) {
// get an associative array of [type=> extension]
// from EXTENSIONS constant defined in Export Resource PHP file
$extensionList = bang(@EXTENSIONS);
$exportType = strtolower($exportType);
// if extension type is present in $extensionList return it, otherwise return the type
return ( @$extensionList [$exportType] ? $extensionList [$exportType] : $exportType );
}
/**
* generates a file suffix for a existing file name to apply intelligent
* file naming
* @return a string containing UUID and random number /timestamp
*/
function generateIntelligentFileId() {
//generate UUID
$UUID = md5(uniqid(rand(), true));
// chck for additional suffix : timestamp or random
// accrodingly add random number ot timestamp
$UUID .= '_' . ( strtolower(FILESUFFIXFORMAT) != "timestamp" ? rand() :
date('dmYHis') . '_' . round(microtime(true) - floor(microtime(true)), 2) * 100
);
return $UUID;
}
/**
* Helper function that splits a string containing delimiter separated key value pairs
* into associative array
* @param $str (string) delimiter separated key value pairs
* @param $delimiterList an Array whose first element is the delimiter and the
* second element can be anything which separates key from value
*
* @return An associative array with key => value
*/
function bang($str, $delimiterList = array(";", "="), $retainPropertyCase = false) {
if (!$delimiterList) {
$delimiterList = array(";", "=");
}
$retArray = array();
// split string as per first delimiter
$tmpArray = explode($delimiterList[0], $str);
// iterate through each element of split string
for ($i = 0; $i < count($tmpArray); $i++) {
// split each element as per second delimiter
$tmp2Array = explode($delimiterList[1], $tmpArray[$i], 2);
if ($tmp2Array[0] && $tmp2Array[1]) {
// if the secondary split creats at-least 2 array elements
// make the fisrt element as the key and the second as the value
// of the resulting array
$retArray[$retainPropertyCase ? $tmp2Array[0] : strtolower($tmp2Array[0])] = $tmp2Array[1];
}
}
return $retArray;
}
/**
* Error reporter function that has a list of error messages. It can terminate the execution
* and send successStatus=0 along with a error message. It can also append notice to a global variable
* and continue execution of the program.
* @param $code error code as Integer (referring to the index of the errMessages
* array containing list of error messages)
* OR, it can be a string containing the error message/notice
* @param $halt (boolean) Whether to halt execution
*/
function raise_error($code, $halt = false) {
// access global notice storage
global $notices;
//list of error messages
$errMessages [100] = " Insufficient data.";
$errMessages [101] = " Width/height not provided.";
$errMessages [102] = " Insufficient export parameters.";
$errMessages [400] = " Bad request.";
$errMessages [401] = " Unauthorized access.";
$errMessages [403] = " Directory write access forbidden.";
$errMessages [404] = " Export Resource not found.";
// take $code as error message if $code is string
// if $code is present as index of errorMessages array, take the value of the element
// take Error! only when all fails
$err_message = is_string($code) ? $code :
( @$errMessages [$code] ? $errMessages [$code] : "statusMessage=ERROR!" );
// If halt is true stop execution and send response back to chart/output stream
if ($halt) {
flushStatus(false, '', $err_message);
} else {
// otherwise add the message into global notice repository
$notices .= $err_message;
}
}
?>

View File

@@ -0,0 +1,327 @@
<?php
/**
*
* FusionCharts Exporter - 'Image Resource' handles
* FusionCharts (since v3.1) Server Side Export feature that
* helps FusionCharts exported as Image files in various formats.
*
*
* @author FusionCharts
* @description FusionCharts Exporter (Server-Side - PHP)
* @version 2.0 [ 12 February 2009 ]
*
*/
/**
* ChangeLog / Version History:
* ----------------------------
*
*
* 1.1 [ 18 July 2009 ]
* background color was turning black in a few linux distro - fixed . The original code is kept commneted. Line 277
*
*
*
* 1.0 [ 12 February 2009 ]
*
* FEATURES:
* - Integrated with new Export feature of FusionCharts 3.1 & FusionCharts Exporter v 2.0
* - can save to server side directory
* - can provide download or open in browser window/frame other than _self
* - can save in various image formats viz. jpeg, png and gif.
*
*
*/
/**
* Copyright (c) 2016 Infosoft Global Private Limited
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* GENERAL NOTES
* -------------
*
* Chart would POST export data (which consists of encoded image data stream,
* width, height, background color and various other export parameters like
* exportFormat, exportFileName, exportAction, exportTargetWindow) to this script.
*
* The script would process this data using appropriate resource files build
* export binary (PDF/image)
*
* It either saves the binary as file to a server side directory or push it as
* Download or open in a new browser window/frame.
*
*
*/
/**
* @requires FCExporter.php A file that includes this resource
*
*
* Details
* -------
*
* The resource files would have these things as common:
*
* a) a constant - MIMETYPES that would have a string
* containing semicolon separated key value pairs.
* Each key can be a format name specified in the
* HANDLERASSOCIATIONS constant. The associated value
* would be the mimetype for the specified format.
*
* e.g. define("MIMETYPES","jpg=image/jpeg;jpeg=image/jpeg;png=image/png;gif=image/gif");
*
*
* b) a constant - EXTENSIONS that again contain a string of
* semicolon separated key value pair. Each key would again be the
* format name and the extension would be the file extension.
*
* e.g. define("EXTENSIONS","jpg=jpg;jpeg=jpg;png=png;gif=gif");
*
*
* c) a function - exportProcessor ( $stream , $meta )
* It would take the FusionCharts exncoded image string as $stream &
* an associative array $meta containging width, height and bgColor keys.
*
* The function would return an object of mixed type which would contain
* the processed binary/relevant export object.
*
*
* d) a function - exportOutput ( $exportObj, $exportSettings, $quality=1 )
* It would take the processed export object and other export setting as parameter.
* Moreover, it would take an optional parameter - $quality (in scale of 0 to 1).
* By Default, the $quality is passed as 1 (best quality)
*
* The function would return the file path on success or return false on failure.
*
* [ The other code in the resource file can be anything that support this architecture ]
*
*/
// =============================================================================
// == Constants and Variables ==
// =============================================================================
// **** Users are recommended NOT to perform any editing beyond this point. ****
/* ------------------------- EXPORT RESOURCES -------------------------------- */
// This constant lists the mime types related to each export format this resource handles
// The value is semicolon separated key value pair for each format
// Each key is the format and value is the mime type
define( "MIMETYPES", "jpg=image/jpeg;jpeg=image/jpeg;gif=image/gif;png=image/png" );
// This constant lists all the file extensions for the export formats
// The value is semicolon separated key value pair for each format
// Each key is the format and value is the file extension
define( "EXTENSIONS", "jpg=jpg;jpeg=jpg;gif=gif;png=png" );
// =============================================================================
// == Public Functions ==
// =============================================================================
/**
* Gets Export data from FCExporter - main module and build the export binary/objct.
* @param $stream (string) export image data in FusionCharts compressed format
* $meta {array) Image meta data in keys "width", "heigth" and "bgColor"
* $exportParams {array} Export related parameters
* @return image object/binary
*/
function exportProcessor( $stream, $meta, $exportParams )
{
// create a new export object
// here it is an image generator class that handles jpg, png, gif export
// pass all reqiured parameters
$FCExporter = new FCIMGGenerator ( $stream, $meta['width'], $meta['height'], $meta['bgColor'] );
// return export ready image object
return $FCExporter->getImageObject();
}
/**
* exports (save/download) FusinoCharts exported image.
* @param $exportObj (mixed) binary/objct exported by exportProcessor
* @param $exportSettings (array) various server-side export settings stored in keys like
* "type", "ready" "filepath" etc. Required for 'save' expotAction.
* For 'download' action "filepath" is blank (this is checked to find
* whether the action is "download" or not.
* @param $quality (integer) quality factor 0-1 (1 being the best quality). As of now we always pass 1.
*
* @return false is fails. {filepath} if succeeds. Only returned when action is 'save'.
*/
function exportOutput ( $exportObj, $exportSettings , $quality = 1 )
{
// decides image encoding and saving php(GD) function as per export type
switch( strtolower( $exportSettings['type' ]) )
{
// in case of PNG check if 'imagepng' function exists.
// save the image as png
// store saving status in $doneExport which receives false if fails and true on success
case "png" :
if( function_exists ( "imagepng" ) ) {
$doneExport = imagepng ( $exportObj, @$exportSettings ['filepath' ], $quality*9 );
}
break;
// in case of GIF check if 'imagegif' function exists.
// save the image as gif
// store saving status in $doneExport which receives false if fails and true on success
case "gif" :
if( function_exists ( "imagegif" ) ) {
// This is done as a fix to some PHP versions running on IIS
if( trim(@$exportSettings ['filepath']) )
$doneExport = imagegif ( $exportObj, @$exportSettings ['filepath'] );
else
$doneExport = imagegif ( $exportObj );
}
break;
// in case of JPG/JPEG check if 'imagejpeg' function exists.
// save the image as jpg
// store saving status in $doneExport which receives false if fails and true on success
case "jpg" :
case "jpeg":
if( function_exists ( "imagejpeg" ) ) {
$doneExport = imagejpeg ( $exportObj, @$exportSettings ['filepath' ], $quality*100 );
}
break;
default :
raise_error( "Invalid Export Format." , true);
break;
}
// clear memory after saving
imagedestroy( $exportObj );
// check 'filepath'. If it is null - the action is 'download' and hence terminate execution
if ( !@$exportSettings [ 'filepath' ] ) exit();
// check $doneEport and if true sets status to {filepath}'s value
// set false if fails
$status =( @$doneExport ? basename ( @$exportSettings ['filepath'] ) : false );
// return status
return $status;
}
#################################################################################
## ##
## EXPORT CLASS ##
## ##
#################################################################################
class FCIMGGenerator
{
//Array - Stores multiple chart export data
var $arrExportData;
//stores number of pages = length of $arrExportData array
var $numPages=0;
//Constructor - By default the chart export data can be passed to this
function FCIMGGenerator($imageData_FCFormat="", $width="", $height="", $bgcolor="ffffff"){
if($imageData_FCFormat && $width && $height){
$this->setBitmapData($imageData_FCFormat, $width, $height, $bgcolor);
}
}
// Add chart export data
function setBitmapData($imageData_FCFormat, $width, $height, $bgcolor="ffffff"){
$this->arrExportData[$this->numPages]["width"]=$width;
$this->arrExportData[$this->numPages]["height"]=$height;
$this->arrExportData[$this->numPages]["bgcolor"]=$bgcolor;
$this->arrExportData[$this->numPages]["imageData"]=$imageData_FCFormat;
$this->numPages++;
}
function getImageObject($id=0){
//create image
$image = imagecreatetruecolor($this->arrExportData[$id]["width"], $this->arrExportData[$id]["height"]);
// Detect the background color
if (!$this->arrExportData[$id]["bgcolor"]){
$this->arrExportData[$id]["bgcolor"] = "ffffff";
}
//set Background color
// Some linux distro have issues with imagefill
// Hence, using imagefilledrectangle() instead
//imagefill($image, 0, 0, $this->composeColor($image,$this->arrExportData[$id]["bgcolor"]));
imagefilledrectangle($image, 0, 0,($this->arrExportData[$id]["width"]+0)-1, ($this->arrExportData[$id]["height"]+0)-1,$this->composeColor($image,$this->arrExportData[$id]["bgcolor"]));
// Split the data into rows using ; as separator
$rows = explode(";", $this->arrExportData[$id]["imageData"]);
// Iterate through all the rows
for($i= 0; $i<count($rows); $i++){
$x=0;
// Parse all the pixels in this row
$pixels = explode(",", $rows[$i]);
// Iterate through the pixels
for($j=0; $j<count($pixels); $j++){
// Split the pixel into color and repeat value
$thispix = explode("_", $pixels[$j]);
// Reference to color
$c = $thispix[0];
// Reference to repeat factor
$r = (int)$thispix[1];
//If color is empty (i.e., background pixel) skip
if ($c==""){
$x+=$r;
continue;
//$c=$this->arrExportData[$id]["bgcolor"];
}
// get color
$color=$this->composeColor($image,$c);
//draw line
imageline($image, $x, $i, ($x+$r)-1, $i, $color);
//set next x pixel position
$x+=$r;
}
}
return $image;
}
// build color object for GD image object
// Parsee 6 Byte Hex Color string to 3 Byte RGB color
function composeColor($imgObj,$strHexColor){
if (strlen($strHexColor)<6){
//If the hexadecimal code is less than 6 characters, pad with 0
$strHexColor = str_pad($strHexColor, 6, '0', STR_PAD_LEFT);
}
//Convert value from HEX to RRGGBB (3 bytes)
$rr = hexdec(substr($strHexColor, 0, 2));
$gg = hexdec(substr($strHexColor, 2, 2));
$bb = hexdec(substr($strHexColor, 4, 2));
// Allocate the color
return imagecolorallocate($imgObj, $rr, $gg, $bb);
}
}
//needed to validate inclusion of this resource file in main file - FCExporter.php
return 'true';
?>

View File

@@ -0,0 +1,421 @@
<?php
/**
*
* FusionCharts Exporter - 'PDF Resource' handles
* FusionCharts (since v3.1) Server Side Export feature that
* helps FusionCharts exported as PDF file.
*
*
* @author FusionCharts
* @description FusionCharts Exporter (Server-Side - PHP)
* @version 2.0 [ 12 February 2009 ]
*
*/
/**
* ChangeLog / Version History:
* ----------------------------
*
* 1.1 [ 13 March 2009 ]
* Fixed PDF Image data Compressor
*
*
*
* 1.0 [ 12 February 2009 ]
*
* FEATURES:
* - Integrated with new Export feature of FusionCharts 3.1 & FusionCharts Exporter v 2.0
* - can save to server side directory
* - can provide download or open in browser window/frame other than _self
* - can save single or multiple page PDF
*
* ISSUES:
* - best viewed in 72 DPI
* - Each page is of the same pixel size that of the chart
* - no page margin or gutter as of now
* - no custom text or other PDF elements can be incorporated
*
*/
/**
* Copyright (c) 2016 Infosoft Global Private Limited
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* GENERAL NOTES
* -------------
*
* Chart would POST export data (which consists of encoded image data stream,
* width, height, background color and various other export parameters like
* exportFormat, exportFileName, exportAction, exportTargetWindow) to this script.
*
* The script would process this data using appropriate resource files build
* export binary (PDF/image)
*
* It either saves the binary as file to a server side directory or push it as
* Download or open in a new browser window/frame.
*
*
* ISSUES
* ------
* Q> What if someone wishes to open in the same page where the chart existed as postback
* replacing the old page?
*
* A> Not directly supported using any chart attribute or parameter but can do by
* removing/commenting the line containing 'header( content-disposition ...'
*
*/
/**
* @requires FCExporter.php A file that includes this resource
*
*
* Details
* -------
*
* The resource files would have these things as common:
*
* a) a constant - MIMETYPES that would have a string
* containing semicolon separated key value pairs.
* Each key can be a format name specified in the
* HANDLERASSOCIATIONS constant. The associated value
* would be the mimetype for the specified format.
*
* e.g. define("MIMETYPES","jpg=image/jpeg;jpeg=image/jpeg;png=image/png;gif=image/gif");
*
*
* b) a constant - EXTENSIONS that again contain a string of
* semicolon separated key value pair. Each key would again be the
* format name and the extension would be the file extension.
*
* e.g. define("EXTENSIONS","jpg=jpg;jpeg=jpg;png=png;gif=gif");
*
*
* c) a function - exportProcessor ( $stream , $meta )
* It would take the FusionCharts exncoded image string as $stream &
* an associative array $meta containging width, height and bgColor keys.
*
* The function would return an object of mixed type which would contain
* the processed binary/relevant export object.
*
*
* d) a function - exportOutput ( $exportObj, $exportSettings, $quality=1 )
* It would take the processed export object and other export setting as parameter.
* Moreover, it would take an optional parameter - $quality (in scale of 0 to 1).
* By Default, the $quality is passed as 1 (best quality)
*
* The function would return the file path on success or return false on failure.
*
* [ The other code in the resource file can be anything that support this architecture ]
*
*/
// =============================================================================
// == Constants and Variables ==
// =============================================================================
// ==============================================================================
// Users are recommended NOT to perform any editing beyond this point. ==
// ==============================================================================
/* ------------------------- EXPORT RESOURCES -------------------------------- */
// This constant lists the mime types related to each export format this resource handles
// The value is semicolon separated key value pair for each format
// Each key is the format and value is the mime type
define( "MIMETYPES" , "pdf=application/pdf" );
// This constant lists all the file extensions for the export formats
// The value is semicolon separated key value pair for each format
// Each key is the format and value is the file extension
define( "EXTENSIONS", "pdf=pdf" );
// =============================================================================
// == Public Functions ==
// =============================================================================
/**
* Gets Export data from FCExporter - main module and build the export binary/objct.
* @param $stream (string) export image data in FusionCharts compressed format
* $meta {array) Image meta data in keys "width", "heigth" and "bgColor"
* $exportParams {array} Export related parameters
* @return image object/binary
*/
function exportProcessor( $stream , $meta, $exportParams )
{
// create a new export object
// here it is an PDF generator class
// pass all reqiured parameters
$FCExporter = new FCPDFGenerator ( $stream, $meta ['width' ], $meta ['height' ], $meta ['bgColor' ] );
// return export ready PDF binary data
return $FCExporter->getPDFObjects();
}
/**
* exports (save/download) FusinoCharts exported PDF.
* @param $exportObj (mixed) binary/objct exported by exportProcessor
* @param $exportSettings (array) various server-side export settings stored in keys like
* "type", "ready" "filepath" etc. Required for 'save' expotAction.
* For 'download' action "filepath" is blank (this is checked to find
* whether the action is "download" or not.
* @param $quality (integer) quality factor 0-1 (1 being the best quality). As of now we always pass 1.
*
* @return false is fails. {filepath} if succeeds. Only returned when action is 'save'.
*/
function exportOutput ( $exportObj, $exportSettings, $quality = 1 )
{
// calls imagepdf function that saves/downloads PDF binary
// store saving status in $doneExport which receives false if fails and true on success
$doneExport = imagepdf ( $exportObj, @$exportSettings ['filepath'] );
// check $doneEport and if true sets status to {filepath}'s value
// set false if fails
$status =( $doneExport ? basename ( @$exportSettings ['filepath'] ) : false );
// return status
return $status;
}
/**
* emulates imagepng/imagegif/imagejpeg. It saves PDF data to server or to sets to download as per
* the exportAction. exportAction is 'download' when {filepath} is null.
* @param $exportObj (string) PDF binary exported by exportProcessor
* @param $filepath (string) Path where the exported PDF is to be stored
* when the action is "download" it is null.
*
* @return (boolean) false is fails. true if succeeds. Only returned when action is 'save'.
*/
function imagepdf ( $exportObject , $filepath )
{
// when filepath is null the action is 'download'
// hence write the PDF bimary yo response stream and immediately terminate/close/end stream
// to prevent any garbage that might get into response and corrupt the PDF binary
if ( !@$filepath ) die ( $exportObject );
// open file path in write mode
$fp = @fopen ( $filepath , "w" );
if( $fp )
{
// write PDF binary
$status = @fwrite( $fp , $exportObject );
//close file
$fc = @fclose( $fp );
}
// return status
return ( bool ) @$status;
}
#################################################################################
## ##
## EXPORT CLASS ##
## ##
#################################################################################
class FCPDFGenerator
{
//Array - Stores multiple chart export data
var $arrExportData;
//stores number of pages = length of $arrExportData array
var $numPages=0;
//Constructor - By default the chart-export-data can be passed to this
function FCPDFGenerator($imageData_FCFormat="", $width="", $height="", $bgcolor="ffffff"){
if($imageData_FCFormat && $width && $height){
$this->setBitmapData($imageData_FCFormat, $width, $height, $bgcolor);
}
}
// Add chart export data
function setBitmapData($imageData_FCFormat, $width, $height, $bgcolor="ffffff"){
$this->arrExportData[$this->numPages]["width"]=$width;
$this->arrExportData[$this->numPages]["height"]=$height;
$this->arrExportData[$this->numPages]["bgcolor"]=$bgcolor;
$this->arrExportData[$this->numPages]["imageData"]=$imageData_FCFormat;
$this->numPages++;
}
//create image PDF object containing the chart image
function addImageToPDF($id=0,$isCompressed=true){
//PDF Object number
$imgObjNo = 6 + $id*3;
//Get chart Image binary
$baImg=$this->getBitmapData24($id);
//Compress image binary
$imgBinary = $isCompressed?gzcompress($baImg, 9):$baImg;
//get the lenght of the image binary
$len=strlen($imgBinary);
//Build PDF object containing the image binary and other formats required
$imgObj=$imgObjNo." 0 obj\n<<\n/Subtype /Image /ColorSpace /DeviceRGB /BitsPerComponent 8 /HDPI 72 /VDPI 72 ".($isCompressed?"/Filter /FlateDecode ":"")."/Width ".$this->arrExportData[$id]["width"]." /Height ".$this->arrExportData[$id]["height"]." /Length ".$len." >>\nstream\n".$imgBinary."endstream\nendobj\n";
return $imgObj;
}
//Main PDF builder function
function getPDFObjects($isCompressed=true) {
$PDFBytes="";
//Store all PDF objects in this temporary string to be written to ByteArray
$strTmpObj="";
//start xref array
$xRefList[0]="xref\n0 ";
$xRefList[1]="0000000000 65535 f \n"; //Address Refenrece to obj 0
//Build PDF objects sequentially
//version and header
$strTmpObj="%PDF-1.3\n%{FC}\n";
$PDFBytes.=$strTmpObj;
//OBJECT 1 : info (optional)
$strTmpObj="1 0 obj<<\n/Author (FusionCharts)\n/Title (FusionCharts)\n/Creator (FusionCharts)\n>>\nendobj\n";
$xRefList[]=$this->calculateXPos(strlen($PDFBytes)); //refenrece to obj 1
$PDFBytes.=$strTmpObj;
//OBJECT 2 : Starts with Pages Catalogue
$strTmpObj="2 0 obj\n<< /Type /Catalog /Pages 3 0 R >>\nendobj\n";
$xRefList[]=$this->calculateXPos(strlen($PDFBytes)); //refenrece to obj 2
$PDFBytes.=$strTmpObj;
//OBJECT 3 : Page Tree (reference to pages of the catalogue)
$strTmpObj="3 0 obj\n<< /Type /Pages /Kids [";
for($i=0;$i<$this->numPages;$i++){
$strTmpObj.=((($i+1)*3)+1)." 0 R\n";
}
$strTmpObj.="] /Count ".$this->numPages." >>\nendobj\n";
$xRefList[]=$this->calculateXPos(strlen($PDFBytes)); //refenrece to obj 3
$PDFBytes.=$strTmpObj;
//Each image page
for($itr=0;$itr<$this->numPages;$itr++){
$iWidth=$this->arrExportData[$itr]["width"];
$iHeight=$this->arrExportData[$itr]["height"];
//OBJECT 4..7..10..n : Page config
$strTmpObj=((($itr+2)*3)-2)." 0 obj\n<<\n/Type /Page /Parent 3 0 R \n/MediaBox [ 0 0 ".$iWidth." ".$iHeight." ]\n/Resources <<\n/ProcSet [ /PDF ]\n/XObject <</R".($itr+1)." ".(($itr+2)*3)." 0 R>>\n>>\n/Contents [ ".((($itr+2)*3)-1)." 0 R ]\n>>\nendobj\n";
$xRefList[]=$this->calculateXPos(strlen($PDFBytes)); //refenrece to obj 4,7,10,13,16...
$PDFBytes.=$strTmpObj;
//OBJECT 5...8...11...n : Page resource object (xobject resource that transforms the image)
$xRefList[]=$this->calculateXPos(strlen($PDFBytes)); //refenrece to obj 5,8,11,14,17...
$PDFBytes.=$this->getXObjResource($itr);
//OBJECT 6...9...12...n : Binary xobject of the page (image)
$imgBA=$this->addImageToPDF($itr,$isCompressed);
$xRefList[]=$this->calculateXPos(strlen($PDFBytes));//refenrece to obj 6,9,12,15,18...
$PDFBytes.=$imgBA;
}
//xrefs compilation
$xRefList[0].=(count($xRefList)-1)."\n";
//get trailer
$trailer=$this->getTrailer(strlen($PDFBytes) ,count($xRefList)-1);
//write xref and trailer to PDF
$PDFBytes.=implode("",$xRefList);
$PDFBytes.=$trailer;
//write EOF
$PDFBytes.="%%EOF\n";
return $PDFBytes;
}
//Build Image resource object that transforms the image from First Quadrant system to Second Quadrant system
function getXObjResource($itr=0) {
return ((($itr+2)*3)-1)." 0 obj\n<< /Length ".(24+strlen($this->arrExportData[$itr]["width"].$this->arrExportData[$itr]["height"]))." >>\nstream\nq\n".$this->arrExportData[$itr]["width"]." 0 0 ".$this->arrExportData[$itr]["height"]." 0 0 cm\n/R".($itr+1)." Do\nQ\nendstream\nendobj\n";
}
// Calculate the XREF position of eah PDF Object
function calculateXPos($posn){
return (str_pad($posn, 10, '0', STR_PAD_LEFT))." 00000 n \n";
}
// Calculate and build Trailer of PDF
function getTrailer($xrefpos,$numxref=7) {
return "trailer\n<<\n/Size ".$numxref."\n/Root 2 0 R\n/Info 1 0 R\n>>\nstartxref\n".$xrefpos."\n";
}
// Parse Chart Image data in to PDF Ready Image Data
function getBitmapData24($id=0){
$imageData24="";
// Split the data into rows using ; as separator
$rows = explode(";", $this->arrExportData[$id]["imageData"]);
// Detect the background color
if (!($this->arrExportData[$id]["bgcolor"])){
$this->arrExportData[$id]["bgcolor"] = "ffffff";
}
// Iterate through all the rows
for($i= 0; $i<count($rows); $i++){
// Parse all the pixels in this row
$pixels = explode(",", $rows[$i]);
// Iterate through the pixels
for($j=0; $j<count($pixels); $j++){
// Split the pixel into color and repeat value
$thispix = explode("_", $pixels[$j]);
// Reference to color
$c = $thispix[0];
// Reference to repeat factor
$r = ( int ) $thispix[1];
//If color is not empty (i.e., not background pixel)
if ($c==""){
$c=$this->arrExportData[$id]["bgcolor"];
}
if (strlen($c)<6){
//If the hexadecimal code is less than 6 characters, pad with 0
$c = str_pad($c, 6, '0', STR_PAD_LEFT);
}
$rgb = pack("CCC",hexdec(substr($c, 0, 2)),hexdec(substr($c, 2, 2)),hexdec(substr($c, 4, 2)));
$strPixelRGB_hex=str_repeat(($rgb),$r);
// Set the pixel
$imageData24.= $strPixelRGB_hex;
}
}
return $imageData24;
}
}
return 'true';
?>

View File

@@ -0,0 +1,381 @@
<?php
/**
*
* FusionCharts Exporter - 'SVG Conversion Resource' handles
* FusionCharts (since XTT) Server Side Export feature that
* helps FusionCharts JavaScript charts to get exported.
*
*
* @author FusionCharts
* @description FusionCharts Exporter (Server-Side - PHP)
* @version 0.0.0.1 [ 32 December 2012 ]
*
*/
/**
* ChangeLog / Version History:
* ----------------------------
*
*
* 1.0.0.0 [ 31 December 2012 ]
*
*
* FEATURES:
* - Integrated with new Export feature of FusionCharts XT & FusionCharts Exporter v 2.0
* - can save to server side directory
* - can provide download or open in browser window/frame other than _self
*
* ISSUES:
*
*
*
*
*
*/
/**
* Copyright (c) 2016 Infosoft Global Private Limited
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* GENERAL NOTES
* -------------
*
* Chart would POST export data (which consists of encoded image data stream,
* width, height, background color and various other export parameters like
* exportFormat, exportFileName, exportAction, exportTargetWindow) to this script.
*
* The script would process this data using appropriate resource files build
* export binary (PDF/image)
*
* It either saves the binary as file to a server side directory or push it as
* Download or open in a new browser window/frame.
*
*
*/
/**
* @requires index.php A file that includes this resource
* Java 1.3+ & Apache Batik rasterizer class: Export JavaScript charts
* (http://xmlgraphics.apache.org/batik/)
*
*
* Details
* -------
*
* The resource files would have these things as common:
*
* a) a constant - MIMETYPES that would have a string
* containing semicolon separated key value pairs.
* Each key can be a format name specified in the
* HANDLERASSOCIATIONS constant. The associated value
* would be the mimetype for the specified format.
*
* e.g. define("MIMETYPES","jpg=image/jpeg;jpeg=image/jpeg;png=image/png;gif=image/gif");
*
*
* b) a constant - EXTENSIONS that again contain a string of
* semicolon separated key value pair. Each key would again be the
* format name and the extension would be the file extension.
*
* e.g. define("EXTENSIONS","jpg=jpg;jpeg=jpg;png=png;gif=gif");
*
*
* c) a function - exportProcessor ( $stream , $meta )
* It would take the FusionCharts exncoded image string as $stream &
* an associative array $meta containging width, height and bgColor keys.
*
* The function would return an object of mixed type which would contain
* the processed binary/relevant export object.
*
*
* d) a function - exportOutput ( $exportObj, $exportSettings, $quality=1 )
* It would take the processed export object and other export setting as parameter.
* Moreover, it would take an optional parameter - $quality (in scale of 0 to 1).
* By Default, the $quality is passed as 1 (best quality)
*
* The function would return the file path on success or return false on failure.
*
* [ The other code in the resource file can be anything that support this architecture ]
*
*/
// =============================================================================
// == Constants and Variables ==
// =============================================================================
// ==============================================================================
// Users are recommended NOT to perform any editing beyond this point. ==
// ==============================================================================
ini_set('magic_quotes_gpc', 'off');
/* ------------------------- EXPORT RESOURCES -------------------------------- */
// This constant lists the mime types related to each export format this resource handles
// The value is semicolon separated key value pair for each format
// Each key is the format and value is the mime type
define("MIMETYPES", "jpg=image/jpeg;jpeg=image/jpeg;gif=image/gif;png=image/png;pdf=application/pdf;svg=image/svg+xml");
// This constant lists all the file extensions for the export formats
// The value is semicolon separated key value pair for each format
// Each key is the format and value is the file extension
define("EXTENSIONS", "jpg=jpg;jpeg=jpg;gif=gif;png=png;pdf=pdf;svg=svg");
define('TEMP_PATH', 'temp/');
define('BATIK_PATH', 'batik/batik-rasterizer.jar');
define('INKSCAPE_PATH', '/usr/bin/inkscape');
define('CONVERT_PATH', '/usr/bin/convert'); // imagemagic
// =============================================================================
// == Public Functions ==
// =============================================================================
class stitchImageCallback {
private $imageData;
function __construct($imageData) {
$this->imageData = $imageData;
}
public function callback($matches) {
$imageRet = '';
$imageName = explode('/', $matches['2']);
$imageName = array_pop($imageName);
foreach ($this->imageData as $key => $value) {
if ($value->name .'.'.$value->type == $imageName) {
$imageRet = $value->encodedData;
}
}
if ($imageRet == '') {
return '';
}
return $matches[1] . $imageRet;
}
}
/**
* The function is use to stitch the image to the SVG when downloaded as SVG
* @param [string] $svg [SVG with image link]
* @param [array] $imageData [Image datauri array]
* @return [string] [SVG with imageDatauri]
*/
function stitchImageToSvg ($svg, $imageData) {
if($imageData != null) {
$imageData = json_decode($imageData);
$callback = new stitchImageCallback($imageData);
return preg_replace_callback("/(<image[^>]*xlink:href *= *[\"']?)([^\"']*)/i", array($callback, 'callback'), $svg);
} else {
return $svg;
}
}
/**
* Gets Export data from FCExporter - main module and build the export binary/objct.
* @param $stream (string) export image data in FusionCharts compressed format
* $meta {array) Image meta data in keys "width", "heigth" and "bgColor"
* $exportParams {array} Export related parameters
* @return image object/binary
*/
function exportProcessor($stream, $meta, $exportParams, $imageData=null) {
// get mime type list parsing MIMETYPES constant declared in Export Resource PHP file
$ext = strtolower($exportParams["exportformat"]);
$ext2 = '';
$mimeList = bang(@MIMETYPES);
$mimeType = $mimeList[$ext];
// prepare variables
if (get_magic_quotes_gpc()) {
$stream = stripslashes($stream);
}
// create a new export data
$tempFileName = md5(rand());
if ('jpeg' == $ext || 'jpg' == $ext) {
$ext = 'png';
$ext2 = 'jpg';
}
$tempInputSVGFile = realpath(TEMP_PATH) . "/{$tempFileName}.svg";
$tempOutputFile = realpath(TEMP_PATH) . "/{$tempFileName}.{$ext}";
$tempOutputJpgFile = realpath(TEMP_PATH) . "/{$tempFileName}.jpg";
$tempOutputPngFile = realpath(TEMP_PATH) . "/{$tempFileName}.png";
if ($ext != 'svg') {
// width format for batik
$width = @$meta['width'];
$height = @$meta['height'];
$size = '';
if (!empty($width) && !empty($height)) {
$size = "-w {$width} -h {$height}";
}
// override the size in case of pdf output
if ('pdf' == $ext) {
$size = '';
}
//batik bg color format
$bg = @$meta['bgColor'];
if ($bg) {
$bg = " --export-background=".$bg;
}
// generate the temporary file
if (!file_put_contents($tempInputSVGFile, $stream)) {
die("Couldn't create temporary file. Check that the directory permissions for
the " . TEMP_PATH . " directory are set to 777.");
}
// do the conversion
//$command = "java -jar ". BATIK_PATH ." -m $mimeType $width $bg $tempInputSVGFile";
$command = INKSCAPE_PATH . "$bg --without-gui {$tempInputSVGFile} --export-{$ext} $tempOutputFile {$size}";
//echo $command;exit;
$output = shell_exec($command);
if ('jpg' == $ext2) {
$comandJpg = CONVERT_PATH . " -quality 100 $tempOutputFile $tempOutputJpgFile";
$tempOutputFile = $tempOutputJpgFile;
$output .= shell_exec($comandJpg);
}
// catch error
if (!is_file($tempOutputFile) || filesize($tempOutputFile) < 10) {
$return_binary = $output;
raise_error($output, true);
}
// stream it
else {
$return_binary = file_get_contents($tempOutputFile);
}
// delete temp internal image files if exist
$imageData = json_decode($imageData);
if ($imageData) {
foreach ($imageData as $key => $value) {
$tempInternalImage = realpath(TEMP_PATH) . "/{$value->name}.{$value->type}";
if (file_exists($tempInternalImage)) {
unlink($tempInternalImage);
}
}
}
// delete temp files
if (file_exists($tempInputSVGFile)) {
unlink($tempInputSVGFile);
}
if (file_exists($tempOutputFile)) {
unlink($tempOutputFile);
}
if (file_exists($tempOutputPngFile)) {
unlink($tempOutputPngFile);
}
// SVG can be streamed back directly
} else if ($ext == 'svg') {
$stream = stitchImageToSvg($stream, $imageData);
$return_binary = $stream;
} else {
raise_error("Invalid Export Format.", true);
}
// return export ready binary data
return @$return_binary;
}
/**
* exports (save/download) SVG to export formats.
* @param $exportObj (mixed) binary/objct exported by exportProcessor
* @param $exportSettings (array) various server-side export settings stored in keys like
* "type", "ready" "filepath" etc. Required for 'save' expotAction.
* For 'download' action "filepath" is blank (this is checked to find
* whether the action is "download" or not.
* @param $quality (integer) quality factor 0-1 (1 being the best quality). As of now we always pass 1.
*
* @return false is fails. {filepath} if succeeds. Only returned when action is 'save'.
*/
function exportOutput($exportObj, $exportSettings, $quality = 1) {
// calls svgparser function that saves/downloads binary
// store saving status in $doneExport which receives false if fails and true on success
$doneExport = filesaver($exportObj, @$exportSettings ['filepath']);
// check $doneExport and if true sets status to {filepath}'s value
// set false if fails
$status = ( $doneExport ? basename(@$exportSettings ['filepath']) : false );
// return status
return $status;
}
/**
* emulates imagepng/imagegif/imagejpeg. It saves data to server
* @param $exportObj (resource) binary exported by exportProcessor
* @param $filepath (string) Path where the exported is to be stored
* when the action is "download" it is null.
*
* @return (boolean) false is fails. true if succeeds. Only returned when action is 'save'.
*/
function filesaver($exportObject, $filepath) {
// when filepath is null the action is 'download'
// hence write the bimary to response stream and immediately terminate/close/end stream
// to prevent any garbage that might get into response and corrupt the binary
if (!@$filepath)
die($exportObject);
// open file path in write mode
$fp = @fopen($filepath, "w");
if ($fp) {
// write binary
$status = @fwrite($fp, $exportObject);
//close file
$fc = @fclose($fp);
}
// return status
return (bool) @$status;
}
/**
* Converts Hex color values to rgb
*
* @param string $h Hex values
* @param string $sep rgb value separator
* @return string
*/
function hex2rgb($h, $sep = "") {
$h = str_replace("#", "", $h);
if (strlen($h) == 3) {
$r = hexdec(substr($h, 0, 1) . substr($h, 0, 1));
$g = hexdec(substr($h, 1, 1) . substr($h, 1, 1));
$b = hexdec(substr($h, 2, 1) . substr($h, 2, 1));
} else {
$r = hexdec(substr($h, 0, 2));
$g = hexdec(substr($h, 2, 2));
$b = hexdec(substr($h, 4, 2));
}
$rgb = array($r, $g, $b);
if ($sep) {
$rgb = implode($sep, $rgb);
}
return $rgb;
}
return 'true';

View File

@@ -0,0 +1,100 @@
<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
include('includes/config.php');
include('writehtaccess.php');
if(isset($_POST["submit"]))
{
$ip = trim(addslashes($_POST["ip"]));
$reason = trim(addslashes($_POST["reason"]));
if($ip == "")
{
//do nothing
showForm("Add", "Null Ip can't be disallowed!");
}
else
{
$insertStatement = "insert into exportServerDb.ipRules (ip,accessRule,dateAdded,reason) values ('".$ip ."','Denied',convert_tz(now(), 'GMT', 'Asia/Kolkata'),'".$reason."')";
if(mysql_query($insertStatement))
{
writeHtaccess();
showForm("Add", "Added Successfully!");
?>
<script>
parent.location.reload(true);
</script>
<?php
}
else
{
showForm("Add", "Error Occurred!");
}
}
/*else if(trim(addslashes($_POST["id"]))!="")
{
$editStatement = "update exportServerDb.ipRules set ip = '".$ip ."',reason = '".$reason."' where id=".$_POST["id"];
if(mysql_query($editStatement))
{
showForm("Edit", "Edited Successfully!");
?>
<script>
parent.location.reload(true);
</script>
<?php
}
else
{
showForm("Edit", "Error Occurred!");
}
}*/
}
else
{
showForm("Add", "");
}
function showForm($mode,$msg,$params = array())
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $mode;?> CIDR/IP</title>
<link href="bootstrap/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div style="color:red;text-align:center;"><?php echo $msg;?></div>
<h3 style="text-align:center;">Add CIDR/IP to the Banlist</h3>
<form class="form-horizontal" action="" method="post">
<div class="control-group">
<label class="control-label" for="ip">CIDR/IP to disallow</label>
<div class="controls">
<input type="text" id="ip" name ="ip" class="span2" ">
</div>
</div>
<div class="control-group">
<label class="control-label" for="reason">Reason</label>
<div class="controls">
<textarea rows="3" id="reason" class="span4" name="reason"></textarea>
</div>
</div>
<div class="control-group">
<div class="controls">
<input type="hidden" name="id" id="id" >
<button type="submit" name="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
</body>
</html>
<?php
}
?>

View File

@@ -0,0 +1,175 @@
<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
include('includes/config.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Export Server Admin Console</title>
<link href="bootstrap/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<link href="css/style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="js/jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<script language="javascript">
jQuery(document).ready(function(){
$(".fancy-add").fancybox({
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'type' : 'iframe'
});
});
</script>
</head>
<body>
<div class="container">
<header>
<a href="./" title="FusionCharts - Delightful charts and gauges in JavaScript &amp; Flash" ><img src="fusioncharts-logo.png" width="" /></a>
</header>
<hr />
<div class="row">
<div class="span3">
<?php include('./includes/leftmenu.php'); ?>
</div>
<div class="span9">
<?php
$selectRules = "select * from ipRules";
$selectRes = mysql_query($selectRules);
?>
<a href="addRule.php" class="btn btn-primary fancy-add">Add</a>
<div class="table-holder">
<table class="table table-striped table-hover table-condensed">
<thead>
<tr><td colspan="4"><h4>Disallowed IPs</h4></td><td colspan="2" style="text-align:right"><a href="javascript:void('0');" onclick="deleteSelected();" class="btn btn-danger">Delete</a> </td></tr>
<tr><td><strong>Ip Disallowed</strong></td><td><strong>User who added</strong></td><td><strong>Date</strong></td> <td><strong>Reason</strong></td><td><strong>Edit</strong></td><td><input type="checkbox" id="selectall"/></td></tr>
</thead>
<tbody>
<?php
if(mysql_num_rows($selectRes)>0)
{
while($selectRows = mysql_fetch_assoc($selectRes))
{
?>
<tr><td><?php echo $selectRows['ip'];?></td><td><?php echo $selectRows['userAdded'];?></td><td><?php echo $selectRows['dateAdded'];?></td><td><?php echo $selectRows['reason'];?></td><td><a href="editRule.php?id=<?php echo $selectRows['id']; ?>" class="btn btn-mini fancy-add" alt=""><i class="icon-edit"></i> EDIT</a></td><td><input type="checkbox" class="checkbox" name="selectDelete" id = "<?php echo $selectRows['id'];?>"/></td></tr>
<?php
}
}
else
{
echo '<tr><td colspan="6" style="text-align:center;">No Rules found</td></tr>';
}
?>
</tbody>
<tfoot>
<tr><td colspan="6" style="text-align:right"><a href="javascript:void('0');" onclick="deleteSelected();" class="btn btn-danger">Delete</a> </td></tr>
</tfoot>
</table>
</div>
</div>
</div>
<hr />
<footer>
<p><small>&copy; Copyright <script type="text/javascript">
var d=new Date();
document.write(d.getFullYear());
</script>, FusionCharts PPL.</small></p>
</footer>
</div>
<script type="text/javascript">
function deleteSelected()
{
var countCheck = document.getElementsByName('selectDelete').length;
var idArray = new Array();
var idString, oneChecked=0, j=0 ;
for(i=0;i<countCheck;i++)
{
if(document.getElementsByName('selectDelete')[i].checked)
{
oneChecked = oneChecked + 1;
idArray[j] = document.getElementsByName('selectDelete')[i].id;
j++;
}
}
if(oneChecked>0)
{
var confirmFlag = confirm("Do you really want to remove these IP from ban list?");
if(confirmFlag == true)
{
if(oneChecked > 1)
idString = idArray.join();
else
idString = idArray[0];
//console.log( oneChecked + ":::::"+idArray[1]);
$.ajax({
type: "POST",
url: 'deleteRules.php',
data: { idString: idString},
success: function(data) {
if(data==1)
{
window.location.reload();
}
else
alert("Deletion Unsuccessfull! Please Contact the administrator");
}
});
//console.log(idString);
}
}
else
{
alert("Please select atleast One record to delete");
}
}
jQuery(document).ready(function() {
jQuery(":checkbox").bind("click", function(e){
$( e.target ).closest('tr').toggleClass("warning") });
// add multiple select / deselect functionality
$("#selectall").click(function () {
$('.checkbox').attr('checked', this.checked);
$('.checkbox').closest('tr').toggleClass("warning");
});
// if all checkbox are selected, check the selectall checkbox
// and viceversa
$(".checkbox").click(function(){
if($(".checkbox").length == $(".checkbox:checked").length) {
$("#selectall").attr("checked", "checked");
} else {
$("#selectall").removeAttr("checked");
}
});
});
</script>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,20 @@
@charset "utf-8";
/* CSS Document */
.table-holder {
border: 1px solid #EFEFEF;
padding: 10px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-khtml-border-radius: 5px;
border-radius: 5px;
margin: 10px 0;
}
.table-holder .table {
margin-bottom: 0;
}
.table-holder .table h4{
line-height: 100%;
}

View File

@@ -0,0 +1,39 @@
<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
include('includes/config.php');
include('writehtaccess.php');
$idArray = array ();
if(empty($_POST['idString']))
{
echo 0;
}
else
{
$idArray = explode ( "," , trim($_POST['idString']) );
$inClause = "" ;
foreach ($idArray as $item)
{
if($inClause == "")
$inClause = "where id in (" . $item;
else
$inClause = $inClause . ", " .$item;
}
$inClause = $inClause . " )";
$delQuery = "delete from ipRules " . $inClause;
if(mysql_query($delQuery))
{
writeHtaccess();
echo 1;
}
else
echo 0;
}
?>

View File

@@ -0,0 +1,134 @@
<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
include('includes/config.php');
include('writehtaccess.php');
if(!isset($_POST['id']) && isset($_GET['id']) && !empty($_GET['id']))
{
$paramToPass = array();
$selectQry = "select * from ipRules where id=" . trim(addslashes($_GET['id']));
$selectRes = mysql_query($selectQry);
$selectRow = mysql_fetch_assoc($selectRes);
if(mysql_num_rows($selectRes) > 0)
{
$paramToPass['id'] = $selectRow['id'];
$paramToPass['ip'] = $selectRow['ip'];
$paramToPass['reason'] = $selectRow['reason'] ;
showForm("Edit", "", $paramToPass);
}
else
{
?>
<script>
parent.location.reload(true);
</script>
<?php
}
}
else if( trim(addslashes($_POST["id"]))!="" && trim(addslashes($_POST["ip"]))!="")
{
$editStatement = "update exportServerDb.ipRules set ip = '".trim(addslashes($_POST["ip"])) ."',reason = '".trim(addslashes($_POST["reason"]))."' where id=".trim(addslashes($_POST["id"]));
if(mysql_query($editStatement))
{
$paramToPass = array();
$selectQry = "select * from ipRules where id=" . trim(addslashes($_POST['id']));
$selectRes = mysql_query($selectQry);
$selectRow = mysql_fetch_assoc($selectRes);
if(mysql_num_rows($selectRes) > 0)
{
$paramToPass['id'] = $selectRow['id'];
$paramToPass['ip'] = $selectRow['ip'];
$paramToPass['reason'] = $selectRow['reason'] ;
}
showForm("Edit", "Edited Successfully!",$paramToPass);
writeHtaccess();
?>
<script>
parent.location.reload(true);
</script>
<?php
}
else
{
$paramToPass = array();
$selectQry = "select * from ipRules where id=" . trim(addslashes($_POST['id']));
$selectRes = mysql_query($selectQry);
$selectRow = mysql_fetch_assoc($selectRes);
if(mysql_num_rows($selectRes) > 0)
{
$paramToPass['id'] = $selectRow['id'];
$paramToPass['ip'] = $selectRow['ip'];
$paramToPass['reason'] = $selectRow['reason'] ;
}
showForm("Edit", "Error Occurred!", $paramToPass);
}
}
else if ( trim(addslashes($_POST["ip"]))=="")
{
$paramToPass = array();
$selectQry = "select * from ipRules where id=" . trim(addslashes($_POST['id']));
$selectRes = mysql_query($selectQry);
$selectRow = mysql_fetch_assoc($selectRes);
if(mysql_num_rows($selectRes) > 0)
{
$paramToPass['id'] = $selectRow['id'];
$paramToPass['ip'] = $selectRow['ip'];
$paramToPass['reason'] = $selectRow['reason'] ;
}
showForm("Edit", "Ip cann't be Null", $paramToPass);
?>
<script>
// parent.location.reload(true);
</script>
<?php
}
function showForm($mode,$msg,$params = array())
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $mode;?> CIDR/IP</title>
<link href="bootstrap/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div style="color:red;text-align:center;"><?php echo $msg;?></div>
<h3 style="text-align:center;"><?php echo $mode;?> CIDR/IP to the Banlist</h3>
<form class="form-horizontal" action="editRule.php" method="post">
<div class="control-group">
<label class="control-label" for="ip">CIDR/IP to disallow</label>
<div class="controls">
<input type="text" id="ip" name ="ip" class="span2" value="<?php echo $params['ip']?>">
</div>
</div>
<div class="control-group">
<label class="control-label" for="reason">Reason</label>
<div class="controls">
<textarea rows="3" id="reason" class="span4" name="reason"><?php echo $params['reason']?></textarea>
</div>
</div>
<div class="control-group">
<div class="controls">
<input type="hidden" name="id" id="id" value="<?php echo $params['id']?>">
<button type="submit" name="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
</body>
</html>
<?php
}

View File

@@ -0,0 +1,120 @@
<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
include('includes/config.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Export List </title>
<link href="bootstrap/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<link href="css/style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="js/jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<script language="javascript">
jQuery(document).ready(function(){
$(".fancy-add").fancybox({
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'type' : 'iframe'
});
});
</script>
</head>
<body>
<div class="container">
<header>
<a href="./" title="FusionCharts - Delightful charts and gauges in JavaScript &amp; Flash" ><img src="fusioncharts-logo.png" width="" /></a>
</header>
<hr />
<div class="row">
<div class="span3">
<?php include('./includes/leftmenu.php'); ?>
</div>
<div class="span9">
<?php
$selectRules = "select * from exportData";
$selectRes = mysql_query($selectRules);
?>
<div class="table-holder">
<table class="table table-striped table-hover table-condensed">
<thead>
<tr>
<td><strong>ChartType</strong></td>
<!--td><strong>StreamType</strong></td-->
<td><strong>MetaBgColor</strong></td>
<td><strong>MetaDomID</strong></td>
<td><strong>MetaWidth</strong></td>
<td><strong>MetaHeight</strong></td>
<!--td><strong>Params</strong></td-->
<!--td><strong>FileName</strong></td-->
<td><strong>SourceIP</strong></td>
<!--td><strong>SourceUseragent</strong></td-->
<td><strong>Date</strong></td>
<!--td><strong>Referrer</strong></td-->
<td><strong>RemoteADDR</strong></td>
</tr>
</thead>
<tbody>
<?php
if(mysql_num_rows($selectRes)>0)
{
while($selectRows = mysql_fetch_assoc($selectRes))
{
?>
<tr>
<td><?php echo $selectRows['ChartType']; ?></td>
<!--td><?php echo $selectRows['StreamType']; ?></td-->
<td><?php echo $selectRows['MetaBgColor']; ?></td>
<td><?php echo $selectRows['MetaDomID']; ?></td>
<td><?php echo $selectRows['MetaWidth']; ?></td>
<td><?php echo $selectRows['MetaHeight']; ?></td>
<!--td><?php echo $selectRows['Params']; ?></td-->
<!--td><?php echo $selectRows['FileName']; ?></td-->
<td><?php echo $selectRows['SourceIP']; ?></td>
<!--td><?php echo $selectRows['SourceUseragent']; ?></td-->
<td><?php echo $selectRows['ExportDateTime']; ?></td>
<!--td><?php echo $selectRows['Referrer']; ?></td-->
<td><?php echo $selectRows['RemoteADDR']; ?></td>
</tr>
<?php
}
}
else
{
echo '<tr><td colspan="11" style="text-align:center;">None</td></tr>';
}
?>
</tbody>
</table>
</div>
</div>
</div>
<hr />
<footer>
<p><small>&copy; Copyright <script type="text/javascript">
var d=new Date();
document.write(d.getFullYear());
</script>, FusionCharts PPL.</small></p>
</footer>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@@ -0,0 +1,16 @@
<?php
date_default_timezone_set('Asia/Kolkata');
$host = "localhost" ;
$user = "root";
$pass = "root";
$db = "exportserverdb";
$con = mysql_connect($host,$user,$pass);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db($db, $con);
if (!$db_selected) {
die ('Can\'t use '. $db . mysql_error());
}

View File

@@ -0,0 +1,9 @@
<ul class="nav nav-list">
<li>
<a href="banlist.php">Ban Ip's</a>
</li>
<li>
<a href="exportList.php"> Downlaods/ Exports till date</a>
</li>
</ul>

View File

@@ -0,0 +1,34 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Export Server Admin Console</title>
<link href="bootstrap/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div class="container">
<header>
<a href="./" title="FusionCharts - Delightful charts and gauges in JavaScript &amp; Flash" ><img src="fusioncharts-logo.png" width="" /></a>
</header>
<hr />
<div class="row">
<div class="span3">
<?php include('./includes/leftmenu.php'); ?>
</div>
<div class="span9" style="text-align:center;">
Please Select options from the left to perform admin actions.
</div>
</div>
<hr />
<footer>
<p><small>&copy; Copyright <script type="text/javascript">
var d=new Date();
document.write(d.getFullYear());
</script>, FusionCharts PPL.</small></p>
</footer>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
</body>
</html>

View File

@@ -0,0 +1,6 @@
<div style="width:400px;">
<h2>This comes from ajax request</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean non velit. Donec pharetra, felis ut tristique adipiscing, diam magna rhoncus neque, sit amet convallis nibh nibh vel libero. Nulla facilisi. In eleifend nisl quis lorem. Duis semper fringilla justo. Proin imperdiet sapien sed lectus. Integer quis nisl et est elementum tempor. Morbi quis tellus nec turpis suscipit molestie. Praesent sed pede. Pellentesque ac orci. Sed sit amet urna eget tellus hendrerit aliquet. Nulla consectetur, pede aliquam ornare placerat, nunc augue commodo leo, sit amet elementum dolor est eleifend magna.
</p>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -0,0 +1,359 @@
/*
* FancyBox - jQuery Plugin
* Simple and fancy lightbox alternative
*
* Examples and documentation at: http://fancybox.net
*
* Copyright (c) 2008 - 2010 Janis Skarnelis
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
*
* Version: 1.3.4 (11/11/2010)
* Requires: jQuery v1.3+
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
#fancybox-loading {
position: fixed;
top: 50%;
left: 50%;
width: 40px;
height: 40px;
margin-top: -20px;
margin-left: -20px;
cursor: pointer;
overflow: hidden;
z-index: 1104;
display: none;
}
#fancybox-loading div {
position: absolute;
top: 0;
left: 0;
width: 40px;
height: 480px;
background-image: url('fancybox.png');
}
#fancybox-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: 1100;
display: none;
}
#fancybox-tmp {
padding: 0;
margin: 0;
border: 0;
overflow: auto;
display: none;
}
#fancybox-wrap {
position: absolute;
top: 0;
left: 0;
padding: 20px;
z-index: 1101;
outline: none;
display: none;
}
#fancybox-outer {
position: relative;
width: 100%;
height: 100%;
background: #fff;
}
#fancybox-content {
width: 0;
height: 0;
padding: 0;
outline: none;
position: relative;
overflow: hidden;
z-index: 1102;
border: 0px solid #fff;
}
#fancybox-hide-sel-frame {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: transparent;
z-index: 1101;
}
#fancybox-close {
position: absolute;
top: -15px;
right: -15px;
width: 30px;
height: 30px;
background: transparent url('fancybox.png') -40px 0px;
cursor: pointer;
z-index: 1103;
display: none;
}
#fancybox-error {
color: #444;
font: normal 12px/20px Arial;
padding: 14px;
margin: 0;
}
#fancybox-img {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
border: none;
outline: none;
line-height: 0;
vertical-align: top;
}
#fancybox-frame {
width: 100%;
height: 100%;
border: none;
display: block;
}
#fancybox-left, #fancybox-right {
position: absolute;
bottom: 0px;
height: 100%;
width: 35%;
cursor: pointer;
outline: none;
background: transparent url('blank.gif');
z-index: 1102;
display: none;
}
#fancybox-left {
left: 0px;
}
#fancybox-right {
right: 0px;
}
#fancybox-left-ico, #fancybox-right-ico {
position: absolute;
top: 50%;
left: -9999px;
width: 30px;
height: 30px;
margin-top: -15px;
cursor: pointer;
z-index: 1102;
display: block;
}
#fancybox-left-ico {
background-image: url('fancybox.png');
background-position: -40px -30px;
}
#fancybox-right-ico {
background-image: url('fancybox.png');
background-position: -40px -60px;
}
#fancybox-left:hover, #fancybox-right:hover {
visibility: visible; /* IE6 */
}
#fancybox-left:hover span {
left: 20px;
}
#fancybox-right:hover span {
left: auto;
right: 20px;
}
.fancybox-bg {
position: absolute;
padding: 0;
margin: 0;
border: 0;
width: 20px;
height: 20px;
z-index: 1001;
}
#fancybox-bg-n {
top: -20px;
left: 0;
width: 100%;
background-image: url('fancybox-x.png');
}
#fancybox-bg-ne {
top: -20px;
right: -20px;
background-image: url('fancybox.png');
background-position: -40px -162px;
}
#fancybox-bg-e {
top: 0;
right: -20px;
height: 100%;
background-image: url('fancybox-y.png');
background-position: -20px 0px;
}
#fancybox-bg-se {
bottom: -20px;
right: -20px;
background-image: url('fancybox.png');
background-position: -40px -182px;
}
#fancybox-bg-s {
bottom: -20px;
left: 0;
width: 100%;
background-image: url('fancybox-x.png');
background-position: 0px -20px;
}
#fancybox-bg-sw {
bottom: -20px;
left: -20px;
background-image: url('fancybox.png');
background-position: -40px -142px;
}
#fancybox-bg-w {
top: 0;
left: -20px;
height: 100%;
background-image: url('fancybox-y.png');
}
#fancybox-bg-nw {
top: -20px;
left: -20px;
background-image: url('fancybox.png');
background-position: -40px -122px;
}
#fancybox-title {
font-family: Helvetica;
font-size: 12px;
z-index: 1102;
}
.fancybox-title-inside {
padding-bottom: 10px;
text-align: center;
color: #333;
background: #fff;
position: relative;
}
.fancybox-title-outside {
padding-top: 10px;
color: #fff;
}
.fancybox-title-over {
position: absolute;
bottom: 0;
left: 0;
color: #FFF;
text-align: left;
}
#fancybox-title-over {
padding: 10px;
background-image: url('fancy_title_over.png');
display: block;
}
.fancybox-title-float {
position: absolute;
left: 0;
bottom: -20px;
height: 32px;
}
#fancybox-title-float-wrap {
border: none;
border-collapse: collapse;
width: auto;
}
#fancybox-title-float-wrap td {
border: none;
white-space: nowrap;
}
#fancybox-title-float-left {
padding: 0 0 0 15px;
background: url('fancybox.png') -40px -90px no-repeat;
}
#fancybox-title-float-main {
color: #FFF;
line-height: 29px;
font-weight: bold;
padding: 0 0 3px 0;
background: url('fancybox-x.png') 0px -40px;
}
#fancybox-title-float-right {
padding: 0 0 0 15px;
background: url('fancybox.png') -55px -90px no-repeat;
}
/* IE6 */
.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); }
.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); }
.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); }
.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); }
.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); }
.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); }
.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame {
height: expression(this.parentNode.clientHeight + "px");
}
#fancybox-loading.fancybox-ie6 {
position: absolute; margin-top: 0;
top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px');
}
#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); }
/* IE6, IE7, IE8 */
.fancybox-ie .fancybox-bg { background: transparent !important; }
.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); }
.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); }
.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); }
.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); }
.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); }
.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); }
.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); }
.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); }

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Some files were not shown because too many files have changed in this diff Show More