function printCategory($category, $level)
{
    printf("%s%s : (%s)\n", str_pad('', $level * 4), $category->Name, $category->CategoryID);
    foreach ($category->ChildCategory as $category) {
        printCategory($category, $level + 1);
    }
}
Beispiel #2
0
function printCategory($printCategory, $level, &$par)
{
    $par = !$par;
    if ($printCategory->hasImage) {
        $imgSrc = \Pasteque\PT::URL_ACTION_PARAM . "=img&w=category&id=" . $printCategory->id;
    } else {
        $imgSrc = \Pasteque\PT::URL_ACTION_PARAM . "=img&w=category";
    }
    ?>
                <tr class="row-<?php 
    echo $par ? 'par' : 'odd';
    ?>
">
                        <td>
                        <?php 
    for ($i = 0; $i < $level; $i++) {
        echo "&nbsp;&nbsp;&nbsp;&nbsp;";
    }
    ?>
                        <img class="thumbnail" src="?<?php 
    echo $imgSrc;
    ?>
" />
                        <td><?php 
    echo $printCategory->label;
    ?>
</td>
                        <td class="edition">
                    <?php 
    \Pasteque\tpl_btn("edition", \Pasteque\get_module_url_action(PLUGIN_NAME, 'category_edit', array("id" => $printCategory->id)), "", 'img/edit.png', \i18n('Edit'), \i18n('Edit'));
    ?>
                                <form action="<?php 
    echo \Pasteque\get_current_url();
    ?>
" method="post"><?php 
    \Pasteque\form_delete("cat", $printCategory->id, \Pasteque\get_template_url() . 'img/delete.png');
    ?>
</form>
                        </td>
                </tr>
        <?php 
    $categories = \Pasteque\CategoriesService::getChildren($printCategory->id);
    $level++;
    foreach ($categories as $childCategory) {
        printCategory($childCategory, $level, $par);
    }
}
Beispiel #3
0
		</div>
	</div>
</nav>


<div class="container">
	<div class="row">
		<div class="col-sm-6">
			<h2 class="menuTitles">Categories</h2>
			<div class="titleDivider"></div>
			<button class="btn btn-add-category">ADD CATEGORY</button>
							
			<?php 
$result = mysqli_query($con, "SELECT * FROM category WHERE rest_id='{$restId}'") or die("Failed 001");
while ($row = mysqli_fetch_array($result)) {
    printCategory($row['name'], $row['id']);
}
function printCategory($name, $code)
{
    echo '<div class="panel panel-default panel-category">';
    echo '<div class="panel-category-body">';
    echo '<p class="panel-item-left category-name-text">' . $name . '</p>';
    //NEEDS ACTION
    echo '<img src="./imgs/trash.png" class="panel-item-right trashIcon">';
    //NEEDS ACTION
    echo '<img src="./imgs/downarrow.png" class="panel-item-right downarrowIcon">';
    //NEEDS ACTION
    echo '<img src="./imgs/uparrow.png" class="panel-item-right uparrowIcon">';
    echo '</div>';
    echo '</div>';
}
Beispiel #4
0
$request->RequesterCredentials->eBayAuthToken = 'AgAAAA**AQAAAA**aAAAAA**5SeqVg**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6wFk4GhDpaLog2dj6x9nY+seQ**ObADAA**AAMAAA**mvKNWcyEW52daMrRGUF/S91xn4Sk+gI//sMCTEStI4H+rj5ZH+ZG0i/LRnuqozz0tlHwGtsM5XKTgZ/1HVZqsaAlx1b1nKYs505sYP0qchX2oHovuFgGHJCcCiwtfJxd7G1k+u8reg8ttrGov2aZgF+yCNZL7kNxxZVBAFXWJqZyQyZDUMZMGV7JfEOW/xCSZG14ZQJhYat5QATzNLLTKTloSwd+0MS7oUPwhR8XTtY+2YRLeHL5JpuILxUSyUacHMfe8kS8tNP5sbMrEjxsG9gO4EuJDISvtDapU8jiYg3BFI0hvBfwI6sMK01QXRQIYxvrhgHKq79suV8CslMWu8UFyZ6jBTRBPkYVfqzoj81mAORewhgx14vbRN9Hmu3SzJZzc+R5BxHgpbbw4MDndIVj6nM+A/yB/K7jM//6YK3JfhkPWYmNQZijpL5cZ+x7bBLOBZLKl6cmiLoiEnJQE3acaZCxm9JD9B0DOm+Q3ImoItx1+g1VBU62waxFkWO5fAl9sV+riGSWdNDAzFtGPs3qAFoogzPGkLHn2lNemWmwxggZK+YTy5mqgtSsRFLt2Ao50aTW4oQWsapFJDQhsJw8NeWjRsbGJqLWts5eZMT3Xre51d+Hb+qYUO27VoFHMgmm3CYxD+WsXe6iRvSCJSm0S9WyX5i88VQw7fO7hPoZ90vbVtALyqNkt+fdf2NpAiunIZ5TXbuZz2auMHUqNSS1M2bjEBEeayq6HVSWvcnHBoHiRchATIkmHFo2nCfL';
//EBY
//EBY
$response = $service->getStore($request);
if (isset($response->Errors)) {
    foreach ($response->Errors as $error) {
        printf("%s: %s\n%s\n\n", $error->SeverityCode === Enums\SeverityCodeType::C_ERROR ? 'Error' : 'Warning', $error->ShortMessage, $error->LongMessage);
    }
}
if ($response->Ack !== 'Failure') {
    $store = $response->Store;
    printf("Name: %s\nDescription: %s\nURL: %s\n\n", $store->Name, $store->Description, $store->URL);
    foreach ($store->CustomCategories->CustomCategory as $category) {
        printf("%s%s : (%s)\n", str_pad('', 0 * 4), $category->Name, $category->CategoryID);
        foreach ($category->ChildCategory as $category) {
            printCategory($category, $level + 1);
        }
    }
}
//EBY
//AWS
$dynamodb = $sdk->createDynamoDb();
//Creating table
try {
    $response = $dynamodb->createTable(['TableName' => "ProductCatalog", 'AttributeDefinitions' => [['AttributeName' => 'Id', 'AttributeType' => 'N']], 'KeySchema' => [['AttributeName' => 'Id', 'KeyType' => 'HASH']], 'ProvisionedThroughput' => ['ReadCapacityUnits' => 10, 'WriteCapacityUnits' => 5]]);
    echo "CreateTable request was successful.\n";
} catch (DynamoDbException $e) {
    echo $e->getMessage() . "\n";
    exit("Unable to create table {$tableName}\n");
}
$response = $dynamodb->putItem(['TableName' => 'ProductCatalog', 'Item' => ['Id' => ['N' => '104'], 'Title' => ['S' => 'Book 104 Title'], 'ISBN' => ['S' => '111-1111111111'], 'Price' => ['N' => '25'], 'Authors' => ['SS' => ['Author1', 'Author2']]]]);