Esempio n. 1
0
 public static function getByID($gID)
 {
     $db = Database::get();
     $data = $db->GetRow("SELECT * FROM VividStoreGroups WHERE gID=?", $gID);
     if (!empty($data)) {
         $group = new ProductGroup();
         $group->setPropertiesFromArray($data);
     }
     return $group instanceof ProductGroup ? $group : false;
 }
Esempio n. 2
0
 public function getGroupList()
 {
     $db = Database::get();
     $data = $db->GetAll("SELECT gID FROM VividStoreGroups");
     $groupList = array();
     foreach ($data as $group) {
         // $groupList[] = $group['gID'];
         // echo $group['gID'];
         $groupList[] = ProductGroup::getByID($group['gID']);
     }
     return $groupList;
 }
Esempio n. 3
0
    if ($grouplist) {
        ?>
        <h3><?php 
        echo t("Groups");
        ?>
</h3>
        <ul class="list-unstyled group-list" data-delete-url="<?php 
        echo View::url('/dashboard/store/products/deletegroup');
        ?>
" data-save-url="<?php 
        echo View::url('/dashboard/store/products/editgroup');
        ?>
">
            <?php 
        foreach ($grouplist as $groupItem) {
            $group = VividProductGroup::getByID($groupItem->getGroupID());
            ?>

                <li data-group-id="<?php 
            echo $group->getGroupID();
            ?>
">
                    <span class="group-name"><?php 
            echo $group->getGroupName();
            ?>
</span>
                    <input class="hideme edit-group-name" type="text" value="<?php 
            echo $group->getGroupName();
            ?>
">
                    <span class="btn btn-default btn-edit-group-name"><i class="fa fa-pencil"></i></span>
Esempio n. 4
0
 public function getGroupName()
 {
     $group = ProductGroup::getByID($this->gID);
     if (is_object($group)) {
         return $group->getGroupName();
     }
 }
Esempio n. 5
0
 public function deletegroup($gID)
 {
     VividProductGroup::getByID($gID)->remove();
 }