Exemplo n.º 1
0
 public static function add($uid, $pid)
 {
     $db = Db::getConection();
     $stmt = $db->prepare("INSERT INTO  us_post (uid, pid)\nVALUES (:uid, :pid)");
     $res = $stmt->execute(array(':uid' => $uid, ':pid' => $pid));
     return $res;
 }
Exemplo n.º 2
0
 public static function dellFree($uid, $date)
 {
     $db = Db::getConection();
     $stmt = $db->prepare("DELETE FROM `freemen` WHERE `uid` = :uid AND `date` = :date");
     $res = $stmt->execute(array('uid' => $uid, 'date' => $date));
     return $res;
 }
Exemplo n.º 3
0
 public static function updateUsersByParam($pole, $val, $oid)
 {
     $db = Db::getConection();
     $res = $db->prepare('UPDATE `users` SET `' . $pole . '`=:val WHERE `id`=:oid');
     $answer = $res->execute(array(':val' => $val, ':oid' => $oid));
     return $answer;
 }
Exemplo n.º 4
0
 public static function addMounting($oid, $uid, $datedb)
 {
     $db = Db::getConection();
     $res = $db->prepare('INSERT INTO `mounting`(`oid`,`uid`,`m_date`) VALUES (:oid, :uid, :date)');
     $answer = $res->execute(array(':oid' => $oid, ':uid' => $uid, ':date' => $datedb));
     echo $uid;
     return $answer;
 }
Exemplo n.º 5
0
 public static function getPosts()
 {
     $db = Db::getConection();
     $res = $db->prepare('SELECT * FROM `posts`');
     $res->execute();
     $res->setFetchMode(PDO::FETCH_ASSOC);
     while ($row = $res->fetch()) {
         $posts[$row['id']] = $row['list'];
     }
     return $posts;
 }
Exemplo n.º 6
0
 public static function getAllDillers()
 {
     $db = Db::getConection();
     $userList = array();
     $res = $db->prepare('SELECT * FROM `dillers`');
     $res->execute();
     $res->setFetchMode(PDO::FETCH_ASSOC);
     while ($row = $res->fetch()) {
         $userList[] = $row;
     }
     return $userList;
 }
Exemplo n.º 7
0
 public static function getSamples()
 {
     $db = Db::getConection();
     $list = array();
     $res = $db->prepare('SELECT * FROM `sample_sms`');
     $res->execute();
     $res->setFetchMode(PDO::FETCH_ASSOC);
     while ($row = $res->fetch()) {
         $list[$row['id']] = $row;
     }
     return $list;
 }
Exemplo n.º 8
0
    public static function getClaimsNoSum()
    {
        $db = Db::getConection();
        $orderList = array();
        $res = $db->prepare('
SELECT `oid`, `contract`, `sum`, (SELECT `name` FROM `users` WHERE `users`.`id` = `orders`. `technologist`) AS `tech`
FROM `orders` , `order_stan`
WHERE `contract` REGEXP \'^.*[РД][1-9]?$\'
AND `orders`.`id` = `order_stan`.`oid`
AND `orders`.`sum` < 1000
AND `order_stan`.`otgruz_end`!= \'2\'
');
        $res->execute();
        $res->setFetchMode(PDO::FETCH_ASSOC);
        while ($row = $res->fetch()) {
            $orderList[] = $row;
        }
        return $orderList;
    }
Exemplo n.º 9
0
 public static function setNote($oid, $note)
 {
     $db = Db::getConection();
     $res = $db->prepare("\nINSERT INTO `notes` (`oid`, `note` , `date`)\nVALUES (:oid, :note, CURDATE())\n\t  ");
     $res->execute(array('oid' => $oid, 'note' => $note));
 }