Skip to content

Commit 2620b4e

Browse files
committed
update config.php
1 parent be250ac commit 2620b4e

File tree

474 files changed

+77824
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

474 files changed

+77824
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* linguist-vendored
2+
*.php linguist-vendored=false

.github/workflows/php.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: PHP Composer
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Validate composer.json and composer.lock
21+
run: composer validate --strict
22+
23+
- name: Cache Composer packages
24+
id: composer-cache
25+
uses: actions/cache@v3
26+
with:
27+
path: vendor
28+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
29+
restore-keys: |
30+
${{ runner.os }}-php-
31+
32+
- name: Install dependencies
33+
run: composer install --prefer-dist --no-progress
34+
35+
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
36+
# Docs: https://getcomposer.org/doc/articles/scripts.md
37+
38+
# - name: Run test suite
39+
# run: composer run-script test

LICENSE

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Smart Report Engine
2+
Community Edition License
3+
4+
Copyright © 2023 Webuccino inc
5+
https://www.mysqlreports.com
6+
All copyrights reserved.
7+
8+
9+
By downloading the community edition of Smart Report Engine software, you accept the following User Agreement.
10+
11+
12+
## Permitted Use
13+
With this license, you are given non-exclusive, non-transferable rights worldwide to evaluate Smart Report Engine (excluding premium features) for personal use or integration into free open-source projects.
14+
15+
## Restrictions
16+
1. You are prohibited from removing the copyright claims from Smart Report Engine or any of its files.
17+
18+
2. Smart Report Engine community edition is strictly for non-commercial use; therefore, you may not use it in any commercial projects.
19+
20+
3. The usage of Smart Report Engine community edition in SaaS projects is not permitted.
21+
22+
4. Distribution, sale, or any other form of distribution of Smart Report Engine is strictly prohibited.
23+
24+
5. You are not allowed to use Smart Report Engine for any unlawful purposes.
25+
26+
6. Renting, leasing, lending, sublicensing, time-sharing, distributing, selling, or assigning the license to use Smart Report Engine is prohibited.
27+
28+
7. Copying any software codes, files, images, or computer-generated scripts from Smart Report Engine to any other software is not permitted.
29+
30+
8. Modifying, adapting, translating, and reverse engineering Smart Report Engine is strictly prohibited.
31+
32+
## Indemnification
33+
You agree to indemnify and protect Webuccino against any third-party claims, actions, or lawsuits, as well as any associated expenses, liabilities, damages, settlements, or fees that may arise due to your use or misuse of the Software or a violation of any terms in this license agreement.
34+
35+
36+
## Disclaimer of Warranty
37+
The Software is provided on an "as-is" basis, without any expressed or implied warranties, including but not limited to warranties of quality, performance, non-infringement, merchantability, or fitness for a particular purpose. Additionally, Webuccino does not guarantee that the Software or any related services will always be available.
38+
39+
40+
## Limitations of Liability
41+
You assume all risks associated with the installation and use of the Software. In no event shall the authors or copyright holders of the Software be liable for any claims, damages, or other liability arising from, out of, or in connection with the Software. License holders are solely responsible for determining the appropriateness of use and assume all risks associated with its use, including but not limited to the risks of program errors, equipment damage, data or software program loss, or unavailability or interruption of operations.
42+

