821
mjoel
Re: Simple WFH Diary module?
  • 2021/5/13 16:34

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


OMG, thank you very much Goffy. that is quick. Module builder is a wonder

That is a good start and i have many request and suggestion

I really think this module can be a multipurpose module and not just a wfh report tool



822
goffy
Re: Simple WFH Diary module?
  • 2021/5/13 15:39

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


hi

are you looking for something like this:
https://github.com/ggoffy/wgwfhdiary



823
mjoel
Xforms Module- show user their own data report
  • 2021/5/13 13:28

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


Hello

In reference to this topic, im currently trying to show user their own data report

with my limited php/mysql knowledge, here's what i tried so far. The code will show data for the currently logged in user

im stucked in how to display the data value for $udata_value , it is stored something like a:1:{i:0;s:8:"YWRtaW4=";} in the database


include("../../mainfile.php");
include(
XOOPS_ROOT_PATH."/header.php");

$meta_keywords "WFH Report";
$meta_description "WFH Report";
$pagetitle "WFH Report";

if(isset(
$xoTheme) && is_object($xoTheme)) {
    
$xoTheme->addMeta'meta''keywords'$meta_keywords);
    
$xoTheme->addMeta'meta''description'$meta_description);
} else { 
    
$xoopsTpl->assign('xoops_meta_keywords'$meta_keywords);
    
$xoopsTpl->assign('xoops_meta_description'$meta_description);
}

$xoopsTpl->assign('xoops_pagetitle'$pagetitle);

//this will only work if your theme is using this smarty variables
$xoopsTpl->assign'xoops_showlblock'0); //set to 0 to hide left blocks
$xoopsTpl->assign'xoops_showrblock'0); //set to 0 to hide right blocks
$xoopsTpl->assign'xoops_showcblock'1); //set to 0 to hide center blocks
//$xoopsUser->isAdmin() or redirect_header('index.php', 3, _NOPERM);

global $xoopsUser
//get current user id  
$loggedinuid is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0;  

?>




    

Work From Home Report



     $getcaption=$GLOBALS['xoopsDB']->query("SELECT 
  form.*, element.*
FROM "
.$GLOBALS['xoopsDB']->prefix("xforms_form")." AS form 
INNER JOIN "
.$GLOBALS['xoopsDB']->prefix("xforms_element")." as element 
ON form.form_id=element.form_id WHERE element.form_id=1 ORDER BY ele_order ASC "
);
            
            if (!
$getcaption) { 
    
trigger_error($GLOBALS['xoopsDB']->error()); 
}
?>

    
        
        
          User
          Date
          Ip Address
        while($row $GLOBALS['xoopsDB']->fetchArray($getcaption))
{
        
$ele_id=$row['ele_id'];
        
$ele_caption=$row['ele_caption'];
        echo 
"$ele_caption ($ele_id)";
        }
echo 
"";
        echo 
"
        "
;
$getdata=$GLOBALS['xoopsDB']->query("SELECT D.uid, D.form_id, D.ele_id, D.udata_time, D.udata_ip, D.udata_value
                                , U.name, U.uname
                                , E.ele_type, E.ele_caption
                                FROM "
.$GLOBALS['xoopsDB']->prefix("xforms_userdata")." D
                                LEFT JOIN "
.$GLOBALS['xoopsDB']->prefix("users")." U ON (D.uid=U.uid)
                                INNER JOIN "
.$GLOBALS['xoopsDB']->prefix("xforms_element")." E ON (D.ele_id=E.ele_id)
                                WHERE D.form_id=1 AND D.uid='
$loggedinuid'
                                ORDER BY D.uid ASC, D.udata_time ASC, D.udata_ip ASC, E.ele_order ASC"
);

            if (!
$getdata) { 
    
trigger_error($GLOBALS['xoopsDB']->error()); 
}

        while(
$row $GLOBALS['xoopsDB']->fetchArray($getdata))
{
        
$uid=$row['uid'];
        
$uname=$row['uname'];
        
$udata_time2=date("Y-m-d"strval($row["udata_time"]));
        
$udata_ip=$row['udata_ip'];
        
$udata_value=$row['udata_value'];
    
echo 
"";
          echo 
"$uname
          
$udata_time2
          
$udata_ip
  
$udata_value
    "
;
          
}
    
?>    
        
      



include(XOOPS_ROOT_PATH."/footer.php");
?>



824
alain01
Re: Printscreen bt5 templates
  • 2021/5/13 13:13

  • alain01

  • Just can't stay away

  • Posts: 530

  • Since: 2003/6/20


Block mainmenu

Resized Image


Resized Image

Resized Image



825
alain01
Printscreen bt5 templates
  • 2021/5/13 10:07

  • alain01

  • Just can't stay away

  • Posts: 530

  • Since: 2003/6/20


Work process in progress on bt5 templates, system templates for the moment...

Block login : Resized Image



826
mjoel
Re: Simple WFH Diary module?
  • 2021/5/13 4:34

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


thankyou zyspec
i just tested the xforms module and i think it does the job, im able to input date and text and upload image and documents ..and i as admin can see the data inserted by user

i can see the data value of the form are kept as text in mysql

now im trying to figure out
how to direct user to their own data after page submit
how to create a page that would allow a user to see their own reports.
how to allow user to edit their report and save to database

i think i will create a separate topic later



827
goffy
Re: Simple WFH Diary module?
  • 2021/5/12 17:46

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


hi

i fixed the bug with the index.php



828
mjoel
Re: Simple WFH Diary module?
  • 2021/5/12 16:40

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


Quote:

zyspec wrote:
@mjoel,

You could try the Xforms module. It will allow you to create the report you want. The module would need to be modified to create a page that would allow a user to see their own reports. I would think that would be easier than creating a completely new module.



Thank you very much..I will look into xforms



829
zyspec
Re: Simple WFH Diary module?
  • 2021/5/12 16:19

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


@mjoel,

You could try the Xforms module. It will allow you to create the report you want. The module would need to be modified to create a page that would allow a user to see their own reports. I would think that would be easier than creating a completely new module.



830
mjoel
Re: Simple WFH Diary module?
  • 2021/5/12 15:10

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


I found an example of a work from home report..this is very similar what i want but i would like to achieve it with xoops if thats possible
https://www.jotform.com/form-templates/employee-end-of-day-report




TopTop
« 1 ... 80 81 82 (83) 84 85 86 ... 29425 »



Login

Who's Online

389 user(s) are online (319 user(s) are browsing Support Forums)


Members: 0


Guests: 389


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits