コード例 #1
0
ファイル: prihlaska.php プロジェクト: Jakuje/www.vpsfree.cz
 }
 if (!isset($_POST['currency'])) {
     $errors[] = 'currency';
 }
 if (count($errors) > 0) {
     if ($is_ajax) {
         echo json_encode($errors);
         die;
     } else {
         include "form.php";
         exit;
     }
 }
 $db = new sql_db(DB_HOST, DB_USER, DB_PASS, DB_NAME);
 $created = time();
 $db->query("INSERT INTO members_changes SET\n\t\t\t\t            m_created = " . $created . ",\n\t\t\t\t            m_type = 'add',\n\t\t\t\t            m_state = 'awaiting',\n\t\t\t\t            m_nick = '" . $db->check($_POST["nick"]) . "',\n\t\t\t\t            m_name = '" . $db->check($_POST["name"] . " " . $_POST["surname"]) . "',\n\t\t\t\t            m_mail = '" . $db->check($_POST["email"]) . "',\n\t\t\t\t            m_address = '" . $db->check($_POST["address"] . ", " . $_POST["zip"] . " " . $_POST["city"] . ", " . $_POST["country"]) . "',\n\t\t\t\t            m_year = '" . $db->check($_POST["birth"]) . "',\n\t\t\t\t            m_jabber = '',\n\t\t\t\t            m_how = '" . $db->check($_POST["how"]) . "',\n\t\t\t\t            m_note = '" . $db->check($_POST["note"]) . "',\n\t\t\t\t            m_distribution = '" . $db->check($_POST["distribution"]) . "',\n\t\t\t\t            m_location = '" . $db->check($_POST["location"]) . "',\n\t\t\t\t            m_currency = '" . $db->check($_POST["currency"]) . "',\n\t\t\t\t            m_reason = '',\n\t\t\t\t            m_addr = '" . $db->check($_SERVER["REMOTE_ADDR"]) . "',\n\t\t\t\t            m_addr_reverse = '" . $db->check(gethostbyaddr($_SERVER["REMOTE_ADDR"])) . "',\n\t\t\t\t            m_last_mail_id = 1\n\t\t\t\t            ");
 $request_id = $db->insert_id();
 // Mail admins
 $admins = explode(",", cfg_get("mailer_requests_sendto"));
 $subject = cfg_get("mailer_requests_admin_sub");
 $text = cfg_get("mailer_requests_admin_text");
 $subject = str_replace("%request_id%", $request_id, $subject);
 $subject = str_replace("%type%", "add", $subject);
 $subject = str_replace("%state%", "awaiting", $subject);
 $subject = str_replace("%member_id%", "-", $subject);
 $subject = str_replace("%member%", "-", $subject);
 $subject = str_replace("%name%", $_POST["name"] . " " . $_POST["surname"], $subject);
 $text = str_replace("%created%", strftime("%Y-%m-%d %H:%M", $created), $text);
 $text = str_replace("%changed_at%", "-", $text);
 $text = str_replace("%request_id%", $request_id, $text);
 $text = str_replace("%type%", "add", $text);
コード例 #2
0
ファイル: index.php プロジェクト: jandanielcz/www.vpsfree.cz
			 <span>Distribuce 64bit:</span>
 		 	 <select name="distribution" id="distribution">
				<?php 
while ($tpl = $db->findByColumn("cfg_templates", "templ_supported", "1", "templ_order, templ_label")) {
    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;">
コード例 #3
0
ファイル: cron_delete.php プロジェクト: whedro/vpsadmin
define('DEMO_MODE', false);
// Include libraries
include WWW_ROOT . 'lib/db.lib.php';
include WWW_ROOT . 'lib/functions.lib.php';
include WWW_ROOT . 'lib/transact.lib.php';
include WWW_ROOT . 'lib/vps.lib.php';
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/nas.lib.php';
include WWW_ROOT . 'lib/mail.lib.php';
$db = new sql_db(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// First delete members
$member_timeout = $cluster_cfg->get("general_member_delete_timeout") * 24 * 60 * 60;
$rs = $db->query("SELECT m_id FROM members WHERE m_state = 'deleted' AND m_deleted < " . $db->check(time() - $member_timeout));
while ($row = $db->fetch_array($rs)) {
    $m = new member_load($row["m_id"]);
    $m->delete_all_vpses(false);
    $m->destroy(false);
}
// Mark expired VPSes for lazy deletion
$rs = $db->query("SELECT vps_id FROM vps WHERE vps_expiration IS NOT NULL AND vps_deleted IS NULL AND FROM_UNIXTIME(vps_expiration) < NOW()");
while ($row = $db->fetch_array($rs)) {
    $vps = new vps_load($row["vps_id"]);
    $vps->stop();
    $vps->destroy(true);
}
// Delete lazy deleted VPSes
$vps_timeout = $cluster_cfg->get("general_vps_delete_timeout") * 24 * 60 * 60;
$rs = $db->query("SELECT vps_id FROM vps WHERE vps_deleted IS NOT NULL AND vps_deleted > 0 AND vps_deleted < " . $db->check(time() - $vps_timeout));