Esempio n. 1
0
function sendSMS($to, $msg)
{
    global $sms;
    $u['sms.ru'] = "sms.ru/sms/send?api_id=" . uc($sms["key"]) . "&to=" . uc($sms["num"]) . "&text=" . uc($msg);
    $u['bytehand.com'] = "bytehand.com:3800/send?id=" . uc($sms["id"]) . "&key=" . uc($sms["key"]) . "&to=" . uc($sms["num"]) . "&partner=callme&from=" . uc($sms["frm"]) . "&text=" . uc($msg);
    $u['sms-sending.ru'] = "lcab.sms-sending.ru/lcabApi/sendSms.php?login="******"log"]) . "&password="******"pss"]) . "&txt=" . uc($msg) . "&to=" . uc($sms["num"]);
    $u['infosmska.ru'] = "api.infosmska.ru/interfaces/SendMessages.ashx?login="******"&pwd=" . uc($sms["pss"]) . "&sender=SMS&phones=" . uc($sms["num"]) . "&message=" . uc($msg);
    $u['smsaero.ru'] = "gate.smsaero.ru/send/?user="******"log"]) . "&password="******"pss"])) . "&to=" . uc($sms["num"]) . "&text=" . uc($msg) . "&from=" . uc($sms["frm"]);
    @($r = file_get_contents("http://" . $u[$sms["prv"]]));
}
Esempio n. 2
0
 private function getController($controller)
 {
     try {
         $splitted = array_diff(explode($this->sepCtrl, $controller), array(''));
         $classname = uc('_', array_pop($splitted)) . 'Controller';
         $dir = count($splitted) ? implode('/', $splitted) : 'default';
         return array('classname' => $classname, 'file' => DIR_CTRL . "/{$dir}/{$classname}.php");
     } catch (Exception $e) {
         throw $e;
     }
 }
Esempio n. 3
0
 function query($sql)
 {
     $this->check_connection();
     $result = $this->connection->query($sql);
     if (!$result) {
         throw new Exception($this->connection->error . ': ' . h($sql));
     }
     if (!str_starts_with(uc($sql), array('SELECT', 'SHOW'))) {
         return $result;
     }
     $data = array();
     while ($row = $result->fetch_assoc()) {
         $data[] = $row;
     }
     $result->free();
     return $data;
 }
Esempio n. 4
0
function sendSMS($to, $msg)
{
    global $id;
    global $key;
    global $from;
    global $frm;
    global $num;
    global $prv;
    global $sms_login;
    global $sms_pass;
    $u['sms.ru'] = "sms.ru/sms/send?api_id=" . uc($key) . "&to=" . uc($num) . "&text=" . uc($msg);
    $u['bytehand.com'] = "bytehand.com:3800/send?id=" . uc($id) . "&key=" . uc($key) . "&to=" . uc($num) . "&partner=callme&from=" . uc($frm) . "&text=" . uc($msg);
    $u['sms-sending.ru'] = "lcab.sms-sending.ru/lcabApi/sendSms.php?login="******"&password="******"&txt=" . uc($msg) . "&to=" . uc($num);
    $u['infosmska.ru'] = "api.infosmska.ru/interfaces/SendMessages.ashx?login="******"&pwd=" . uc($sms_pass) . "&sender=SMS&phones=" . uc($num) . "&message=" . uc($msg);
    $u['smsaero.ru'] = "gate.smsaero.ru/send/?user="******"&password="******"&to=" . uc($num) . "&text=" . uc($msg) . "&from=" . uc($frm);
    $r = file_get_contents("http://" . $u[$prv]);
}
Esempio n. 5
0
/**
 * Gets an environment variable from available sources, and provides emulation
 * for unsupported or inconsistent environment variables (i.e. DOCUMENT_ROOT on
 * IIS, or SCRIPT_NAME in CGI mode).  Also exposes some additional custom
 * environment information.
 *
 * @param  string $key Environment variable name.
 * @return string Environment variable setting.
 * @link http://book.cakephp.org/view/701/env
 */
