コード例 #1
0
ファイル: FollowerData.php プロジェクト: evilnapsis/imayik
 public static function getAllByPopular()
 {
     //		$sql = "select * from ".self::$tablename;
     $sql = "select *,count(*) as total from " . self::$tablename . " group by channel_id limit 10";
     $query = Executor::doit($sql);
     return Model::many($query[0], new FollowerData());
 }
コード例 #2
0
ファイル: Model.php プロジェクト: CloudGt/suggbox-php
 public static function one_object($sql)
 {
     $query = Executor::doit($sql);
     $cnt = 0;
     $found = null;
     $data = null;
     while ($r = $query[0]->fetch_object()) {
         $data = $r;
         $found = $data;
         break;
     }
     return $found;
 }
コード例 #3
0
ファイル: StatusData.php プロジェクト: evilnapsis/imayik
 public static function getByName($name)
 {
     $sql = "select * from " . self::$tablename . " where name=\"{$name}\"";
     $query = Executor::doit($sql);
     $found = null;
     $data = new StatusData();
     while ($r = $query->fetch_array()) {
         $data->id = $r['id'];
         $data->name = $r['name'];
         $found = $data;
         break;
     }
     return $found;
 }
コード例 #4
0
ファイル: UserTypeData.php プロジェクト: evilnapsis/imayik
 public static function getAll()
 {
     $sql = "select * from " . self::$tablename;
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query->fetch_array()) {
         $array[$cnt] = new UserTypeData();
         $array[$cnt]->id = $r['id'];
         $array[$cnt]->name = $r['name'];
         $cnt++;
     }
     return $array;
 }
コード例 #5
0
ファイル: BoxData.php プロジェクト: leanet/inventio-lite
 public static function getLike($q)
 {
     $sql = "select * from " . self::$tablename . " where name like '%{$q}%'";
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query[0]->fetch_array()) {
         $array[$cnt] = new BoxData();
         $array[$cnt]->id = $r['id'];
         $array[$cnt]->created_at = $r['created_at'];
         $cnt++;
     }
     return $array;
 }
コード例 #6
0
 public static function getAll()
 {
     $sql = "select * from " . self::$tablename . " order by created_at desc";
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query[0]->fetch_array()) {
         $array[$cnt] = new OperationTypeData();
         $array[$cnt]->id = $r['id'];
         $array[$cnt]->name = $r['name'];
         $cnt++;
     }
     return $array;
 }
コード例 #7
0
ファイル: AlbumImageData.php プロジェクト: evilnapsis/imayik
 public static function getAll()
 {
     $sql = "select * from " . self::$tablename . " order by created_at desc";
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query->fetch_array()) {
         $array[$cnt] = new AlbumImageData();
         $array[$cnt]->album_id = $r['album_id'];
         $array[$cnt]->image_id = $r['image_id'];
         $array[$cnt]->created_at = $r['created_at'];
         $cnt++;
     }
     return $array;
 }
コード例 #8
0
ファイル: ThemeData.php プロジェクト: evilnapsis/cazueliyas
 public static function getAll()
 {
     $sql = "select * from " . self::$tablename . "";
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query[0]->fetch_array()) {
         $array[$cnt] = new ThemeData();
         $array[$cnt]->id = $r['id'];
         $array[$cnt]->name = $r['name'];
         $array[$cnt]->header_background_color = $r['header_background_color'];
         $array[$cnt]->header_text_color = $r['header_text_color'];
         $array[$cnt]->body_background_color = $r['body_background_color'];
         $array[$cnt]->body_text_color = $r['body_text_color'];
         $cnt++;
     }
     return $array;
 }
コード例 #9
0
ファイル: LoveData.php プロジェクト: evilnapsis/cazueliyas
 public static function getAllBySlideId($slide_id)
 {
     $sql = "select * from " . self::$tablename . " where slide_id={$slide_id} order by created_at desc";
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query[0]->fetch_array()) {
         $array[$cnt] = new LoveData();
         $array[$cnt]->id = $r['id'];
         $array[$cnt]->slide_id = $r['slide_id'];
         $array[$cnt]->user_id = $r['user_id'];
         $array[$cnt]->created_at = $r['created_at'];
         $cnt++;
     }
     return $array;
 }
コード例 #10
0
ファイル: AlbumData.php プロジェクト: evilnapsis/imayik
 public static function getAll()
 {
     $sql = "select * from " . self::$tablename . " order by created_at desc";
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query->fetch_array()) {
         $array[$cnt] = new AlbumData();
         $array[$cnt]->id = $r['id'];
         $array[$cnt]->name = $r['name'];
         $array[$cnt]->title = $r['title'];
         $array[$cnt]->description = $r['description'];
         $array[$cnt]->tags = $r['tags'];
         $array[$cnt]->channel_id = $r['channel_id'];
         $array[$cnt]->category_id = $r['category_id'];
         $array[$cnt]->privacy_id = $r['privacy_id'];
         $array[$cnt]->created_at = $r['created_at'];
         $cnt++;
     }
     return $array;
 }