README.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Smart Report Engine - Community Edition
2+
Smart Report Engine is a user-friendly PHP reporting framework that enables the effortless creation of professional reports programmatically within your projects.
3+
4+
[![Watch the video](https://mysqlreports.com/video.png)](https://www.youtube.com/embed/ZLa24Eo5gmE)
5+
6+
## Getting started
7+
1- You have the option to either clone the community edition of Smart Report Engine or download it directly from [this download page](https://mysqlreports.com/engine/documentation/index.php?post=community_install)
8+
9+
2- After downloading, extract the compressed folder to reveal the structure of SmartReportEngine. The contents will resemble something similar to the following:
10+
11+
```sh
12+
├── SmartReportingEngine/
13+
├── sre_config/
14+
└── config.php
15+
├── sre_reports/
16+
├── db/
17+
└── example.sql
18+
├── examples/
19+
└── sre_bootstrap.php
20+
```
21+
22+
3- To initiate your first project on your server, you need to import a sample MySQL database. This process will enable you to get started with Smart Report Engine smoothly.
23+
- Inside the downloaded package of Smart Report Engine, locate the "/db/example.sql" file in the "db" directory. This SQL file contains the necessary commands to create and populate a single MySQL table named 'items'
24+
- Select the MySQL database for your first project setup. You can opt for an existing database or create a new one specifically for this project.
25+
- Import the "example.sql" file into your chosen MySQL database. This will create the "items" table and populate it with initial data.
26+
27+
4- Configure the database Connection String
28+
- Navigate to the "sre_config" directory within the Smart Report Engine Community Edition package. There, you will find the "config.php" file. Please open this file using any text editor you prefer.
29+
- In the "config.php" file, you will find a section dedicated to database configuration. Update the connection string with the appropriate details of the MySQL database where you imported the example SQL file during the 3rd step. Make sure to provide the correct hostname, database name, username, and password in their respective fields.
30+
31+
5- Save the changes to the "config.php" file.
32+
33+
6- In the Community Edition's "/examples" directory, you'll find three helpful examples to get you started with Smart Report Engine. To execute any of these examples, just access their URLs from your web browser. This will enable you to view the generated report based on the code in each example.
34+
35+
7- Should you prefer to build the example projects from scratch, kindly proceed with step 8 in the installation process.
36+
> **_NOTE:_** Regardless of your choice, the code walkthrough sections will provide explanations for the code in each example.
37+
38+
8- To begin writing your first project, you'll require a new PHP script. For the purpose of this tutorial, you can add the script to the root directory of the community edition, alongside the "sre_bootstrap.php" file. If you manually downloaded the community edition (without using Composer), you'll need to require the "sre_bootstrap.php" autoload filein your code, as demonstrated in the example below. In case your code is placed in different locations for other projects, ensure that you adjust the path to this autoload file accordingly. Please follow these steps to get started with your project:
39+
- Create a new PHP script for your project.
40+
- Optionally, place the script in the root directory of the community edition (same level as "sre_bootstrap.php") for this tutorial's purpose.
41+
- In your first new project, try writing the following simple PHP code. It should work without any issues.
42+
```sh
43+
use SRE\Engine\CustomEngine;
44+
use SRE\Engine\ReportOptions;
45+
46+
require_once "sre_bootstrap.php";
47+
48+
try {
49+
50+
$report = new ReportOptions();
51+
$report->select_tables("items")
52+
->set_grouping("country")
53+
->set_title("Items Per country")
54+
->select_all_fields();
55+
$engine = new CustomEngine($report);
56+
$report_path = $engine->create_report();
57+
if ($report_path) {
58+
// The user will be redirected to the URL of the generated report. All generated reports are stored as subdirectories under /sre_reports.
59+
header("location: ".$report_path);
60+
exit();
61+
}
62+
} catch (Exception $e) {
63+
echo $e->getMessage();
64+
}
65+
```
66+
67+
[Generate This Report](https://mysqlreports.com/engine/sre-community/sre_reports/rep1691646585168400/rep1691646585168400.php)
68+
69+
70+
71+
## Code Walkthrough: Understanding the Example
72+
The given code demonstrates a basic example of using Smart Report Engine effectively. Let's walk through the code step by step to understand how it functions:
73+
- **Namespaces:** The given code utilizes two namespaces, "SRE\Engine\CustomEngine" and "SRE\Engine\ReportOptions." These namespaces help organize and access specific parts of the code.
74+
- **Requiring "sre_bootstrap.php":** If you manually downloaded the community edition (without using Composer), you need to add a special file called "sre_bootstrap.php" to your code.
75+
- **Creating the ReportOptions Object:** The code initializes an object from the "ReportOptions" class. This object is responsible for defining the options needed for your report. You can customize various options, keeping in mind that [some features are exclusive to the commercial edition.](https://mysqlreports.com/engine/documentation/index.php?post=community)
76+
- **Passing ReportOptions Object to CustomEngine:** Once you have set your report options, you pass the "ReportOptions" object to the constructor of the "CustomEngine" class. This class handles the creation of your report based on the provided options.
77+
- **Calling CreateReport Function:** To generate your report, you call the "CreateReport" function using the "CustomEngine" object. This function processes the defined options and generates the report. Upon successful creation, it returns the URL of the report. All the reports generated using Smart Report Engine will be automatically saved in the "sre_reports" directory.
78+
79+
## Important links
80+
- [More Examples](https://mysqlreports.com/engine/documentation/index.php?post=community_install)
81+
- [Detailed license comparison](http://mysqlreports.com/engine/index.php?post=community)
82+
To help you better understand the distinctions between the community and commercial editions, we have provided a concise overview in [this page](http://mysqlreports.com/engine/index.php?post=community). It highlights the key differences in features and use cases for each version.
83+
- [Smart Report Engine Troubleshooting](http://mysqlreports.com/engine/documentation/index.php?post=troubleshooting)
84+
The purpose of this section in the documentation is to guide users through essential checkpoints to consider when encountering any issues during the report generation process with Smart Report Engine. Additionally, we will explore Smart Report Engine's logging feature, which assists in troubleshooting potential problems that may arise in the generated reports.
85+
- [Smart Report Engine documentation](https://mysqlreports.com/engine/documentation/index.php?class=reportoptions)
86+
In this section, you will discover comprehensive documentation and examples for each built-in class, method, and constant of Smart Report Engine.
87+
- [What's new](https://mysqlreports.com/engine/documentation/index.php?post=new)
88+
This section will encompass the latest features introduced in Smart Report Engine.
89+
- [Home Page of Smart Report Engine](https://mysqlreports.com/mysql-reporting-tools/smart-report-engine/)
90+
- [Contact Us](https://mysqlreports.com/open-ticket/)
91+
92+
## Community Edition license
93+
##### The Community Edition permits you to:
94+
- Experiment with Smart Report Engine (Non-Premium features only).
95+
- Freely utilize Smart Report Engine for personal use.
96+
- Freely integrate Smart Report Engine into free open-source projects as long as you keep our copyright claims.
97+
##### The Community Edition restricts you from:
98+
- Accessing Premium features.
99+
- Integrating Smart Report Engine into commercial or SaaS projects.
100+
- Removing the "Powered by" claim from reports generated by the community edition of Smart Report Maker.
101+
> **_NOTE:_** By using any of our [commercial editions](http://mysqlreports.com/engine/documentation/index.php?post=community), you are granted access to all premium features, as well as the removal of all community restrictions mentioned above.
102+

SmartReportingEngine/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{\rtf1}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?php
2+
/**
3+
* Smart Report Engine
4+
* Community Edition
5+
* Author : Webuccino
6+
* All copyrights are preserved to Webuccino
7+
* URL : https://mysqlreports.com/
8+
*
9+
*/
10+
define ( "DIRECTACESS", "true" );
11+
ob_start();
12+
require_once ("request.php");
13+
/*
14+
* #################################################################################################
15+
* hANDLING SUPER GLOBALS
16+
* ################################################################################################
17+
*/
18+
$_CLEANED = remove_unexpected_superglobals($_GET, array("setStyle"));
19+
$_GET = array ();
20+
$_POST = array ();
21+
$_REQUEST = array ();
22+
$_ENV = array ();
23+
$_FILES = array ();
24+
$_COOKIE = array ();
25+
$report_url = basename ( __DIR__ );
26+
$report_url .= ".php";
27+
if(!file_exists($report_url)){
28+
$report_url = $file_name . ".php" ;
29+
}
30+
if(!isset($_CLEANED["RequestToken"]) || $_CLEANED["RequestToken"] != $_SESSION[$request_token]){
31+
ob_end_clean( );
32+
header ( "location: " . $report_url );
33+
exit ();
34+
}
35+
36+
/*
37+
* #################################################################################################
38+
* Changing the style
39+
* ################################################################################################
40+
*/
41+
$all_styles = array (
42+
"blue",
43+
"grey",
44+
"default"
45+
);
46+
$posted_style = isset ( $_CLEANED ["setStyle"] ) ? $_CLEANED ["setStyle"] : "";
47+
$posted_style_key = array_search ( strtolower ( $posted_style ), $all_styles );
48+
$keys = array (
49+
0,
50+
1,
51+
2
52+
);
53+
if (in_array ( $posted_style_key, $keys )) {
54+
$_SESSION ["change_style_srm7"] = $all_styles [$posted_style_key];
55+
}
56+
ob_end_clean();
57+
header ( "location: " . $report_url );
58+
exit ();
59+
?>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?php
2+
/**
3+
* Smart Report Engine
4+
* Community Edition
5+
* Author : Webuccino
6+
* All copyrights are preserved to Webuccino
7+
* URL : https://mysqlreports.com/
8+
*
9+
*/
10+
define ( "DIRECTACESS", "true" );
11+
ob_start();
12+
require_once 'request.php';
13+
// valid only for mobile views
14+
if (strtolower($layout) != "mobile") {
15+
ob_end_clean();
16+
header ( 'Location: ' . $file_name . '.php' );
17+
exit();
18+
}
19+
//case mobile layout displayed in a mobile or tablet screen
20+
if (isset ( $detect )) {
21+
if ($detect->isMobile () || $detect->isTablet ()) {
22+
ob_end_clean();
23+
header ( 'Location: ' . $file_name . '.php' );
24+
exit();
25+
}
26+
}
27+
28+
$mobile_report_url = $file_name . '.php';
29+
if ($_SERVER ['QUERY_STRING'] !== "") {
30+
$mobile_report_url = $mobile_report_url . "?" . $_SERVER ['QUERY_STRING'];
31+
}
32+
ob_end_flush();
33+
?>
34+
35+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
36+
<html xmlns="http://www.w3.org/1999/xhtml">
37+
<head>
38+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
39+
<title><?php echo $title ?> - Tablet View </title>
40+
<style type="text/css">
41+
.ipad {
42+
background-image: url(../shared/images/icons/ipad-emulator.jpg);
43+
background-repeat: no-repeat;
44+
height: 727px;
45+
width: 800px;
46+
margin-right: auto;
47+
margin-bottom: 10px;
48+
margin-left: auto;
49+
}
50+
</style>
51+
</head>
52+
53+
<body>
54+
<div
55+
style="text-align: center; position: absolute; width: 200px; margin: 0px auto;">
56+
<a title="<?php echo $Mobile_view_language;?>" href="Mobile.php"><img
57+
border="0" src="../shared/images/icons/view_mobile.png" /></a>
58+
</div>
59+
<div class="ipad">
60+
<iframe src="<?php echo $mobile_report_url; ?>" frameborder="0" width="582" height="423"
61+
style="background-color: #FFF; margin-left: 108px; margin-top: 157px;"></iframe>
62+
63+
</div>
64+
65+
</body>
66+
</html>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
3+
/**
4+
* Smart Report Engine
5+
* Community Edition
6+
* Author : Webuccino
7+
* All copyrights are preserved to Webuccino
8+
* URL : https://mysqlreports.com/
9+
*
10+
*/
11+
if (!defined("DIRECTACESS"))
12+
exit("No direct script access allowed");
13+
14+
require_once ("../shared/helpers/Model/search.php");
15+
require_once ("../shared/helpers/Model/Report.php");
16+
require_once ("../shared/helpers/Model/TableReport.php");
17+
require_once ("../shared/helpers/functions.php");
18+
require_once ("../shared/helpers/celltypes.php");
19+
require_once ("../shared/helpers/lib.php");
20+
require_once ("../shared/helpers/export.php");
21+
22+
23+
/*
24+
* #################################################################################################
25+
* Creating the Report Sql
26+
* ################################################################################################
27+
*/
28+
29+
30+
$sql = Prepare_TSql();
31+
32+
if ($empty_search_parameters || $possible_attack) {
33+
// case user send empty search keywords or entered the $Enter_your_search_lang in the search box
34+
35+
$all_records = array();
36+
$nRecords = 0;
37+
$empty_Report = true;
38+
$numberOfPages = 1;
39+
$records_per_page = 10;
40+
} else {
41+
42+
$all_records = query($sql [0], "LayOut : Prepare SQL", $sql [1], $sql [2]);
43+
44+
$nRecords = (is_array($all_records)) ? count($all_records) : 0;
45+
if ($records_per_page == 0) {
46+
$records_per_page = 10;
47+
}
48+
49+
$numberOfPages = ceil($nRecords / $records_per_page);
50+
if ($numberOfPages == 0 || $nRecords == 0) {
51+
$empty_Report = true;
52+
$numberOfPages = 1;
53+
} else {
54+
$empty_Report = false;
55+
}
56+
}
57+
$levels = count($group_by);

0 commit comments

Comments
 (0)