index.php 19 KB

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