Esempio n. 1
0
            // czy produkt był zamawiany przez klienta?
            $rowOrder = $db->getOrder($uid, $id);
            if ($uid == 1 || $rowOrder == NULL) {
                $koszt = $product['product']['coins'];
            }
        }
    }
    $db->destroy();
}
$song_formats = array("midi" => "MIDI");
$songs = getValFromItem($product['songs']);
// robie zalozenie, ze sa piosnki we wszytkich formatach
$isHasMidi15k = TRUE;
$isHasMp3 = TRUE;
foreach ($songs as $song) {
    $songId = getValFromItem($song['id']);
    //print("[$songId]".MOBIKAR_PRODUCTS_DIR."songs/$songId.15k.midi");
    if (!file_exists(MOBIKAR_PRODUCTS_DIR . "songs/{$songId}.15k.midi")) {
        $isHasMidi15k = FALSE;
    }
    if (!file_exists(MOBIKAR_PRODUCTS_DIR . "songs/{$songId}.mp3")) {
        $isHasMp3 = FALSE;
    }
}
if ($isHasMidi15k == TRUE) {
    $song_formats["15k.midi"] = "MIDI 15k";
}
if ($isHasMp3 == TRUE) {
    $song_formats["mp3"] = "MP3";
}
$app_formats = array("midp20" => "MIDP 2.0", "mmapi" => "MIDP 1.0 MMAPI", "sie" => "MIDP 1.0 Siemens");
Esempio n. 2
0
<?php 
include_once '../scripts/myErrorHandler.php';
include_once '../scripts/utils.php';
// parametry
$par_request = getParameter('request', NULL);
$par_partner = getParameter('partner', "0");
$par_format = getParameter('format', "xhtml");
$par_lang = getParameter('lang', "pl");
$par_css = getParameter('css', "1");
$par_dir = getParameter('dir', "dir");
$browser = getValFromItem($_SERVER['HTTP_USER_AGENT']);
trigger_error("request:" . $par_request . " REMOTE_ADDR:" . getValFromItem($_SERVER['REMOTE_ADDR']) . " HTTP_USER_AGENT:" . getValFromItem($_SERVER['HTTP_USER_AGENT']), E_USER_NOTICE);
$message = NULL;
define('M1K0_REASON_NO_DIR', 1);
define('M1K0_REASON_LOAD', 2);
define('M1K0_REASON_NO_TEXT', 3);
$messages = array(M1K0_REASON_NO_DIR => "Nie można stworzyć katalou", M1K0_REASON_LOAD => "Plik nie został wczytany", M1K0_REASON_NO_TEXT => "Brak tekstu do przetworzenia");
$reason = 0;
$lyric_text = "";
$directory = "http://" . MOBIKAR_SERVER_DOMAIN;
$path_mlyr = null;
$title = "title";
$music = "music";
if (strcmp($par_request, 'upload_kar') == 0) {
    $file = isset($_FILES['file_kar']) && $_FILES['file_kar']['tmp_name'] != '' ? $_FILES['file_kar']['tmp_name'] : '';
    if ($file != '') {
        $par_dir = getCode();
        // skopiowanie pliku
        $path = "../wap/get/" . $par_dir;
        // TODO: sprawdzi, czy taki kod już jest w filesystemie
        if (mkdir($path) == FALSE) {
Esempio n. 3
0
        print "</tr>\n";
    }
    ?>
	</table>
	<h2> Historia sprzedaży opracowań</h2>
	<table border="1">
		<tr>
			<td> Miesiąc </td>
			<td> Sprzedaż </td>
		</tr>
	<?php 
    //print_r($history_month);
    foreach ($history_month_songs as $month) {
        $year = getValFromItem($month['year']);
        $month1 = getValFromItem($month['month']);
        $orders = getValFromItem($month['orders']);
        print "<tr>";
        printf("<td>{$year}-%02d</td>", $month1);
        print "<td style='text-align:right'>{$orders}</td>";
        print "</tr>\n";
    }
    if (count($history_month_songs) == 0) {
        print "<tr>";
        print "<td colspan='2'>Brak danych</td>";
        print "</tr>\n";
    }
    ?>
	</table>
	
</body>
</html>
Esempio n. 4
0
$password = NULL;
$product = NULL;
$code = NULL;
if ($uid == null && $kod != null) {
    // ustawiamy user o kodzie 1
    $uid = 1;
}
if ($uid != NULL) {
    $db = new Database();
    $rowUser = $db->getUser(NULL, $uid);
    if ($rowUser == NULL) {
        $reason = "BAD_USER";
    } else {
        $login = getValFromItem($rowUser['login']);
        $secure = getValFromItem($rowUser['secure']);
        $password = getValFromItem($rowUser['password']);
        $product = $db->getProduct($id);
        if ($product == NULL) {
            $reason = "BAD_PRODUCT";
        } else {
            if ($kod != null) {
                // pożarcie kodu
                // TODO: sprawdzenie, czy kod ma odpowienią liczbę żetonów
                if ($paymentId = $db->updateUserAccount($uid, $kod) == true) {
                    // dodanie dla klienta zamowienia
                    $code = $db->addOrder($uid, $id, $paymentId);
                    if ($code != null) {
                        $isAllowed = TRUE;
                    } else {
                        $reason = "TOOCHEAP_CODE";
                    }
Esempio n. 5
0
<?php

ob_start();
include_once '../scripts/myErrorHandler.php';
include_once '../scripts/utf8ToEntities.php';
include_once '../scripts/create_midlet.php';
include_once '../scripts/utils.php';
include_once '../scripts/create_midlet.php';
$isAllowed = FALSE;
$reason = NULL;
$par_code = getParameter('code');
$par_app = getParameter('app');
$par_song = getParameter('song');
$browser = getValFromItem($_SERVER['HTTP_USER_AGENT']);
// TODO: sprawdzenie czy wszystko jets OK
$isAllowed = TRUE;
$reason_text = NULL;
if (strcmp($reason, "BAD_USER") == 0) {
    $reason_text = "B&#x142;&#x119;dny identyfikator u&#x17c;ytkownika: {$uid}";
} elseif (strcmp($reason, "TOOCHEAP_CODE") == 0) {
    $reason_text = "U&#x17c;yty kod nie jest w&#x142;a&#x15b;ciwy dla wybranego produktu";
} elseif (strcmp($reason, "BAD_CODE") == 0) {
    $reason_text = "B&#x142;&#x119;dny kod {$kod}";
} elseif (strcmp($reason, "BAD_PRODUCT") == 0) {
    $reason_text = "B&#x142;&#x119;dny identyfikator produktu: {$id}";
} elseif (strcmp($reason, "LOW_SCORE") == 0) {
    $reason_text = "Brak wystarczaj&#x105;cych &#x15b;rodk&#xf3;w na koncie ";
}
if ($reason != null) {
    trigger_error("reason_text:" . $reason_text, E_USER_NOTICE);
}
Esempio n. 6
0
if (isset($_GET['l'])) {
    $login = $_GET['l'];
    $password = $_GET['p'];
    $login = trim(strtolower($login));
    $login = urlencode(htmlentities(htmlspecialchars($login), ENT_QUOTES));
    $password = urlencode(htmlentities(htmlspecialchars($password), ENT_QUOTES));
    trigger_error(" /\\ ", E_USER_NOTICE);
    if (isset($_SERVER['HTTP_USER_AGENT'])) {
        $browser = $_SERVER['HTTP_USER_AGENT'];
    }
    $db = new Database();
    $rowUser = $db->getUser($login, NULL);
    trigger_error(" \\/ ", E_USER_NOTICE);
    if ($rowUser != NULL) {
        $uid = getValFromItem($rowUser['id']);
        if (strcmp($password, getValFromItem($rowUser['password'])) == 0) {
            $isAllowed = TRUE;
            $sid = getCode();
            if ($db->updateUserSid($uid, $sid) == FALSE) {
                $reason = "ERROR";
                $isAllowed = FALSE;
            }
        } else {
            $reason = "BAD_PASSWORD";
        }
        trigger_error("login:"******" password(" . $rowUser['password'] . "):" . $password . "uid:" . $uid . " sid" . $sid, E_USER_NOTICE);
    }
    $db->destroy();
}
if ($isAllowed) {
    ob_end_clean();