示例#1
0
function addSociety($sessionkey, $appcode, $Societydata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Society = new Society();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "SOCIETYID":
                    $obj_Society->SocietyId = $child;
                    break;
                case "NAME":
                    $obj_Society->Name = $child;
                    break;
                case "DESCRIPTION":
                    $obj_Society->Description = $child;
                    break;
                case "MISSION":
                    $obj_Society->Mission = $child;
                    break;
                case "SOCIETYTYPEID":
                    $obj_Society->SocietyTypeId = $child;
                    break;
                case "SOCIETYADDRESS":
                    $obj_Society->SocietyAddress = $child;
                    break;
            }
        }
        $obj_retResult_Society = DAL_manageSociety::addSociety($obj_Society);
        if ($obj_retResult_Society->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getSocietyXml($obj_retResult_Society->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
示例#2
0
 public static function addSociety2($SocietyId, $Name, $Description, $Mission, $SocietyTypeId, $SocietyAddress)
 {
     $obj_retResult = new returnResult();
     $obj_newSociety = new Society();
     $obj_newuser->setSociety($SocietyId, $Name, $Description, $Mission, $SocietyTypeId, $SocietyAddress);
     // $isExist = BL_manageSociety::isExist($obj_newSociety->id);
     if (!$isExist) {
         $obj_retResult_Society = DAL_manageSociety::addSociety($obj_newSociety);
         if ($obj_retResult_Society->type == 1) {
             $obj_retResult->type = 1;
             $obj_retResult->msg = "Success";
             $obj_retResult->data = $obj_retResult_Society->data;
         } else {
             $obj_retResult->type = 0;
             $obj_retResult->msg = "Failed";
         }
     } else {
         $obj_retResult->type = 0;
         $obj_retResult->msg = "Sorry! Society already exist";
     }
     return $obj_retResult;
 }