コード例 #11
0
ファイル: ProductData.php プロジェクト: evilnapsis/cazueliyas
 public static function getAllByUserId($user_id)
 {
     $sql = "select * from " . self::$tablename . " where user_id={$user_id} order by created_at desc";
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query[0]->fetch_array()) {
         $array[$cnt] = new ProductData();
         $array[$cnt]->id = $r['id'];
         $array[$cnt]->name = $r['name'];
         $array[$cnt]->price_in = $r['price_in'];
         $array[$cnt]->price_out = $r['price_out'];
         $array[$cnt]->presentation = $r['presentation'];
         $array[$cnt]->unit = $r['unit'];
         $array[$cnt]->user_id = $r['user_id'];
         $array[$cnt]->created_at = $r['created_at'];
         $cnt++;
     }
     return $array;
 }
コード例 #12
0
ファイル: UserData.php プロジェクト: rogelino/smile
 public static function getLike($q)
 {
     $sql = "select * from " . self::$tablename . " inner join profile on (user.id=profile.user_id) where name like '%{$q}%' or lastname like '%{$q}%' ";
     $query = Executor::doit($sql);
     return Model::many($query[0], new UserData());
 }
コード例 #13
0
 public static function getAll()
 {
     $sql = "select * from " . self::$tablename;
     $query = Executor::doit($sql);
     return Model::one($query[0], new NotificationTypeData());
 }
コード例 #14
0
ファイル: PostData.php プロジェクト: leanet/inventio-lite
 public static function getLike($q)
 {
     $sql = "select * from " . self::$tablename . " where title like '%{$q}%' or content like '%{$q}%'";
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query[0]->fetch_array()) {
         $array[$cnt] = new PostData();
         $array[$cnt]->id = $r['id'];
         $array[$cnt]->title = $r['title'];
         $array[$cnt]->content = $r['content'];
         $array[$cnt]->image = $r['image'];
         $array[$cnt]->is_public = $r['is_public'];
         $array[$cnt]->user_id = $r['user_id'];
         $array[$cnt]->created_at = $r['created_at'];
         $cnt++;
     }
     return $array;
 }
コード例 #15
0
 public static function getLast5ByChannelId($channel_id)
 {
     $sql = "select * from " . self::$tablename . " where channel_id={$channel_id} order by created_at desc limit 5";
     $query = Executor::doit($sql);
     return Model::many($query[0], new NotificationData());
 }
コード例 #16
0
ファイル: SellData.php プロジェクト: evilnapsis/cazueliyas
 public static function getAllAppliedByPage($start_from, $limit)
 {
     $sql = "select * from " . self::$tablename . " where id<={$start_from} and is_applied=1 limit {$limit}";
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query[0]->fetch_array()) {
         $array[$cnt] = new SellData();
         $array[$cnt]->id = $r['id'];
         $array[$cnt]->mesero_id = $r['mesero_id'];
         $array[$cnt]->cajero_id = $r['cajero_id'];
         $array[$cnt]->mesa = $r['mesa'];
         $array[$cnt]->is_applied = $r['is_applied'];
         $array[$cnt]->created_at = $r['created_at'];
         $cnt++;
     }
     return $array;
 }
コード例 #17
0
 public static function getInputByProductIdCutIdYesF($product_id, $cut_id)
 {
     $sql = "select * from " . self::$tablename . " where product_id={$product_id} and cut_id={$cut_id} and operation_type_id=1 order by created_at desc";
     $query = Executor::doit($sql);
     return Model::many($query[0], new OperationData());
 }
コード例 #18
0
ファイル: OperationData.php プロジェクト: evilnapsis/thunder
 public static function getInputByProductIdCutIdNoF($product_id, $cut_id)
 {
     $sql = "select * from " . self::$tablename . " where product_id={$product_id} and cut_id={$cut_id} and is_oficial=0 and operation_type_id=1 order by created_at desc";
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query[0]->fetch_array()) {
         $array[$cnt] = new OperationData();
         $array[$cnt]->id = $r['id'];
         $array[$cnt]->product_id = $r['product_id'];
         $array[$cnt]->q = $r['q'];
         $array[$cnt]->is_oficial = $r['is_oficial'];
         $array[$cnt]->cut_id = $r['cut_id'];
         $array[$cnt]->operation_type_id = $r['operation_type_id'];
         $array[$cnt]->created_at = $r['created_at'];
         $cnt++;
     }
     return $array;
 }
