Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 644eec0e84 | |||
| 851ca86cb7 | |||
| a01e857b72 | |||
| 1363060c07 | |||
| c781458763 | |||
| aa60d39522 | |||
| 3ddc3bbd00 | |||
| f2a0b27418 | |||
| b638c63812 | |||
| 71c6f90685 | |||
| d667905f07 | |||
| 3ef1d29081 | |||
| 03604e29ff | |||
| 722db3bb55 | |||
| d5eb5b2f86 | |||
| ff5ca40f3f | |||
| 65b4ec05b9 | |||
| 188e40fda4 | |||
| 0b1af02535 | |||
| d277462d40 | |||
| 7f7678737c | |||
| 46aef95e61 | |||
| 1b8dbdf0b6 | |||
| 4409b75edf | |||
| 5652cbf9d1 | |||
| b630d2fb4e | |||
| bac003c30d | |||
| 58ac0b9e91 | |||
| 73eb2761c6 | |||
| 1e9df9ce55 |
+1
-2
@@ -5,5 +5,4 @@
|
||||
/volume/*
|
||||
!/volume/www
|
||||
/volume/www/**/conf/nginx.conf
|
||||
/backup
|
||||
/conf/env/*.env
|
||||
/backup
|
||||
@@ -3,8 +3,6 @@ version: '3'
|
||||
services:
|
||||
|
||||
nginx:
|
||||
ports:
|
||||
- "8080:80"
|
||||
volumes:
|
||||
- ../volume/www:/home/www:cached
|
||||
restart: "no"
|
||||
|
||||
@@ -9,6 +9,8 @@ services:
|
||||
build: build/nginx
|
||||
container_name: ${CLIENT}.nginx.${ENV}
|
||||
hostname: nginx
|
||||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- ../volume/nginx/etc.nginx.sites-enabled:/etc/nginx/sites-enabled
|
||||
- ../volume/www:/home/www
|
||||
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
POSTGRES_DB=database
|
||||
POSTGRES_USER=user
|
||||
POSTGRES_PASSWORD=edcl56
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
MYSQL_ROOT_PASSWORD=n1O060}8S<()+G;X
|
||||
MYSQL_DATABASE=db
|
||||
MYSQL_USER=dbuser
|
||||
MYSQL_PASSWORD=|;YR1,rf-E}ICoh5
|
||||
@@ -6,21 +6,6 @@ upstream store_php {
|
||||
server tt-website.store-php.prod:9000;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name static.talentstube.com;
|
||||
|
||||
index index.html;
|
||||
root /home/www/www.talentstube.com/www/web/uploads/;
|
||||
|
||||
access_log /home/www/website/log/access.log vhosts;
|
||||
error_log /home/www/website/log/error.log;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
|
||||
listen 80;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
define('_DB_SERVER_', 'tt-website.store-php.prod');
|
||||
define('_DB_NAME_', 'database');
|
||||
define('_DB_USER_', 'user');
|
||||
define('_DB_PASSWD_', 'O}lk|45&J,kT+DDM{uk[');
|
||||
define('_DB_PASSWD_', '|;YR1,rf-E}ICoh5');
|
||||
define('_DB_PREFIX_', '');
|
||||
define('_MYSQL_ENGINE_', 'InnoDB');
|
||||
define('_PS_CACHING_SYSTEM_', 'CacheFs');
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<a href="{{ path('company_show',{'alias': ad.company.alias }) }}" title="{{ ad.company.brandName }}" class="btn btn-default btn-small-grey">
|
||||
Découvrir l'employeur
|
||||
Découvir l'employeur
|
||||
</a>
|
||||
<p class="profil-name">
|
||||
<a href="{{ path('company_show',{'alias': company.alias }) }}" title="{{ company.brandName }}">
|
||||
|
||||
@@ -16,37 +16,43 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="col s3">
|
||||
<div class="col s5">
|
||||
<h5 class="blue-text no-margin-top">Volumes des visites</h5>
|
||||
</div>
|
||||
<div class="col s9 choiceMonthWrapper right-align">
|
||||
{% set thisYear = "now"|date("Y") %}
|
||||
{% set thisMonth = "now"|date("m") %}
|
||||
{% set thisDay = "now"|date("d") %}
|
||||
{% set dateTextMoins = "now -1 Month"|date("d-m-Y") %}
|
||||
{% set dateText = "now"|date("d-m-Y") %}
|
||||
<input id="choiceMonth" type="text" name="daterange" value="{{ dateTextMoins }} au {{ dateText }}" />
|
||||
<i class="fa fa-refresh fa-spin fa-fw"></i>
|
||||
<span class="sr-only">Loading...</span>
|
||||
<div class="col s2 choiceMonthWrapper right-align">
|
||||
<select id="choiceMonth">
|
||||
{% set thisYear = "now"|date("Y") %}
|
||||
{% set thisMonth = "now"|date("m") %}
|
||||
{% for month in 1..thisMonth %}
|
||||
{% set date = month ~ "/01/" ~ thisYear %}
|
||||
<option {% if loop.last %}selected{% endif %} value="{{ date|date("m") }}">{{ date|datetime('%B') }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col s5 right-align">
|
||||
{% set totalAds = 0 %}
|
||||
{% if arrayByAds is defined %}
|
||||
{% for record in arrayByAds %}
|
||||
{% set totalAds = totalAds + record.count %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<span class="btn-countVisitsAds">{{ totalAds }} visites</span>
|
||||
<span class="btn-countVisitsCompany">{{ totalRecordsCompany }} visites</span>
|
||||
</div>
|
||||
<div class="col s12">
|
||||
<canvas id="nb_visits" width="600" height="300"></canvas>
|
||||
</div>
|
||||
<div class="col s6 countLegend">
|
||||
<div class="col s12">
|
||||
<p><span class="btn-countVisitsAds"> </span>Nombre de visites d'annonces rattachées à votre territoire</p>
|
||||
<p><span class="btn-countVisitsCompany"> </span>Nombre de visites de votre page territoire</p>
|
||||
</div>
|
||||
<div class="col s6 countBlock">
|
||||
<span class="btn-countVisitsAds"><span class="countVisitsAds"></span> visites</span>
|
||||
<span class="btn-countVisitsCompany"><span class="countVisitsCompany"></span> visites</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="donutChart-wrapper" class="row bg-bordered p-20">
|
||||
<div class="col s6">
|
||||
<h5 class="blue-text no-margin-top">Répartition des visites</h5>
|
||||
<canvas id="donught_visits" width="300" height="300"></canvas>
|
||||
</div>
|
||||
<div class="col s6 donutLegend countLegend">
|
||||
<div class="col s6 donutLegend">
|
||||
<p><span class="btn-count btn-countVisitsTalentByCompany"> </span>Visites de talents</p>
|
||||
<p><span class="btn-count btn-countVisitsCompanyByCompany"> </span>Visites d'entreprises</p>
|
||||
<p><span class="btn-count btn-countVisitsAnonymByCompany"> </span>Visites d'internautes non-inscrits</p>
|
||||
@@ -55,123 +61,61 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
<script src="{{ asset('/js/vendors/Chart.bundle.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
var currentMonth = '{{ "now"|date("m") }}';
|
||||
var arrayRecords;
|
||||
var ctx,myChart,arrayCurrentsLabel,arrayCurrentsAdsValues,arrayCurrentsCompanyValues,donughtRecords;
|
||||
var sumVisitsAds = 0;
|
||||
var sumCompanyValues = 0;
|
||||
function loadChartData() {
|
||||
{{ parent() }}
|
||||
<script src="{{ asset('/js/vendors/Chart.bundle.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
$('#choiceMonth').on('change',function(){
|
||||
currentMonth = $(this).val();
|
||||
setArrayValues();
|
||||
dataLine.labels = arrayCurrentsLabel;
|
||||
dataLine.datasets[0].data = arrayCurrentsAdsValues;
|
||||
dataLine.datasets[1].data = arrayCurrentsCompanyValues;
|
||||
myChart.update();
|
||||
});
|
||||
|
||||
var currentMonth = '{{ "now"|date("m") }}';
|
||||
var arrayRecords = JSON.parse('{{ lineRecords|json_encode()|raw }}');
|
||||
var arrayCurrentsLabel,arrayCurrentsAdsValues,arrayCurrentsCompanyValues;
|
||||
setArrayValues();
|
||||
myChart.update();
|
||||
myDoughnutChart.update();
|
||||
}
|
||||
|
||||
function getChartData(date1,date2) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '{{ path("territory_ajax_dashboard") }}',
|
||||
data: 'date1='+date1+'&date2='+date2,
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
arrayRecords = data.lineRecords;
|
||||
donughtRecords = data.donughtRecords;
|
||||
myDoughnutChart.data.datasets[0].data = donughtRecords;
|
||||
loadChartData();
|
||||
$('.fa-refresh').hide();
|
||||
},
|
||||
error: function (data) {
|
||||
$('.fa-refresh').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
$('.fa-refresh').hide();
|
||||
getChartData(0, 0);
|
||||
configDatePicker = {
|
||||
applyBtnClass: 'btn btn-default',
|
||||
format: 'DD-MM-YYYY',
|
||||
separator: ' au ',
|
||||
endDate: new Date(),
|
||||
maxDays: 365
|
||||
}
|
||||
$('#choiceMonth').dateRangePicker(configDatePicker).bind('datepicker-apply',function(event,obj) {
|
||||
$('.fa-refresh').show();
|
||||
var month1 = obj.date1.getMonth();
|
||||
var day1 = obj.date1.getDate();
|
||||
var year1 = obj.date1.getUTCFullYear();
|
||||
var month2 = obj.date2.getMonth();
|
||||
var day2 = obj.date2.getDate();
|
||||
var year2 = obj.date2.getUTCFullYear();
|
||||
var date1 = (month1 + 1) + "/" + day1 + "/" + year1 +" 00:00:00";
|
||||
var date2 = (month2 + 1) +"/" + day2 + "/" + year2 +" 23:59:59";
|
||||
getChartData(date1, date2);
|
||||
});
|
||||
$('.apply-btn').attr('value','Valider');
|
||||
});
|
||||
|
||||
function setArrayValues(){
|
||||
arrayCurrentsLabel = [];
|
||||
arrayCurrentsAdsValues = [];
|
||||
arrayCurrentsCompanyValues = [];
|
||||
arrayRecords['labels'].forEach(function(element, index) {
|
||||
var date = element.split("-");
|
||||
var dateAffiche = date[2]+"-"+date[1]+"-"+date[0];
|
||||
arrayCurrentsLabel.push(dateAffiche);
|
||||
arrayCurrentsAdsValues.push(arrayRecords['datasetsAd'][index]);
|
||||
arrayCurrentsCompanyValues.push(arrayRecords['datasetsCompany'][index]);
|
||||
});
|
||||
myChart.data.labels = arrayCurrentsLabel;
|
||||
myChart.data.datasets[0].data = arrayCurrentsAdsValues;
|
||||
myChart.data.datasets[1].data = arrayCurrentsCompanyValues;
|
||||
|
||||
if (arrayCurrentsAdsValues.length > 0) {
|
||||
sumVisitsAds = arrayCurrentsAdsValues.reduce(function(memo, val) {
|
||||
let value = val || 0;
|
||||
if (value != null) {
|
||||
return memo + value;
|
||||
function setArrayValues(){
|
||||
arrayCurrentsLabel = [];
|
||||
arrayCurrentsAdsValues = [];
|
||||
arrayCurrentsCompanyValues = [];
|
||||
arrayRecords['labels'].forEach(function(element, index) {
|
||||
var date = element.split("-");
|
||||
if(date[1] == currentMonth){
|
||||
var dateAffiche = date[2]+"-"+date[1]+"-"+date[0];
|
||||
arrayCurrentsLabel.push(dateAffiche);
|
||||
arrayCurrentsAdsValues.push(arrayRecords['datasetsAd'][index]);
|
||||
arrayCurrentsCompanyValues.push(arrayRecords['datasetsCompany'][index]);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
sumVisitsAds = 0;
|
||||
}
|
||||
if (arrayCurrentsCompanyValues.length > 0) {
|
||||
sumCompanyValues = arrayCurrentsCompanyValues.reduce(function(memo, val) {
|
||||
let value = val || 0;
|
||||
if (value != null) {
|
||||
return memo + value;
|
||||
|
||||
var dataLine = {
|
||||
labels: arrayCurrentsLabel,
|
||||
datasets: [
|
||||
{
|
||||
label: "Nombre de visite d'annonce par jour",
|
||||
fill: false,
|
||||
fontColor: "rgba(39,139,231,1)",
|
||||
backgroundColor: "rgba(39,139,231,1)",
|
||||
borderColor: "rgba(39,139,231,1)",
|
||||
data: arrayCurrentsAdsValues
|
||||
}, {
|
||||
label: "Nombre de visite de votre page entreprise",
|
||||
fill: false,
|
||||
fontColor: "#F9C339",
|
||||
backgroundColor: "#F9C339",
|
||||
borderColor: "#F9C339",
|
||||
data: arrayCurrentsCompanyValues
|
||||
}
|
||||
});
|
||||
} else {
|
||||
sumCompanyValues = 0;
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
$('.countVisitsAds').html(sumVisitsAds);
|
||||
$('.countVisitsCompany').html(sumCompanyValues);
|
||||
}
|
||||
|
||||
var dataLine = {
|
||||
datasets: [
|
||||
{
|
||||
label: "Nombre de visite d'annonce par jour",
|
||||
fill: false,
|
||||
fontColor: "rgba(39,139,231,1)",
|
||||
backgroundColor: "rgba(39,139,231,1)",
|
||||
borderColor: "rgba(39,139,231,1)"
|
||||
}, {
|
||||
label: "Nombre de visite de votre page entreprise",
|
||||
fill: false,
|
||||
fontColor: "#F9C339",
|
||||
backgroundColor: "#F9C339",
|
||||
borderColor: "#F9C339"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
var ctx = document.getElementById("nb_visits");
|
||||
var ctx = document.getElementById("nb_visits");
|
||||
var myChart = new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: dataLine,
|
||||
@@ -181,58 +125,59 @@
|
||||
},
|
||||
scales: {
|
||||
xAxes: [{
|
||||
display: true,
|
||||
scaleLabel: {
|
||||
display: true,
|
||||
labelString: 'Date'
|
||||
}
|
||||
display: true,
|
||||
scaleLabel: {
|
||||
display: true,
|
||||
labelString: 'Date'
|
||||
}
|
||||
}],
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
min: 0
|
||||
},
|
||||
scaleLabel: {
|
||||
display: true,
|
||||
labelString: 'Valeur'
|
||||
}
|
||||
}]
|
||||
scaleLabel: {
|
||||
display: true,
|
||||
labelString: 'Valeur'
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var dataDonught = {
|
||||
labels: [
|
||||
"Visites de talents",
|
||||
"Visites d'entreprises",
|
||||
"Visites d'internautes non inscrit"
|
||||
],
|
||||
datasets: [
|
||||
{
|
||||
data: donughtRecords,
|
||||
backgroundColor: [
|
||||
"#FF6384",
|
||||
"#36A2EB",
|
||||
"#FFCE56"
|
||||
],
|
||||
hoverBackgroundColor: [
|
||||
"#FF6384",
|
||||
"#36A2EB",
|
||||
"#FFCE56"
|
||||
]
|
||||
}]
|
||||
};
|
||||
var ctxDonught = document.getElementById("donught_visits");
|
||||
var myDoughnutChart = new Chart(ctxDonught, {
|
||||
type: 'doughnut',
|
||||
data: dataDonught,
|
||||
options: {
|
||||
legend: {
|
||||
display: false,
|
||||
},
|
||||
animation: {
|
||||
animateScale: true
|
||||
var dataDonught = {
|
||||
labels: [
|
||||
"Visites de talents",
|
||||
"Visites d'entreprises",
|
||||
"Visites d'internautes non inscrit"
|
||||
],
|
||||
datasets: [
|
||||
{
|
||||
data: {{ donughtRecords|json_encode() }},
|
||||
backgroundColor: [
|
||||
"#FF6384",
|
||||
"#36A2EB",
|
||||
"#FFCE56"
|
||||
],
|
||||
hoverBackgroundColor: [
|
||||
"#FF6384",
|
||||
"#36A2EB",
|
||||
"#FFCE56"
|
||||
]
|
||||
}]
|
||||
};
|
||||
var ctxDonught = document.getElementById("donught_visits");
|
||||
var myDoughnutChart = new Chart(ctxDonught, {
|
||||
type: 'doughnut',
|
||||
data: dataDonught,
|
||||
options: {
|
||||
legend: {
|
||||
display: false,
|
||||
},
|
||||
animation: {
|
||||
animateScale: true
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -23,39 +23,15 @@ class TerritoryController extends Controller
|
||||
{
|
||||
setlocale(LC_ALL, 'fr_FR.utf-8');
|
||||
$stats = $this->get("app.stats_manager");
|
||||
$records = $stats->getTerritoryDashboard($this->getUser()->getCompany()->getId(), null);
|
||||
$records = $stats->getTerritoryDashboard($this->getUser()->getCompany()->getId());
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
return $this->render('territory/dashboard.html.twig', [
|
||||
"arrayByAds" => $records['arrayByAds']
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/territoire/me/ajax/dashboard", name="territory_ajax_dashboard")
|
||||
*/
|
||||
public function territoryAjaxDashboardAction(Request $request)
|
||||
{
|
||||
$stats = $this->get("app.stats_manager");
|
||||
if( ($request->request->get('date1') != 0) && ($request->request->get('date2') != 0) ) {
|
||||
$dateBegin = new \DateTime();
|
||||
$dateEnd = new \DateTime();
|
||||
$dateBegin->setTimestamp(strtotime($request->request->get('date1')));
|
||||
$dateEnd->setTimestamp(strtotime($request->request->get('date2')));
|
||||
$arrayDate['dateBegin'] = $dateBegin;
|
||||
$arrayDate['dateEnd'] = $dateEnd;
|
||||
} else {
|
||||
$arrayDate['dateBegin'] = new \DateTime('now -1 Month');
|
||||
$arrayDate['dateEnd'] = new \DateTime('now');
|
||||
}
|
||||
$records = $stats->getTerritoryDashboard($this->getUser()->getCompany()->getId(), $arrayDate);
|
||||
|
||||
return new JsonResponse([
|
||||
"lineRecords" => $records['lineRecords'],
|
||||
"donughtRecords" => $records['donughtRecords'],
|
||||
"totalRecords" => $records['totalRecords'],
|
||||
"totalRecordsCompany" => $records['totalRecordsCompany'],
|
||||
"arrayByAds" => $records['arrayByAds'],
|
||||
"arrayByAds" => $records['arrayByAds']
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class StatsManager
|
||||
* @param $idCompany
|
||||
* @return array
|
||||
*/
|
||||
public function getTerritoryDashboard($idCompany, $dateArray)
|
||||
public function getTerritoryDashboard($idCompany)
|
||||
{
|
||||
$arrByAd = array();
|
||||
$arrDatasetsAd = array();
|
||||
@@ -52,7 +52,7 @@ class StatsManager
|
||||
$ad = $territoryAd->getAd();
|
||||
if($ad) {
|
||||
$arrByAd[$ad->getId()]['count'] = 0;
|
||||
$recordAd = $this->history->recordShow(null, "r", 'AppBundle\Entity\Ad', $ad->getId(), 0, $dateArray);
|
||||
$recordAd = $this->history->recordShow(null, "r", 'AppBundle\Entity\Ad', $ad->getId(), 0);
|
||||
foreach ($recordAd as $record) {
|
||||
if ($record->getUserId() == 0) {
|
||||
$nbVisitAnonym = $nbVisitAnonym + 1;
|
||||
@@ -93,7 +93,7 @@ class StatsManager
|
||||
}
|
||||
}
|
||||
|
||||
$recordCompany = $this->history->recordShow(null, "r", 'AppBundle\Entity\Company', $idCompany, 0, $dateArray);
|
||||
$recordCompany = $this->history->recordShow(null, "r", 'AppBundle\Entity\Company', $idCompany, 0);
|
||||
$nbVisitTalentByCompany = 0;
|
||||
$nbVisitCompanyByCompany = 0;
|
||||
$nbVisitAnonymByCompany = 0;
|
||||
@@ -117,9 +117,6 @@ class StatsManager
|
||||
|
||||
$date = $record->getCtime();
|
||||
$stringDate = $date->format('Y-m-d');
|
||||
if(!isset($arrayRecords['ad'][$stringDate][$idCompany])){
|
||||
$arrayRecords['ad'][$stringDate][$idCompany] = 0;
|
||||
}
|
||||
if (!isset($arrayRecords['company'][$stringDate][$idCompany])) {
|
||||
$arrayRecords['company'][$stringDate][$idCompany] = 1;
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{% extends 'company/base_dashboard_company.html.twig' %}
|
||||
|
||||
{% block title %}{{ 'profile.company.title'|trans }}{% endblock %}
|
||||
|
||||
{% block dashContent %}
|
||||
{% include 'default/flash_message.html.twig' %}
|
||||
<div class="row bg-bordered p-20">
|
||||
{#<h1 class="alttitle">{{ 'profile.company.title'|trans }}</h1>#}
|
||||
{{ form_start(form, { 'action': path('company_profile'), 'attr': { 'class': 'fos_user_profile_edit' } }) }}
|
||||
{{ form_widget(form) }}
|
||||
<br/>
|
||||
<input class="btn btn-default" type="submit" value="{{ 'profile.edit.submit'|trans }}"/>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user