Beispiel #1
0
function aa_admin_import_page()
{
    global $keyword, ${$selectedSearchIndex}, $itempage;
    $appid = get_option('dbaa_amazon_appid');
    $coutryCode = get_option('dbaa_amazon_coutnrycode');
    $secretKey = get_option('dbaa_amazon_secretkey');
    $associatetag = get_option('dbaa_amazon_associatetag');
    if ($appid == '' || $coutryCode == '' || $secretKey == '') {
        echo '<H2>Bitte gehen Sie zu den Einstellungen und geben Sie Ihre Daten zur Kommunikation mit der Amazon Api ein.</H2>';
    } else {
        $defaultOptions = array('AssociateTag' => $associatetag, 'ResponseGroup' => 'Small, OfferFull, ItemAttributes, Images, Variations');
        $amazon = new Zend_clicks_Service_Amazon($appid, $coutryCode, $secretKey);
        $itemResults = array();
        if ($_REQUEST['action'] == 'search' && !empty($_POST['keyword']) && empty($_POST['asin'])) {
            $keyword = $_POST['keyword'];
            $selectedSearchIndex = $_POST['searchIndex'];
            $itempage = 1;
            $options = array('SearchIndex' => $selectedSearchIndex, 'Keywords' => $keyword, 'ItemPage' => $itempage);
            $options = array_merge($options, $defaultOptions);
            $itemResults = $amazon->itemSearch($options);
        } elseif ($_REQUEST['action'] == 'search' && empty($_POST['keyword']) && !empty($_POST['asin'])) {
            $asin = $_POST['asin'];
            $selectedSearchIndex = $_POST['searchIndex'];
            $itemResults = $amazon->itemLookup($asin, $defaultOptions);
        } elseif ($_REQUEST['action'] == 'back' && !empty($_POST['itempage']) || $_REQUEST['action'] == 'next' && !empty($_POST['itempage'])) {
            $keyword = $_POST['keyword'];
            $selectedSearchIndex = $_POST['searchIndex'];
            $itempage = $_POST['itempage'];
            $options = array('SearchIndex' => $selectedSearchIndex, 'Keywords' => $keyword, 'ItemPage' => $itempage);
            $options = array_merge($options, $defaultOptions);
            $itemResults = $amazon->itemSearch($options);
        } elseif ($_REQUEST['action'] == 'save' && !empty($_POST['title'])) {
            if (saveItem($_POST)) {
                echo '<div class="updated"><p><strong>Produkt erfolgreich importiert</strong></p></div>';
            }
        }
        echo '<h2>Produkte importieren</h2>';
        searchItem($keyword, $asin, $selectedSearchIndex, $itempage);
        // Suchformular einblenden;
        foreach ($itemResults as $result) {
            formatResult($result);
        }
    }
}
Beispiel #2
0
    include_once '_list.php';
    exit;
    // $finalResult = array(
    // "songs" => array(),
    // "page" => 0,
    // "total" => 0,
    // "totalNumber" => 0
    // );
    // formatResult($finalResult);
    // exit;
}
$countValue = $result['total'];
if ($countValue == 0) {
    $pageCount = 0;
} else {
    $pageCount = (int) ($countValue / $number);
    if ($countValue % $number != 0) {
        $pageCount = $pageCount + 1;
    }
    $totalNumber = intval($countValue);
}
$mid_list = array();
foreach ($result['matches'] as $match) {
    array_push($mid_list, $match['id']);
}
$queryString = "SELECT A.mid, A.serial_id, A.name, A.singer, A.path, A.original_track, A.sound_track, A.start_volume_1, A.start_volume_2, A.lyric, A.prelude, A.match, B.name AS effect, C.name AS version, A.artist_sid_1 AS singer_id \r\nFROM media A \r\nLEFT JOIN media_effect B ON A.effect = B.id \r\nLEFT JOIN media_version C ON A.version=C.id WHERE A.mid IN (" . implode(',', $mid_list) . ") ORDER BY FIELD(mid," . implode(',', $mid_list) . ")";
$results = $mdb->query($queryString);
$songs = formatSongsResult($results);
$finalResult = array("songs" => $songs, "page" => $pageNum, "total" => $pageCount, "totalNumber" => $totalNumber);
formatResult($finalResult);
Beispiel #3
0
<?php

