示例#1
0
 public static function Get($id = null)
 {
     $sql = "SELECT * FROM 2015Fall_WorkoutDate";
     if ($id) {
         $sql .= " WHERE id={$id} ";
         $ret = FetchAll($sql);
         return $ret[0];
     } else {
         return FetchAll($sql);
     }
 }
示例#2
0
 public static function Get($id = null)
 {
     $sql = "SELECT m.Name, m.id, m.Calories, m.Carbohydrates, m.Fiber, m.Protein, m.Cholestrol, m.Users_id, mt.id as MealType_Id, mt.MealType FROM 2015Fall_Meals m" . " left join 2015Fall_MealTypes mt on mt.id=m.2015Fall_MealTypes_id";
     if ($id) {
         $sql .= " WHERE m.id={$id} ";
         $ret = FetchAll($sql);
         return $ret[0];
     } else {
         return FetchAll($sql);
     }
 }
示例#3
0
 public static function Get($id = null)
 {
     $sql = "SELECT * FROM Meals";
     if ($id) {
         $sql .= " WHERE meals_id= {$id} ";
         $ret = FetchAll($sql);
         return $ret[0];
     } else {
         return FetchAll($sql);
     }
 }
示例#4
0
 public static function Get($id = null)
 {
     $sql = "SELECT * from exercises";
     if ($id) {
         $sql .= " WHERE id={$id} ";
         $ret = FetchAll($sql);
         return $ret[0];
     } else {
         return FetchAll($sql);
     }
 }
示例#5
0
 public static function Get($id = null)
 {
     $sql = "SELECT * FROM FitnessTracker_User";
     if ($id) {
         $sql .= " WHERE id={$id}";
         $ret = FetchAll($sql);
         return $ret[0];
     } else {
         return FetchAll($sql);
     }
 }
示例#6
0
 public static function Get($id = null)
 {
     $sql = "\tSELECT * FROM 2014Fall_Food_Types\n\t\t";
     if ($id) {
         $sql .= " WHERE id={$id} ";
         $ret = FetchAll($sql);
         return $ret[0];
     } else {
         return FetchAll($sql);
     }
 }
示例#7
0
 public static function Get($id = null)
 {
     $sql = "SELECT * FROM 2015Fall_Friends f inner join 2015Fall_Users u on u.id=f.Users_id ";
     if ($id) {
         $sql .= " WHERE Friend_id={$id} ";
         $ret = FetchAll($sql);
         return $ret[0];
     } else {
         return FetchAll($sql);
     }
 }
示例#8
0
 public static function Get($id = null)
 {
     $sql = "\tSELECT E.*, T.Name as T_Name\n\t\t\t\t\tFROM Food E \n\t\t";
     if ($id) {
         $sql .= " WHERE E.id={$id} ";
         $ret = FetchAll($sql);
         return $ret[0];
     } else {
         return FetchAll($sql);
     }
 }
示例#9
0
     if ($_POST['text']) {
         if ($_POST['rank'] == 'all') {
             $reciprecants = FetchAll(doquery("SELECT `id` FROM {{table}} WHERE `ally_id` = '" . $allyrow['id'] . "' ;", 'users'));
         } elseif (strlen($_POST['rank']) > 0) {
             $reciprecants = FetchAll(doquery("SELECT `id` FROM {{table}} WHERE `ally_id` = '" . $allyrow['id'] . "' AND `ally_rank_name` = '" . mysql_real_escape_string($_POST['rank']) . "' ;", 'users'));
         } else {
             info("Circular message was not sent", "Error", './?page=network&mode=circ', './?page=network&mode=circ');
             die;
         }
         $message = "Player " . $user['username'] . " tells you the following:\n" . mysql_real_escape_string(htmlentities($_POST['text']));
         $subject = "Circular mail of alliance [" . $allyrow['ally_tag'] . "]";
         GroupPM($reciprecants, $user['id'], $message, $subject, $user['username'], 1);
         info("Circular message has been sent", "Reference", './?page=network&mode=circ', './?page=network&mode=circ');
         die;
     } else {
         $ranks = FetchAll(doquery("SELECT `ally_rank_name` FROM {{table}} WHERE `ally_id` = '" . $allyrow['id'] . "' GROUP BY `ally_rank_name` ;", 'users'));
         $parse['ranks'] = '';
         foreach ($ranks as $rank) {
             $parse['ranks'] .= '<option value="' . $rank . '">Only rank: ' . $rank . '</option>';
         }
         if ($_GET['axah']) {
             makeAXAH(parsetemplate(gettemplate('alliance/circ'), $parse));
         } else {
             displaypage(parsetemplate(gettemplate('alliance/circ'), $parse), $lang['title']);
         }
     }
     //On send, info("Circular message has been sent","Reference",'./?page=network&mode=circ','<<');
     break;
 case 'apps':
     if (!$user['permisions'][8]) {
         header("Location: " . AddUniToString('./?page=network&axah=' . $_GET['axah']));
示例#10
0
 public static function Search($q)
 {
     $sql = "\tSELECT E.*, T.Name as T_Name\n\t\t\t\t\tFROM 2014Fall_Food_Eaten E\n\t\t\t\t\t\tJoin 2014Fall_Food_Types T ON E.Type_id = T.id\n\t\t\t\t\tWHERE E.Name LIKE '%{$q}%'\n\t\t";
     return FetchAll($sql);
 }
示例#11
0
 public static function Get()
 {
     return FetchAll("SELECT * FROM Users");
 }
示例#12
0
 public static function Get()
 {
     return FetchAll("SELECT * FROM 2015Fall_Persons");
 }