Ejemplo n.º 1
0
         }
       }*/
     break;
     //delete
 //delete
 case 'delete':
     //http://bootstrap.mkgalaxy.com/svnprojects/horo/records.php
     //Get Params
     //?action=delete&id=15
     //&access_token=ya29.bAJm48DiufO5cxC1kd5IE8f6lnEDIMseVzVF4D3i6GUQwf8gUWTfcpgpMF8EWmqRfyfVKQ
     if (empty($_REQUEST['id'])) {
         throw new Exception('id not found');
     }
     $ids = $_REQUEST['id'];
     $DbTools = new DbTools();
     $return['data']['deleted'] = $DbTools->delete($ids, $tableName, $tableTag);
     /*$exp = explode(',', $ids);
       foreach ($exp as $id) {
         
         $q = 'select * from '.$tableName.' WHERE id = ?';
         $res = $Models_General->fetchRow($q, array($id), 0);
         
         if ($res['uid'] != UID) {
           throw new Exception('invalid user');
         }
         $q = 'delete from '.$tableName.' WHERE id = ?';
         $Models_General->deleteDetails($q, array($id));
         $q = 'delete from '.$tableTag.' WHERE id = ?';
         $Models_General->deleteDetails($q, array($id));
       }*/
     break;