Can you change Layout of php and filter?

HI All,
I have some code:
function tc($v) {
if (!$v) {
return 'NULL';
} else {
return '\''.mysql_real_escape_string($v).'\'';
$field = array(
array("surname", "Surname"),
array("forename", "Forename(s)"),
array("address", "Address"),
array("post_code", "Post Code"),
array("telephone1", "Telephone Number"),
array("telephone2",  "Alternative Number 1"),
array("telephone3", "Alternative Number 2"),
array("dob", "Date of Birth"),
array("gender", "Gender"),
array("religion", "Religion"),
array("special", "Disabilities / Special Needs"),
array("mother_name", "Mother Name"),
array("mother_occ", "Mother Occupation"),
array("mother_crb", "Mother CRB?"),
array("father_name", "Father Name"),
array("father_occ", "Father Occupation"),
array("father_crb", "Father CRB?"),
array("email", "Email Address"),
array("subs", "Subs"),
array("GA", "Gift Aid Signed?"),
array("dpa", "DPA Signed?"),
array("editby", "Record last edited by"),
array("edittime", "Record last edited at"),
array('datejoined', 'Date Joined'),
array('year1', 'Year One Badge'),
array('year2', 'Year Two Badge'),
array('year3', 'Year Three Badge'),
array('year4', 'Year Four Badge'),
array('year5', 'Year Five Badge'),
array('year6', 'Year Six Badge'),
array('year7', 'Year Seven Badge'),
array('year8', 'Year Eight Badge'),
array('year9', 'Year Nine Badge'),
array('EA1', 'Emergency Aid Stage 1'),
array('EA2', 'Emergency Aid Stage 2'),
array('EA3', 'Emergency Aid Stage 3'),
array('EA4', 'Emergency Aid Stage 4'),
array('EA5', 'Emergency Aid Stage 5'),
array('HA1', 'Hikes Away Stage 1'),
array('HA2', 'Hikes Away Stage 2'),
array('HA3', 'Hikes Away Stage 3'),
array('HA4', 'Hikes Away Stage 4'),
array('HA5', 'Hikes Away Stage 5'),
array('HA6', 'Hikes Away Stage 6'),
array('IT1', 'IT Stage 1'),
array('IT2', 'IT Stage 2'),
array('IT3', 'IT Stage 3'),
array('IT4', 'IT Stage 4'),
array('IT5', 'IT Stage 5'),
array('music1', 'Musician Stage 1'),
array('music2', 'Musician Stage 2'),
array('music3', 'Musician Stage 3'),
array('music4', 'Musician Stage 4'),
array('music5', 'Musician Stage 5'),
array('NAtotal', 'Total Nights Away'),
array('NA1', 'Nights Away Stage 1'),
array('NA2', 'Nights Away Stage 2'),
array('NA3', 'Nights Away Stage 3'),
array('NA4', 'Nights Away Stage 4'),
array('NA5', 'Nights Away Stage 5'),
array('NA6', 'Nights Away Stage 6'),
array('NA7', 'Nights Away Stage 7'),
array('NA8', 'Nights Away Stage 8'),
array('NA9', 'Nights Away Stage 9'),
array('NA10', 'Nights Away Stage 10'),
array('NA11', 'Nights Away Stage 11'),
array('NA12', 'Nights Away Stage 12'),
array('swim1', 'Swimming Stage 1'),
array('swim2', 'Swimming Stage 2'),
array('swim3', 'Swimming Stage 3'),
array('swim4', 'Swimming Stage 4'),
array('swim5', 'Swimming Stage 5'),
array('OCDATE', 'SCOUTS: Outdoor Challenge'),
array('OPCDATE', 'SCOUTS: Outdoor Plus Challenge'),
array('ACDATE', 'SCOUTS: Adventure Challenge'),
array('CCDATE', 'SCOUTS: Creative Challenge')
if ($user = User()) {
if ($_POST['section'])  {
if (UserRead($_POST['section']) || UserAdmin()) {
echo '<h1>1st Chalfont St Giles Scout Group - ';
$lsec_query = mysql_query('SELECT * FROM csg_section WHERE section='.tc($_POST['section'])) or die("<b>MySql Error:</b>".mysql_error());
if ($lsec = mysql_fetch_array($lsec_query)) {
echo $lsec['name']."\n</h1>";
} else {
echo 'Section Not Found</h1>';
die();
echo '<table border="2"><tr>'."\n";
foreach ($field as $item) {
if ($_POST[$item[0]]==1) {
$fielddo[] = $item;
echo '<td>'.$item[1].'</td>'."\n";
echo '</tr>';
switch($_POST['sort']) {
case 'a':
$sort = 'surname ASC, forename ASC';
break;
default:
$sort = 'dob ASC';
$ypl_query = mysql_query("SELECT * FROM csg_yp WHERE section=".tc($_POST['section'])." ORDER BY $sort") or die('<b>MySql Error:</b>'.mysql_error());
while ($ypl = mysql_fetch_array($ypl_query)) {
echo '<tr>'."\n";
foreach ($fielddo as $item)
echo '<td>'.$ypl[$item[0]].'</td>'."\n";
echo '</tr>'."\n";
echo '</table>'."\n";
} else {
?>
<p><b>Access Denied.</b> You are not authorised to view this section.
<?
} else {
?>
All this does is produce a list of all the fields in the database in a long list so we can choose which fields to print.
As this list is now growing as we have added a lot more fields to the database ... is there anyway we could split it into say 3 columns?
Ideally the first column would be all the personal details - i.e. down to DPA Signed - Second column would be the other badges and the third column different depending on the section.
On the data input page we have different badges depending on section. Using the following code:
if ($action=='add' || ($action=='edit' && (UserRead($yp['section']) || UserAdmin()))) {
$yp_section_query = mysql_query("SELECT name FROM csg_section WHERE section=".tc($yp['section'])) or die("<b>MySql Error:</b>".mysql_error());
$yp_name = mysql_fetch_assoc($yp_section_query);
$yp_name = $yp_name['name'];
$yp_section = (strstr($yp_name,"Scout")) ? 1 : (strstr($yp_name,"Cub") ? 2 : 3) //If has word 'scout' -> 1. Else If has word 'cub' -> 2 Else 3 (beaver)
?>
<form action="yp2.php" method="post">
<input type="hidden" name="yp" value="<?php echo $yp['yp_id']; ?>">
<input type="hidden" name="section" value="<?php echo $yp['section']; ?>">
could we use this on the print page to show different badge list depending on section in the third column??
Many Thanks,
Steve

I am not sure how it looks familiar ... are you in Scouting too?
So can i just create columns and put the different bits in each column?
How can I sort by database - sorry I am a bit of a novice when it comes to php and coding, etc.
Also was it able to filter depending on section?
Many Thanks,
Steve

Similar Messages

  • How can you change your security questions and answers if it doesn't show the link forgot answer?

    how do you change your security questions/answers if it does not show the link forgot answers

    Hi, Morganr2954.  
    Thank you for visiting Apple Support Communities.  
    I understand that you want to reset your security questions.  Here is an article I would go though for this.  
    If you forgot the answers to your Apple ID security questions
    http://support.apple.com/en-us/HT201485
    Cheers, 
    Jason H.  

  • Can you change the checkbox value and the caption fontColor in the same checkbox field?

    There was a discussion last March where the discussion creator wanted to change the caption text on a checkbox.  And the response used a separate check box to change the fontColor in a different text field.
    Is it impossible to manipulate the color of the check mark and the caption in the same field?
    It would make something I'm doing a lot easier if it was possible.
    Thanks,
    Christina

    Not sure how you created the field.  In the object library under the custom group there is a Current Date field object.  It's basically a text field that has some script behind it.  Drop it on your form and instead of setting the runtime property, leave the "Calculation Script" radio button selected.  It should display the date as M/D/YY, in the format of the selected locale.  If you need to use a different format then you need to change the script that's automatically generated behind the scenes (it'll be in the ready:layout event for the field).  BTW, selecting Runtime Property also generates a script, it's just different and formats the date as you see it.  Either way you need to modify the script to change it.
    If you need help with the scripting, post the format that you want the date in.

  • Just uploaded iso7 , . . .hate it!  Can you change background colours?  How do you add a new item/activity to the schedule? In notes the font has changed, can I change it back and the link colour is now yellow instead of blue, can I change it?  Thanks

    Just uploaded iso7 , . . .hate it!  Can you change background colours?  How do you add a new item/activity to the schedule? In notes the font has changed, can I change it back and the link colour is now yellow instead of blue, can I change it?  Yellow on white is harder to read. Thanks

    Another question. How do you bookmark something.  It was so easy before, why did they change it?  Can I uninstall it?

  • How Can You Change the Look and Feel of Charts in OBIEE 11g

    How Can You Change the Look and Feel of Charts in OBIEE 11g?
    Edited by: user11973122 on Jul 18, 2012 12:13 AM

    Check these files
    OFM_HOME\Oracle_BI1\bifoundation\web\msgdb\s_blafp\viewui\chart\dvt-graph-skin.xml
    OFM_HOME\Oracle_BI1\bifoundation\web\msgdb\views\dvtchart\obips.dvtchart.xml
    OFM_HOME\Oracle_BI1\bifoundation\web\display\chartfontmapping.xml
    Pls mark correct or helpful if helps

  • How can you change your security questions!! i got a new iphone 5 and i forgot them!!

    How can you change your security questions?! I got the iphone 5 and i forgot them and it wont let me buy songs!!!!

    Click here and request assistance.
    (72909)

  • How can you change the font size in the application and system headers?

    How can you change the font size in the application and system headers?  I searched the system and finder prefs to no avail.  Changing the screen density is not a good option.
    Thanks

    I downloaded Tinkertool.  Found the font section and increased the size of most selections.  The only thing that changed that I can see is the window label.  The apple line, bookmarks line, the tool bar in safari are all the same---font size of about 4.  Found the finder "show view options" but that didn't seem to change anything either.  I'll keep working.  Restarted all apps after changes as well.

  • When using the Save Layer Comps to PDF Script, can you change the PDF settings. I need both Smallest File Size and Press Quality?

    When using the Save Layer Comps to PDF Script, can you change the PDF settings. I need both Smallest File Size and Press Quality? Thanks in advance to the group for assisting with this matter.
    — John

    No, there isn't. The way you're using the file is not recommended. You
    should use a review tracker to avoid getting in the way of one another.

  • Can you change and set your own defult midi sync project settings

    Hi All,
    Can you change the default Midi Sync Project Setting so they have your own settings everytime you start up logic Pro X?
    Preferences > Midi > Sync >MIDI sync project settings
    General Default:
    Frame Rate 25 fps
    Check auto detect format of MTC
    Default required:
    Set frame rate to 29.97fps
    check 'auto detect format of MTC'
    check Enable Separate SMPTE View Offset
    MDI Default is:
    MTC and MMC  all unchecked
    Default required:
    Check 'Transmit MTC'
    Check 'Transmit MMC'
    Check 'Listen to MMC Input'
    Any assistance would be appreciated.
    Regards,
               Gavin.

    No, that's not what I typed above.
    The rule is... Preferences are Global, changes made in Preferences affect all Projects.
    "Settings" are on a per song basis.
    In Logic 9 (and I imagine in X as well) there are two main areas to configure Logic.
    1. Is Preferences    Preferences settings are global and affect all projects.
    2. Is Settings          Settings are set for each project, they are not global
    You typed:  Preferences > Midi > Sync >MIDI sync project settings
    See what is says, MIDI Sync Project Settings.
    Preferences has forwarded you into the Settings area so no, the MIDI Sync options are not global, they have to be adjusted for each song, that's why I suggested setting up templates of your most used project setups.

  • You know how when your ipod touch 4th gen is turned on and on the top left corner it says ipod can you change that

    You know how when your ipod touch 4th gen is turned on and on the top left corner it says ipod can you change that'

    No.

  • Can you update an iOs app and change its platform offering from iPad/iPhone to just iPad?

    When building a new app with Adobe DPS to update an existing app, can you update an iOs app and change its platform offering from iPad/iPhone to just iPad?

    Vinod is correct in that you can build a new app that's iPad-only, but if you try to submit it as an update to the existing app, Neil is correct--Apple will reject it because it's considered a downgrade. You either need to stick to the universal app and do something like create a single iPhone folio that refers users to the iPad, or you need to submit it as a new app.

  • When you first get your phone and set it up, can you change it a few days later?

    Some of the first questions it asks you can you change them a few days later.

    Change in what way?
    If still within the 14 day return window, it can be returned or exchanges for a different model, color, or capacity.

  • Can you change the search engine in iPad Safari?

    iPad Safari is set to use Google in the upper right search field.
    Can you change to another search engine other than Google like you can in regular Safari on or Macs?

    Yes, and those might be available through some of the alternative browsers available in the App Store. In addition, iOS provides a range of ways you can filter web content there in Settings. I've not played with it but it looks as though you could exert some control that way.

  • How can you change your security question for I tunes?

    How can you change your security question for I tunes?

    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then the steps half-way down this page give you a reset link on your account : http://support.apple.com/kb/HT5312
    If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then you will need to contact iTunes Support / Apple to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down the HT5312 link above to add a rescue email address for potential future use

  • How many times can you change your iPod if you have insurance

    How many times can you change your iPod if you have insurance

    If you are talking aboutn the Apple warranty, if the iPod is defectve and not abused there is not limit.
    If you have AppleCare+ which covers accidental damage
    two incidents of accidental damage coverage, each subject to a $29 service fee plus applicable tax.1

Maybe you are looking for