<?php
require_once("cmscommon.inc");
?>
<html>
<head>
<title>CMS Article Entry/Edit</title>
<STYLE TYPE="text/css">
.headw { font: BOLD 14pt arial, helvetica, sans-serif; }
.headw { color: #336600; }
.headk { font: BOLD 11pt arial, helvetica, sans-serif; }
.headk { color: #336600; }
.smallk { font: 10pt arial, helvetica, sans-serif; }
.smallgk { font: 10pt arial, helvetica, sans-serif; }
.smallgk { color: #336600; }
.tinyk { font: 8pt arial, helvetica, sans-serif; }
</style>
<script type="text/javascript">
window.onload = function()
{
var eSelect = document.getElementById('appselect');
eSelect.onchange = function()
{
if(eSelect.selectedIndex === 0)
{
document.getElementById('cdiv2').style.display='none';
document.getElementById('cdiv3').style.display='none';
}
else if(eSelect.selectedIndex === 1)
{
document.getElementById('cdiv2').style.display='none';
document.getElementById('cdiv3').style.display='none';
}
else if(eSelect.selectedIndex === 2)
{
document.getElementById('cdiv2').style.display='block';
document.getElementById('cdiv3').style.display='none';
}
else if(eSelect.selectedIndex === 3)
{
document.getElementById('cdiv2').style.display='none';
document.getElementById('cdiv3').style.display='block';
}
}
}
</script>
</head>
<?php
$sql = "SELECT * FROM cmsmain WHERE cmsid = 100606";
$result = db_query($sql, $db);
$myrow = mysql_fetch_array($result);
$coveragearea=$myrow["coveragearea"];
$application=$myrow["application"];
$topicid = $myrow["topicid"];
$sql = "SELECT * FROM cmstopic";
$topicresult = db_query($sql, $db);
?>
<body link="#336600" alink="#669966" vlink="#669966" >
<form name="addarticle" method="post" action="2.3EditorUpdateDatabase.php">
<input type="hidden" name="cmsid" value="<?php echo $cmsid?>">
<table width="100%" cellpadding="0" cellspacing="4" border="0" bgcolor="#FFFFFF">
<tr>
<td align="left" width="20%" class="smallgk"><b>Application:</b></td>
<td width="30%" align="left"><select id="appselect" name="application" >
<option <?php if($application == ""){?> selected <?php } ?>value="">Please Select</option>
<option <?php if($application == "Need To Know Guides"){?> selected <?php } ?>value="Need to Know Guides">Need To Know Guides</option>
<option <?php if($application == "Buying Guides"){?> selected <?php } ?>value="Buying Guides">Buying Guides</option>
<option <?php if($application == "Local Page Articles"){?> selected <?php } ?>value="Local Page Articles">Local Page Articles</option>
</select></td>
<?php if($application == 'Buying Guides'){$topicstatus='block';}else{$topicstatus='none'; } ?>
<?php if($application == 'Local Page Articles'){$castatus='block';}else{$castatus='none'; } ?>
<td width="49%" align="left" class="smallgk"><b>
<div id="cdiv2" style="display: <?php echo $topicstatus; ?>;" >
Topic:
<select name="topic">
<option value="" selected>- Select -</option>
<?php
while ($mytopic = mysql_fetch_array($topicresult))
{
?>
<option value="<?php echo $mytopic["topicid"]; ?>" <?php if($topicid == $myrow["topicid"]){?>selected<?php } ?>><?php echo $mytopic["topicname"] ?></option>
<?php
}
?>
</select>
</div>
<div id="cdiv3" style="display: <?php echo $castatus; ?>;" >
Coverage Area:
<select name="coveragearea">
<option value="0" selected>- Select -</option>
<option <?php if($coveragearea == "Alaska"){?>selected<?php } ?>>Alaska </option>
<option <?php if($coveragearea == "Arizona"){?>selected<?php } ?>>Arizona</option>
<option <?php if($coveragearea == "Arkansas"){?>selected<?php } ?>>Arkansas</option>
<option <?php if($coveragearea == "California"){?>selected<?php } ?>>California</option>
<option <?php if($coveragearea == "Colorado"){?>selected<?php } ?>>Colorado</option>
<option <?php if($coveragearea == "Connecticut"){?>selected<?php } ?>>Connecticut</option>
<option <?php if($coveragearea == "Delaware"){?>selected<?php } ?>>Delaware</option>
<option <?php if($coveragearea == "Florida"){?>selected<?php } ?>>Florida</option>
<option <?php if($coveragearea == "Georgia"){?>selected<?php } ?>>Georgia</option>
<option <?php if($coveragearea == "Hawaii"){?>selected<?php } ?>>Hawaii</option>
<option <?php if($coveragearea == "Idaho"){?>selected<?php } ?>>Idaho</option>
<option <?php if($coveragearea == "Illinois"){?>selected<?php } ?>>Illinois</option>
<option <?php if($coveragearea == "Indiana"){?>selected<?php } ?>>Indiana</option>
<option <?php if($coveragearea == "Iowa"){?>selected<?php } ?>>Iowa</option>
<option <?php if($coveragearea == "Kansas"){?>selected<?php } ?>> Kansas</option>
<option <?php if($coveragearea == "Kentucky"){?>selected<?php } ?>>Kentucky</option>
<option <?php if($coveragearea == "Louisiana"){?>selected<?php } ?>>Louisiana</option>
<option <?php if($coveragearea == "Maine"){?>selected<?php } ?>>Maine</option>
<option <?php if($coveragearea == "Maryland"){?>selected<?php } ?>>Maryland</option>
<option <?php if($coveragearea == "Massachusetts"){?>selected<?php } ?>>Massachusetts</option>
<option <?php if($coveragearea == "Michigan"){?>selected<?php } ?>>Michigan</option>
<option <?php if($coveragearea == "Minnesota"){?>selected<?php } ?>> Minnesota</option>
<option <?php if($coveragearea == "Mississippi"){?>selected<?php } ?>> Mississippi</option>
<option <?php if($coveragearea == "Missouri"){?>selected<?php } ?>>Missouri</option>
<option <?php if($coveragearea == "Montana"){?>selected<?php } ?>>Montana</option>
<option <?php if($coveragearea == "Nebraska"){?>selected<?php } ?>>Nebraska</option>
<option <?php if($coveragearea == "Nevada"){?>selected<?php } ?>>Nevada</option>
<option <?php if($coveragearea == "New Hampshire"){?>selected<?php } ?>>New Hampshire</option>
<option <?php if($coveragearea == "New Jersey"){?>selected<?php } ?>>New Jersey</option>
<option <?php if($coveragearea == "New Mexico"){?>selected<?php } ?>>New Mexico</option>
<option <?php if($coveragearea == "New York"){?>selected<?php } ?>>New York</option>
<option <?php if($coveragearea == "North Carolina"){?>selected<?php } ?>>North Carolina </option>
<option <?php if($coveragearea == "North Dakota"){?>selected<?php } ?>>North Dakota</option>
<option <?php if($coveragearea == "Ohio"){?>selected<?php } ?>>Ohio</option>
<option <?php if($coveragearea == "Oklahoma "){?>selected<?php } ?>>Oklahoma</option>
<option <?php if($coveragearea == "Oregon"){?>selected<?php } ?>> Oregon</option>
<option <?php if($coveragearea == "Pennsylvania"){?>selected<?php } ?>>Pennsylvania</option>
<option <?php if($coveragearea == "Rhode Island"){?>selected<?php } ?>>Rhode Island</option>
<option <?php if($coveragearea == "South Carolina"){?>selected<?php } ?>>South Carolina</option>
<option <?php if($coveragearea == "South Dakota"){?>selected<?php } ?>>South Dakota</option>
<option <?php if($coveragearea == "Tennessee"){?>selected<?php } ?>>Tennessee</option>
<option <?php if($coveragearea == "Texas"){?>selected<?php } ?>>Texas</option>
<option <?php if($coveragearea == "Utah"){?>selected<?php } ?>>Utah</option>
<option <?php if($coveragearea == "Vermont"){?>selected<?php } ?>>Vermont</option>
<option <?php if($coveragearea == "Virginia"){?>selected<?php } ?>> Virginia</option>
<option <?php if($coveragearea == "Washington"){?>selected<?php } ?>>Washington</option>
<option <?php if($coveragearea == "West Virginia"){?>selected<?php } ?>> West Virginia</option>
<option <?php if($coveragearea == "Wisconsin"){?>selected<?php } ?>>Wisconsin</option>
<option <?php if($coveragearea == "Wyoming"){?>selected<?php } ?>>Wyoming</option>
<option <?php if($coveragearea == "District of Columbia"){?>selected<?php } ?>>District of Columbia</option>
</select></div>
</td>
</tr>
</table>
</form>
</body>
</html>
|