Example #1
0
<?php

$entries = new Object\Plans\Listing();
$entries->setLimit("5");
$entries->setOrderKey("oo_id");
$entries->setOrder("Desc");
$i = 0;
if (count($entries) > 0) {
    ?>

<div class="container-fluid">
    <div class="row">
        <div class="frame-featured">
            <?php 
    foreach ($entries as $entry) {
        ?>
            <?php 
        //echo "<pre>"; print_r($entry->images); die();
        ?>
                <?php 
        if ($i == 0) {
            ?>
                    <div class="main-featured">
                        <a href="javascript:void(0)">
                            <?php 
            foreach ($entry->images as $image) {
                ?>
                                <div class="image-featured" style="background: url('<?php 
                echo $image->Image;
                ?>
') no-repeat center center; background-size: cover; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover;">
 public function getPlan($id, $count, $offset, $orderBy, $order)
 {
     if (!isset($orderBy) or empty($orderBy)) {
         $orderBy = "name";
     }
     if (!isset($order) or empty($order)) {
         $order = "ASC";
     }
     if (!isset($count) or empty($count)) {
         $count = "10";
     }
     $plan = new Object\Plans\Listing();
     $plan->setOffset($offset);
     $plan->setLimit($count);
     $plan->setOrderKey($orderBy);
     $plan->setOrder($order);
     if (isset($id) and $id != "") {
         $plan->setCondition("o_id='" . $id . "'");
     }
     $plans = array();
     $i = 0;
     foreach ($plan as $key => $value) {
         $plans[$i] = array("o_key" => $value->o_key, "o_id" => $value->o_id, "name" => $value->name, "slugName" => $value->slugName, "price" => $value->price, "code" => $value->code, "images" => array("imageId" => $value->images->items[0]->Image->id, "type" => $value->images->items[0]->Image->type, "ImageName" => $value->images->items[0]->ImageName, "filename" => $value->images->items[0]->Image->filename, "path" => $value->images->items[0]->Image->path), "quota" => $value->quota, "typeUsage" => $value->typeUsage, "typePreferredNetwork" => $value->typePreferredNetwork, "typeProduct" => "plan");
         $i++;
     }
     $arrayReturn = array("status" => "success", "message" => "success", "data" => $plans);
     return $arrayReturn;
 }