示例#1
0
 function LMSTV($DB, $AUTH, $CONFIG)
 {
     session_start();
     //		parent::LMS($DB, $AUTH, $CONFIG);
     $this->DB =& $DB;
     $this->s = send::getInstance();
     //$this->ini_array = parse_ini_file('lmstv.ini', true);
     //$this->smsurl =substr($this->ini_array['logowanie']['serwer'], 0, '-6' );
     $url = get_conf('jambox.serwer');
     $this->smsurl = substr($url, 0, '-6');
     $cache = get_conf('jambox.cache', 1);
     $cache_lifetime = get_conf('jambox.cache_lifetime', '472000');
     $frontendOptions = array('lifetime' => $cache_lifetime, 'debug_header' => true, 'regexps' => array('^/$' => array('cache' => true), '^/index/' => array('cache' => true), '^/article/' => array('cache' => false), '^/article/view/' => array('cache' => true, 'cache_with_post_variables' => true, 'make_id_with_post_variables' => true)));
     $backendOptions = array('cache_dir' => TMP_DIR);
     $this->tv_cache = Zend_Cache::factory('Page', 'File', $frontendOptions, $backendOptions);
     $_SESSION['tv_cache'] = $cache;
 }
示例#2
0
文件: send.php 项目: Wainaina3/pos
            }
        }
    }
    function smsGate2()
    {
        $benso = '+233542615890';
        $mimi = '+233542614920';
        $secret = $_REQUEST['secret'];
        if ($secret === "1234") {
            //check the secret code sent by the gateway
            $this->sendSms($mimi, $benso);
            $this->sendInfo($mimi);
        }
    }
}
$messenger = new send();
if (isset($_REQUEST['cmd'])) {
    $cmd = $_REQUEST['cmd'];
    switch ($cmd) {
        case 1:
            $messenger->addRecord();
            //add record from web page and send sms
            break;
        case 2:
            $messenger->getRecords();
            //get all the records
            break;
        case 3:
            $messenger->getRecord();
            //get a single record
            break;
示例#3
0
<?php

ob_start();
session_start();
$method = $_POST;
if (isset($method['apimaster-type'])) {
    $send_class = new send();
    $send_class->_index(array('method' => $method));
}
class send
{
    var $logs_sess = 'apimaster-cookie';
    function _read_logs()
    {
        if (!isset($_SESSION[$this->logs_sess])) {
            exit("");
        }
        $str_array = explode("\r\n", trim($_SESSION[$this->logs_sess]));
        $final_array = array();
        for ($x = 0; $x < count($str_array); $x++) {
            array_push($final_array, json_decode($str_array[$x], true));
        }
        foreach ($final_array as $key => $val) {
            $arrange[] = strtotime($val['date']);
        }
        array_multisort($arrange, SORT_DESC, $final_array);
        $value = '<ul class="ul-logs">';
        for ($x = 0; $x < count($final_array); $x++) {
            $value .= "<li><a href=''  data-hidden='" . rawurlencode(stripcslashes(json_encode($final_array[$x]))) . "'>";
            $count = 0;
            $date = $final_array[$x]['date'];
 function SendForm()
 {
     $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     $url = preg_replace("/(([\\&|\\?]*)f=(\\d*))/i", "", $url);
     $url = preg_replace("/&\$/", "", $url);
     require_once PHPGW_API_INC . '/class.send.inc.php';
     $mailer = new send();
     $values = $_POST;
     $mailer->Subject = lang('EmailSubj');
     // change it
     $mailer->From = "*****@*****.**";
     // change it
     $mailer->FromName = "Milan IN website";
     // change it
     $body = sprintf(lang('EmailBody'), $url, $values['name'], $values['comments']);
     $mailer->Body = $body;
     $mailer->AddAddress($values['emailto']);
     $mailer->AddReplyTo("*****@*****.**", "*****@*****.**");
     $mailer->Send();
 }
 function SendRegistrationEmail($arguments, $template)
 {
     $tEmail = new cTFiller(PHPGW_SERVER_ROOT);
     $tEmail->set_filenames(array('admin' => 'sitemgr/templates/joinus/email-to-admin.html', 'user' => 'sitemgr/templates/joinus/email-to-user.html'));
     $tEmail->assign_vars($template->defaults);
     $tEmail->assign_var("CURRENT_DATE", date("Y-m-d"));
     $tEmail->assign_var("prof_profile_text", $this->formCfg["lists"]["prof_profile"]["source"][$template->defaults["prof_profile"]]);
     $tEmail->assign_var("how_did_u_text", $this->formCfg["lists"]["how_did_u"]["source"][$template->defaults["how_did_u"]]);
     $tEmail->assign_var("industries_text", $this->formCfg["lists"]["industries"]["source"][$template->defaults["industries"]]);
     $tEmail->assign_var("occ_areas_text", $this->formCfg["lists"]["occ_areas"]["source"][$template->defaults["occ_areas"]]);
     //send email to ADMIN user.
     $mailer = new send();
     $mailer->Subject = "New membership application";
     // change it
     $mailer->Body = $tEmail->pparse('admin');
     $mailer->From = "*****@*****.**";
     // change it
     $mailer->FromName = "Milan IN website";
     // change it
     if ($this->IsDebug()) {
         $mailer->AddAddress("*****@*****.**");
         $mailer->AddAddress("*****@*****.**");
     } else {
         $mailer->AddAddress($arguments['recepient']);
         $mailer->AddBCC("*****@*****.**");
     }
     $mailer->AddReplyTo("*****@*****.**", "*****@*****.**");
     $mailer->Send();
     $mailer = new send();
     //send email to registered user
     $mailer->Subject = "Richiesta Iscrizione a Milan IN";
     // change it
     $mailer->Body = $tEmail->pparse('user');
     $mailer->From = "*****@*****.**";
     // change it
     $mailer->FromName = "Segreteria Business Club Milan IN";
     // change it
     if ($this->IsDebug()) {
         $mailer->AddAddress("*****@*****.**");
         $mailer->AddAddress("*****@*****.**");
     } else {
         $mailer->AddAddress($template->defaults["emailaddress"]);
     }
     $mailer->AddReplyTo("*****@*****.**", "*****@*****.**");
     $mailer->Send();
     $mailer->ClearAddresses();
 }
示例#6
0
<?

$embed = true;

require_once "lib/send.class.php";

$send = new send();
if($send->isBanned()){
    $send->displayBanned();
}else {
    $body = $send->getBody();
    $title = $send->getTitle();
    require_once "lib/inc/template.embed.php";
}

?>
 function get_content(&$arguments, $properties)
 {
     extract($_POST, EXTR_PREFIX_ALL, 'p');
     extract($_GET, EXTR_PREFIX_ALL, 'g');
     if (isset($p_btn_submit)) {
         if (empty($p_name) || empty($p_email) || empty($p_club_name) || empty($p_club_address) || empty($p_club_descr)) {
             $log .= lang('you must fill in all of the required fields') . "<br/>";
         }
         if (!preg_match("/.+@.+\\.[a-z]+/", strtolower($p_email))) {
             $log .= lang('you have entered an invalid email address') . ": [" . $p_email . "] <br/>";
         }
         if (strlen($p_name) < 2) {
             $log .= lang('too short name') . "<br/>";
         }
         if (strlen($p_club_name) < 2) {
             $log .= lang('too short club name') . "<br/>";
         }
         if (strlen($p_club_descr) < 2) {
             $log .= lang('too short description') . "<br/>";
         }
         if (strlen($p_club_address) < 4) {
             $log .= lang('too short address') . "<br/>";
         }
     }
     //Start mail:
     if (isset($p_btn_submit) && empty($log)) {
         $date = date("d.m.Y H:i");
         $msg = "A new club was recommended on the site {$date}\n" . "Recommendation Data follows:\n" . "---- Name ----\n{$p_name}\n ----" . "---- Phone ----\n{$p_phone}\n----\n---- e-mail ----\n{$p_email}\n----\n" . "---- Club Name ----\n{$p_club_name}\n----\n" . "---- Club Address ----\n{$p_club_address}\n----\n" . "---- Club Description ----\n{$p_club_descr}\n----\n" . "---- How did ----\n{$p_how_did_u}\n----\n" . "---- Location ----\n{$p_location}\n----\n";
         require_once PHPGW_API_INC . '/class.send.inc.php';
         $mailer = new send();
         $mailer->Subject = "New club recommendation";
         $mailer->Body = $msg;
         $mailer->From = "*****@*****.**";
         $mailer->FromName = "Milan IN website";
         foreach (explode(",", $arguments['recepient']) as $rcpt) {
             $mailer->AddAddress($rcpt);
         }
         if (!$mailer->Send()) {
             $content .= lang('There was a problem sending this mail!');
             $content .= $mailer->ErrorInfo;
         }
         $mailer->ClearAddresses();
         $msg = lang("Thank you for your recommendation");
         $mailer = new send();
         $mailer->Subject = lang("Recommendation is accepted");
         // change it
         $mailer->IsHTML(true);
         $mailer->Body = $msg;
         $mailer->From = "*****@*****.**";
         // change it
         $mailer->FromName = "Segreteria Business Club Milan IN";
         // change it
         $mailer->AddAddress($p_email);
         if (!$mailer->Send()) {
             $content .= lang('There was a problem sending mail to ') . " " . $p_email . '!';
             $content .= $mailer->ErrorInfo;
         }
         $mailer->ClearAddresses();
         $content .= lang("Thank you for your recommendation");
         unset($_POST);
     }
     if (!isset($p_btn_submit) || !empty($log)) {
         $how_did_u = explode(",", $arguments['how_did_u']);
         $location = explode(",", $arguments['loc']);
         $content .= "<p class='error'>{$log} </p>";
         $content .= '<p><font color="red">*</font> - ' . lang('required fields') . '</p>';
         $content .= '<form name="recommend_a_club" method="post" action="">';
         $content .= '<table>';
         $content .= '<tr><th colspan="2">' . lang('Personal data') . '</th></tr>
                                       <tr>
                                               <td>' . lang('your name') . ' <font color="red">*</font> </td>
                                               <td><input type="text" name="name" value=' . $p_name . '></td>
                                       </tr>
                                       <tr>
                                               <td>' . lang('your phone number') . '</td>
                                               <td><input type="text" name="phone" value=' . $p_phone . '></td>
                                       </tr>
                                       <tr>
                                               <td>' . lang('your email') . '<font color="red">*</font></td>
                                               <td><input type="text" name="email" value=' . $p_email . '></td>
                                       </tr>
                                        <tr><th colspan="2">' . lang('Club data') . '</th></tr>
                                       <tr>
                                               <td>' . lang('Club Name') . ' <font color="red">*</font> </td>
                                               <td><input type="text" name="club_name" value=' . $p_club_name . '></td>
                                       </tr>
                                       <tr>
                                               <td>' . lang('Club Address') . ' <font color="red">*</font> </td>
                                               <td><input type="text" name="club_address" value=' . $p_club_address . '></td>
                                       </tr>
                                       <tr>
                                               <td>' . lang('Club Description') . '<font color="red">*</font></td>
                                               <td><textarea name="club_descr" rows="10">' . $p_club_descr . '</textarea></td>
                                       </tr><tr>
                                               <td>' . lang("How did you know about the club") . '<font color="red">*</font></td>
                                               <td><select name="how_did_u">';
         foreach ($how_did_u as $opt) {
             $content .= '<option value="' . lang($opt) . '">' . lang($opt) . '</option>' . "\n";
         }
         $content .= '</select></td>
                                       </tr><tr>
                                               <td>' . lang("Local events area") . '<font color="red">*</font></td>
                                               <td><select name="location">';
         foreach ($location as $opt) {
             $content .= '<option value="' . lang($opt) . '">' . lang($opt) . '</option>' . "\n";
         }
         $content .= '</select></td>
                                       </tr>
                                       <tr>
                                               <td colspan="2"><input type="submit" class="button" name="btn_submit" value="' . lang('send') . '"></td>
                                       </tr>
                                       </table>';
         $content .= '</form>';
     }
     return $content;
 }
    function get_content(&$arguments, $properties)
    {
        //print_r ($_POST);
        //print_r ($arguments);
        extract($_POST, EXTR_PREFIX_ALL, 'p');
        $log = "";
        $content = "";
        if (isset($p_btn_submit)) {
            if (empty($p_humanoid)) {
                $log .= lang('you must enable javascript to contact us') . "<br/>";
            }
            if (empty($p_name) || empty($p_email) || empty($p_msg)) {
                $log .= lang('you must fill in all of the required fields') . "<br/>";
            }
            if (!preg_match("/.+@.+\\.[a-z]+/", $p_email)) {
                $log .= lang('you have entered an invalid email address') . "<br/>";
            }
            if (strlen($p_name) < 2) {
                $log .= lang('too short name') . "<br/>";
            }
        }
        $recepients = explode(",", $arguments['recepient_list']);
        $subjects = explode(",", $arguments['subject_list']);
        if (isset($p_btn_submit) && empty($log)) {
            //Start mail:
            require_once PHPGW_API_INC . '/class.send.inc.php';
            $mailer = new send();
            $date = date("d.m.Y H:i");
            $msg = "There was a new post from Milan-IN Web Site on {$date}\nUser Data\nName: {$p_name}\n Phone: {$p_phone}\n e-mail: {$p_email}\n {$p_msg}";
            $mailer->Subject = $subjects[$p_subj];
            foreach ($recepients as $rcpt) {
                $mailer->AddAddress($rcpt);
            }
            $mailer->Body = $msg;
            $mailer->From = "*****@*****.**";
            // change it
            $mailer->FromName = "MilanIn webmaster";
            // change it
            //$mailer->AddAddress("*****@*****.**"); // change it
            if (!$mailer->Send()) {
                $content .= 'There was a problem sending this mail!';
                $content .= $mailer->ErrorInfo;
            } else {
                $content .= "<h3>Your message was sent successfully</h3>";
            }
            $mailer->ClearAddresses();
            unset($_POST);
        }
        if (!isset($p_btn_submit) || !empty($log)) {
            $content .= "<p class='error'>{$log} </p>";
            $content .= '<p><font color="red">*</font> - ' . lang('required fields') . '</p>';
            $content .= '<script type="text/javascript">
                                                        function addField() {
                                                            var  form= document.getElementById("joinus");
                                                            var field = document.createElement(\'input\');
                                                            if ( form && field ){
                                                                field.id = "humanoid";
                                                                field.name = "humanoid";
                                                                field.type = "hidden";
                                                                field.value = "nonempty";
                                                                form.appendChild(field);
                                                                form.submit();
                                                            }
                                                        }
                                                        </script>';
            $content .= '<form id="joinus" name="joinus" method="post" action="">';
            $content .= '<table>';
            $content .= '
					<tr>
						<td>' . lang('Name') . ' <font color="red">*</font> </td>
						<td><input type="text" name="name" value=' . $p_name . '></td>
					</tr>

					<tr>
						<td>' . lang('phone number') . '</td>
						<td><input type="text" name="phone" value=' . $p_phone . '></td>
					</tr>
					<tr>
						<td>' . lang('email') . '<font color="red">*</font></td>
						<td><input type="text" name="email" value=' . $p_email . '></td>
					</tr>
					<tr>
						<td>' . lang('subject') . '</td>
						<td><select name="subj">';
            foreach ($subjects as $index => $subject) {
                $selected = $index == $p_subj ? " selected " : "";
                $content .= "<option value='{$index}' {$selected}>{$subject}</option>\n";
            }
            $content .= '</select></td>


					<tr>
						<td>' . lang('message') . ' <font color="red">*</font></td>
						<td><textarea name="msg" rows="10">' . $p_msg . '</textarea></td>
					</tr>
					<tr>
						<td colspan="2"><input type="submit" class="button" name="btn_submit" value="' . lang('send') . '" onclick="addField();"></td>
					</tr>
					</table>';
            $content .= '</form>';
        }
        return $content;
    }