Hello all,
I have created an application with DHTMLX 6 years ago. Lot of grids loading perfectly the data from mysql DB.
My hosting company has upgraded the PHP version and I had to upgrade my code (CMS).
My grids are not working anymore. I have change the connexion strings from mysql to mysqli in my code and also in DHTMLX ones.
Here is my code
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("../media/");
mygrid.setHeader("Détail,Workflow,Type,Code,Nom,Date Début,Date Fin,Active,Responsable,OTP,Centre de coût,Nature Comptable,Nb de patients par investigateur,Préfixe patients,Date debut 2,Date fin 2");
mygrid.attachHeader(",,#connector_select_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_select_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,,")
mygrid.setInitWidths("50,60,100,100,100,100,100,100,100,100,100,100,100,100,0,0")
mygrid.setColTypes("img,img,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro");
mygrid.setColSorting("server,server,server,server,server,server,server,server,server,server,server,server,server,server,server,server")
mygrid.setColAlign("center,center,left,left,left,left,left,left,left,left,left,left,left,left,left");
mygrid.setSkin("dhx_skyblue");
mygrid.attachEvent("onXLS", function() {
document.getElementById('cover').style.display = 'block';
});
mygrid.attachEvent("onXLE", function() {
document.getElementById('cover').style.display = 'none';
});
mygrid.attachEvent("onXLE", setCounter);
mygrid.enableSmartRendering(true,30)
mygrid.attachEvent("onBeforeSorting",sortGridOnServer);
mygrid.attachEvent("onFilterStart", filterGridOnServer);
mygrid.attachEvent("onDynXLS", filterDynamicGridOnServer);
mygrid.init();
if (mygrid.setColspan);
/mygrid.loadXML("connector.php?provenance=ETUDE");
var dp = new dataProcessor("connector.php?provenance=ETUDE");
dp.init(mygrid);
and here is my connector.php
require(“…/dhtmlx/pro30/common/codebase/grid_connector.php”);
require(“…/dhtmlx/pro30/common/codebase/combo_connector.php”);
require(“…/dhtmlx/pro30/common/codebase/dataview_connector.php”);
$mysqli = mysqli_connect(“localhost”, $database_user, $database_password, $dbase);
require(“sql_global.php”); //Appel au fichier global des requêtes SQL
$gridConn = new GridConnector($mysqli,“MySQL”);
$dvConn = new DataViewConnector($mysqli);
switch ($provenance) {
case ‘ETUDE’:
$columns=array(“id”,“detail”,“workflow”,“lib_etude”,“code”,“nom”,“dateD”,“dateF”,“statut”,“responsable”,“otp”,“centre_cout”,“nature_comptable”,“nombre_patients_defaut”,“prefixe_code_patient”,“date_debut”,“date_fin”);
$sql_grid_1=ajout_tri($sql_grid_1,$columns);
$gridConn->dynamic_loading(60);
$gridConn->render_sql(“select * from sql_grid_1”,“id”,“detail,workflow,lib_etude,code,nom,dateD,dateF,statut,responsable,otp,centre_cout,nature_comptable,nombre_patients_defaut,prefixe_code_patient,date_debut,date_fin”);
break;
Can anyone help me please ?
Thanks in advance,
KR,
Arnaud