Example #1
0
 function e($name, $message)
 {
     $sql = "INSERT INTO `logs`" . " (`kind`, `name`, `message`, `createdAt`)" . " VALUES (?, ?, ?, ?)";
     $statement = $this->db->prepare($sql);
     return $statement->execute(array("e", $name, $message, current_date()));
 }
Example #2
0
function create_game($my_player)
{
    return create_entry("game", array("date", "my_player"), array(), array("date" => current_date(), "my_player" => $my_player));
}
Example #3
0
 /**
  * Sanitizes a comment.
  */
 private function sanitize()
 {
     global $is_index, $index, $content;
     // Sanitize user input
     $this->message = sanitize_html($_POST['comment-message']);
     $this->name = sanitize_string($_POST['comment-name']);
     $this->email = $_POST['comment-email'];
     $this->website = sanitize_url($_POST['comment-website']);
     // Get date, time
     $this->date = current_date();
     $this->time = current_time();
 }
Example #4
0
 function insert_into($live_id, $title)
 {
     $sql = "INSERT INTO `lives`" . " (`nicoLiveId`, `title`, `createdAt`)" . " VALUES (?, ?, ?)";
     $statement = $this->db->prepare($sql);
     return $statement->execute(array($live_id, $title, current_date()));
 }
/**
 * smspromote (german provider for sending paid SMS)
 * 
 * @param unknown $param
 * @return Ambigous <string>
 */
function churchdb_smspromote($param)
{
    global $config, $user;
    $url = "https://gateway.smspromote.de";
    // Gateway URL
    // $url = "https://gateway.smspromote.de/bulk/";
    $request = "";
    $param["key"] = $config["churchdb_smspromote_apikey"];
    // Gateway Key
    $param["route"] = "gold";
    // use of Goldroute
    // $param["route"] = "basic";// use of Basicroute
    $param["debug"] = "0";
    // SMS will not be send - Testmode
    $param["message"] = utf8_decode($param["message"]);
    foreach ($param as $key => $val) {
        $request .= $key . "=" . urlencode($val) . "&";
    }
    /********************************************************
     * through file, Problem, allow_url_fopen=on needed!
     * // send SMS
     * $response = @file($url."?".$request); // send request
     * $response_code = intval($response[0]); // read response code
     ********************************************************/
    /**
     * Through FSOCKOPEN, SSL DON'T WORKS, DOES IT?
     */
    //
    // prepare connection
    $host = "gateway.smspromote.de";
    $script = "/";
    $request_length = strlen($request);
    $method = "POST";
    // generate HTTP Header, currently use 1.0 to prevent chunked
    $header = "{$method} {$script} HTTP/1.0\r\n";
    $header .= "Host: {$host}\r\n";
    $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
    $header .= "Content-Length: {$request_length}\r\n";
    $header .= "Connection: close\r\n\r\n";
    $header .= "{$request}\r\n";
    // open connection
    $socket = @fsockopen($host, 80, $errno, $errstr);
    if ($socket) {
        fputs($socket, $header);
        // send Header
        while (!feof($socket)) {
            $output[] = fgets($socket);
            // get Response
        }
        fclose($socket);
    }
    $response_code = intval($output[count($output) - 1]);
    $response_code_arr = array();
    $response_code_arr[0] = "Keine Verbindung zum Gateway";
    $response_code_arr[10] = "Empfänger fehlerhaft";
    $response_code_arr[20] = "Absenderkennung zu lang";
    $response_code_arr[30] = "Nachrichtentext zu lang";
    $response_code_arr[31] = "Messagetyp nicht korrekt";
    $response_code_arr[40] = "Falscher SMS-Typ";
    $response_code_arr[50] = "Fehler bei Login";
    $response_code_arr[60] = "Guthaben zu gering";
    $response_code_arr[70] = "Netz wird von Route nicht unterstützt";
    $response_code_arr[71] = "Feature nicht über diese Route möglich";
    $response_code_arr[80] = "SMS konnte nicht versendet werden";
    $response_code_arr[90] = "Versand nicht möglich";
    $response_code_arr[100] = "SMS wurde erfolgreich versendet.";
    $body = $param["message"] . "<br><br><i>Status: " . $response_code_arr[$response_code] . "</i>";
    db_query('INSERT INTO {cc_mail_queue} (receiver, sender, subject, body, htmlmail_yn, priority, 
               modified_date, modified_pid, send_date, error, reading_count) 
            VALUES (:receiver, :sender, :subject, :body, :htmlmail_yn, :priority, 
               :modified_date, :modified_pid, :send_date, :error, :reading_count)', array(":receiver" => $param["to"], ":sender" => "{$user->vorname} {$user->name}", ":subject" => shorten_string($param["message"], 30), ":body" => $body, ":htmlmail_yn" => 0, ":priority" => 1, ":modified_date" => current_date(), ":modified_pid" => $user->id, ":send_date" => current_date(), ":error" => $response_code == 100 ? 0 : 1, ":reading_count" => 0));
    return $response_code_arr[$response_code];
}
Example #6
0
$this->load->view('header');
$this->load->view('sidebar');
?>
<!--MAIN-->

<div id="main">
  <!--POST PROJECT-->
  <?php 
$this->load->view('innerMenu');
$currentDate = current_date(get_est_time());
$mailCount = 0;
$unreadcount = 0;
$mailData = array();
$unreadmsg = array();
foreach ($mailList->result() as $mail) {
    if (current_date($mail->created) == $currentDate) {
        $mailCount = $mailCount + 1;
        $mailData[$mailCount] = $mail->id;
    }
    $unreadcount = $unreadcount + 1;
    $unreadmsg[$unreadcount] = $mail->id;
}
//Add comma between values for post values to controller
if (isset($mailData)) {
    $mailData = implode(',', $mailData);
}
if (isset($unreadmsg)) {
    $unreadmsg = implode(',', $unreadmsg);
}
$transactions1 = $transactions1;
//pr($transaction->result());