mirror of
				https://github.com/nerzhul/ocsms.git
				synced 2025-10-28 00:49:11 +00:00 
			
		
		
		
	Testing pushing test datas
This commit is contained in:
		
							parent
							
								
									07261636e6
								
							
						
					
					
						commit
						129e627cb0
					
				| @ -37,7 +37,10 @@ class SmsController extends Controller { | ||||
| 	/** | ||||
| 	 * @NoAdminRequired | ||||
| 	 */ | ||||
| 	public function push($json_datas) { | ||||
| 	public function push($smsCount, $smsDatas) { | ||||
| 		if ($smsCount != count($smsDatas)) { | ||||
| 			return "ERROR"; | ||||
| 		} | ||||
| 		return array("test" => "test2"); | ||||
| 	} | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										40
									
								
								db/SmsObject.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								db/SmsObject.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,40 @@ | ||||
| <?php | ||||
| /** | ||||
|  * ownCloud - ocsms | ||||
|  * | ||||
|  * This file is licensed under the Affero General Public License version 3 or | ||||
|  * later. See the COPYING file. | ||||
|  * | ||||
|  * @author Loic Blot <loic.blot@unix-experience.fr> | ||||
|  * @copyright Loic Blot 2014 | ||||
|  */ | ||||
| 
 | ||||
| namespace OCA\OcSms\Db; | ||||
| 
 | ||||
| use \OCP\IDb; | ||||
| 
 | ||||
| class Sms { | ||||
| 	private $db; | ||||
| 
 | ||||
|     public function __construct(IDb $db) { | ||||
|         $this->db = $db; | ||||
|     } | ||||
| 
 | ||||
| 	// @TODO
 | ||||
| 	public function saveAll() { | ||||
| 	} | ||||
| 
 | ||||
|     public function find($id) { | ||||
|         $sql = 'SELECT * FROM `*PREFIX*myapp_authors` ' . | ||||
|             'WHERE `id` = ?'; | ||||
|         $query = $db->prepareQuery($sql); | ||||
|         $query->bindParam(1, $id, \PDO::PARAM_INT); | ||||
|         $result = $query->execute(); | ||||
| 
 | ||||
|         while($row = $result->fetchRow()) { | ||||
|             return $row; | ||||
|         } | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| ?>
 | ||||
| @ -11,7 +11,7 @@ | ||||
| (function ($, OC) { | ||||
| 
 | ||||
| 	$(document).ready(function () { | ||||
| 		$('#echo').click(function () { | ||||
| 		$('#push').click(function () { | ||||
| 			var url = OC.generateUrl('/apps/ocsms/push'); | ||||
| 			var data = { | ||||
| 				sms_count: 1, | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user