Please help
Hi Aditya,
Please update the code in /admin/user/user_bulk_download.php
change following array
$fields = array('id' => 'id',
'username' => 'username',
'email' => 'email',
'firstname' => 'firstname',
'lastname' => 'lastname',
'idnumber' => 'idnumber',
'institution' => 'institution',
'department' => 'department',
'phone1' => 'phone1',
'phone2' => 'phone2',
'city' => 'city',
'url' => 'url',
'icq' => 'icq',
'skype' => 'skype',
'aim' => 'aim',
'yahoo' => 'yahoo',
'msn' => 'msn',
'country' => 'country');
to
$fields = array('id' => 'id',
'username' => 'username',
'email' => 'email',
'firstname' => 'firstname',
'lastname' => 'lastname',
'idnumber' => 'idnumber',
'institution' => 'institution',
'department' => 'department',
'phone1' => 'phone1',
'phone2' => 'phone2',
'city' => 'city',
'url' => 'url',
'icq' => 'icq',
'skype' => 'skype',
'aim' => 'aim',
'yahoo' => 'yahoo',
'msn' => 'msn',
'country' => 'country',
'firstaccess'=> 'firstaccess',
'lastaccess' => 'lastaccess');
// added first access and last access
and if you want to change format of date time
please follow the below steps:
change
foreach ($fields as $fieldname) {
$worksheet[0]->write(0, $col, $fieldname);
$col++;
}
to
foreach ($fields as $field=>$unused) {
if(($field == 'firstaccess') || ($field == 'lastaccess')){
$accesstime = date('d-m-Y H:i:s',$user->$field);
$worksheet[0]->write($row, $col, $accesstime);
}else{
$worksheet[0]->write($row, $col, $user->$field);
}
$col++;
}
is this clear for you
Thanks Triveni
I got 2 instances of
foreach ($fields as $fieldname) {
$worksheet[0]->write(0, $col, $fieldname);
$col++;
}
Its on line 96 and on line 150.
Which one I need to change as I changed line 96 then it gives me attached result. User_Bulk_Download file is also attached.
There is problem in date format in excel sheet. It wont give me date even I try custom format "d-m-Y H:i:s".
Aditya
Hello Aditya..!
Please find the attached file, as i modified your code.
and its working well for me
Thanks
It works for me
I found you made some changes below.
Can you please explain why you made those changes and how it works
Aditya
Hello Aditya,
i modified code in user_download_xls function, since we are using this function for downloading users in excel format.
your changes would be work for ods file format
Ohh
Thanks a ton
Now I can identify user access in excel too.
It helps me a lot.
Hi Triveni,
I need your favor
Please tell me from where we can get field name which we can add in Bulk user download file???
Like I wish to add enrolled course of user in that file then what I need to add???
Thanks in advance,
Aditya