public static function getByName($name) { $sql = "select * from " . self::$tablename . " where name=\"{$name}\""; $query = Executor::doit($sql); $found = null; $data = new AlbumData(); while ($r = $query->fetch_array()) { $data->id = $r['id']; $data->nick = $r['nick']; $data->name = $r['name']; $data->mail = $r['mail']; $data->password = $r['password']; $data->usertype = UserTypedata::getById($r['usertype_id']); $data->status = StatusData::getById($r['status_id']); $data->is_admin = $r['is_admin']; $data->is_verified = $r['is_verified']; $data->created_at = $r['created_at']; $found = $data; break; } return $found; }
public static function getAllLikeName($username) { $sql = "select * from " . self::$tablename . " where name like '%{$username}%'"; $query = Executor::doit($sql); $array = array(); $cnt = 0; while ($r = $query->fetch_array()) { $array[$cnt] = new UserData(); $array[$cnt]->id = $r['id']; $array[$cnt]->nick = $r['nick']; $array[$cnt]->name = $r['name']; $array[$cnt]->mail = $r['mail']; $array[$cnt]->image = $r['image']; $array[$cnt]->password = $r['password']; $array[$cnt]->usertype_id = UserTypeData::getById($r['usertype_id']); $array[$cnt]->status_id = StatusData::getById($r['status_id']); $array[$cnt]->is_admin = $r['is_admin']; $array[$cnt]->is_verified = $r['is_verified']; $array[$cnt]->created_at = $r['created_at']; $cnt++; } return $array; }
public function getStatus() { return StatusData::getById($this->status_id); }
</div> </div> <div class="container"> <div class="row"> <div class="col-md-12"> <?php if ($buy->status_id == 1) { ?> <p class="alert alert-warning">Operacion Pendiente</p> <?php } elseif ($buy->status_id >= 2 && $buy->status_id <= 4) { ?> <p class="alert alert-info"><?php echo StatusData::getById($buy->status_id)->name; ?> </p> <?php } elseif ($buy->status_id == 5) { ?> <p class="alert alert-danger">Operacion Cancelada</p> <?php } ?> <h2> Compra #<?php echo $buy->id; ?> </h2> <?php if (count($products) > 0) {