mirror of
				https://github.com/optim-enterprises-bv/control-pane.git
				synced 2025-10-31 09:57:57 +00:00 
			
		
		
		
	* Refactor the rest of the scripts
This commit is contained in:
		| @@ -263,7 +263,7 @@ class Config | |||||||
| 	function authkeys_list() | 	function authkeys_list() | ||||||
| 	{ | 	{ | ||||||
| 		$db=new Db('base','authkey'); | 		$db=new Db('base','authkey'); | ||||||
| 		$res=$db->select('SELECT idx,name FROM authkey;'); | 		$res=$db->select('SELECT idx,name FROM authkey;', array()); | ||||||
| 		 | 		 | ||||||
| 		$html=''; | 		$html=''; | ||||||
| 		if(!empty($res))foreach($res as $item) | 		if(!empty($res))foreach($res as $item) | ||||||
| @@ -276,7 +276,7 @@ class Config | |||||||
| 	function vm_packages_list() | 	function vm_packages_list() | ||||||
| 	{ | 	{ | ||||||
| 		$db=new Db('base','local'); | 		$db=new Db('base','local'); | ||||||
| 		$res=$db->select('select id,name,description,pkg_vm_ram,pkg_vm_disk,pkg_vm_cpus,owner from vmpackages order by name asc;'); | 		$res=$db->select('select id,name,description,pkg_vm_ram,pkg_vm_disk,pkg_vm_cpus,owner from vmpackages order by name asc;', array()); | ||||||
| 		 | 		 | ||||||
| 		$html='<option value="0"></option>'; | 		$html='<option value="0"></option>'; | ||||||
| 		$min=0; | 		$min=0; | ||||||
|   | |||||||
| @@ -50,7 +50,7 @@ class Forms | |||||||
| 		if($this->db->error) return; | 		if($this->db->error) return; | ||||||
| 		//$query="select * from forms order by group_id asc, order_id asc"; | 		//$query="select * from forms order by group_id asc, order_id asc"; | ||||||
| 		$query="select * from forms order by groupname asc, group_id asc, order_id asc"; | 		$query="select * from forms order by groupname asc, group_id asc, order_id asc"; | ||||||
| 		$fields=$this->db->select($query); | 		$fields=$this->db->select($query, array()); | ||||||
| 		//print_r($fields);exit; | 		//print_r($fields);exit; | ||||||
| 		//echo '<pre>';print_r($fields); | 		//echo '<pre>';print_r($fields); | ||||||
| 		//$defaults=array(); | 		//$defaults=array(); | ||||||
| @@ -197,8 +197,8 @@ class Forms | |||||||
| 		{ | 		{ | ||||||
| 			$id=$arr['link'];	//$arr['param'].'-'. | 			$id=$arr['link'];	//$arr['param'].'-'. | ||||||
| 			$tpl='<datalist id="'.$id.'">'; | 			$tpl='<datalist id="'.$id.'">'; | ||||||
| 			$query="select * from {$arr['link']} order by order_id asc"; | 			$query="select * from ? order by order_id asc"; | ||||||
| 			$opts=$this->db->select($query); | 			$opts=$this->db->select($query, array([$arr['link']])); | ||||||
| 			if(!empty($opts))foreach($opts as $key=>$opt) | 			if(!empty($opts))foreach($opts as $key=>$opt) | ||||||
| 			{ | 			{ | ||||||
| 				$tpl.='<option>'.$opt['text'].'</option>'; | 				$tpl.='<option>'.$opt['text'].'</option>'; | ||||||
| @@ -213,8 +213,8 @@ class Forms | |||||||
| 		$tpl='<div class="form-field"><select name="${param}">'; | 		$tpl='<div class="form-field"><select name="${param}">'; | ||||||
| 		if(isset($arr['link'])) | 		if(isset($arr['link'])) | ||||||
| 		{ | 		{ | ||||||
| 			$query="select * from {$arr['link']} order by order_id asc"; | 			$query="select * from ? order by order_id asc"; | ||||||
| 			$opts=$this->db->select($query); | 			$opts=$this->db->select($query, array([$arr['link']])); | ||||||
| 			// Пустое поле в списках оказалось ненужным! | 			// Пустое поле в списках оказалось ненужным! | ||||||
| 			//array_unshift($opts,array('id'=>0,'text'=>'','order_id'=>-1)); | 			//array_unshift($opts,array('id'=>0,'text'=>'','order_id'=>-1)); | ||||||
| 			if(!empty($opts))foreach($opts as $key=>$opt) | 			if(!empty($opts))foreach($opts as $key=>$opt) | ||||||
| @@ -232,8 +232,8 @@ class Forms | |||||||
| 		$tpl='<div class="form-field"><fieldset><legend>${desc}</legend>'; | 		$tpl='<div class="form-field"><fieldset><legend>${desc}</legend>'; | ||||||
| 		if(isset($arr['link'])) | 		if(isset($arr['link'])) | ||||||
| 		{ | 		{ | ||||||
| 			$query="select * from {$arr['link']} order by order_id asc"; | 			$query="select * from ? order by order_id asc"; | ||||||
| 			$opts=$this->db->select($query); | 			$opts=$this->db->select($query, array([$arr['link']])); | ||||||
| 			if(!empty($opts))foreach($opts as $key=>$opt) | 			if(!empty($opts))foreach($opts as $key=>$opt) | ||||||
| 			{ | 			{ | ||||||
| 				$checked=($opt['id']==$arr['cur'])?' checked':''; | 				$checked=($opt['id']==$arr['cur'])?' checked':''; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Momchil Bozhinov
					Momchil Bozhinov