Ejemplo n.º 1
0
    private function _displayTm4b()
    {
        include_once dirname(__FILE__) . '/classes/Tm4bSms.php';
        $testsms_txt = 'Send';
        $this->_html .= '
		<fieldset><legend><img src="' . $this->_path . 'informations.gif" alt="" title="" /> ' . $this->l('Information') . '</legend>
			<form action="' . $_SERVER['REQUEST_URI'] . '" method="post">
				<label>' . $this->l('Send test SMS:') . '</label>
				<div class="margin-form"><input onclick="this.value=\'\'" type="text" style="margin-bottom:10px;" name="test_number" size="30" value="' . ((isset($_POST) and isset($_POST['test_number'])) ? $_POST['test_number'] : $this->l('Enter your phone number')) . '">
				<input class="button" name="btnTestSms" value="' . $testsms_txt . '" type="submit" style="margin-bottom:10px;" /><br />' . $this->l('ex: 33642424242') . '</div>';
        if (!empty($this->_user) and !empty($this->_password)) {
            $sms = new Tm4bSms($this->_user, $this->_password, $this->_route, $this->_originator);
            $credits = $sms->CheckCredits();
            $color = $credits < self::__TM4B_LOWBALANCE__ ? '#900' : '#080';
            $this->_html .= '<label>' . $this->l('SMS credits:') . '</label>
					<div class="margin-form" style="color:#000000; font-size:12px;">' . $this->l('You have') . ' <span style="font-weight: bold; color: ' . $color . ';">' . $credits . '</span> ' . $this->l('credits') . '</div>';
        }
        $this->_html .= '
			</form>
		</fieldset><br />';
    }
Ejemplo n.º 2
0
<?php

include dirname(__FILE__) . '/../../config/config.inc.php';
include dirname(__FILE__) . '/../../init.php';
include dirname(__FILE__) . '/tm4b.php';
include dirname(__FILE__) . '/classes/Tm4bSms.php';
if (!Configuration::get('TM4B_DAILY_REPORT_ACTIVE')) {
    die('Daily report not active');
}
if (Configuration::get('TM4B_LAST_REPORT') == date('Y-m-d')) {
    die('Report already sent');
}
Configuration::updateValue('TM4B_LAST_REPORT', date('Y-m-d'));
$module = new Tm4b();
$sms = new Tm4bSms(Configuration::get('TM4B_USER'), Configuration::get('TM4B_PASSWORD'), Configuration::get('TM4B_ROUTE'));
$sms->msg = $module->getStatsBody();
$numbers = explode(',', Configuration::get('TM4B_NEW_ORDER_NUMBERS'));
foreach ($numbers as $number) {
    if ($number != '') {
        $sms->addRecipient($number);
    }
}
$sms->Send(Configuration::get('TM4B_SIM'));
die('OK');
Ejemplo n.º 3
0
    private function _displayTm4b()
    {
        require_once dirname(__FILE__) . '/classes/Tm4bSms.php';
        $testsms_txt = 'Send';
        $this->_html .= '
		<fieldset><legend><img src="' . $this->_path . 'informations.gif" alt="" title="" /> ' . $this->l('Information') . '</legend>
			<form action="' . Tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']) . '" method="post">
				<label>' . $this->l('Send test SMS:') . '</label>
				<div class="margin-form"><input onclick="this.value=\'\'" type="text" style="margin-bottom:10px;" name="test_number" size="30" value="' . Tools::getValue('test_number', $this->l('Enter your phone number')) . '">
				<input class="button" name="btnTestSms" value="' . $testsms_txt . '" type="submit" style="margin-bottom:10px;" /><br />' . $this->l('ex: 33642424242') . '</div>';
        if (!empty($this->_user) and !empty($this->_password)) {
            $sms = new Tm4bSms($this->_user, $this->_password, $this->_route, $this->_originator);
            $credits = $sms->CheckCredits();
            $color = $credits < self::__TM4B_LOWBALANCE__ ? '#900' : '#080';
            $this->_html .= '<label>' . $this->l('SMS credits:') . '</label>
					<div class="margin-form" style="color:#000000; font-size:12px;">' . $this->l('You have') . ' <span style="font-weight: bold; color: ' . $color . ';">' . $credits . '</span> ' . $this->l('credits') . '</div>';
        }
        $this->_html .= '
			</form>
		</fieldset><br />
		<fieldset>
			<legend><img src="' . $this->_path . 'informations.gif" alt="" title="" /> ' . $this->l('Information about CRON tab') . '</legend>
			
			<label>' . $this->l('URL for cron task configuration:') . '</label>
			<b>http://' . Tools::getShopDomain() . __PS_BASE_URI__ . 'modules/' . $this->name . '/cron.php?token=' . $this->token . '</b>
		</fieldset><br />';
    }