<?php

/*++++++++++++++++++++++++++++++++++++++++

  Script: Maian Gallery v2.0
  Written by: David Ian Bennett
  E-Mail: support@maianscriptworld.co.uk
  Website: http://www.maianscriptworld.co.uk

  ++++++++++++++++++++++++++++++++++++++++
  
  This File: selling_options.php
  Description: Selling Options
  New in v2.0

  ++++++++++++++++++++++++++++++++++++++++*/

// Make sure that this file is being called from parent file
if (!defined('INCLUDE_FILES')) {
  accessDenied($msg_script18,$msg_script19);
  exit;
}
 
?>
<div align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="1" style="border: 2px solid #083253">
<tr>
    <td align="left" class="msgBox">&raquo; <b><?php echo $msg_sellingoptions; ?></b><br><br><?php echo $msg_sellingoptions2; ?></td>
</tr>
</table>
<?php
if (isset($OK))
{
?>
<table cellpadding="0" cellspacing="0" width="100%" class="updateTable">
<tr>
    <td align="center" style="padding:5px"><?php echo str_replace("{count}",$count,$msg_sellingoptions6); ?></td>
</tr>
</table>
<?php
}
?>
<table cellpadding="0" cellspacing="0" width="100%" class="menutable">
<tr>
    <td align="left" class="leftPad">&raquo; <b><?php echo strtoupper($msg_sellingoptions3); ?></b></td>
</tr>
</table>
<form method="post" action="index.php?cmd=selling_options" onsubmit="return delete_confirm('<?php echo $msg_javascript35; ?>')">
<input type="hidden" name="process" value="1">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
    <td align="left">
    <table border="0" cellpadding="0" cellspacing="1" width="100%" style="border: 2px solid #083253">
    <tr>
        <td align="left" class="msgBox">
        <table width="100%" border="0" cellpadding="0" cellspacing="2">
        <tr>
            <td align="left" class="tdHeight"><b><?php echo $msg_addimg9; ?></b>:</td>
            <td align="left" class="tdHeight">
            <select name="cat">
            <?php
            
            $q_cats = mysql_query("SELECT * FROM ".$database['prefix']."categories 
                                   WHERE parent = '1'
                                   ORDER BY catname
                                   ") or die(mysql_error());
  
            while ($CATS = mysql_fetch_object($q_cats)) {
              echo '<option value="'.$CATS->id.'" style="padding-left:3px">'.cleanData($CATS->catname).'</option>'."\n";
  
              // Does this category have children...
              $q_children = mysql_query("SELECT * FROM ".$database['prefix']."categories
                                         WHERE child = '{$CATS->id}'
                                         ORDER BY catname
                                         ") or die(mysql_error());
  
              if (mysql_num_rows($q_children)>0) {
                while ($CHILDREN = mysql_fetch_object($q_children)) {
                  echo '<option value="'.$CHILDREN->id.'" style="padding-left:3px">- '.cleanData($CHILDREN->catname).'</option>'."\n";
                }
              }
            }

            ?> 
            </select>
            </td>
        </tr>
        <tr>
            <td align="left" class="tdHeight"><b><?php echo $msg_addimg6; ?></b>:</td>
            <td align="left" class="tdHeight"><?php echo $msg_script5; ?> <input type="radio" name="sale" value="1"> <?php echo $msg_script6; ?> <input type="radio" name="sale" value="0" checked></td>
        </tr>
        <tr>
            <td align="left" class="tdHeight" valign="top"><b><?php echo $msg_addimg15; ?></b>:<br><br>[<a href="index.php?cmd=add_images&amp;salehelp=1" rel="gb_page_center[450, 400]" title="<?php echo $msg_addimg24; ?>"><b>?</b></a>]</td>
            <td align="left" class="tdHeight"><textarea name="details" style="width:90%" rows="5" cols="20"></textarea><br><?php echo $msg_sellingoptions4; ?></td>
        </tr>
        <tr>
            <td align="left" class="tdHeight">&nbsp;</td>
            <td align="left" class="tdHeight"><br><input type="submit" class="formbutton" value="<?php echo $msg_sellingoptions5; ?>" title="<?php echo $msg_sellingoptions5; ?>"></td>
        </tr>
        </table>
        </td>
    </tr>
    </table>
    </td>
</tr>
</table>
</form>
</div>
