<?php
/*
	DevSaver Web Framework
	Copyright (c) 2013-2016 DevSaver. 
	All rights reserved.
		web:  www.devsaver.com
		mail: support@devsaver.com				
*/


class CWidgetsWidgetProgressBars extends CWidget {

	/**
	* description
	*
	* @var type
	*
	* @access type
	*/
	var $meta = array(
		"type"	=> "8",
		"name"	=> "Progress Bars",
		"module"	=> array(
			"name"	=> "",
			"id"	=> "",
			"type"	=> "",
		)
	);

		

	/**
	* description
	*
	* @param
	*
	* @return
	*
	* @access
	*/
	function Render($widget) {
		global $base;

		if (trim($widget["settings"]["set_options"])) {

			$tmp = explode("\n" ,$widget["settings"]["set_options"] );

			if (count($tmp)) {
				foreach ($tmp as $key => $val) {
					$_tmp = explode("|" , $val);
					$vals[] = array(
						"title"	=> $_tmp[0],
						"perc"	=> min(100 , trim($_tmp[1])),
					);
				}


				return $this->tpl->blockReplace(
					"Widget",
					array(
						"items"	=> $base->html->table(
							$this->tpl,
							"",
							$vals
						)
					),
					$widget
				);
				
			}
			
		}

	}
	
}


?>