public function matchCancelAction() { if (isPost()) { $mid = post('mid', 'int'); $model = new ProfileModel(); $response['error'] = 0; if ($model->delete("matches", " id = {$mid} AND uready=0 AND pready=0 ")) { $response['target_h']['#cancelMatch' . $mid] = "Match was deleted!"; } else { $response['target_h']['#cancelMatch' . $mid] = "Match cannot be deleted!"; } echo json_encode($response); exit; } }
function deleteProfile($aFormValues) { $pm = new ProfileModel(); $res = new xajaxResponse(); if (isset($aFormValues['mailaddressText'])) { $mailaddress = $aFormValues['mailaddressText']; try { $pm->delete($aFormValues['mailaddressText']); } catch (Exception $e) { if ($e->getCode() == 6) { $res->addAssign("contentView", "innerHTML", "Error:" . $e->getMessage()); return $res; } else { throw $e; } } } else { return $res; } if (isset($_COOKIE['defaultProfile']) && $_COOKIE['defaultProfile'] == $aFormValues['mailaddressText']) { setcookie("defaultProfile", "", time() - 3600, dirname($_SERVER['PHP_SELF']), $_SERVER['SERVER_NAME']); } if (isset($_SESSION['defaultProfile']) && $_SESSION['defaultProfile'] == $aFormValues['mailaddressText']) { unset($_SESSION['defaultProfile']); } $res->addScriptCall("setModifyMask"); $res->addAssign("home_country_select", "innerHTML", ""); $res->addAssign("home_apcode_select", "innerHTML", ""); $res->addAssign("home_region_select", "innerHTML", ""); $res->addAssign("contentView", "innerHTML", "Profile " . $mailaddress . " deleted"); return $res; }