41 lines
892 B
PHP
Raw Normal View History

2013-07-19 18:52:52 +03:00
<?php
namespace OCA\Office;
class Op {
2013-07-20 18:56:09 +03:00
2013-08-06 18:07:05 +03:00
public static function add($op){
2013-08-07 00:48:43 +03:00
$query = \OCP\DB::prepare('INSERT INTO `*PREFIX*office_op` (`es_id`, `member`, `opspec`) VALUES (?, ?, ?) ');
2013-08-07 00:59:53 +03:00
$query->execute(array(
$result = $op['es_id'],
2013-07-20 18:56:09 +03:00
$op['member'],
$op['opspec'],
));
2013-08-07 00:59:53 +03:00
if ($result){
return \OCP\DB::insertid(`*PREFIX*office_op`);
}
return 0;
2013-08-06 18:07:05 +03:00
}
public static function getHeadSeq($esId){
$query = \OCP\DB::prepare('SELECT `seq` FROM `*PREFIX*office_op` WHERE `es_id`=? ORDER BY `seq` DESC LIMIT 1');
$result = $query->execute(array(
$esId
))
->fetchOne()
;
return $result;
}
public static function getOpsAfter($esId, $seq){
$query = \OCP\DB::prepare('SELECT `seq` FROM `*PREFIX*office_op` WHERE `es_id`=? AND `seq`>? ORDER BY `seq` ASC');
$result = $query->execute(array(
$esId, $seq
))
->fetchAll()
;
return $result;
2013-07-20 18:56:09 +03:00
}
2013-07-19 18:52:52 +03:00
}