merbers.php - Ausgabe Handynummer

Alles, was nicht in die anderen Foren passt, kannst du hier loswerden.
Antworten
eslavator
Beiträge: 5
Registriert: 8. Okt 2008, 08:28

merbers.php - Ausgabe Handynummer

Beitrag von eslavator »

Hallo zusammen

mein Wunsch:

ich möchte in der merbers.php Liste noch ausgeben, wenn eine Handynr in einem Profifeld hinterlegt ist. Bin zwar am tüfteln, komme aber mit dem internen Tabellenaufbau nicht weiter.

wie veränder ich das sql Statement so ab, das aus der ffb_user_data bei dem akt. Benutzer das Feld usd_usf_id Datensatz 43 (Handynr_Vorwahl) und Datensatz 44 (Handymr_Nummer) zusammen als Handynr ausgelesen werden können.

Code: Alles auswählen

$sql    = "SELECT DISTINCT usr_id, last_name.usd_value as last_name, 
                        first_name.usd_value as first_name, 
                        email.usd_value as email, homepage.usd_value as homepage, 
                        usr_login_name, usr_last_change, 1 member
             FROM ". TBL_MEMBERS. ", ". TBL_ROLES. ", ". TBL_CATEGORIES. ", ". TBL_USERS. "
            RIGHT JOIN ". TBL_USER_DATA. " as last_name
               ON last_name.usd_usr_id = usr_id
              AND last_name.usd_usf_id = ". $g_current_user->getProperty("Nachname", "usf_id"). "
             LEFT JOIN ". TBL_USER_DATA. " as first_name
               ON first_name.usd_usr_id = usr_id
              AND first_name.usd_usf_id = ". $g_current_user->getProperty("Vorname", "usf_id"). "
             LEFT JOIN ". TBL_USER_DATA. " as email
               ON email.usd_usr_id = usr_id
              AND email.usd_usf_id = ". $g_current_user->getProperty("E-Mail", "usf_id"). "
             LEFT JOIN ". TBL_USER_DATA. " as homepage
               ON homepage.usd_usr_id = usr_id
              AND homepage.usd_usf_id = ". $g_current_user->getProperty("Homepage", "usf_id"). "
            WHERE usr_valid = 1
              AND mem_usr_id = usr_id
              AND mem_rol_id = rol_id
              AND mem_valid  = 1
              AND rol_valid  = 1
              AND rol_cat_id = cat_id
              AND cat_org_id = ". $g_current_organization->getValue("org_id"). "
                  $search_condition
            ORDER BY last_name.usd_value "
Den Rest werde ich dan wahrscheinlich selber schaffen.

Besten Dank!

PS: Super Script!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

MfG

Sebastian Pech
matzman2000
Former team member
Beiträge: 1087
Registriert: 2. Sep 2007, 17:12
Wohnort: Itzstedt
Kontaktdaten:

Re: merbers.php - Ausgabe Handynummer

Beitrag von matzman2000 »

Hallo Sebastian,

ich habe die Abfrage nicht getestet, müsste aber unterm Strich so hinkommen:

Code: Alles auswählen

$sql    = "SELECT DISTINCT usr_id, last_name.usd_value as last_name, 
                        first_name.usd_value as first_name, handyvor.usd_value as handyvor,  
                        handynr.usd_value as handynr,  
                        email.usd_value as email, homepage.usd_value as homepage, 
                        usr_login_name, usr_last_change, 1 member
             FROM ". TBL_MEMBERS. ", ". TBL_ROLES. ", ". TBL_CATEGORIES. ", ". TBL_USERS. "
            RIGHT JOIN ". TBL_USER_DATA. " as last_name
               ON last_name.usd_usr_id = usr_id
              AND last_name.usd_usf_id = ". $g_current_user->getProperty("Nachname", "usf_id"). "
             LEFT JOIN ". TBL_USER_DATA. " as first_name
               ON first_name.usd_usr_id = usr_id
              AND first_name.usd_usf_id = ". $g_current_user->getProperty("Vorname", "usf_id"). "
             LEFT JOIN ". TBL_USER_DATA. " as handyvor
               ON handyvor.usd_usr_id = usr_id
              AND handyvor.usd_usf_id = ". $g_current_user->getProperty("Handynr_Vorwahl", "usf_id").
             LEFT JOIN ". TBL_USER_DATA. " as handynr
               ON handynr.usd_usr_id = usr_id
              AND handynr.usd_usf_id = ". $g_current_user->getProperty("Handymr_Nummer", "usf_id").
             LEFT JOIN ". TBL_USER_DATA. " as email
               ON email.usd_usr_id = usr_id
              AND email.usd_usf_id = ". $g_current_user->getProperty("E-Mail", "usf_id"). "
             LEFT JOIN ". TBL_USER_DATA. " as homepage
               ON homepage.usd_usr_id = usr_id
              AND homepage.usd_usf_id = ". $g_current_user->getProperty("Homepage", "usf_id"). "
            WHERE usr_valid = 1
              AND mem_usr_id = usr_id
              AND mem_rol_id = rol_id
              AND mem_valid  = 1
              AND rol_valid  = 1
              AND rol_cat_id = cat_id
              AND cat_org_id = ". $g_current_organization->getValue("org_id"). "
                  $search_condition
            ORDER BY last_name.usd_value "
Du musst natürlich die Ausgabe noch anpassen, aber das hattest Du ja schon geschrieben. :wink:

Gruss,
Matze
Antworten