public static function addGroup_member($obj_Group_member)
 {
     $db = config::dbconfig();
     $obj_retresult = new returnResult();
     $obj_Group_member->MemberId = DAL_manageGroup_member::getLastGroup_memberId() + 1;
     $sql = "INSERT INTO tbl_group_member (GroupId,MemberId,MemberType,MemberDate,Description) \n\t\tVALUES (" . common::noSqlInject($obj_Group_member->GroupId) . "," . common::noSqlInject($obj_Group_member->MemberId) . "," . "'" . common::noSqlInject($obj_Group_member->MemberType) . "'" . "," . "'" . common::noSqlInject($obj_Group_member->MemberDate) . "'" . "," . "'" . common::noSqlInject($obj_Group_member->Description) . "'" . ");";
     $rs = mysql_query($sql);
     if (mysql_affected_rows() > 0) {
         $obj_retresult->type = 1;
         $obj_retresult->msg = "success";
         $obj_retresult->data = $obj_Group_member;
     } else {
         $obj_retresult->type = 0;
         $obj_retresult->msg = "failed";
     }
     return $obj_retresult;
 }
Exemplo n.º 2
0
function updateGroup_member($sessionkey, $appcode, $Group_memberdata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Group_member = new Group_member();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "GROUPID":
                    $obj_Group_member->GroupId = $child;
                    break;
                case "MEMBERID":
                    $obj_Group_member->MemberId = $child;
                    break;
                case "MEMBERTYPE":
                    $obj_Group_member->MemberType = $child;
                    break;
                case "MEMBERDATE":
                    $obj_Group_member->MemberDate = $child;
                    break;
                case "DESCRIPTION":
                    $obj_Group_member->Description = $child;
                    break;
            }
        }
        $obj_retResult_Group_member = DAL_manageGroup_member::updateGroup_member($obj_Group_member);
        if ($obj_retResult_Group_member->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getGroup_memberXml($obj_retResult_Group_member->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
Exemplo n.º 3
0
 public static function isChildGroup_member($MemberId, $ChildMemberId)
 {
     $ischild = false;
     $obj_retResult = DAL_manageGroup_member::getGroup_memberListByMemberId($ChildMemberId);
     //get child node
     if ($obj_retResult->type == 1) {
         $arr_Group_memberList = $obj_retResult->data;
         $obj_Group_member = $arr_Group_memberList[0];
         $arrParentIds = explode(",", $obj_Group_member->Url);
         foreach ($arrParentIds as $Group_memberParentId) {
             if ($Group_memberParentId == $MemberId) {
                 $ischild = true;
             }
         }
     }
     return $ischild;
 }