Example #1
0
include WWW_ROOT . 'lib/members.lib.php';
include WWW_ROOT . 'lib/networking.lib.php';
include WWW_ROOT . 'lib/version.lib.php';
include WWW_ROOT . 'lib/cluster.lib.php';
include WWW_ROOT . 'lib/mail.lib.php';
$db = new sql_db(DB_HOST, DB_USER, DB_PASS, DB_NAME);
$whereCond = "m_mailer_enable = 1 AND m_state != 'deleted'";
while ($m = $db->find("members", $whereCond)) {
    $member = member_load($m["m_id"]);
    if ($member->m["m_paid_until"] - time() <= 604800) {
        $subject = $cluster_cfg->get("mailer_tpl_payment_warning_subj");
        $subject = str_replace("%member%", $m["m_nick"], $subject);
        $content = $cluster_cfg->get("mailer_tpl_payment_warning");
        $content = str_replace("%member%", $m["m_nick"], $content);
        $content = str_replace("%memberid%", $m["m_id"], $content);
        $content = str_replace("%expiredate%", $m["m_paid_until"] ? strftime("%Y-%m-%d", $m["m_paid_until"]) : '---', $content);
        $content = str_replace("%monthly%", $m["m_monthly_payment"], $content);
        send_mail($m["m_mail"], $subject, $content, $cluster_cfg->get("mailer_admins_in_cc") ? explode(",", $cluster_cfg->get("mailer_admins_cc_mails")) : array());
    }
}
$rs = $db->query("SELECT v.vps_id, vps_expiration, m_nick, m_mail FROM vps v\n                  INNER JOIN members m ON v.m_id = m.m_id\n                  WHERE m_mailer_enable = 1\n                    AND vps_expiration IS NOT NULL\n                    AND vps_deleted IS NULL\n                    AND DATE_SUB(FROM_UNIXTIME(vps_expiration), INTERVAL 7 DAY) < NOW()\n                    AND FROM_UNIXTIME(vps_expiration) > NOW()");
while ($row = $db->fetch_array($rs)) {
    $subject = $cluster_cfg->get("mailer_tpl_vps_expiration_subj");
    $subject = str_replace("%member%", $row["m_nick"], $subject);
    $subject = str_replace("%vpsid%", $row["vps_id"], $subject);
    $content = $cluster_cfg->get("mailer_tpl_vps_expiration");
    $content = str_replace("%member%", $row["m_nick"], $content);
    $content = str_replace("%vpsid%", $row["vps_id"], $content);
    $content = str_replace("%datetime%", strftime("%Y-%m-%d %H:%M", $row["vps_expiration"]), $content);
    send_mail($row["m_mail"], $subject, $content);
}
Example #2
0
    echo '<option value="' . $tpl["templ_id"] . '">' . $tpl["templ_label"] . '</option>';
}
?>
		 	 </select>

			 <span>Preferovaná lokace pro VPS:</span>
			 <select name="location" id="location">
				<?php 
$sql = 'SELECT location_id, location_label
						FROM locations l
						INNER JOIN servers s ON l.location_id = s.server_location
						WHERE s.environment_id = ' . $db->check(ENVIRONMENT_ID) . '
						GROUP BY location_id
						ORDER BY location_id';
$rs = $db->query($sql);
while ($loc = $db->fetch_array($rs)) {
    echo '<option value="' . $loc["location_id"] . '">Master Internet ' . $loc["location_label"] . '</option>';
}
?>
			 </select>
			 <span>Měna platby:</span>
			 <select name="currency" id="currency">
 			   <option value="CZK">členský poplatek 900&nbsp;Kč na tři měsíce</option>
 			   <option value="EUR">členský poplatek 36&nbsp;eur na tři měsíce</option>			 
			 </select>
			 
			 <input type="submit" name="send" id="send" class="largeButton" value="Odeslat" onclick="signup(); return false;">
			</form>
		</div>
	</section>
Example #3
0
$_SESSION["is_admin"] = true;
define('CRON_MODE', true);
define('DEMO_MODE', false);
// Include libraries
include WWW_ROOT . 'lib/db.lib.php';
include WWW_ROOT . 'lib/functions.lib.php';
include WWW_ROOT . 'lib/version.lib.php';
include WWW_ROOT . 'lib/cluster.lib.php';
$db = new sql_db(DB_HOST, DB_USER, DB_PASS, DB_NAME);
if ($cluster_cfg->get("maintenance_mode")) {
    echo "MAINTENANCE";
    exit;
}
$rs = $db->query("SELECT server_id, server_name\n                  FROM locations l\n                  INNER JOIN servers s ON l.location_id = s.server_location\n                  WHERE server_maintenance = 0\n                  ORDER BY l.location_id, s.server_id");
$bad = false;
while ($row = $db->fetch_array($rs)) {
    $sql = 'SELECT * FROM servers_status WHERE server_id ="' . $row["server_id"] . '"';
    if ($result = $db->query($sql)) {
        $status = $db->fetch_array($result);
    }
    if (time() - $status["timestamp"] > 150) {
        if (!$bad) {
            $bad = true;
            header('HTTP/1.1 503 Service Unavailable');
        }
        echo $row["server_name"] . "\n";
    }
}
if (!$bad) {
    echo "OK";
}