57 lines
999 B
PHP
57 lines
999 B
PHP
|
<?php
|
||
|
/**
|
||
|
* Heihe 黑河项目通用类
|
||
|
*/
|
||
|
|
||
|
class Heihe
|
||
|
{
|
||
|
|
||
|
private $db;//传入PDO对象
|
||
|
|
||
|
//使用到的公共变量
|
||
|
public $tbl_heiheproject = "heiheproject" ; //黑河项目表
|
||
|
public $tbl_heiheuser = "heiheuser"; //黑河用户表
|
||
|
public $project_status; //汇交项目计划状态
|
||
|
|
||
|
function __construct($db)
|
||
|
{
|
||
|
$this->db = $db;
|
||
|
|
||
|
$this->project_status = array(
|
||
|
0 => "计划未提交",
|
||
|
1 => "计划未审核",
|
||
|
2 => "跟踪专家审核",
|
||
|
3 => "跟踪专家通过",
|
||
|
4 => "数据委员会通过"
|
||
|
);
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
//获取汇交状态
|
||
|
public function getStatus($code){
|
||
|
|
||
|
$status = $this->project_status;
|
||
|
|
||
|
if(isset($status[$code]))
|
||
|
{
|
||
|
return $status[$code];
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
//改变状态
|
||
|
public function ChangeStatus($p,$s){
|
||
|
|
||
|
$sql = "UPDATE ".$this->tbl_heiheproject." SET status=? WHERE id=?";
|
||
|
|
||
|
$sth = $this->db->prepare($sql);
|
||
|
|
||
|
$rs = $sth->execute(array($s,$p));
|
||
|
|
||
|
return $rs;
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|