コード例 #19
0
 public static function getAllByUserId($user_id)
 {
     $sql = "select * from " . self::$tablename . " where user_id={$user_id}";
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query[0]->fetch_array()) {
         $array[$cnt] = new InvitationData();
         $array[$cnt]->id = $r['id'];
         $array[$cnt]->the_key = $r['the_key'];
         $array[$cnt]->is_used = $r['is_used'];
         $array[$cnt]->email = $r['email'];
         $array[$cnt]->user_id = $r['user_id'];
         $array[$cnt]->created_at = $r['created_at'];
         $cnt++;
     }
     return $array;
 }
コード例 #20
0
 public static function getAllByUserId($user)
 {
     $sql = "select * from " . self::$tablename . " where user_id=" . $user;
     $query = Executor::doit($sql);
     return Model::many($query[0], new CommentData());
 }
コード例 #21
0
ファイル: ProductData.php プロジェクト: evilnapsis/thunder
 public static function getAllByUserId($user_id)
 {
     $sql = "select * from " . self::$tablename . " where user_id={$user_id} order by created_at desc";
     $query = Executor::doit($sql);
     return Model::many($query[0], new ProductData());
 }
コード例 #22
0
ファイル: CutData.php プロジェクト: leanet/inventio-lite
 public static function getAllByPage($start_from, $limit)
 {
     $sql = "select * from " . self::$tablename . " where id>={$start_from} limit {$limit}";
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query[0]->fetch_array()) {
         $array[$cnt] = new CutData();
         $array[$cnt]->id = $r['id'];
         $array[$cnt]->finished_at = $r['finished_at'];
         $array[$cnt]->created_at = $r['created_at'];
         $cnt++;
     }
     return $array;
 }
コード例 #23
0
ファイル: ItemData.php プロジェクト: evilnapsis/thunder
 public static function getAllUnActive()
 {
     $sql = "select * from " . self::$tablename . " where is_active=0";
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query[0]->fetch_array()) {
         $array[$cnt] = new ItemData();
         $array[$cnt]->id = $r['id'];
         $array[$cnt]->name = $r['name'];
         $cnt++;
     }
     return $array;
 }
コード例 #24
0
ファイル: UserData.php プロジェクト: evilnapsis/imayik
 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;
 }
コード例 #25
0
ファイル: Criteria.php プロジェクト: CloudGt/suggbox-php
 function delete($where)
 {
     $this->sql = "delete from " . $this->tablename . " where {$where}";
     return Executor::doit($this->sql);
 }
コード例 #26
0
ファイル: TipData.php プロジェクト: evilnapsis/imayik
 public static function getAllByUID($author_id)
 {
     $sql = "select * from " . self::$tablename . " where author_id=" . $author_id . " order by created_at desc";
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query->fetch_array()) {
         $array[$cnt] = new TipData();
         $array[$cnt]->id = $r['id'];
         $array[$cnt]->title = $r['title'];
         $array[$cnt]->content = $r['content'];
         $array[$cnt]->author_id = $r['author_id'];
         $array[$cnt]->tags = $r['tags'];
         $array[$cnt]->created_at = $r['created_at'];
         $array[$cnt]->is_public = $r['is_public'];
         $cnt++;
     }
     return $array;
 }
コード例 #27
0
ファイル: BlockData.php プロジェクト: evilnapsis/xoolar-lite
 public static function getLike($q)
 {
     $sql = "select * from " . self::$tablename . " where name like '%{$q}%'";
     $query = Executor::doit($sql);
     return Model::many($query[0], new BlockData());
 }
コード例 #28
0
ファイル: SellData.php プロジェクト: evilnapsis/thunder
 public static function getAllAppliedByPage($start_from, $limit)
 {
     $sql = "select * from " . self::$tablename . " where id<={$start_from} and is_applied=1 limit {$limit}";
     $query = Executor::doit($sql);
     return Model::many($query[0], new SellData());
 }
コード例 #29
0
ファイル: StatusData.php プロジェクト: alfieris/katana
 public static function getPublics()
 {
     $sql = "select * from " . self::$tablename . " where is_public=1";
     $query = Executor::doit($sql);
     return Model::many($query[0], new StatusData());
 }
コード例 #30
0
ファイル: ChannelData.php プロジェクト: evilnapsis/imayik
 public static function getAllByUID($uid)
 {
     $sql = "select * from " . self::$tablename . " where user_id={$uid}";
     $query = Executor::doit($sql);
     return Model::many($query[0], new ChannelData());
 }