⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 listing.php

📁 FP2 CRM code+Mysql DB
💻 PHP
字号:
<?php
class ListAction
{
	var $name;
	var $url;
	var $cssClass;
	var $onclickEvent;
	
	function ListAction($name,$url,$class,$onclickEvent='',$target,$idName='')
	{
		 $this->name = $name;
		 $this->url = $url;
		 $this->cssClass = $class;
		 $this->onclickEvent = $onclickEvent;
		 $this->target = $target;
		 $this->idName = $idName;
	}
	//----------
	function printAction($id,$name)
	{
		if(empty($this->idName))
			$idName = 'id';
		else
			$idName = $this->idName;

		if($this->name == 'Delete')
		{
			$this->onclickEvent = 'return confirm("Do You Really want to delete '.$name.'")';
			?>
				<a class="<?=$this->cssClass?>" target="<?=$this->target?>" href="<?=$this->url.'&'.$idName.'='.$id?>" onClick='<?=$this->onclickEvent?>'><img title="Click Hear To Delete This Item" border="0" src="<?=APP_WEB_ROOT?>/templates/images/delicon.gif" /></a>
			<?php

		}
		else
		if($this->name == 'Edit')
		{
			?>
				<a class="<?=$this->cssClass?>" target="<?=$this->target?>" href="<?=$this->url.'&'.$idName.'='.$id?>" onClick='<?=$this->onclickEvent?>'><img title="Click Hear To Edit This Item" border="0" src="<?=APP_WEB_ROOT?>/templates/images/button_edit.png" /></a>
			<?php

		}
		
		else
		{
		?>
			[<a class="<?=$this->cssClass?>" target="<?=$this->target?>" href="<?=$this->url.'&'.$idName.'='.$id?>" onClick='<?=$this->onclickEvent?>'><?=$this->name?></a>]
		<?php
		}
		
		
	}
	
}//end of Class ListAction

class ActionArrayList
{
	var $curCount=0;
	var $actionList = array();
	function add($name,$url,$class,$target,$idName='')
	{
		$var = new ListAction($name,$url,$class,'',$target,$idName);
		$this->actionList[$this->curCount] = $var;
		$this->curCount++;
	}

	function printListOfActions($id,$name)
	{
		foreach($this->actionList as $key=>$val)	
		{
			$val->printAction($id,$name);
		}
	}
	
}//end of class ActionList

?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -