Skip to content

Commit b65d8ed

Browse files
committed
Last fulfill
1 parent e175805 commit b65d8ed

File tree

1,077 files changed

+115374
-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.

1,077 files changed

+115374
-0
lines changed

Diff for: README.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# DataWarehouse Brava Fabrics
2+
3+
Everything is confidential and only serves for Brava Fabrics.
4+
5+
## Getting Started
6+
7+
You'll have to fulfill the access for :
8+
- Google Adwords API keychain_api.php
9+
- Facebook API keychain_api.php
10+
- Database Bravafabrics database keychain.php
11+
- Datawarehouse database keychain.php
12+
13+
## main
14+
The file main.php will be executed by crontab each day at 1 a.m. It will fulfill the database everyday with the CMS datas and send an email.
15+
16+
## main sales product
17+
The file main_sales_product.php will be executed everyday at 1:10 a.m. It will fulfill all the cost.
18+
19+
## recurrency
20+
The file recurrency_compute.php will be executed at the beginning of each month. It will returns the recurrency.

Diff for: ajax/countries_and_zones_get_query.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
include("../queries_database.php");
3+
$countries_info = get_all_countrycode_coming_from_service($_GET['service']);
4+
echo json_encode($countries_info);
5+
?>

Diff for: ajax/gateway_get_query.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
include("../queries_database.php");
3+
$gateway_info = get_all_gateways();
4+
echo json_encode($gateway_info);
5+
?>

Diff for: ajax/gateway_insert_query.php

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
4+
include("../queries_database.php");
5+
6+
7+
$set_local_time = new DateTimeZone("Europe/Madrid"); // Lets Set the timezone (Europe)
8+
$now = new DateTime(date("Y-m-d"), $set_local_time);
9+
$payment_method = (string)$_POST['payment_method'];
10+
$payment_method = str_replace('_', ' ', $payment_method);
11+
$payment_method = str_replace('0', '(', $payment_method);
12+
$payment_method = str_replace('1', ')', $payment_method);
13+
ajax_insert_gateway($now->format("Y-m-d"), $payment_method, $_POST['percentage'], $_POST['fix']);
14+
15+
?>

Diff for: ajax/gateway_update_query.php

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
include("../queries_database.php");
4+
5+
$payment_method = (string)$_POST['payment_method'];
6+
$payment_method = str_replace('_', ' ', $payment_method);
7+
$payment_method = str_replace('0', '(', $payment_method);
8+
$payment_method = str_replace('1', ')', $payment_method);
9+
10+
ajax_update_gateway($_POST['date'], $payment_method, $_POST['percentage'], $_POST['fix']);
11+
12+
13+
?>

Diff for: ajax/handling_get_query.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
include("../queries_database.php");
3+
$hand_info = get_all_handling();
4+
echo json_encode($hand_info);
5+
?>

Diff for: ajax/handling_insert_query.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
4+
include("../queries_database.php");
5+
6+
7+
$set_local_time = new DateTimeZone("Europe/Madrid"); // Lets Set the timezone (Europe)
8+
$now = new DateTime(date("Y-m-d"), $set_local_time);
9+
10+
// function ajax_insert_handling($date, $packaging_cost, $handling_cost, $shipping_materals_cost, $preparation_cost)
11+
ajax_insert_handling($now->format("Y-m-d"), $_POST['packaging_cost'], $_POST['handling_cost'],
12+
$_POST['shipping_materals_cost'], $_POST['preparation_cost']);
13+
14+
?>

Diff for: ajax/handling_update_query.php

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
include("../queries_database.php");
4+
5+
6+
ajax_update_handling($_POST['date'], $_POST['packaging_cost'], $_POST['handling_cost'], $_POST['shipping_materals_cost'], $_POST['preparation_cost']);
7+
8+
9+
?>

Diff for: ajax/marketing_get_query.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
include("../queries_database.php");
3+
$market_info = ajax_get_marketing($_GET['date']);
4+
echo json_encode($market_info);
5+
?>

