index.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. <?php
  2. /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
  5. * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  19. */
  20. /**
  21. * \file htdocs/public/demo/index.php
  22. * \ingroup core
  23. * \brief Entry page to access demo
  24. */
  25. if (!defined('NOLOGIN')) {
  26. define('NOLOGIN', '1');
  27. }
  28. if (!defined('NOCSRFCHECK')) {
  29. define('NOCSRFCHECK', '1');
  30. }
  31. if (!defined('NOBROWSERNOTIF')) {
  32. define('NOBROWSERNOTIF', 1);
  33. }
  34. if (!defined('NOIPCHECK')) {
  35. define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
  36. }
  37. require '../../main.inc.php';
  38. require_once '../../core/lib/functions2.lib.php';
  39. $langs->loadLangs(array("main", "install", "other"));
  40. $conf->dol_hide_topmenu = GETPOST('dol_hide_topmenu', 'int');
  41. $conf->dol_hide_leftmenu = GETPOST('dol_hide_leftmenu', 'int');
  42. $conf->dol_optimize_smallscreen = GETPOST('dol_optimize_smallscreen', 'int');
  43. $conf->dol_no_mouse_hover = GETPOST('dol_no_mouse_hover', 'int');
  44. $conf->dol_use_jmobile = GETPOST('dol_use_jmobile', 'int');
  45. // Security check
  46. global $dolibarr_main_demo;
  47. if (empty($dolibarr_main_demo)) {
  48. httponly_accessforbidden('Parameter dolibarr_main_demo must be defined in conf file with value "default login,default pass" to enable the demo entry page');
  49. }
  50. // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
  51. $res = $hookmanager->initHooks(array('demo'));
  52. $demoprofiles = array();
  53. $alwayscheckedmodules = array();
  54. $alwaysuncheckedmodules = array();
  55. $alwayshiddencheckedmodules = array();
  56. $alwayshiddenuncheckedmodules = array();
  57. $url = '';
  58. $url .= ($url ? '&' : '').($conf->dol_hide_topmenu ? 'dol_hide_topmenu='.$conf->dol_hide_topmenu : '');
  59. $url .= ($url ? '&' : '').($conf->dol_hide_leftmenu ? 'dol_hide_leftmenu='.$conf->dol_hide_leftmenu : '');
  60. $url .= ($url ? '&' : '').($conf->dol_optimize_smallscreen ? 'dol_optimize_smallscreen='.$conf->dol_optimize_smallscreen : '');
  61. $url .= ($url ? '&' : '').($conf->dol_no_mouse_hover ? 'dol_no_mouse_hover='.$conf->dol_no_mouse_hover : '');
  62. $url .= ($url ? '&' : '').($conf->dol_use_jmobile ? 'dol_use_jmobile='.$conf->dol_use_jmobile : '');
  63. $url = DOL_URL_ROOT.'/index.php'.($url ? '?'.$url : '');
  64. $tmpaction = 'view';
  65. $parameters = array();
  66. $object = new stdClass();
  67. $reshook = $hookmanager->executeHooks('addDemoProfile', $parameters, $object, $tmpaction); // Note that $action and $object may have been modified by some hooks
  68. $error = $hookmanager->error; $errors = $hookmanager->errors;
  69. if (empty($reshook)) {
  70. $demoprofiles = array(
  71. array('default'=>'1', 'key'=>'profdemoservonly', 'label'=>'DemoCompanyServiceOnly',
  72. 'disablemodules'=>'adherent,barcode,bom,cashdesk,don,expedition,externalsite,ftp,incoterm,mailmanspip,margin,mrp,prelevement,product,productbatch,stock,takepos',
  73. //'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot8.png',
  74. 'icon'=>DOL_URL_ROOT.'/public/demo/demo-profile-service.jpg',
  75. 'url'=>$url
  76. ),
  77. array('default'=>'0', 'key'=>'profmanufacture', 'label'=>'DemoCompanyManufacturing',
  78. 'disablemodules'=>'adherent,contrat,don,externalsite,ficheinter,ftp,mailmanspip,prelevement,service',
  79. 'icon'=>DOL_URL_ROOT.'/public/demo/demo-profile-manufacturing.jpg',
  80. 'url'=>$url
  81. ),
  82. array('default'=>'0', 'key'=>'profdemoprodstock', 'label'=>'DemoCompanyProductAndStocks',
  83. 'disablemodules'=>'adherent,bom,contrat,don,externalsite,ficheinter,ftp,mailmanspip,mrp,prelevement,service',
  84. //'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot2.png',
  85. 'icon'=>DOL_URL_ROOT.'/public/demo/demo-profile-product.jpg',
  86. 'url'=>$url
  87. ),
  88. array('default'=>'0', 'key'=>'profdemofun2', 'label'=>'DemoFundation2',
  89. 'disablemodules'=>'barcode,cashdesk,bom,commande,commercial,compta,comptabilite,contrat,expedition,externalsite,ficheinter,ftp,incoterm,mailmanspip,margin,mrp,prelevement,product,productbatch,projet,propal,propale,service,societe,stock,tax,takepos',
  90. //'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot6.png',
  91. 'icon'=>DOL_URL_ROOT.'/public/demo/demo-profile-foundation.jpg',
  92. 'url'=>$url
  93. ),
  94. // All demo profile
  95. array('default'=>'0', 'key'=>'profdemoall', 'label'=>'ChooseYourDemoProfilMore',
  96. 'disablemodules'=>'adherent,cashdesk,don,externalsite,mailmanspip',
  97. //'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot9.png'
  98. 'icon'=>DOL_URL_ROOT.'/public/demo/demo-profile-all.jpg'
  99. )
  100. );
  101. // Visible
  102. $alwayscheckedmodules = array('barcode', 'bookmark', 'categorie', 'externalrss', 'fckeditor', 'geoipmaxmind', 'gravatar', 'memcached', 'syslog', 'user', 'webservices'); // Technical module we always want
  103. $alwaysuncheckedmodules = array('dav', 'dynamicprices', 'incoterm', 'loan', 'multicurrency', 'paybox', 'paypal', 'stripe', 'google', 'printing', 'scanner', 'skype', 'website'); // Module we dont want by default
  104. // Not visible
  105. $alwayshiddencheckedmodules = array('accounting', 'api', 'barcode', 'blockedlog', 'bookmark', 'clicktodial', 'comptabilite', 'cron', 'document', 'domain', 'externalrss', 'externalsite', 'fckeditor', 'geoipmaxmind', 'gravatar', 'label', 'ldap',
  106. 'mailmanspip', 'notification', 'oauth', 'syslog', 'user', 'webservices', 'workflow',
  107. // Extended modules
  108. 'memcached', 'numberwords', 'zipautofillfr');
  109. $alwayshiddenuncheckedmodules = array('cashdesk', 'collab', 'dav', 'debugbar', 'emailcollector', 'ftp', 'hrm', 'modulebuilder', 'printing', 'webservicesclient', 'zappier',
  110. // Extended modules
  111. 'awstats', 'bittorrent', 'bootstrap', 'cabinetmed', 'cmcic', 'concatpdf', 'customfield', 'datapolicy', 'deplacement', 'dolicloud', 'filemanager', 'lightbox', 'mantis', 'monitoring', 'moretemplates', 'multicompany', 'nltechno', 'numberingpack', 'openstreetmap',
  112. 'ovh', 'phenix', 'phpsysinfo', 'pibarcode', 'postnuke', 'dynamicprices', 'receiptprinter', 'selectbank', 'skincoloreditor', 'submiteverywhere', 'survey', 'thomsonphonebook', 'topten', 'tvacerfa', 'voyage', 'webcalendar', 'webmail');
  113. }
  114. // Search modules
  115. $dirlist = $conf->file->dol_document_root;
  116. // Search modules dirs
  117. $modulesdir = dolGetModulesDirs();
  118. $filename = array();
  119. $modules = array();
  120. $orders = array();
  121. $categ = array();
  122. $dirmod = array();
  123. $i = 0; // is a sequencer of modules found
  124. $j = 0; // j is module number. Automatically affected if module number not defined.
  125. foreach ($modulesdir as $dir) {
  126. // Charge tableaux modules, nom, numero, orders depuis repertoire dir
  127. $handle = @opendir($dir);
  128. if (is_resource($handle)) {
  129. while (($file = readdir($handle)) !== false) {
  130. //print "$i ".$file."\n<br>";
  131. if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') {
  132. $modName = substr($file, 0, dol_strlen($file) - 10);
  133. if ($modName) {
  134. try {
  135. include_once $dir.$file;
  136. $objMod = new $modName($db);
  137. if ($objMod->numero > 0) {
  138. $j = $objMod->numero;
  139. } else {
  140. $j = 1000 + $i;
  141. }
  142. $modulequalified = 1;
  143. // We discard modules according to features level (PS: if module is activated we always show it)
  144. $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
  145. if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && empty($conf->global->$const_name)) {
  146. $modulequalified = 0;
  147. }
  148. if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && empty($conf->global->$const_name)) {
  149. $modulequalified = 0;
  150. }
  151. if ($modulequalified) {
  152. $modules[$i] = $objMod;
  153. $filename[$i] = $modName;
  154. $orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module
  155. //print "x".$modName." ".$orders[$i]."\n<br>";
  156. $dirmod[$i] = $dirroot;
  157. $j++;
  158. $i++;
  159. }
  160. } catch (Exception $e) {
  161. dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
  162. }
  163. }
  164. }
  165. }
  166. }
  167. }
  168. asort($orders);
  169. //var_dump($orders);
  170. /*
  171. * Actions
  172. */
  173. if (GETPOST('action', 'aZ09') == 'gotodemo') { // Action run when we click on "Start" after selection modules
  174. //print 'ee'.GETPOST("demochoice");
  175. $disablestring = '';
  176. // If we disable modules using a profile choice
  177. if (GETPOST("demochoice")) {
  178. foreach ($demoprofiles as $profilearray) {
  179. if ($profilearray['key'] == GETPOST("demochoice")) {
  180. $disablestring = $profilearray['disablemodules'];
  181. break;
  182. }
  183. }
  184. }
  185. // If we disable modules using personalized list
  186. foreach ($modules as $val) {
  187. $modulekeyname = strtolower($val->name);
  188. if (!GETPOST($modulekeyname) && empty($val->always_enabled) && !in_array($modulekeyname, $alwayscheckedmodules)) {
  189. $disablestring .= $modulekeyname.',';
  190. if ($modulekeyname == 'propale') {
  191. $disablestring .= 'propal,';
  192. }
  193. }
  194. }
  195. // Do redirect to login page
  196. if ($disablestring) {
  197. if (GETPOST('urlfrom')) {
  198. $url .= (preg_match('/\?/', $url) ? '&amp;' : '?').'urlfrom='.urlencode(GETPOST('urlfrom', 'alpha'));
  199. }
  200. $url .= (preg_match('/\?/', $url) ? '&amp;' : '?').'disablemodules='.$disablestring;
  201. //var_dump($url);exit;
  202. header("Location: ".$url);
  203. exit;
  204. }
  205. }
  206. /*
  207. * View
  208. */
  209. $head = '';
  210. $head .= '<meta name="keywords" content="demo,online,demonstration,example,test,erp,crm,demos,web">'."\n";
  211. $head .= '<meta name="description" content="Dolibarr ERP and CRM demo. You can test here several profiles for Dolibarr ERP and CRM demonstration.">'."\n";
  212. $head .= '
  213. <script type="text/javascript">
  214. var openedId="";
  215. jQuery(document).ready(function () {
  216. jQuery("tr.moduleline").hide();
  217. // Enable this to allow personalized setup
  218. jQuery(".modulelineshow").attr("href","#a1profdemoall");
  219. jQuery(".cursorpointer").css("cursor","pointer");
  220. jQuery(".modulelineshow").click(function() {
  221. console.log("We select the custom demo");
  222. var idstring=$(this).attr("id");
  223. if (typeof idstring != "undefined")
  224. {
  225. var currentId = idstring.substring(2);
  226. jQuery("tr.moduleline").hide();
  227. if (currentId != openedId)
  228. {
  229. openedId=currentId;
  230. jQuery("#tr1"+currentId).show();
  231. jQuery("#tr2"+currentId).show();
  232. }
  233. else openedId = "";
  234. }
  235. });
  236. });
  237. </script>';
  238. llxHeaderVierge($langs->trans("DolibarrDemo"), $head);
  239. print "\n";
  240. print '<div class="demoban demobackground">';
  241. print '<div class="right" style="padding-right: 30px; padding-top: 30px;">';
  242. print '<a alt="Official portal of your ERP CRM application" targe="_blank" href="https://www.dolibarr.org?utm_medium=website&utm_source=demo"><img class="demologo" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" alt="Dolibarr logo"></a>';
  243. print '</div>';
  244. print '</div>';
  245. print '<div class="demobantext" style="max-width: 1024px;">';
  246. print '<div style="font-size: 20px; padding: 40px;">';
  247. print '<div class="hideonsmartphone" style="text-align: justify;">'.$langs->trans("DemoDesc").'</div><br>';
  248. print '<div class="titre"><span style="font-size: 20px">'.$langs->trans("ChooseYourDemoProfil").'</span></div>';
  249. print '</div>';
  250. print '</div>';
  251. print '<div class="clearboth"></div>';
  252. print '<div class="demobanbox">';
  253. $i = 0;
  254. foreach ($demoprofiles as $profilearray) {
  255. if ($profilearray['default'] >= 0) {
  256. //print $profilearray['lang'];
  257. if (!empty($profilearray['lang'])) {
  258. $langs->load($profilearray['lang']);
  259. }
  260. $url = $_SERVER["PHP_SELF"].'?action=gotodemo';
  261. $urlwithmod = $url.'&amp;demochoice='.$profilearray['key'];
  262. // Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr'
  263. //print "xx".$_SERVER["PHP_SELF"].' '.DOL_URL_ROOT.'<br>';
  264. $urlfrom = preg_replace('/^'.preg_quote(DOL_URL_ROOT, '/').'/i', '', $_SERVER["PHP_SELF"]);
  265. //print $urlfrom;
  266. if (!empty($profilearray['url'])) {
  267. $urlwithmod = $profilearray['url'];
  268. $urlwithmod = $urlwithmod.(preg_match('/\?/', $urlwithmod) ? '&amp;' : '?').'urlfrom='.urlencode($urlfrom);
  269. if (!empty($profilearray['disablemodules'])) {
  270. $urlwithmod = $urlwithmod.(preg_match('/\?/', $urlwithmod) ? '&amp;' : '?').'disablemodules='.$profilearray['disablemodules'];
  271. }
  272. }
  273. if (empty($profilearray['url'])) {
  274. print '<div class="clearboth"></div>';
  275. }
  276. print '<form method="POST" class="valigntop inline-block" name="form'.$profilearray['key'].'" id="form'.$profilearray['key'].'" action="'.$_SERVER["PHP_SELF"].'#a1'.$profilearray['key'].'">'."\n";
  277. print '<input type="hidden" name="action" value="gotodemo">'."\n";
  278. print '<input type="hidden" name="urlfrom" value="'.dol_escape_htmltag($urlfrom).'">'."\n";
  279. print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
  280. print '<input type="hidden" name="username" value="demo">'."\n";
  281. print '<input type="hidden" name="dol_hide_topmenu" value="'.$conf->dol_hide_topmenu.'">'."\n";
  282. print '<input type="hidden" name="dol_hide_leftmenu" value="'.$conf->dol_hide_leftmenu.'">'."\n";
  283. print '<input type="hidden" name="dol_optimize_smallscreen" value="'.$conf->dol_optimize_smallscreen.'">'."\n";
  284. print '<input type="hidden" name="dol_no_mouse_hover" value="'.$conf->dol_no_mouse_hover.'">'."\n";
  285. print '<input type="hidden" name="dol_use_jmobile" value="'.$conf->dol_use_jmobile.'">'."\n";
  286. print '<div id="div'.$profilearray['key'].'" summary="Dolibarr online demonstration for profile '.$profilearray['label'].'" class="center inline-block CTable CTableRow'.($i % 2 == 0 ? '1' : '0').'">'."\n";
  287. print '<div id="a1'.$profilearray['key'].'" class="demobox '.(empty($profilearray['url']) ? 'modulelineshow cursorpointer' : 'nomodulelines').'">';
  288. print '<a href="'.$urlwithmod.'" class="'.(empty($profilearray['url']) ? 'modulelineshow' : 'nomodulelines').'">';
  289. print '<div style="padding: 10px;">';
  290. print '<img class="demothumb" src="'.$profilearray['icon'].'" alt="Demo '.$profilearray['label'].'">';
  291. print '<div class="clearboth"></div>';
  292. print '<div class="demothumbtext">';
  293. print $langs->trans($profilearray['label']);
  294. print '</div>';
  295. print '</div>';
  296. print '</a>';
  297. // Modules (a profile you must choose modules)
  298. if (empty($profilearray['url'])) {
  299. print '<div id="tr1'.$profilearray['key'].'" class="moduleline hidden" style="margin-left: 8px; margin-right: 8px; text-align: justify; font-size:0.75em; line-height: 130%; padding-bottom: 8px">';
  300. print '<span class="opacitymedium">'.$langs->trans("ThisIsListOfModules").'</span><br><br>';
  301. print '<div class="csscolumns">';
  302. $listofdisabledmodules = explode(',', $profilearray['disablemodules']);
  303. $j = 0;
  304. //$nbcolsmod = empty($conf->dol_optimize_smallscreen) ? 4 : 3;
  305. //var_dump($modules);
  306. foreach ($orders as $index => $key) { // Loop on qualified (enabled) modules
  307. //print $index.' '.$key;
  308. $val = $modules[$index];
  309. $modulekeyname = strtolower($val->name);
  310. $modulequalified = 1;
  311. if (!empty($val->always_enabled) || in_array($modulekeyname, $alwayshiddenuncheckedmodules)) {
  312. $modulequalified = 0;
  313. }
  314. if ($val->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && empty($conf->global->$const_name)) {
  315. $modulequalified = 0;
  316. }
  317. if ($val->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && empty($conf->global->$const_name)) {
  318. $modulequalified = 0;
  319. }
  320. if (!$modulequalified) {
  321. continue;
  322. }
  323. if (in_array($modulekeyname, $alwayshiddencheckedmodules)) {
  324. print "\n".'<!-- Module '.$modulekeyname.' hidden and always checked -->';
  325. print '<input type="hidden" name="'.$modulekeyname.'" value="1">';
  326. } else {
  327. //$modulo = ($j % $nbcolsmod);
  328. //if ($modulo == 0) print '<tr>';
  329. print '<!-- id='.$val->numero.' -->';
  330. print '<div class="nowrap">';
  331. print '<input type="checkbox" class="checkbox valignmiddle paddingright" id="id'.$modulekeyname.'" name="'.$modulekeyname.'" value="1" title="'.dol_escape_htmltag($val->getName()).'"';
  332. $disabled = '';
  333. if (in_array($modulekeyname, $alwaysuncheckedmodules)) {
  334. $disabled = 'disabled';
  335. print ' '.$disabled;
  336. }
  337. if (!in_array($modulekeyname, $alwaysuncheckedmodules) && (!in_array($modulekeyname, $listofdisabledmodules) || in_array($modulekeyname, $alwayscheckedmodules))) {
  338. print ' checked';
  339. }
  340. print '>';
  341. /*
  342. $s = img_picto('', $modulekeyname, 'class="pictofixedwidth paddingleft"');
  343. if ($s) {
  344. print $s;
  345. } else {
  346. print img_picto('', 'generic', 'class="pictofixedwidth paddingleft"');
  347. }*/
  348. print '<label for="id'.$modulekeyname.'" class="inline-block demomaxoveflow valignmiddle paddingleft'.($disabled ? ' opacitymedium' : '').'" title="'.dol_escape_htmltag($val->getName()).'">'.$val->getName().'</label><br>';
  349. print '</div>';
  350. //if ($modulo == ($nbcolsmod - 1)) print '</tr>';
  351. $j++;
  352. }
  353. }
  354. print '</div>';
  355. print '<br><div class="center">';
  356. print '<input type="submit" value=" &nbsp; &nbsp; '.$langs->trans("Start").' &nbsp; &nbsp; " class="button">';
  357. print '<br><br>';
  358. print '</div>';
  359. print '</div>';
  360. }
  361. print '</div></div>';
  362. print '</form>'."\n";
  363. $i++;
  364. }
  365. }
  366. print '</div>';
  367. print '<br>';
  368. // TODO Replace this with a hook
  369. // Google Adsense (need Google module)
  370. if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !empty($conf->global->MAIN_GOOGLE_AD_SLOT)) {
  371. if (empty($conf->dol_use_jmobile)) {
  372. print '<div align="center">'."\n";
  373. print '<script><!--'."\n";
  374. print 'google_ad_client = "'.$conf->global->MAIN_GOOGLE_AD_CLIENT.'";'."\n";
  375. print 'google_ad_slot = "'.$conf->global->MAIN_GOOGLE_AD_SLOT.'";'."\n";
  376. print 'google_ad_width = '.$conf->global->MAIN_GOOGLE_AD_WIDTH.';'."\n";
  377. print 'google_ad_height = '.$conf->global->MAIN_GOOGLE_AD_HEIGHT.';'."\n";
  378. print '//-->'."\n";
  379. print '</script>'."\n";
  380. print '<script src="//pagead2.googlesyndication.com/pagead/show_ads.js"></script>'."\n";
  381. print '</div>'."\n";
  382. } else {
  383. print '<!-- google js advert tag disabled with jmobile -->'."\n";
  384. }
  385. }
  386. llxFooterVierge();
  387. $db->close();
  388. /**
  389. * Show header for demo
  390. *
  391. * @param string $title Title
  392. * @param string $head Head string
  393. * @return void
  394. */
  395. function llxHeaderVierge($title, $head = "")
  396. {
  397. top_httphead();
  398. top_htmlhead($head, $title, 0, 0, array(), array('public/demo/demo.css'), 0, 1);
  399. print '<body class="demobody"><div class="demobackgrounddiv">'."\n";
  400. }
  401. /**
  402. * Show footer for demo
  403. *
  404. * @return void
  405. */
  406. function llxFooterVierge()
  407. {
  408. printCommonFooter('public');
  409. print "\n";
  410. print "</div></body>\n";
  411. print "</html>\n";
  412. }