Exemplo n.º 1
0
 public function delete()
 {
     $wid = isset($_POST['id']) ? addslashes($_POST['id']) : '';
     $typ = isset($_POST['typ']) ? addslashes($_POST['typ']) : '';
     if ($wid == "") {
         die('ID empty');
     }
     if ($typ == '') {
         die('Type empty');
     }
     $json['bool'] = 0;
     if ($typ == "kelas") {
         $wallmurid = new MuridWall();
     }
     if ($typ == "school") {
         $wallmurid = new SchoolWall();
     }
     //load
     $wallmurid->getByID($wid);
     if ($wallmurid->wall_from == Account::getMyID()) {
         $json['bool'] = $wallmurid->delete($wid);
     } else {
         $json['err'] = Lang::t('Not Authorize');
     }
     die(json_encode($json));
 }