Ejemplo n.º 1
0
 public function add()
 {
     $reValue = 0;
     $mysql = new Mysql();
     $sql = "insert into " . $mysql->dbpre . "memo" . $mysql->debug . "(ProjectId,Memo,CreateTime,UserId) values(\n\t\t" . intval($this->ProjectId) . ",\n\t\t'" . $mysql->escape($this->Memo) . "',\n\t\t'" . $mysql->escape($this->CreateTime) . "',\n\t\t" . intval($this->UserId) . "\n\t\t)";
     //echo $sql;
     $mysql->runSql($sql);
     $reValue = $mysql->lastId();
     $mysql->closeDb();
     return $reValue;
 }
Ejemplo n.º 2
0
 public function add()
 {
     $reValue = 0;
     $mysql = new Mysql();
     $sql = "insert into " . $mysql->dbpre . "hours" . $mysql->debug . "(ProjectId,Memo,CreateTime,UserId,Hours1,Ratio,Hours2,WorkDate) values(\n\t\t" . intval($this->ProjectId) . ",\n\t\t'" . $mysql->escape($this->Memo) . "',\n\t\t'" . $mysql->escape($this->CreateTime) . "',\n\t\t" . intval($this->UserId) . ",\n\t\t" . floatval($this->Hours1) . ",\n\t\t" . floatval($this->Ratio) . ",\n\t\t" . floatval($this->Hours2) . ",\n\t\t'" . $mysql->escape($this->WorkDate) . "'\n\t\t)";
     //echo $sql;
     $mysql->runSql($sql);
     $reValue = $mysql->lastId();
     $mysql->closeDb();
     return $reValue;
 }
Ejemplo n.º 3
0
 public function add()
 {
     $reValue = 0;
     $mysql = new Mysql();
     $sql = "insert into boguan_tubu_invit (Name,Phone,Address,CreateTime) values(\n    \t\t'" . $mysql->escape($this->Name) . "',\n            '" . $mysql->escape($this->Phone) . "',\n    \t\t'" . $mysql->escape($this->CreateTime) . "'\n    \t\t)";
     //echo $sql;
     $mysql->runSql($sql);
     $reValue = $mysql->lastId();
     if ($mysql->errno() == 1062) {
         $reValue = -1;
     }
     $mysql->closeDb();
     return $reValue;
 }
Ejemplo n.º 4
0
 public function updateOpenIdQQ()
 {
     $mysql = new Mysql();
     $sql = "update  " . $mysql->dbpre . "user" . $mysql->debug . " set \n\t\t\tOpenIdQQ='" . $mysql->escape($this->OpenIdQQ) . "'\n\t\t\t WHERE UserId=" . intval($this->UserId);
     $mysql->runSql($sql);
     $result = $mysql->affectedRows();
     $mysql->closeDb();
     return $result;
 }
Ejemplo n.º 5
0
 function addOrEditCategory($id, $description, $displayOrder, $status, $name, $nameUrl, $parentId, $image)
 {
     $mysql = new Mysql();
     // @helu time 2014-06-13
     //判断别名是否添加过如果添加过则不能添加
     $sqlAlias = "SELECT COUNT(nameurl) as countId, id FROM " . $mysql->dbpre . "category" . $mysql->debug;
     $sqlAlias .= " WHERE nameurl= '" . $mysql->escape($nameUrl) . "'";
     $aliasRes = $mysql->getData($sqlAlias);
     $aliasCount = intval($aliasRes[0]['countId']);
     $aliasId = $aliasRes[0]['id'];
     // var_dump( $id );
     // var_dump( $aliasCount );
     // var_dump( $aliasId );
     // exit;
     if ($aliasCount === 1) {
         if (empty($id) || $id != $aliasId) {
             $result = array();
             $result['Success'] = false;
             $result['Code'] = -1;
             // -1 : 别名已经添加过
             $mysql->closeDb();
             return $result;
         }
     }
     if ($id > 0) {
         $sqlformat = "update %scategory%s set Description='%s',DisplayOrder=%d,status=%d,name='%s',nameurl='%s',parentid=%d,image='%s' where id=%d and belong=%d";
         $sql = sprintf($sqlformat, $mysql->dbpre, $mysql->debug, $mysql->escape($description), intval($displayOrder), intval($status), $mysql->escape($name), $mysql->escape($nameUrl), intval($parentId), $mysql->escape($image), intval($id), intval($this->Belong));
     } else {
         $sqlformat = "insert into %scategory%s (Description,DisplayOrder,status,Name,NameUrl,ParentId,Image,Belong,Creator) values('%s',%d,%d,'%s','%s',%d,'%s',%d,%d)";
         $sql = sprintf($sqlformat, $mysql->dbpre, $mysql->debug, $mysql->escape($description), intval($displayOrder), intval($status), $mysql->escape($name), $mysql->escape($nameUrl), intval($parentId), $mysql->escape($image), intval($this->Belong), intval($this->Creator));
     }
     $result = $mysql->runSql($sql);
     $mysql->closeDb();
     return $result;
 }
