All pastes #1313357 Raw Edit

Miscellany

public php v1 · immutable
#1313357 ·published 2009-01-20 11:18 UTC
rendered paste body
<?php	error_reporting(E_ALL);	$link = mysql_connect("localhost","dcework","dceworkpass");	mysql_select_db("pluto_dce_work",$link);	$result = mysql_query("INSERT INTO InfraredGroup  SET FK_DeviceCategory = 168,  FK_Manufacturer = 73,  Description = \"Denon AVR Zone Group\",  FK_CommMethod = 11");	if (!$result) { print "Error:" . mysql_error(); }	$newPK = mysql_insert_id();	$fkInfraredGroup = $newPK;	print 'InfraredGroup: ' . $fkInfraredGroup;	$result = mysql_query("INSERT INTO DeviceTemplate  SET Description = \"Denon AVR Zone\",  Comments = \"\",  FK_DeviceCategory = 168,  FK_Manufacturer = 73,  Define = \"\",  ImplementsDCE = 0,  IsEmbedded = 1,  CommandLine = \"\",  IsPlugAndPlay = 0,  IsIPBased = 0,  IsPlugIn = 0,  FK_Users_Maintainer = 1,  InheritsMacFromPC = 0,  ConfigureScript = \"\",  FK_InfraredGroup = " . $fkInfraredGroup . ",  FK_CommMethod = 1");	if (!$result) { print "Error:" . mysql_error(); }	$newPK = mysql_insert_id();	$deviceTemplateID = $newPK;	print "New DeviceTemplate: " . $newPK;	$result = mysql_query("INSERT INTO DeviceTemplate_AV  SET FK_DeviceTemplate = " . $newPK . ",  IR_PowerDelay = 7000,  IR_ModeDelay = 2000,  DigitDelay = 250,  TogglePower = 0,  ToggleDSP = 0,  ToggleInput = 0,  ToggleOutput = 0,  MonitorInputChanges = 0,  RepeatIR = 4,  RepeatVolume = 2");	if (!$result) { print "Error:" . mysql_error(); }	$result = mysql_query("INSERT INTO DeviceTemplate_DeviceCommandGroup  SET FK_DeviceTemplate = " . $newPK . ",  FK_DeviceCommandGroup = 40");	if (!$result) { print "Error:" . mysql_error(); }	$result = mysql_query("INSERT INTO DeviceTemplate_DeviceCommandGroup  SET FK_DeviceTemplate = " . $newPK . ",  FK_DeviceCommandGroup = 65");	if (!$result) { print "Error:" . mysql_error(); }	$result = mysql_query("INSERT INTO DeviceTemplate_DeviceData  SET FK_DeviceTemplate = " . $newPK . ",  FK_DeviceData = 10,  IK_DeviceData = \"\",  Required = 0,  AllowedToModify = 1,  SetByDevice = 0,  Description = \"Location on Floorplan\",  UseDeviceTemplateDefault = 0,  ShowInWizard = 1");	if (!$result) { print "Error:" . mysql_error(); }	$result = mysql_query("INSERT INTO DeviceTemplate_DeviceData  SET FK_DeviceTemplate = " . $newPK . ",  FK_DeviceData = 11,  IK_DeviceData = \"26\",  Required = 0,  AllowedToModify = 1,  SetByDevice = 0,  Description = \"Floorplan Icon\",  UseDeviceTemplateDefault = 0,  ShowInWizard = 1");	if (!$result) { print "Error:" . mysql_error(); }	$result = mysql_query("INSERT INTO DeviceTemplate_DeviceData  SET FK_DeviceTemplate = " . $newPK . ",  FK_DeviceData = 158,  IK_DeviceData = \"0\",  Required = 1,  AllowedToModify = 1,  SetByDevice = 1,  Description = \"Volume Level for this Zone. 0 to 99\",  UseDeviceTemplateDefault = 0,  ShowInWizard = 1");	if (!$result) { print "Error:" . mysql_error(); }	$result = mysql_query("INSERT INTO DeviceTemplate_DeviceData  SET FK_DeviceTemplate = " . $newPK . ",  FK_DeviceData = 171,  IK_DeviceData = \"\",  Required = 1,  AllowedToModify = 1,  SetByDevice = 0,  Description = \"Which Zone is this child attached to?\",  UseDeviceTemplateDefault = 0,  ShowInWizard = 1");	if (!$result) { print "Error:" . mysql_error(); }	$result = mysql_query("INSERT INTO DeviceTemplate_DeviceTemplate_ControlledVia  SET FK_DeviceTemplate = " . $newPK . ",  FK_DeviceTemplate_ControlledVia = 1947,  RerouteMessagesToParent = 1,  AutoCreateChildren = 0");	if (!$result) { print "Error:" . mysql_error(); }	$result = mysql_query("INSERT INTO DeviceTemplate_Input  SET FK_DeviceTemplate = " . $newPK . ",  FK_Command = 161,  OrderNo = 0");	if (!$result) { print "Error:" . mysql_error(); }	$result = mysql_query("INSERT INTO DeviceTemplate_Input  SET FK_DeviceTemplate = " . $newPK . ",  FK_Command = 163,  OrderNo = 0");	if (!$result) { print "Error:" . mysql_error(); }	$result = mysql_query("INSERT INTO DeviceTemplate_Input  SET FK_DeviceTemplate = " . $newPK . ",  FK_Command = 164,  OrderNo = 0");	if (!$result) { print "Error:" . mysql_error(); }	$result = mysql_query("INSERT INTO DeviceTemplate_Input  SET FK_DeviceTemplate = " . $newPK . ",  FK_Command = 165,  OrderNo = 0");	if (!$result) { print "Error:" . mysql_error(); }	$result = mysql_query("INSERT INTO DeviceTemplate_Input  SET FK_DeviceTemplate = " . $newPK . ",  FK_Command = 166,  OrderNo = 0");	if (!$result) { print "Error:" . mysql_error(); }	$result = mysql_query("INSERT INTO DeviceTemplate_Input  SET FK_DeviceTemplate = " . $newPK . ",  FK_Command = 282,  OrderNo = 0");	if (!$result) { print "Error:" . mysql_error(); }	$result = mysql_query("INSERT INTO DeviceTemplate_Input  SET FK_DeviceTemplate = " . $newPK . ",  FK_Command = 285,  OrderNo = 0");	if (!$result) { print "Error:" . mysql_error(); }	$result = mysql_query("INSERT INTO DeviceTemplate_Input  SET FK_DeviceTemplate = " . $newPK . ",  FK_Command = 714,  OrderNo = 0");	if (!$result) { print "Error:" . mysql_error(); }	$result = mysql_query("INSERT INTO DeviceTemplate_Input  SET FK_DeviceTemplate = " . $newPK . ",  FK_Command = 909,  OrderNo = 0");	if (!$result) { print "Error:" . mysql_error(); }	$result = mysql_query("INSERT INTO DeviceTemplate_Input  SET FK_DeviceTemplate = " . $newPK . ",  FK_Command = 969,  OrderNo = 0");	if (!$result) { print "Error:" . mysql_error(); }?>