function env($key)
{
    $key = uc($key);
    if ($key == 'HTTPS') {
        if (isset($_SERVER) && !empty($_SERVER)) {
            return isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on';
        }
        return strpos(env('SCRIPT_URI'), 'https://') === 0;
    }
    if ($key == 'SCRIPT_NAME' && env('CGI_MODE') && isset($_ENV['SCRIPT_URL'])) {
        $key = 'SCRIPT_URL';
    }
    $val = null;
    if (isset($_SERVER[$key])) {
        $val = $_SERVER[$key];
    } else {
        if (isset($_ENV[$key])) {
            $val = $_ENV[$key];
        } else {
            if (getenv($key) !== false) {
                $val = getenv($key);
            }
        }
    }
    if ($key === 'REMOTE_ADDR' && $val === env('SERVER_ADDR')) {
        $addr = env('HTTP_PC_REMOTE_ADDR');
        if ($addr !== null) {
            $val = $addr;
        }
    }
    if ($val !== null) {
        return $val;
    }
    if ($key === 'SCRIPT_FILENAME' && defined('SERVER_IIS') && SERVER_IIS === true) {
        return str_replace('\\\\', '\\', env('PATH_TRANSLATED'));
    }
    if ($key === 'DOCUMENT_ROOT') {
        $name = env('SCRIPT_NAME');
        $filename = env('SCRIPT_FILENAME');
        $offset = 0;
        if (!strpos($name, '.php')) {
            $offset = 4;
        }
        return substr($filename, 0, strlen($filename) - (strlen($name) + $offset));
    }
    if ($key == 'PHP_SELF') {
        return str_replace(env('DOCUMENT_ROOT'), '', env('SCRIPT_FILENAME'));
    }
    if ($key === 'CGI_MODE') {
        return PHP_SAPI === 'cgi';
    }
    if ($key === 'HTTP_BASE') {
        $host = env('HTTP_HOST');
        if (substr_count($host, '.') !== 1) {
            return preg_replace('/^([^.])*/i', null, env('HTTP_HOST'));
        }
        return '.' . $host;
    }
    return null;
}
Esempio n. 6
0
File: Form.php Progetto: sks40gb/sks
 /**
  * submit - Handles the form, and throws an exception upon error.
  * 
  * @return boolean
  * 
  * @throws Exception 
  */
 public function submit()
 {
     if (empty($this->_error)) {
         return true;
     } else {
         $str = '';
         foreach ($this->_error as $key => $value) {
             $str .= $key . ' => ' . $value . "\n";
         }
         throw new \Exception(uc(str));
     }
 }
Esempio n. 7
0
            $username = $_POST["username"];
            $password = $_POST["password"];
            $cpassword = $_POST["cpassword"];
            $email = $_POST["email"];
            $cemail = $_POST["cemail"];
            $aemail = $_POST["aemail"];
            $pemail = $_POST["pemail"];
            $country = $_POST["country"];
            if ($username == NULL | $password == NULL | $cpassword == NULL | $email == NULL | $cemail == NULL | $pemail == NULL | $country == NULL) {
                ?>
			<div class="cuadro_error">Son requeridos todos los campos del formulario</div><?php 
            } else {
                // sanitizamos las variables
                $username = uc($username);
                $password = uc($password);
                $cpassword = uc($cpassword);
                $email = limpiar($email);
                $cemail = limpiar($cemail);
                $aemail = limpiar($aemail);
                $pemail = limpiar($pemail);
                $country = limpiar($country);
                // limitamos el numero de caracteres
                $username = limitatexto($username, 15);
                $password = limitatexto($password, 15);
                $cpassword = limitatexto($cpassword, 15);
                $email = limitatexto($email, 100);
                $cemail = limitatexto($cemail, 100);
                $aemail = limitatexto($aemail, 100);
                $pemail = limitatexto($pemail, 100);
                $country = limitatexto($country, 15);
                // comprobamos que tengan un minimo de caracteres
class="on"<?php 
            }
            ?>
