src/VTvotingTrees.class.php
// users take care about the issue
users take care about the issue
users take care about the issue
function takeCare($user)
  {
    $id=$this->id;
    $query="LOCK TABLES VTpending WRITE, VTdelegate WRITE";
    mysqli_query($this->mysqli_link,$query);
    $query="CALL takeCare($id,$user,@o_steps,@o_result)";
    mysqli_query($this->mysqli_link,$query);
    $query = "select @o_steps,@o_result";
    $result=mysqli_query($this->mysqli_link,$query);
    $result_vals=mysqli_fetch_array($result);
    $row=mysqli_fetch_array($result);
    $query="UNLOCK TABLES";
    mysqli_query($this->mysqli_link,$query);
    $query="UPDATE VTissue SET VTissue.total=(SELECT count(*) from VTdelegate where VTissue.id=VTdelegate.issue_id) where VTissue.id=$id";
    mysqli_query($this->mysqli_link,$query);
    return $result_vals['@o_result'];
  }
function takeCare ( $ user ) { $ id = $ this -> id ; $ query = " LOCK TABLES VTpending WRITE, VTdelegate WRITE " ; mysqli_query ( $ this -> mysqli_link , $ query ) ; $ query = " CALL takeCare( $ id , $ user ,@o_steps,@o_result) " ; mysqli_query ( $ this -> mysqli_link , $ query ) ; $ query = " select @o_steps,@o_result " ; $ result = mysqli_query ( $ this -> mysqli_link , $ query ) ; $ result_vals = mysqli_fetch_array ( $ result ) ; $ row = mysqli_fetch_array ( $ result ) ; $ query = " UNLOCK TABLES " ; mysqli_query ( $ this -> mysqli_link , $ query ) ; $ query = " UPDATE VTissue SET VTissue.total=(SELECT count(*) from VTdelegate where VTissue.id=VTdelegate.issue_id) where VTissue.id= $ id " ; mysqli_query ( $ this -> mysqli_link , $ query ) ; return $ result_vals [ '@o_result' ] ; }
users take care about the issue
users take care about the issue
// lock tables pending, VTdelegate // TODO: error handling // print mysqli_error($this->mysqli_link); // TODO: error handling // print mysqli_error($this->mysqli_link); // TODO: error handling // print mysqli_error($this->mysqli_link); // TODO: error handling // print mysqli_error($this->mysqli_link);