Exemplo n.º 1
0
     // no direct "insert", as created/destroyed from jornadaFunctions
     case "update":
         $am->access(PERMS_OPERATOR);
         $result = $mangas->update($manga);
         break;
     case "sharejuez":
         $am->access(PERMS_OPERATOR);
         $result = $mangas->shareJuez();
         break;
         // no direct delete as created/destroyed from jornadaFunctions
     // no direct delete as created/destroyed from jornadaFunctions
     case "enumerate":
         $result = $mangas->selectByJornada();
         break;
     case "swap":
         $result = $mangas->swapMangas($manga);
         break;
     case "getbyid":
         $result = $mangas->selectByID($manga);
         break;
     default:
         throw new Exception("mangaFunctions:: invalid operation: {$operation} provided");
 }
 if ($result === null) {
     throw new Exception($mangas->errormsg);
 }
 if ($result === "") {
     echo json_encode(array('success' => true, 'insert_id' => 0, 'affected_rows' => 0));
 } else {
     echo json_encode($result);
 }