Diff for: ajax/marketing_insert_query.php

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
4+
include("../queries_database.php");
5+
6+
7+
ajax_insert_marketing($_POST['date'], $_POST['name'], $_POST['country'], $_POST['value']);
8+
9+
10+
// *********** INSERTION DATAWARE HOUSE **//
11+
update_marketing_cost($_POST['date'], $_POST['country'], $_POST['name'], $_POST['value']);
12+
13+
14+
// UPDATE ALL THE COST
15+
16+
recompute_all_the_total($_POST['date'], $_POST['country']);
17+
18+
?>

Diff for: ajax/marketing_update_query.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
include("../queries_database.php");
4+
5+
ajax_update_marketing($_POST['date'], $_POST['country'], $_POST['name'], $_POST['value']);
6+
// *********** INSERTION DATAWARE HOUSE **//
7+
update_marketing_cost($_POST['date'], $_POST['country'], $_POST['name'], $_POST['value']);
8+
9+
10+
// UPDATE ALL THE COST
11+
12+
recompute_all_the_total($_POST['date'], $_POST['country']);
13+
14+
?>

Diff for: ajax/recurrency_get_query.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
include("../queries_database.php");
3+
$recurrencies = ajax_get_recurrency();
4+
echo json_encode($recurrencies);
5+
?>

Diff for: ajax/recurrency_insert_query.php

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
4+
include("../queries_database.php");
5+
6+
7+
ajax_insert_recurrency($_POST['date'], $_POST['recurrency']);
8+
9+
?>

Diff for: ajax/recurrency_update_query.php

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
include("../queries_database.php");
4+
5+
6+
ajax_update_recurrency($_POST['date'], $_POST['recurrency']);
7+
8+
9+
?>

Diff for: ajax/shipping_extra_get_query.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
include("../queries_database.php");
3+
$extra_ship_info = get_all_extra_ship();
4+
echo json_encode($extra_ship_info);
5+
?>

Diff for: ajax/shipping_extra_insert_query.php

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
4+
include("../queries_database.php");
5+
6+
7+
$set_local_time = new DateTimeZone("Europe/Madrid"); // Lets Set the timezone (Europe)
8+
$now = new DateTime(date("Y-m-d"), $set_local_time);
9+
$service = (string)$_POST['service'];
10+
ajax_insert_ship_extra($now->format("Y-m-d"), $service, $_POST['percentage'], $_POST['fix']);
11+
12+
?>

Diff for: ajax/shipping_extra_update_query.php

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
include("../queries_database.php");
4+
5+
$service = (string)$_POST['service'];
6+
$service = str_replace('_', ' ', $service);
7+
$service = str_replace('__', '(', $service);
8+
$service = str_replace('--', ')', $service);
9+
ajax_update_ship_extra($_POST['date'], $service, $_POST['percentage'], $_POST['fix']);
10+
11+
12+
?>

Diff for: ajax/shipping_get_count_weight_query.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
include("../queries_database.php");
3+
$all_infos = get_the_number_of_distinct_weight($_GET['service']);
4+
echo json_encode($all_infos);
5+
?>

Diff for: ajax/shipping_get_query.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
include("../queries_database.php");
3+
$all_infos = get_all_infos_from_shipping_courier($_GET['service']);
4+
echo json_encode($all_infos);
5+
?>

Diff for: ajax/shipping_insert_query.php

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include("../queries_database.php");
3+
ajax_insert_shipping_from_array($_POST['finaleArray'])
4+
?>

Diff for: ajax/zone_get_countrycode.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
include("../prestashop.php");
3+
$countries_info = ajax_get_countrycode();
4+
echo json_encode($countries_info);
5+
?>

Diff for: ajax/zone_get_query.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
include("../queries_database.php");
3+
$zone_info = get_all_zones();
4+
echo json_encode($zone_info);
5+
?>

Diff for: ajax/zone_insert_countrycode.php

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
4+
include("../queries_database.php");
5+
6+
ajax_insert_zone($_POST['country_code'], $_POST['service'], $_POST['zone']);
7+
8+
?>

0 commit comments

Comments
 (0)