Welcome Guest, Not a member yet? Register   Sign In
How to add users from column 1 to column 2 using codeigniter?
#1

[eluser]Unknown[/eluser]
How to add users from column 1 to column 2 using codeigniter?
Column 1 has all the usernames and column 2 is the blank lines

Column1 (ALL USERS)#Column 2(MOderators) #

::Mark::::::::::::::::::::::_______:::
::JOhn::::::::::::::::::::::_______:::
::Xyz:::::::::::::::::::::::_______:::
::ABC::::::Add::::::::::::::_______:::
::you::::::Remove:::::::::::_______:::
::Me:::::::Undo:::::::::::::_______:::
::HIm:::::::::::::::::::::::_______:::
::WE::::::::::::::::::::::::_______:::
::123:::::::::::::::::::::::_______:::
::321:::::::::::::::::::::::_______:::

Save Option

There are two columns ,Column 1 has all the users on it and column 2 is for the moderators.If an admin selects one of the user then clicks on add then user must be in the column 2

I am adding a real time example (Screenshot) attachment

http://www.flickr.com/photos/[email protected]


Any tutorial on it please? Thank you
#2

[eluser]TheFuzzy0ne[/eluser]
I suggest you look at your database design again. What you're wanting to do can be done by simply setting a flag against the relevant row.
#3

[eluser]Unknown[/eluser]
what you say is correct ...But I want to do it in the front end

I have come till this far


<html>
[removed]
function SelectMoveRows(SS1,SS2)
{
var SelID='';
var SelText='';
// Move rows from SS1 to SS2 from bottom to top
for (i=SS1.options.length - 1; i>=0; i--)
{
if (SS1.options[i].selected == true)
{
SelID=SS1.options[i].value;
SelText=SS1.options[i].text;
var newRow = new Option(SelText,SelID);
SS2.options[SS2.length]=newRow;
SS1.options[i]=null;
}
}
SelectSort(SS2);
}
function SelectSort(SelList)
{
var ID='';
var Text='';
for (x=0; x < SelList.length - 1; x++)
{
for (y=x + 1; y < SelList.length; y++)
{
if (SelList[x].text > SelList[y].text)
{
// Swap rows
ID=SelList[x].value;
Text=SelList[x].text;
SelList[x].value=SelList[y].value;
SelList[x].text=SelList[y].text;
SelList[y].value=ID;
SelList[y].text=Text;
}
}
}
}
[removed]
&lt;form name="Example"&gt;
<table border="0" cellpadding="3" cellspacing="0">
<tr>
<td>
<select name="Features" size="9" MULTIPLE>
<option value="2">Row 2</option>
<option value="4">Row 4</option>
<option value="5">Row 5</option>
<option value="6">Row 6</option>
<option value="7">Row 7</option>
<option value="8">Row 8</option>
<option value="9">Row 9</option>
</select>
</td>
<td align="center" valign="middle">
&lt;input type="Button" value="Add &gt;&gt;" &gt;&lt;br>
<br>
&lt;input type="Button" value="&lt;&lt; Remove" &gt;
</td>
<td>
<select name="FeatureCodes" size="9" MULTIPLE>
<option value="1">Row 1</option>
<option value="3">Row 3</option>
</select>
</td>
</tr>
</table>
&lt;/form&gt;

&lt;/html&gt;




Theme © iAndrew 2016 - Forum software by © MyBB