><?php 
            echo $val["title"];
            ?>
</a></li><?php 
        }
    }
} else {
    echo "";
}
if (!is_null($uid)) {
    ?>
<li><a href="<?php 
    echo uc('uc/index');
    ?>
" target="_blank">我的专辑</a></li><?php 
}
?>
</ul></div><div class="album_index infinite_scroll clearfix" style="min-height:200px;"><ul><?php 
if (is_array($album_list)) {
    $key = 0;
    $__LIST__ = $album_list;
    if (count($__LIST__) == 0) {
        echo "";
    } else {
        foreach ($__LIST__ as $key => $val) {
            $mod = $key % 2;
            ++$key;
            if ($val["items_num"] != 0) {
Esempio n. 9
0
<?php

require_once __DIR__ . '/vendor/autoload.php';
use Alfred\Workflow;
use Guzzle\Http\Client;
$wf = new Workflow('com.ryanparman.workflow.redbox');
$http = new Client();
$query = stripslashes($argv[1]);
$request = $http->get("https://content.atomz.com/autocomplete/sp10/04/a1/b7/?query=" . urlencode($query));
$r = $request->send()->getBody(true);
// Do some cleanup
$r = trim(substr(trim($r), 1, -1));
$r = preg_replace('/\\s+/i', ' ', $r);
$r = json_decode($r, true);
function uc($s)
{
    $s = ucwords($s);
    $s = str_ireplace('blu-ray', 'Blu-ray', $s);
    return $s;
}
if (count($r) > 0) {
    foreach ($r as $i => $result) {
        $result = uc($result);
        $wf->result(array('uid' => sha1($query . $i . time()), 'arg' => rawurlencode($result), 'title' => $result, 'subtitle' => "Search Redbox for \"{$result}\"", 'icon' => __DIR__ . '/icon.png', 'valid' => 'yes'));
    }
} else {
    $wf->result(array('uid' => sha1($query . $i . time()), 'arg' => rawurlencode($query), 'title' => 'No results found for "' . uc($query) . '"', 'subtitle' => "Try using fewer keywords.", 'icon' => __DIR__ . '/icon.png', 'valid' => 'no'));
}
echo $wf->toXML();
Esempio n. 10
-1
function index_print()
{
    global $root, $srcdir, $tmpdir;
    include_once $srcdir . DS . 'libs' . DS . 'fpdf.php';
    include_once $srcdir . DS . 'libs' . DS . 'barcode.php';
    if (!isset($_POST['mandate'])) {
        $_POST['mandate'] = 1;
    }
    if (!isset($_POST['subscription'])) {
        $_POST['subscription'] = 1;
    }
    $mdt = new Modele('mandate');
    $mdt->fetch($_POST['mandate']);
    $sub = new Modele('subscription');
    $sub->fetch($_POST['subscription']);
    $usr = new Modele('users');
    $usr->fetch($_SESSION['user']['user_id']);
    $sublist = new Modele('subscription');
    //$sublist->find(array('subscription_mandate' => $mdt->mandate_id));
    $sublist->find();
    if (new DateTime($mdt->mandate_start) > new DateTime() || new DateTime($mdt->mandate_end) < new DateTime()) {
        modexec('syscore', 'moderror');
    }
    ob_start();
    $pdf = new FPDF();
    $pdf->AddPage();
    $pdf->SetXY(18, 12);
    $pdf->SetFont('Arial', '', 30);
    $pdf->Cell(180, 10, 'EPITANIME', 0, 0, 'C');
    $pdf->SetFont('Arial', '', 10);
    $pdf->SetXY(18, 21);
    $pdf->Cell(180, 5, 'FEUILLE DE RENSEIGNEMENTS ' . uc($mdt->mandate_label), 0, 0, 'C');
    $pdf->SetXY(18, 26);
    $pdf->Cell(180, 5, 'Veuillez remplir lisiblement en lettres capitales', 0, 0, 'C');
    $pdf->SetFont('Arial', 'B', 10);
    $pdf->SetXY(18, 35);
    $pdf->Cell(180, 5, 'Informations essentielles :', 0, 0, '');
    $pdf->SetXY(18, 40);
    $pdf->Cell(50, 5, 'Pseudo', 1, 0, '');
    $pdf->SetXY(18, 45);
    $pdf->Cell(50, 5, 'Nom', 1, 0, '');
    $pdf->SetXY(18, 50);
    $pdf->Cell(50, 5, uc('Prénom'), 1, 0, '');
    $pdf->SetXY(18, 55);
    $pdf->Cell(50, 5, 'Adresse', 1, 0, '');
    $pdf->SetXY(18, 60);
    $pdf->Cell(50, 5, 'Code postal', 1, 0, '');
    $pdf->SetXY(18, 65);
    $pdf->Cell(50, 5, 'Ville', 1, 0, '');
    $pdf->SetXY(18, 70);
    $pdf->Cell(50, 5, 'Sexe', 1, 0, '');
    $pdf->SetXY(18, 75);
    $pdf->Cell(50, 5, 'Date de naissance', 1, 0, '');
    $pdf->SetXY(18, 80);
    $pdf->Cell(50, 5, uc('Téléphone'), 1, 0, '');
    $pdf->SetXY(18, 85);
    $pdf->Cell(50, 5, 'Courriel', 1, 0, '');
    $pdf->SetXY(18, 95);
    $pdf->Cell(50, 5, uc('Réservé aux étudiants IONIS'), 0, 0, '');
    $pdf->SetXY(18, 100);
    $pdf->Cell(50, 5, 'Login', 1, 0, '');
    $pdf->SetXY(18, 105);
    $pdf->Cell(50, 5, 'Ecole', 1, 0, '');
    $pdf->SetXY(18, 110);
    $pdf->Cell(50, 5, 'Promotion', 1, 0, '');
    $pdf->SetXY(18, 120);
    $pdf->Cell(50, 5, uc('Réservé aux membres prenant l\'inscription FFG (fédération française de GO)'), 0, 0, '');
    $pdf->SetXY(18, 125);
    $pdf->Cell(50, 5, uc('Nationalité'), 1, 0, '');
    $pdf->SetXY(18, 130);
    $pdf->Cell(50, 5, 'Niveau', 1, 0, '');
    $pdf->SetXY(18, 135);
    $pdf->Cell(50, 5, 'Pseudo FFG', 1, 0, '');
    $pdf->SetFont('Arial', '', 12);
    $pdf->SetXY(18, 222);
    $pdf->Cell(160, 5, uc('Reçu par ______________________ le ___/___/20___ , accompagné de la cotisation choisie.'), 0, 0, '');
    $pdf->SetFont('Arial', 'B', 10);
    $pdf->SetXY(38, 230);
    $pdf->Cell(50, 5, 'Signature du membre', 1, 0, '');
    $pdf->Rect(38, 235, 50, 20);
    $pdf->SetXY(130, 230);
    $pdf->Cell(50, 5, uc('Signature du récepteur'), 1, 0, '');
    $pdf->Rect(130, 235, 50, 20);
    $pdf->SetFont('Arial', '', 8);
    $pdf->SetXY(18, 260);
    $pdf->MultiCell(180, 3, uc('Les informations recueillies sont nécessaires pour votre adhésion. Elles font l’objet d’un traitement informatique et sont destinées au secrétariat de l’association. En application de l’article 34 de la loi du 6 janvier 1978, vous bénéficiez d’un droit d’accès et de rectification aux informations qui vous concernent. Si vous souhaitez exercer ce droit et obtenir communication des informations vous concernant, veuillez vous adresser au secrétariat de l’association.'));
    $pdf->SetFont('Arial', '', 10);
    $pdf->SetXY(68, 40);
    $pdf->Cell(130, 5, uc($usr->user_name), 1, 0, '');
    $pdf->SetXY(68, 45);
    $pdf->Cell(130, 5, uc($usr->user_lastname), 1, 0, '');
    $pdf->SetXY(68, 50);
    $pdf->Cell(130, 5, uc($usr->user_firstname), 1, 0, '');
    $pdf->SetXY(68, 55);
    $pdf->Cell(130, 5, uc($usr->user_address), 1, 0, '');
    $pdf->SetXY(68, 60);
    $pdf->Cell(130, 5, uc($usr->user_cp), 1, 0, '');
    $pdf->SetXY(68, 65);
    $pdf->Cell(130, 5, uc($usr->user_town), 1, 0, '');
    $pdf->SetXY(68, 70);
    $pdf->Cell(130, 5, uc($usr->user_sexe), 1, 0, '');
    $pdf->SetXY(68, 75);
    $pdf->Cell(130, 5, uc($usr->user_born), 1, 0, '');
    $pdf->SetXY(68, 80);
    $pdf->Cell(130, 5, uc($usr->user_phone), 1, 0, '');
    $pdf->SetXY(68, 85);
    $pdf->Cell(130, 5, uc($usr->user_email), 1, 0, '');
    $pdf->SetXY(68, 100);
    $pdf->Cell(130, 5, uc($usr->user_login), 1, 0, '');
    $pdf->SetXY(68, 105);
    $pdf->Cell(130, 5, uc($usr->user_type->ut_name), 1, 0, '');
    $pdf->SetXY(68, 110);
    $pdf->Cell(130, 5, uc($usr->user_promo), 1, 0, '');
    $pdf->SetXY(68, 125);
    $pdf->Cell(130, 5, '', 1, 0, '');
    $pdf->SetXY(68, 130);
    $pdf->Cell(130, 5, '', 1, 0, '');
    $pdf->SetXY(68, 135);
    $pdf->Cell(130, 5, '', 1, 0, '');
    $pdf->SetFont('Arial', 'B', 10);
    $pdf->SetXY(18, 145);
    $pdf->Cell(50, 5, uc('Cotisation'), 0, 0, '');
    $cb = '9' . str_pad($mdt->getKey(), 4, '0', STR_PAD_LEFT) . str_pad($usr->getKey(), 7, '0', STR_PAD_LEFT);
    $cbfile = tempnam($tmpdir, 'cb');
    imagebarcode($cbfile, $cb, 200, 40, 2);
    $pdf->Image($cbfile, 10, 10, 30, 0, 'PNG');
    unlink($cbfile);
    $pdf->SetFont('Arial', 'I', 8);
    $pdf->SetXY(185, 10);
    $pdf->Cell(10, 5, $usr->getKey(), 0, 0, 'R');
    $pos = -1;
    $pdf->SetFont('Arial', '', 10);
    while ($c = $sublist->next()) {
        $pos++;
        $x = 25 + $pos % 2 * 90;
        $y = 150 + 5 * floor($pos / 2);
        $pdf->SetXY($x, $y);
        $pdf->Cell(60, 5, uc($c['subscription_label']), 1, 0, '');
        $pdf->Cell(15, 5, number_format($c['subscription_price'], 2, ',', '') . ' ' . chr(128), 1, 0, '');
        $pdf->Rect($x + 75, $y, 5, 5);
        if ($c['subscription_id'] == $sub->subscription_id) {
            $pdf->SetFont('Arial', 'B', 12);
            $pdf->Cell(5, 5, 'X', 0, 0, 'C');
            $pdf->SetFont('Arial', '', 10);
        }
    }
    if (ob_get_flush() == '') {
        $pdf->Output('inscription.pdf', 'I');
    }
    quit();
}