122 lines
		
	
	
		
			4.7 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			122 lines
		
	
	
		
			4.7 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php include '../config.php';?>
 | 
						|
 | 
						|
<form action="write2.php" method="post">
 | 
						|
<div style="width:100%;"> <!-- Main Div -->
 | 
						|
<div style="float:left; width:50%;">
 | 
						|
	SAB Enabled:  <input name="sabvisible" id="id" type="checkbox" <?php if($sabvisible > "0")  echo "checked=checked; "; ?> /><br />
 | 
						|
	SAB Port:  <input type="text" value="<?php echo $sabport ?>" name="sabport" /><br />
 | 
						|
	SAB Name:  <input type="text" value="<?php echo $sabname ?>" name="sabname" /><br />
 | 
						|
	SAB Pic:  <?php 
 | 
						|
 | 
						|
$folder = '../Pic/Upload'; 
 | 
						|
 | 
						|
echo '<select name="sabpic">'."\n". 
 | 
						|
     dropdown(image_filenames($folder), @$_POST['image']). 
 | 
						|
     '</select>'."\n".'</br></br>'; 
 | 
						|
 | 
						|
function image_filenames($dir) 
 | 
						|
{ 
 | 
						|
    $handle = @opendir($dir) 
 | 
						|
        or die("I cannot open the directory '<b>$dir</b>' for reading."); 
 | 
						|
    $images = array(); 
 | 
						|
    while (false !== ($file = readdir($handle))) 
 | 
						|
    { 
 | 
						|
        if (eregi('\.(jpg|gif|png)$', $file)) 
 | 
						|
        { 
 | 
						|
            $images[] = $file; 
 | 
						|
        } 
 | 
						|
    } 
 | 
						|
    closedir($handle); 
 | 
						|
    return $images; 
 | 
						|
} 
 | 
						|
 | 
						|
function dropdown($options_array, $selected = null) 
 | 
						|
{ 
 | 
						|
global $sabpicname;
 | 
						|
    $return = "<option></option>";
 | 
						|
    foreach($options_array as $option) 
 | 
						|
    { 
 | 
						|
        $return .= '<option value="'.$option.'"'. 
 | 
						|
                   (($option == $sabpicname) ? ' selected="selected"' : null ). 
 | 
						|
                   '>'.$option.'</option>'."\n"; 
 | 
						|
    } 
 | 
						|
    return $return; 
 | 
						|
} 
 | 
						|
 | 
						|
?>
 | 
						|
	Sick Enabled:  <input name="sickvisible" id="id" type="checkbox" <?php if($sickvisible > "0")  echo "checked=checked; "; ?> /><br />
 | 
						|
	Sick Type : <input type="radio" name="sicktype" value="1" <?php if($sicktype < "2")  echo "checked=checked; "; ?>>SickBeard / <input type="radio" name="sicktype" value="2" <?php if($sicktype > "1")  echo "checked=checked; "; ?>>SickRage<br />
 | 
						|
	Sick Port:  <input type="text" value="<?php echo $sickport ?>" name="sickport" /><br />
 | 
						|
	Sick Name:  <input type="text" value="<?php echo $sickname ?>" name="sickname" /><br />
 | 
						|
	Sick Pic:<?php 
 | 
						|
 | 
						|
echo '<select name="sickpic">'."\n". 
 | 
						|
     dropdown_sick(image_filenames($folder), @$_POST['image2']). 
 | 
						|
     '</select>'."\n".'</br></br>'; 
 | 
						|
 | 
						|
function dropdown_sick($options_array, $selected = null) 
 | 
						|
{ 
 | 
						|
global $sickpicname;
 | 
						|
    $return = "<option></option>";
 | 
						|
    foreach($options_array as $option) 
 | 
						|
    { 
 | 
						|
        $return .= '<option value="'.$option.'"'. 
 | 
						|
                   (($option == $sickpicname) ? ' selected="selected"' : null ). 
 | 
						|
                   '>'.$option.'</option>'."\n"; 
 | 
						|
    } 
 | 
						|
    return $return; 
 | 
						|
} 
 | 
						|
 | 
						|
?>
 | 
						|
		</div>
 | 
						|
<div style="float:right; width:50%; ">	
 | 
						|
	Couch Enabled:  <input name="couchvisible" id="id" type="checkbox" <?php if($couchvisible > "0")  echo "checked=checked; "; ?> /><br />
 | 
						|
	Couch Adults : <input type="radio" name="cpadultsvisible" value="1" <?php if($cpadultsvisible > "0")  echo "checked=checked; "; ?>>Enabled / <input type="radio" name="cpadultsvisible" value="2" <?php if($cpadultsvisible < "1")  echo "checked=checked; "; ?>>Disabled<br />
 | 
						|
	Couch Adults Port:  <input type="text" value="<?php echo $cpadults ?>" name="cpadults" /><br />
 | 
						|
	Couch Adults Name:  <input type="text" value="<?php echo $cpadultsname ?>" name="cpadultsname" /><br />
 | 
						|
	Couch Adults Pic:  <?php 
 | 
						|
 | 
						|
echo '<select name="cpapic">'."\n". 
 | 
						|
     dropdown_cpa(image_filenames($folder), @$_POST['image2']). 
 | 
						|
     '</select>'."\n".'</br></br>'; 
 | 
						|
 | 
						|
function dropdown_cpa($options_array, $selected = null) 
 | 
						|
{ 
 | 
						|
global $cpadultspicname;
 | 
						|
    $return = "<option></option>";
 | 
						|
    foreach($options_array as $option) 
 | 
						|
    { 
 | 
						|
        $return .= '<option value="'.$option.'"'. 
 | 
						|
                   (($option == $cpadultspicname) ? ' selected="selected"' : null ). 
 | 
						|
                   '>'.$option.'</option>'."\n"; 
 | 
						|
    } 
 | 
						|
    return $return; 
 | 
						|
} 
 | 
						|
 | 
						|
?>
 | 
						|
	Couch Kids : <input type="radio" name="cpkidsvisible" value="1" <?php if($cpkidsvisible > "0")  echo "checked=checked; "; ?>>Enabled / <input type="radio" name="cpkidsvisible" value="2" <?php if($cpkidsvisible < "1")  echo "checked=checked; "; ?>>Disabled<br />
 | 
						|
	Couch Kids Port:  <input type="text" value="<?php echo $cpkids ?>" name="cpkids" /><br />
 | 
						|
	Couch Kids Name:  <input type="text" value="<?php echo $cpkidsname ?>" name="cpkidsname" /><br />
 | 
						|
	Couch Kids Pic:  <?php 
 | 
						|
 | 
						|
echo '<select name="cpkpic">'."\n". 
 | 
						|
     dropdown_cpk(image_filenames($folder), @$_POST['image2']). 
 | 
						|
     '</select>'."\n".'</br></br>'; 
 | 
						|
 | 
						|
function dropdown_cpk($options_array, $selected = null) 
 | 
						|
{ 
 | 
						|
global $cpkidspicname;
 | 
						|
    $return = "<option></option>";
 | 
						|
    foreach($options_array as $option) 
 | 
						|
    { 
 | 
						|
        $return .= '<option value="'.$option.'"'. 
 | 
						|
                   (($option == $cpkidspicname) ? ' selected="selected"' : null ). 
 | 
						|
                   '>'.$option.'</option>'."\n"; 
 | 
						|
    } 
 | 
						|
    return $return; 
 | 
						|
} 
 | 
						|
 | 
						|
?>  
 | 
						|
   <input type="submit"  name="submit" value="Update" />
 | 
						|
</form>
 | 
						|
</div>
 |