Benjamin Renard
Fix locale setting
Benjamin Renard commited aad026c at 2015-01-07 10:05:19
<?php
error_reporting(E_ERROR);
@require_once "lib/api-allocine-helper/api-allocine-helper.php";
require_once "functions.php";
// Set locale to 'fr_FR.UTF-8' (required to retreive correct days short name)
// CAUTION : If you want to modify it, you have to change day2int() function
setlocale(LC_ALL, 'fr_FR.UTF-8');
// Manage script parameters
$options=getopt('hc:t:d:');
if (isset($options["h"])) {
echo "Usage: ".$argv[0]." [-h] -c=[code_cine] -t=[0612345678] -d=[sms.domain.tld]\n";
echo " -h Show this message\n";
echo " -c=[code_cine] Specify cine code\n";
echo " -t=[number] Specify phone number\n";
echo " -d=[sms.domain.tld] Specify SMS mail domaine\n";
exit();
}
if (isset($options["c"]) && $options["c"]!==false) {
$code_cine=$options["c"];
}
else die("You must provide cine code with -c=XXX parameter.\n");
$send_to=false;
$mail_domain=false;
if (isset($options["t"]) && $options["t"]!==false) {
$send_to=$options["t"];
if (isset($options["d"]) && $options["d"]!==false) {
$mail_domain=$options["d"];
}
else die("You must provide SMS mail domain with -d=domain.tld parameter.\n");
}
try {
$helper = new AlloHelper;
$result = $helper->showtimesByTheaters($code_cine);
}
catch( ErrorException $error ) {
die("Error retreiving informations (Err. n°". $error->getCode(). ") : ". $error->getMessage());
}
try {
$name_cine=null;
$movies=array();
foreach($result->theaterShowtimes as $t) {
$name_cine=$t->place->theater->name;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX