Explorar o código

Merge pull request #4 from Obada8/patch-2

Update Shop.php
OwN-3m-All %!s(int64=9) %!d(string=hai) anos
pai
achega
cf4462f33c
Modificáronse 1 ficheiros con 8 adicións e 3 borrados
  1. 8 3
      modules/simple-billing/shop.php

+ 8 - 3
modules/simple-billing/shop.php

@@ -23,7 +23,7 @@
  */
 function exec_ogp_module()
 {	
-	global $db;
+	global $db, $view;
 
 	$settings = $db->getSettings();
 		
@@ -61,10 +61,15 @@ function exec_ogp_module()
 	</table>
 	<?php 
 	// Shop Form
-	if(isset($_REQUEST['service_id'])) $where_service_id = " WHERE service_id=".$_REQUEST['service_id']; else $where_service_id = "";
+	if(intval($_REQUEST['service_id']) !==0) $where_service_id = " WHERE service_id=".intval($_REQUEST['service_id']); else $where_service_id = "";
 	$qry_services = "SELECT * FROM OGP_DB_PREFIXbilling_services".$where_service_id;
 	$services = $db->resultQuery($qry_services);
-					
+	
+	if (isset($_REQUEST['service_id']) && $services === false) {
+		$view->refresh('home.php?m=simple-billing&p=shop');
+		return;
+	}
+	
 	foreach ($services as $key => $row) {
 		$service_id[$key] = $row['service_id'];
 		$home_cfg_id[$key] = $row['home_cfg_id'];