GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 06-Aug-2003, 08:12
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point

getting values


hi,
i created dirmodify.phtml and how i can get the values in text field called New directory
for eg, when i select radio button let say download and this link having HTML inside it
so when i select this link then
New directory download
HTML Information its checked as this downlaod have html file

if you dont mind shall i post the code

please visit this link

server2.vitodesign.com

thanks
  #2  
Old 07-Aug-2003, 02:12
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point

Re: getting values


hi,
the code for above posted topic actually i dont understand one thign how i get value in text field when any of radio button is selected but only child directories
thanks in advance
PHP Code:

<? $dir = './'; require($dir.'lib.php'); get_session(); ?>
<? // if (!$session->login || !$session->admin) send_location_die('login.phtml?error=true'); ?>
<? expire_header(); ?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
    <head>
         <title>Directory Administration</title>
         <link rel="stylesheet" type="text/css" href="../styles/styles.css" />
         <? expire(); ?>
    </head>

    <body>
         <?
              $trees = 2;
              $tree = array();
                        $users = array();
              query_db("SELECT sys_pk, name FROM t_user ORDER BY name");
              while($r = foreach_db()) {
                   $users[$r->sys_pk] = $r;
              }
              query_db("SELECT sys_pk, fk_t_directories_parent AS parent, name FROM t_directories ORDER BY sort, name");
              while($r = foreach_db())
                   $tree[$r->sys_pk] = $r;
              $top = array();
              foreach(array_keys($tree) as $key) {
                   $v =& $tree[$key];
                   if (isset($tree[$v->parent])) {
                        $tree[$v->parent]->child[] =& $v;
                   } else {
                        $top[] =& $v;
                   }
                   unset($v);
              }
              unset($tree);
              function recurse(&$tree, &$maxdepth, &$opens, &$opens_new, &$subtree, $depth) {
                   if (++$depth > $maxdepth) $maxdepth = $depth;
                   foreach($subtree as $r) {
                        $s = new stdClass();
                        $s->sys_pk = $r->sys_pk;
                        $s->depth = $depth;
                        $s->name = $r->name;
                        $children = is_array($r->child) ? count($r->child) : 0;
                        if ($children) {
                             if ($opens[$s->sys_pk]) {
                                  $s->mode = 2;
                                  $opens_new[$s->sys_pk] = true;
                             } else {
                                  $s->mode = 1;
                             }
                        } else {
                             $s->mode = 0;
                        }
                        $tree[$r->sys_pk] = $s;
                        if ($s->mode == 2)
                             recurse($tree, $maxdepth, $opens, $opens_new, $r->child, $depth);
                   }
              }
              function make_tree(&$opens) {
                   global $top;
                   $tree = array();
                   $maxdepth = 0;
                   $opens_new = array();
                   recurse($tree, $maxdepth, $opens, $opens_new, $top, 0);
                   $opens = $opens_new;
                   return array($tree, $maxdepth);
              }
              if (!is_array($session->opens) || !$click) $session->opens = array();
              for($i = 0; $i < $trees; $i++)
                   if (!is_array($session->opens[$i]))
                        $session->opens[$i] = array();
              if ($click) {
                   $side += 0;
                   $id += 0;
                   if ($side < 1 || $side > $trees) $side = 1;
                   $session->opens[$side-1][$id] = ($click == 2);
              }
         ?>
         <form action="diradmin.php" method="post">
              <table border="0" cellpadding="0" cellspacing="0" width="95%">
                   <tr>
                        <td valign="top">
                             <? $side = 1; list($tree, $maxdepth) = make_tree($session->opens[$side-1]); ?>
                             <table border="0" cellpadding="0" cellspacing="0">
                                  <th style="line-height: 150%" colspan="<?=($maxdepth+1) ?>">Directory under which to create new one<br /></th>
                                  <tr>
                                            <td class="black2"><input type="radio" name="ddir" value="0" id="ddir0" /></td>
                                            <td width="99%" class="black2"<?=($r->depth < $maxdepth ? (' colspan="'.($maxdepth-$r->depth+1).'"') : '') ?>>
                                                 &nbsp;<label for="<?="ddir0" ?>">&lt;top level&gt;</label>
                                            </td>
                                  </tr>
                                  <? foreach($tree as $r) { ?>
                                       <tr>
                                            <?=str_repeat('<td></td>', $r->depth-1) ?>
                                            <td class="black2"><input type="radio" name="ddir" value="<?=$r->sys_pk ?>" id="<?="dir{$r->sys_pk}" ?>" /></td>
                                            <td width="99%" class="black2"<?=($r->depth < $maxdepth ? (' colspan="'.($maxdepth-$r->depth+1).'"') : '') ?>>
                                                 &nbsp;<label for="<?="dir{$r->sys_pk}" ?>"><? if ($r->mode) { ?><a href="<?=htmlentities("dirmodify.phtml?click=".($r->mode == 2 ? 1 : 2)."&id={$r->sys_pk}&side={$side}") ?>" style="color: inherit;"><?=htmlentities(($r->mode == 2) ? '-' : '+') ?><? } ?><?=htmlentities($r->name) ?><? if ($r->mode) { ?></a><? } ?></label>
                                            </td>
                                       </tr>
                                  <? } ?>
                             </table><br />
                             <hr noshade="noshade" width="80%" size="1" />

                             <table border="0" cellspacing="2" cellpadding="0">
                                                        <tr>
                                       <th style="line-height: 150%" colspan="4" align="center">Modify directory</th>
                                  </tr>
                                                        <tr>
                                       <td class="black2" colspan="2" align="center"><em>(Select both the Directory Rights )</em></td>
                                  </tr>
                                                        <tr>
                                       <td class="black2">New Directory:&nbsp;</td>
                                       <td class="black2"><input type="text" name="name" size="30" /></td>
                                  </tr>

                                                        <tr>
                                     <td class="black2" nowrap>HTML-Informationen:&nbsp;</td>
                                      <td class="black2"><input name="check" type="checkbox" /></td>
                                  </tr>

                                                        <tr>
                                                          <td class="black2" valign="top">Benutzer und Rechte:</td>
                                                            <td class="black2">keine Datens&auml;tze</td>
                                                    </tr>

                                                        <tr>
                                                            <td class="black2">Benutzer: </td>
                                                             <td>
                                                                            <select name="benutzer">
                                                                            <option selected="selected">** Bitte w&auml;hlen **</option>
                                                                                <? foreach($users as $r) { ?>
                                                                            <option value="<?=$r->sys_pk ?>"><?=htmlentities($r->name) ?></option>
                                                                             <? } ?>
                                                                            </select>
                                                              </td>
                                                        </tr>

                                                        <tr>
                                                                <td class="black2">Rechte: </td>
                                  </tr>
                                                            <tr>
                                      <td class="black2"><input id="add" type="radio" name="add" value="1" checked="checked" /> <label for="add">read only</label></td>
                                                         </tr>
                                     <tr>
                                       <td class="black2"><input id="remove" type="radio" name="add" value="2" /> <label for="remove">write only</label></td>
                                                        </tr>
                                     <tr>
                                       <td class="black2"><input id="add" type="radio" name="add" value="3" checked="checked" /> <label for="add">read and write</label></td>
                                                        </tr>
                                     <tr>
                                       <td class="black2"><input id="remove" type="radio" name="add" value="0" /> <label for="remove">no rights</label></td>
                                     </tr>
                                                        <tr>
                                       <td class="black2" colspan="4" align="center"><input type="submit" name="modify" value="Modify" /></td>
                                                        </tr>
                             </table><br />
                   </td>
                        <td valign="top">&nbsp;&nbsp;&nbsp;</td>
                        <td valign="top">
                             <? $side = 1; list($tree, $maxdepth) = make_tree($session->opens[$side-1]); ?>
                             <table border="0" cellpadding="0" cellspacing="0">
                                  <th style="line-height: 150%" colspan="<?=($maxdepth+1) ?>">Directory to copy rights from<br /></th>
                                  <? foreach($tree as $r) { ?>
                                       <tr>
                                            <?=str_repeat('<td></td>', $r->depth-1) ?>
                                            <td class="black2"><input type="radio" name="dir" value="<?=$r->sys_pk ?>" id="<?="dir{$r->sys_pk}" ?>" /></td>
                                            <td width="99%" class="black2"<?=($r->depth < $maxdepth ? (' colspan="'.($maxdepth-$r->depth+1).'"') : '') ?>>
                                                 &nbsp;<label for="<?="dir{$r->sys_pk}" ?>"><? if ($r->mode) { ?><a href="<?=htmlentities("dirmodify.phtml?click=".($r->mode == 2 ? 1 : 2)."&id={$r->sys_pk}&side={$side}") ?>" style="color: inherit;"><?=htmlentities(($r->mode == 2) ? '-' : '+') ?><? } ?><?=htmlentities($r->name) ?><? if ($r->mode) { ?></a><? } ?></label>
                                            </td>
                                       </tr>
                                  <? } ?>
                             </table><br />
                        </td>
                   </tr>
              </table><br />
         </form>
    </body>
</html>
  #3  
Old 07-Aug-2003, 04:33
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point

Re: Re: getting values


used soemthing liekt his to get the value of radio in text box
<td class="black2"><input type="radio" name="ddir" onClick="document.enableform.name.value='<?=htmlen tities($r->name) ?>'" value="<?=$r->sys_pk ?>" id="<?="dir{$r->sys_pk}" ?>" /></td>

its working fine now but i want checkbox to be checked when radio button is checked
for eg. download directory contains HTML file so when i slect radio button for this particular file checkbox must be slected else false for those directories which doesnt contain HTML information

hope this is clear enough to post the reply
 
 

Recent GIDBlogNARMY by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
store values skyloon MySQL / PHP Forum 6 23-Jul-2005 03:29
Including Maps and strings?? maddie CPP / C++ Forum 17 05-Jul-2004 06:25
join problem zuzupus MySQL / PHP Forum 0 14-Aug-2003 05:11
paasing values in fk_t_diectories zuzupus MySQL / PHP Forum 6 12-Aug-2003 07:12
[class] Generate Forms Without Using HTML! Elmseeker PHP Code Library 6 11-Mar-2003 12:05

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 21:24.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.