function deleteShell($data) { $dataArray = preg_split("/,{1,1}/", $data); $reciveToken = $dataArray[0]; $shellUrl = $dataArray[1]; if ($reciveToken === $_SESSION['loginToken']) { SQLAdopt::delete(new shellModel($shellUrl, '', '', '', '')); } echo 'completed'; }
function set_ActiveServerByJson($json) { $all = json_decode($json); $rtn = array(); if (is_array($all)) { foreach ($all as $row => $rowValue) { $model = new activeServerModel('', '', ''); foreach ($rowValue as $key => $value) { $model->{$key} = $value; } $rtn[] = $model; } } SQLAdopt::delete(new activeServerModel('', '', '')); foreach ($rtn as $o) { SQLAdopt::insert($o); } }