268 lines
18 KiB
PHP
268 lines
18 KiB
PHP
<?php
|
|
|
|
|
|
|
|
require_once 'include/utils/utils.php';
|
|
|
|
require_once 'includes/Loader.php';
|
|
|
|
vimport ('includes.runtime.EntryPoint');
|
|
|
|
require_once 'SUtiles.php';
|
|
|
|
@session_start();
|
|
|
|
global $adb;
|
|
|
|
|
|
|
|
|
|
|
|
$current_user = Users_Record_Model::getCurrentUserModel();
|
|
|
|
$roleid = $current_user->get('roleid');
|
|
|
|
|
|
|
|
$viewer = new Vtiger_Viewer();
|
|
|
|
$viewer->assign('MODULE', 'Products');
|
|
|
|
$viewer->assign('SELECTED_MENU_CATEGORY', 'INVENTORY');
|
|
|
|
$viewer->assign('COMPANY_LOGO', Vtiger_CompanyDetails_Model::getInstanceById()->getLogo());
|
|
|
|
$viewer->assign('COMPANY_DETAILS_SETTINGS',new Settings_Vtiger_CompanyDetails_Model());
|
|
|
|
$viewer->assign('USER_MODEL', $current_user);
|
|
|
|
$viewer->assign('CURRENT_USER_MODEL', $current_user);
|
|
|
|
$viewer->assign('PAGETITLE','liste Questionnaires');
|
|
|
|
$viewer->view('CustomDashboard.tpl');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function result($formulaire){
|
|
|
|
|
|
|
|
echo '
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<form action="?module=QuestionnaireEdit&view=QuestionnaireEdit&IDproduit='.$_GET['IDproduit'].'" method="post"><input type="hidden" class="rowNumber" name="idFormulaire" value='.$formulaire['id_formulaire'].'>
|
|
|
|
<button type="submit" name="submit" style="border:none; background:none;"><i class="fa fa-edit deleteRow cursorPointer" title="Edit"></i></button></form>
|
|
|
|
</td>
|
|
|
|
<td>'.$formulaire['nom_formulaire'].'</td>
|
|
|
|
<td>'.$formulaire['date_debut'].'</td>
|
|
|
|
<td>'.$formulaire['date_fin'].'</td>
|
|
|
|
<td>'.getProduitName($_GET['IDproduit']).'</td>
|
|
|
|
<td>'.$formulaire['specialite'].'</td>
|
|
|
|
|
|
|
|
</tr> ';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getFormulaire(){
|
|
|
|
global $adb;
|
|
|
|
|
|
|
|
if(!empty($_GET['IDproduit'])){
|
|
|
|
$query = "SELECT * FROM `formulaire` where id_produit = '".$_GET['IDproduit']."'";
|
|
|
|
}else{
|
|
|
|
$query = "SELECT * FROM `formulaire` where id_produit = 0 ";
|
|
|
|
}
|
|
|
|
|
|
|
|
$sql_get_result = $adb->query($query);
|
|
|
|
$formulaire= array();
|
|
|
|
|
|
|
|
while ($recordinfo = $adb->fetch_array($sql_get_result)) {
|
|
|
|
$formulaire[] = $recordinfo;
|
|
|
|
}
|
|
|
|
return $formulaire;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getProduitName($idProduit){
|
|
|
|
global $adb;
|
|
|
|
$query = "SELECT productname FROM `vtiger_products` where productid = '".$idProduit."'";
|
|
|
|
$sql_get_result = $adb->query($query);
|
|
|
|
$ProduitName= array();
|
|
|
|
|
|
|
|
while ($recordinfo = $adb->fetch_array($sql_get_result)) {
|
|
|
|
$ProduitName[] = $recordinfo;
|
|
|
|
}
|
|
|
|
return $ProduitName[0]['productname'];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function GenerateColor(){
|
|
|
|
$rgbColor = array();
|
|
|
|
//Create a loop.
|
|
|
|
foreach(array('r', 'g', 'b') as $color){
|
|
|
|
//Generate a random number between 0 and 255.
|
|
|
|
$rgbColor[$color] = mt_rand(0, 255);
|
|
|
|
}
|
|
|
|
return $rgbColor;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$formulaire = getFormulaire();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '<div class="main-container main-container-Accounts">
|
|
|
|
<div class="container-fluid" style="margin:15px 15px 15px 15px;">
|
|
|
|
<div class=" detailview-header-block">
|
|
|
|
<div class="row" >
|
|
|
|
<div class="col-md-2">
|
|
|
|
<a type="button" href = "index.php?module=QuestionnaireAjouter&view=QuestionnaireAjouter&IDproduit='.$_GET['IDproduit'].'" class="btn addButton btn-default module-buttons" >
|
|
|
|
<div class="fa fa-plus" aria-hidden="true"></div>
|
|
|
|
Ajouter
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class=" detailview-header-block" style="margin-top:15px;">';
|
|
|
|
|
|
|
|
if(!empty($_GET['IDproduit'])){
|
|
|
|
echo' <div class="detailViewTitle">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-5">
|
|
|
|
<div class="col-md-5 recordImage" style="height: 50px; width: 50px; background-color: rgb('.implode(",", GenerateColor()).');">
|
|
|
|
<div class="name">
|
|
|
|
<span style="font-size:24px; color: #FFFFFF;"><strong>'.substr( getProduitName($_GET['IDproduit']) , 0,2).'</strong></span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<span class="font-x-x-large" style="margin:5px;font-size:24px">'.getProduitName($_GET['IDproduit']).'</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<hr>';
|
|
|
|
}
|
|
|
|
|
|
|
|
echo'<a href="index.php?module=QuestionnaireListPicklist&view=QuestionnaireListPicklist">Liste Déroulantes </a>
|
|
|
|
<div class="row" style="margin: 5px 0px 0px 0px;">
|
|
|
|
<div class="col">
|
|
|
|
|
|
|
|
<table class="js-dynamitable table table-bordered" >
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th></th>
|
|
|
|
<th>Libellé</th>
|
|
|
|
<th>Date début</th>
|
|
|
|
<th>Date fin</th>
|
|
|
|
<th>Produit</th>
|
|
|
|
<th>Specialite</th>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<th></th>
|
|
|
|
<th><input class="js-filter form-control" type="text" value=""></th>
|
|
|
|
<th><input class="js-filter form-control" type="text" value=""></th>
|
|
|
|
<th><input class="js-filter form-control" type="text" value=""></th>
|
|
|
|
<th><input class="js-filter form-control" type="text" value=""></th>
|
|
|
|
<th><input class="js-filter form-control" type="text" value=""></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>';
|
|
|
|
foreach ($formulaire as $formulaire) {
|
|
|
|
result($formulaire);
|
|
|
|
}
|
|
|
|
echo '</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>';
|
|
|
|
|
|
|
|
|
|
|
|
$viewer->view('CustomDashboardFooter.tpl');
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- script pour liste déroulante -->
|
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('.js-example-basic-single').select2();
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" src="layouts/v7/lib/jquery/purl.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/select2/select2.min.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/jquery.class.min.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/jquery-ui-1.11.3.custom/jquery-ui.js"></script><script type="text/javascript" src="layouts/v7/lib/todc/js/bootstrap.min.js"></script><script type="text/javascript" src="libraries/jquery/jstorage.min.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/jquery-validation/jquery.validate.min.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/jquery.slimscroll.min.js"></script><script type="text/javascript" src="libraries/jquery/jquery.ba-outside-events.min.js"></script><script type="text/javascript" src="libraries/jquery/defunkt-jquery-pjax/jquery.pjax.js"></script><script type="text/javascript" src="libraries/jquery/multiplefileupload/jquery_MultiFile.js"></script><script type="text/javascript" src="resources/jquery.additions.js"></script><script type="text/javascript" src="layouts/v7/lib/bootstrap-notify/bootstrap-notify.min.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/websockets/reconnecting-websocket.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/jquery-play-sound/jquery.playSound.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/malihu-custom-scrollbar/jquery.mousewheel.min.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/malihu-custom-scrollbar/jquery.mCustomScrollbar.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/autoComplete/jquery.textcomplete.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/jquery.qtip.custom/jquery.qtip.js"></script><script type="text/javascript" src="libraries/jquery/jquery-visibility.min.js"></script><script type="text/javascript" src="layouts/v7/lib/momentjs/moment.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/daterangepicker/moment.min.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/daterangepicker/jquery.daterangepicker.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/jquery.timeago.js"></script><script type="text/javascript" src="libraries/jquery/ckeditor/ckeditor.js"></script><script type="text/javascript" src="libraries/jquery/ckeditor/adapters/jquery.js"></script><script type='text/javascript' src='layouts/v7/lib/anchorme_js/anchorme.min.js'></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Class.js?v=7.1.0"></script><script type='text/javascript' src="layouts/v7/resources/helper.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/resources/application.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Utils.js?v=7.1.0"></script><script type='text/javascript' src="layouts/v7/modules/Vtiger/resources/validation.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/lib/bootbox/bootbox.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Base.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Vtiger.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Calendar/resources/TaskManagement.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Import/resources/Import.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Emails/resources/EmailPreview.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Base.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Google/resources/Settings.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/CkEditor.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Documents/resources/Documents.js?v=7.1.0"></script><script type="text/javascript" src="libraries/bootstrap/js/eternicode-bootstrap-datepicker/js/bootstrap-datepicker.js?v=7.1.0"></script><script type="text/javascript" src="libraries/bootstrap/js/eternicode-bootstrap-datepicker/js/locales/bootstrap-datepicker.fr.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/lib/jquery/timepicker/jquery.timepicker.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/lazyYT/lazyYT.min.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Header.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Edit.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Popup.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Field.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jquery_windowmsg.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/BasicSearch.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/AdvanceFilter.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/SearchAdvanceFilter.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/AdvanceSearch.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/BaseList.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/List.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/AdvanceSearchList.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/RecordSelectTracker.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Pagination.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Import/resources/Popup.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Emails/resources/MassEdit.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/EmailsRelatedPopup.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/lib/jquery/sadropdown.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/posabsolute-jQuery-Validation-Engine/js/languages/jquery.validationEngine-fr.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Vtiger.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jquery.stickytableheaders.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/gridster/jquery.gridster.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/jquery.jqplot.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.canvasTextRenderer.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.pieRenderer.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.barRenderer.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.categoryAxisRenderer.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.pointLabels.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.funnelRenderer.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.logAxisRenderer.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/VtJqplotInterface.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/vtchart.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/lib/jquery/gridster/jquery.gridster.min.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/DashBoard.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/dashboards/Widget.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Detail.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Reports/resources/Detail.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Reports/resources/ChartDetail.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/CkEditor.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/lib/bootstrap-daterangepicker/moment.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/lib/bootstrap-daterangepicker/daterangepicker.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/resources/v7_client_compat.js?v=7.1.0"></script><!-- Added in the end since it should be after less file loaded --><script type="text/javascript" src="libraries/bootstrap/js/less.min.js"></script>
|
|
|
|
<!-- Enable tracking pageload time -->
|
|
|
|
<script type="text/javascript">var _REQSTARTTIME = "1589749969";jQuery(document).ready(function() { window._PAGEREADYAT = new Date(); });
|
|
|
|
jQuery(window).load(function() {
|
|
|
|
window._PAGELOADAT = new Date();
|
|
|
|
window._PAGELOADREQSENT = false;
|
|
|
|
// Transmit the information to server about page render time now.
|
|
|
|
if (typeof _REQSTARTTIME != 'undefined') {
|
|
|
|
// Work with time converting it to GMT (assuming _REQSTARTTIME set by server is also in GMT)
|
|
|
|
var _PAGEREADYTIME = _PAGEREADYAT.getTime() / 1000.0; // seconds
|
|
|
|
var _PAGELOADTIME = _PAGELOADAT.getTime() / 1000.0; // seconds
|
|
|
|
var data = { page_request: _REQSTARTTIME, page_ready: _PAGEREADYTIME, page_load: _PAGELOADTIME };
|
|
|
|
data['page_xfer'] = (_PAGELOADTIME - _REQSTARTTIME).toFixed(3);
|
|
|
|
data['client_tzoffset']= -1*_PAGELOADAT.getTimezoneOffset()*60;
|
|
|
|
data['client_now'] = JSON.parse(JSON.stringify(new Date()));
|
|
|
|
if (!window._PAGELOADREQSENT) {
|
|
|
|
// To overcome duplicate firing on Chrome
|
|
|
|
window._PAGELOADREQSENT = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- dynamitable pour le filtre-->
|
|
|
|
<script>
|
|
|
|
! function (t) {
|
|
|
|
"use strict";
|
|
|
|
t.fn.dynamitable = function (e) {
|
|
|
|
var n = this,
|
|
|
|
i = new function (t) {
|
|
|
|
this.getIndex = function (t) {
|
|
|
|
return t.parents("tr").children("td, th").index(t)
|
|
|
|
}, this.getBody = function () {
|
|
|
|
return t.find("tbody")
|
|
|
|
}, this.getRows = function () {
|
|
|
|
return this.getBody().children("tr")
|
|
|
|
}, this.getField = function (t, e) {
|
|
|
|
return e.children("td, th").eq(t)
|
|
|
|
}, this.getValue = function (t, e) {
|
|
|
|
return this.getField(t, e).text()
|
|
|
|
}
|
|
|
|
}(t(this));
|
|
|
|
return this.filterList = [], this.displayAll = function () {
|
|
|
|
return i.getRows().each(function () {
|
|
|
|
t(this).show()
|
|
|
|
}), this
|
|
|
|
}, this.filter = function (e, n) {
|
|
|
|
var r = new RegExp(n, "i");
|
|
|
|
return i.getRows().each(function () {
|
|
|
|
!0 !== r.test(i.getValue(e, t(this))) && t(this).hide()
|
|
|
|
}), this
|
|
|
|
}, this.addFilter = function (e) {
|
|
|
|
n.filterList.push(e);
|
|
|
|
var r = function () {
|
|
|
|
n.displayAll(), t(n.filterList).each(function (e, r) {
|
|
|
|
t(n).find(r).each(function () {
|
|
|
|
var e = t(this);
|
|
|
|
n.filter(i.getIndex(e.parent("td, th")), e.val())
|
|
|
|
})
|
|
|
|
})
|
|
|
|
};
|
|
|
|
return t(e).on("change keyup keydown", r), r(), this
|
|
|
|
}, this.addSorter = function (e, r) {
|
|
|
|
return t(n).find(e).each(function () {
|
|
|
|
var e = t(this),
|
|
|
|
s = i.getIndex(e.parent("td, th"));
|
|
|
|
e.on("click", function () {
|
|
|
|
n.sorter(s, r)
|
|
|
|
})
|
|
|
|
}), this
|
|
|
|
}, this.sorter = function (e, n) {
|
|
|
|
return i.getBody().append(i.getRows().detach().sort(function (r, s) {
|
|
|
|
var d = i.getValue(e, t(r)),
|
|
|
|
a = i.getValue(e, t(s)),
|
|
|
|
c = "desc" === n ? !0 : !1;
|
|
|
|
return "" !== d.replace(/[^\d-]/g, "") && "" !== a.replace(/[^\d-]/g, "") && (d = parseFloat(d.replace(/[^\d,.-]/g, "")), a = parseFloat(a.replace(/[^\d,.-]/g, ""))), d === a ? 0 : d > a ? c ? 1 : -1 : c ? -1 : 1
|
|
|
|
})), this
|
|
|
|
}, this
|
|
|
|
}, t(document).find(".js-dynamitable").each(function () {
|
|
|
|
t(this).dynamitable().addFilter(".js-filter").addSorter(".js-sorter-asc", "asc").addSorter(".js-sorter-desc", "desc")
|
|
|
|
})
|
|
|
|
}(jQuery);
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</html>
|