#!/usr/bin/perl -w
# 
# nom = accueil/departP2.pl  #  25.3.2005
# pour imingo - 18.8.2006
# = departP3  : 16.3.2020

use locale; use CGI qw/:standard escapeHTML/; use strict; use CGI::Carp;

BEGIN { use CGI::Carp qw(carpout); open(LOG, ">>/home/cedra/logsPERL/errPERL") or die "ouverture errPERL impossible: $!\n"; carpout(*LOG);}; use CGI::Carp qw(fatalsToBrowser);

our $mobile= undef; 
if ( ($ENV{'REMOTE_ADDR'}=~ /185.73.235.135/) && (($ENV{'HTTP_USER_AGENT'} =~ /android/i) or ($ENV{'HTTP_USER_AGENT'} =~ /mobile/i)) ) {$mobile= 1}

if ($mobile) { # si mobile : cadres différents ; même nom mais fondP tient toute la place
    print
	header (-expires=>'now', -target=>"_top"),
	"<HTML><HEAD><TITLE>Bienvenue dans l'espace priv&eacute; du C&eacute;dra</TITLE></HEAD>",
#	"<frameset cols=20%,* frameborder=0 border=0>",
##	"<frameset cols=0%,* frameborder=0 border=0>",
##	"<frame SRC='http:../accueil/sommaireP2.html' NAME='sommaire' scrolling='auto' marginwidth='3' marginheight='10' >", 
	"<frameset cols=100%,* frameborder=0 border=0>",
	"<frame SRC='http:../sperl/ouverture2.pl' NAME='fondP' scrolling='yes' marginwidth='4' marginheight='10'></frameset>",
	"<noframes>ici pour no frames ********** é</noframes>",
	"</HTML>";
}
else {
    print
	header (-expires=>'now', -target=>"_top"),
	"<HTML><HEAD><TITLE>Bienvenue dans l'espace priv&eacute; du C&eacute;dra</TITLE></HEAD>",
	"<frameset cols=20%,* frameborder=0 border=0>",
	"<frame SRC='http:../accueil/sommaireP2.html' NAME='sommaire' scrolling='auto' marginwidth='3' marginheight='10' >", 
	"<frame SRC='http:../sperl/ouverture2.pl' NAME='fondP' scrolling='yes' marginwidth='4' marginheight='10'></frameset>",
	"<noframes>ici pour no frames ********** é</noframes>",
	"</HTML>";
}
exit (0);