include $VERSION_PATH . "core/header.php";
echo formatResult(allTasks(), true);
include $VERSION_PATH . "core/footer.php";
?>

        $implants = filterImplantOnly($morphGear);
        foreach ($implants as $i) {
            if ($i->occurence > 1) {
                $occ = "(" . $i->occurence . ") ";
            } else {
                $occ = "";
            }
            echo formatResult($occ . $i->name) . $tab . setBookLink($i->name, $p) . $carriageReturn;
        }
        echo $line . $carriageReturn;
        //MEMO (all ego bonus malus descriptive only)
        echo formatTitle("Morph Memo") . $carriageReturn . $carriageReturn;
        $morphBonusMalus = $_SESSION['cc']->getBonusMalusForMorph($morph);
        foreach ($morphBonusMalus as $bm) {
            echo formatResult($bm->name) . $carriageReturn;
            echo formatResult($bm->description) . $carriageReturn . $carriageReturn;
        }
        echo $line . $carriageReturn;
    }
} else {
    header("Status: 500 Internal Server Error", true, 500);
    echo "Bad news, something went wrong, we can not print your character, verify your character and try again.";
    die;
}
//HELPERS ===============================================================
function formatTitle($string)
{
    return padString($string, 12);
}
function formatResult($string)
{
Beispiel #5
0
<?php

include $VERSION_PATH . "core/header.php";
$format = 'Y-m-d';
$date = date($format);
$lastWeek = date($format, strtotime('-7 day' . $date));
?>
<table>
	<tr>
		<td><b>COMPLETED THIS WEEK</b></td>
	</tr>
	<tr>
	<td><?php 
echo formatResult(completedTasks($lastWeek), false);
?>
	</tr>
	<tr>
		<td><b>STILL TO DO</b></td>
	</tr>
	<tr>
	<td><?php 
echo formatResult(todoTasks(), false);
?>
	</tr>
</table>

<?php 
include $VERSION_PATH . "core/footer.php";
?>

Beispiel #6
0
<?php

include $VERSION_PATH . "core/header.php";
?>

<?php 
echo formatResult(todoTasks(), true);
?>

<?php 
include $VERSION_PATH . "core/footer.php";
?>

Beispiel #7
0
        } else {
            // Single leg (patrol etc)
            $radio = selectRadio($cls);
            if ($radio != '') {
                if ($radio == 'finish') {
                    $sql = "SELECT t.id AS id, cmp.name AS name, t.name AS team, t.rt AS time, t.stat AS status " . "FROM mopteammember tm, mopcompetitor cmp, mopteam t " . "WHERE t.cls = '{$cls}' AND t.id = tm.id AND tm.rid = cmp.id AND tm.leg=1 " . "AND t.cid = '{$cmpId}' AND tm.cid = '{$cmpId}' AND cmp.cid = '{$cmpId}' AND t.stat>0 ORDER BY t.stat, t.rt ASC, t.id";
                    $rname = $lang["finish"];
                } else {
                    $rid = (int) $radio;
                    $sql = "SELECT name FROM mopcontrol WHERE cid='{$cmpId}' AND id='{$rid}'";
                    $res = mysql_query($sql);
                    $rinfo = mysql_fetch_array($res);
                    $rname = $rinfo['name'];
                    $sql = "SELECT team.id AS id, cmp.name AS name, team.name AS team, radio.rt AS time, 1 AS status " . "FROM mopradio AS radio, mopteammember AS m, mopteam AS team, mopcompetitor AS cmp " . "WHERE radio.ctrl='{$rid}' " . "AND radio.id=cmp.id " . "AND m.rid = radio.id " . "AND m.id = team.id " . "AND cmp.stat<=1 " . "AND m.leg=1 " . "AND cmp.cls='{$cls}' " . "AND radio.cid = '{$cmpId}' AND m.cid = '{$cmpId}' AND team.cid = '{$cmpId}' AND cmp.cid = '{$cmpId}' " . "ORDER BY radio.rt ASC ";
                }
                $res = mysql_query($sql);
                $results = calculateResult($res);
                print "<h3>{$rname}</h3>\n";
                formatResult($results);
            }
        }
    }
}
print '</div>';
?>
 
<div style="clear:both;padding-top:3em;color: grey;">
 Results provided by <a href="http://www.melin.nu/meos" target="_blank">MeOS Online Results</a>.
</div>
</body></html>