Ejemplo n.º 6
0
 function update()
 {
     $mysql = new Mysql();
     if ($this->EditFast) {
         $sql = "update " . $mysql->dbpre . "post" . $mysql->debug . " set " . "DisplayOrder=" . intval($this->DisplayOrder) . ", Subject='" . $mysql->escape($this->Subject) . "',status=" . intval($this->Status) . ",DisplayDate='" . $mysql->escape($this->DisplayDate) . "',commentStatus=" . intval($this->CommentStatus) . " where id=" . intval($this->Id) . " and belong=" . intval($this->Belong);
     } else {
         $sql = "update " . $mysql->dbpre . "post" . $mysql->debug . " set ChildIds='" . $mysql->escape($this->ChildIds) . "', Subject='" . $mysql->escape($this->Subject) . "',DisplayOrder=" . intval($this->DisplayOrder) . ",status=" . intval($this->Status) . ",content='" . $mysql->escape($this->Content) . "',Summary='" . $mysql->escape($this->Summary) . "',commentStatus=" . intval($this->CommentStatus) . ",image='" . $mysql->escape($this->Image) . "',tags='" . $mysql->escape($this->Tags) . "',Keywords='" . $mysql->escape($this->Keywords) . "',Memo='" . $mysql->escape($this->Memo) . "',Link='" . $mysql->escape($this->Link) . "',Source='" . $mysql->escape($this->Source) . "',DisplayDate='" . $mysql->escape($this->DisplayDate) . "',categoryIds='," . $mysql->escape($this->CategoryIds) . ",' where id=" . intval($this->Id) . " and belong=" . intval($this->Belong);
     }
     // var_dump( $sql );
     // exit;
     $mysql->runSql($sql);
     $mysql->closeDb();
     return true;
 }
Ejemplo n.º 7
0
 public function update()
 {
     $mysql = new Mysql();
     $sql = "update  " . $mysql->dbpre . "project" . $mysql->debug . " set \n\t\t\tSubject='" . $mysql->escape($this->Subject) . "',\n\t\t\tType=" . intval($this->Type) . ",\n\t\t\tDepartment=" . intval($this->Department) . ",\n\t\t\tTeam=" . intval($this->Team) . ",\n\t\t\tPublishTime='" . $mysql->escape($this->PublishTime) . "',\n\t\t\tStatus='" . $mysql->escape($this->Status) . "',\n\t\t\tHours='" . $mysql->escape($this->Hours) . "',\n\t\t\tDeveloper='" . $mysql->escape($this->Developer) . "',\n\t\t\tSchedule='" . $mysql->escape($this->Schedule) . "',\n\t\t\tDetail='" . $mysql->escape($this->Detail) . "',\n\t\t\tPv='" . $mysql->escape($this->Pv) . "',\n\t\t\tUv='" . $mysql->escape($this->Uv) . "',\n\t\t\tFans='" . $mysql->escape($this->Fans) . "',\n\t\t\tSummary='" . $mysql->escape($this->Summary) . "',\n\t\t\tUrl='" . $mysql->escape($this->Url) . "',\n\t\t\tQrCode='" . $mysql->escape($this->QrCode) . "',\n\t\t\tLaud=" . intval($this->Laud) . "\n\t\t\t WHERE Id=" . intval($this->Id);
     //echo $sql;
     $mysql->runSql($sql);
     $result = $mysql->affectedRows();
     $mysql->closeDb();
     return $result;
 }