$row->name";} ?> Currency value: How much you want to add?: Confirm? I really need help"> Dropdown users names by filter and modify DB values - Forums

Forums

Dropdown users names by filter and modify DB values

paulocentr 07 Oct, 2010
Good evening,
I really dont know what to do, i'm a beginner on crono forms

i need a form to modify a user database field, based on previous currency numerical data.
like this
user1 have: $100 and i want to add $50, so he will have $150
this user must be only selected by the manager that have registred him, so i will make a filter on the dropdown using the manager id to show the data (the id will be stored previously on user registration)
the closest ive got is the code below
<h2>Add value.</h2>
<form name="form1" method="post" action="">
  Select the user   
    <select class="cf_inputbox validate-selection" id="cf_user_id" size="1" title=""  name="cf_user_id">
    <option value="">Select</option>
    <?php
    $db =& JFactory::getDBO();
    $query = "
      SELECT *
        FROM #__users ";
    $db->setQuery($query);
    $rows = $db->loadObjectList();

foreach ($rows as $row) {
      echo "<option value='$row->id'>$row->name</option>";
}
    ?>
  </select>
  <br>
  Currency value:
  <br>
  How much you want to add?: 
  <input name="valor" type="text" id="valor" size="10" maxlength="10">
  <br>
  Confirm?
  <input name="confirma" type="checkbox" value="" checked id="confirma">
  <br>
  <input name="confirma" type="submit" value="Submit" id="confirma">
</form>
</p>

I really need help
GreyHead 08 Oct, 2010
Hi paulocentr,

Where is all the data stored? You presumably have some way of linking the manager to the related staff and of saving the amounts? Which tables are these in and what are the relavant column names?

Bob

PS You should not include <form> tags in your Form HTML for ChronoForms, it will break your form.
This topic is locked and no more replies can be posted.