Пример #1
0
	function add($type,$text,$checkright=true) {
		global $user;
		if ($checkright) {
			$r = getright($user);
			if (!($r[$type]["edit"] || $r[$type]["del"] || $r[$type]["view"])) return; 
		}
		$this->html.="<td><div class='menuitemcp' id='$type'><a onclick=\"selectmenu('$type','')\"><div>$text</div></a></div>";
	}
Пример #2
0
include_once $GLOBALS["DOCUMENT_ROOT"]."/lib/sql.php";
authorize(); // вызов авторизации


if (isset($delete)) 
{
	// удаление
	$sql = "UPDATE conductors SET ts=NOW(), user_id='$userid', ready='1' WHERE id='$delete'";
	mylog('conductors',$delete);
	mysql_query($sql);
}
elseif (isset($show) || isset($edit)|| isset($add) )
{
	if (!isset($accept) ) {
	$id=isset($show)?$id:(isset($edit)?$edit:$add);
	$r = getright($user);

		echo "<form method=post id=editform>";
		if ($edit!=0) {
			$sql="SELECT *, customers.id AS cusid, conductors.board_id AS plid FROM conductors JOIN (customers,plates) ON (conductors.board_id=plates.id AND plates.customer_id=customers.id) WHERE conductors.id='$edit'";
			$res = mysql_query($sql);
			if ($rs=mysql_fetch_array($res)) {
				$customer=$rs["cusid"];
				$plid = $rs["plid"];
				$side = $rs["side"];
				$pib=$rs["pib"];
				$lays=$rs["lays"];
				echo "Заказчик:<input type=input readonly style='background-color:gray;' value='".$rs["customer"]."'><br>";
				echo "Плата:<input type=input readonly style='background-color:gray;' value='".$rs["plate"]."'>";
				echo "<input type=hidden name=plate_id value='$plid'>";
			}