function put_info_for_person($person) { ?> <div class="Person_content"> <div class="Person_Category_Container"> <?php if (NULL != ($aliases = get_string_of_aliases($person['personid']))) { put_Separating("circular138.png", $aliases); } if ($person['birthday']) { put_Separating("birthday20.png", "" . date("d-m-Y", strtotime($person['birthday'])) . " (" . get_age($person['birthday']) . " χρονών)"); } if (NULL != $person['imageBase64']) { //put_Separating( "camera44.png" , $person['photopath'] ); ?> <div class="photo" style="background-image: url('<?php echo "data:image;base64," . $person['imageBase64']; ?> ');"></div> <?php } ?> </div> </div> <?php }
public function getContent() { global $sql; // $kio->disableRegion('left'); if (u1 || LOGGED) { // TODO: Zamiast zapytania dla własnego konta dać User::toArray() $profile = $sql->query(' SELECT u.* FROM ' . DB_PREFIX . 'users u WHERE u.id = ' . (ctype_digit(u1) ? u1 : UID))->fetch(); } if ($profile) { Kio::addTitle(t('Users')); Kio::addBreadcrumb(t('Users'), 'users'); Kio::addTitle($profile['nickname']); Kio::addBreadcrumb($profile['nickname'], 'profile/' . u1 . '/' . clean_url($profile['nickname'])); Kio::setDescription(t('%nickname's profile', array('%nickname' => $profile['nickname'])) . ($profile['title'] ? ' - ' . $profile['title'] : '')); Kio::addTabs(array(t('Edit profile') => 'edit_profile/' . u1)); if ($profile['birthdate']) { $profile['bd'] = $profile['birthdate'] ? explode('-', $profile['birthdate']) : ''; // DD Month YYYY (Remaining days to next birthday) $profile['birthdate'] = $profile['bd'][2] . ' ' . Kio::$months[$profile['bd'][1]] . ' ' . $profile['bd'][0] . ' (' . day_diff(mktime(0, 0, 0, $profile['bd'][1], $profile['bd'][2] + 1, date('y')), t('%d days remaining')) . ')'; $profile['age'] = get_age($profile['bd'][2], $profile['bd'][1], $profile['bd'][0]); if (Plugin::exists('zodiac')) { require_once ROOT . 'plugins/zodiac/zodiac.plugin.php'; $profile['zodiac'] = Zodiac::get($profile['bd'][2], $profile['bd'][1]); } } if ($profile['http_agent'] && Plugin::exists('user_agent')) { require_once ROOT . 'plugins/user_agent/user_agent.plugin.php'; $profile['os'] = User_Agent::getOS($profile['http_agent']); $profile['browser'] = User_Agent::getBrowser($profile['http_agent']); } $group = Kio::getGroup($profile['group_id']); $profile['group'] = $group['name'] ? $group['inline'] ? sprintf($group['inline'], $group['name']) : $group['name'] : ''; if ($profile['gender']) { $profile['gender'] = $profile['gender'] == 1 ? t('Male') : t('Female'); } try { // TODO: Zrobić modyfikator dla funkcji o wielu parametrach (teraz jest tylko jeden możliwy) $tpl = new PHPTAL('modules/profile/profile.tpl.html'); $tpl->profile = $profile; return $tpl->execute(); } catch (Exception $e) { return template_error($e); } } else { return not_found(t('Selected user doesn't exists.'), array(t('This person was deleted from database.'), t('Entered URL is invalid.'))); } }
function add_student($db, $argv) { if (sizeof($argv) == 3) { $login = $argv[2]; if (preg_match("/^[a-zA-Z]{2,6}_[a-zA-Z0-9]\$/", $login) == 1) { $collection = $db->createCollection("students"); $document = array("login" => $login, "name" => get_name(), "age" => intval(get_age()), "email" => get_email(), "phone" => get_number(), "rented_movies" => array()); $collection->insert($document); echo "[32mUser registered ![0m\n"; } else { echo "[31mError: Login invalide.\n[0m"; } } else { echo "[31mInvalid arg number!\nUsage: ./etna_movies.php login.[0m\n"; } }
function get_user_info_func($xmlrpc_params) { global $db, $lang, $theme, $plugins, $mybb, $session, $settings, $cache, $time, $mybbgroups, $parser, $displaygroupfields; $lang->load("member"); $input = Tapatalk_Input::filterXmlInput(array('user_name' => Tapatalk_Input::STRING, 'user_id' => Tapatalk_Input::INT), $xmlrpc_params); if ($mybb->usergroup['canviewprofiles'] == 0) { error_no_permission(); } if (isset($input['user_id']) && !empty($input['user_id'])) { $uid = $input['user_id']; } elseif (!empty($input['user_name'])) { $query = $db->simple_select("users", "uid", "username='******'user_name_esc']}'"); $uid = $db->fetch_field($query, "uid"); } else { $uid = $mybb->user['uid']; } if ($mybb->user['uid'] != $uid) { $memprofile = get_user($uid); } else { $memprofile = $mybb->user; } if (!$memprofile['uid']) { error($lang->error_nomember); } // Get member's permissions $memperms = user_permissions($memprofile['uid']); if (!$memprofile['displaygroup']) { $memprofile['displaygroup'] = $memprofile['usergroup']; } // Grab the following fields from the user's displaygroup $displaygroupfields = array("title", "usertitle", "stars", "starimage", "image", "usereputationsystem"); $displaygroup = usergroup_displaygroup($memprofile['displaygroup']); // Get the user title for this user unset($usertitle); unset($stars); if (trim($memprofile['usertitle']) != '') { // User has custom user title $usertitle = $memprofile['usertitle']; } elseif (trim($displaygroup['usertitle']) != '') { // User has group title $usertitle = $displaygroup['usertitle']; } else { // No usergroup title so get a default one $query = $db->simple_select("usertitles", "*", "", array('order_by' => 'posts', 'order_dir' => 'DESC')); while ($title = $db->fetch_array($query)) { if ($memprofile['postnum'] >= $title['posts']) { $usertitle = $title['title']; $stars = $title['stars']; $starimage = $title['starimage']; break; } } } // User is currently online and this user has permissions to view the user on the WOL $timesearch = TIME_NOW - $mybb->settings['wolcutoffmins'] * 60; $query = $db->simple_select("sessions", "location,nopermission", "uid='{$uid}' AND time>'{$timesearch}'", array('order_by' => 'time', 'order_dir' => 'DESC', 'limit' => 1)); $session = $db->fetch_array($query); if (($memprofile['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $memprofile['uid'] == $mybb->user['uid']) && !empty($session)) { // Fetch their current location $lang->load("online"); require_once MYBB_ROOT . "inc/functions_online.php"; $activity = fetch_wol_activity($session['location'], $session['nopermission']); /*unset($activity['tid']); unset($activity['fid']); unset($activity['pid']); unset($activity['eid']); unset($activity['aid']);*/ $location = strip_tags(build_friendly_wol_location($activity)); $location_time = my_date($mybb->settings['timeformat'], $memprofile['lastactive']); $online = true; } else { $online = false; } // Get custom fields start $custom_fields_list = array(); if ($memprofile['birthday']) { $membday = explode("-", $memprofile['birthday']); if ($memprofile['birthdayprivacy'] != 'none') { if ($membday[0] && $membday[1] && $membday[2]) { $lang->membdayage = $lang->sprintf($lang->membdayage, get_age($memprofile['birthday'])); if ($membday[2] >= 1970) { $w_day = date("l", mktime(0, 0, 0, $membday[1], $membday[0], $membday[2])); $membday = format_bdays($mybb->settings['dateformat'], $membday[1], $membday[0], $membday[2], $w_day); } else { $bdayformat = fix_mktime($mybb->settings['dateformat'], $membday[2]); $membday = mktime(0, 0, 0, $membday[1], $membday[0], $membday[2]); $membday = date($bdayformat, $membday); } $membdayage = $lang->membdayage; } elseif ($membday[2]) { $membday = mktime(0, 0, 0, 1, 1, $membday[2]); $membday = date("Y", $membday); $membdayage = ''; } else { $membday = mktime(0, 0, 0, $membday[1], $membday[0], 0); $membday = date("F j", $membday); $membdayage = ''; } } if ($memprofile['birthdayprivacy'] == 'age') { $membday = $lang->birthdayhidden; } else { if ($memprofile['birthdayprivacy'] == 'none') { $membday = $lang->birthdayhidden; $membdayage = ''; } } $custom_fields_list[] = new xmlrpcval(array('name' => new xmlrpcval(basic_clean($lang->date_of_birth), 'base64'), 'value' => new xmlrpcval(basic_clean("{$membday} {$membdayage}"), 'base64')), 'struct'); } // thank you/like field global $mobiquo_config; $prefix = $mobiquo_config['thlprefix']; if ($mybb->settings[$prefix . 'enabled'] == "1") { $lang->load("thankyoulike"); if ($mybb->settings[$prefix . 'thankslike'] == "like") { $lang->tyl_total_tyls_given = $lang->tyl_total_likes_given; $lang->tyl_total_tyls_rcvd = $lang->tyl_total_likes_rcvd; } else { if ($mybb->settings[$prefix . 'thankslike'] == "thanks") { $lang->tyl_total_tyls_given = $lang->tyl_total_thanks_given; $lang->tyl_total_tyls_rcvd = $lang->tyl_total_thanks_rcvd; } } $daysreg = (TIME_NOW - $memprofile['regdate']) / (24 * 3600); $tylpd = $memprofile['tyl_unumtyls'] / $daysreg; $tylpd = round($tylpd, 2); if ($tylpd > $memprofile['tyl_unumtyls']) { $tylpd = $memprofile['tyl_unumtyls']; } $tylrcvpd = $memprofile['tyl_unumrcvtyls'] / $daysreg; $tylrcvpd = round($tylrcvpd, 2); if ($tylrcvpd > $memprofile['tyl_unumrcvtyls']) { $tylrcvpd = $memprofile['tyl_unumrcvtyls']; } // Get total tyl and percentage $options = array("limit" => 1); $query = $db->simple_select($prefix . "stats", "*", "title='total'", $options); $total = $db->fetch_array($query); if ($total['value'] == 0) { $percent = "0"; $percent_rcv = "0"; } else { $percent = $memprofile['tyl_unumtyls'] * 100 / $total['value']; $percent = round($percent, 2); $percent_rcv = $memprofile['tyl_unumrcvtyls'] * 100 / $total['value']; $percent_rcv = round($percent_rcv, 2); } if ($percent > 100) { $percent = 100; } if ($percent_rcv > 100) { $percent_rcv = 100; } $memprofile['tyl_unumtyls'] = my_number_format($memprofile['tyl_unumtyls']); $memprofile['tyl_unumrcvtyls'] = my_number_format($memprofile['tyl_unumrcvtyls']); $tylpd_percent_total = $lang->sprintf($lang->tyl_tylpd_percent_total, my_number_format($tylpd), $tyl_thankslikes_given, $percent); $tylrcvpd_percent_total = $lang->sprintf($lang->tyl_tylpd_percent_total, my_number_format($tylrcvpd), $tyl_thankslikes_rcvd, $percent_rcv); addCustomField($lang->tyl_total_tyls_given, "{$memprofile['tyl_unumtyls']} ({$tylpd_percent_total})", $custom_fields_list); addCustomField($lang->tyl_total_tyls_rcvd, "{$memprofile['tyl_unumrcvtyls']} ({$tylrcvpd_percent_total})", $custom_fields_list); } if ($memprofile['timeonline'] > 0) { $timeonline = nice_time($memprofile['timeonline']); addCustomField($lang->timeonline, $timeonline, $custom_fields_list); } if ($mybb->settings['usereferrals'] == 1 && $memprofile['referrals'] > 0) { addCustomField($lang->members_referred, $memprofile['referrals'], $custom_fields_list); } if ($memperms['usereputationsystem'] == 1 && $displaygroup['usereputationsystem'] == 1 && $mybb->settings['enablereputation'] == 1 && ($mybb->settings['posrep'] || $mybb->settings['neurep'] || $mybb->settings['negrep'])) { addCustomField($lang->reputation, $memprofile['reputation'], $custom_fields_list); } if ($mybb->settings['enablewarningsystem'] != 0 && $memperms['canreceivewarnings'] != 0 && ($mybb->usergroup['canwarnusers'] != 0 || $mybb->user['uid'] == $memprofile['uid'] && $mybb->settings['canviewownwarning'] != 0)) { $warning_level = round($memprofile['warningpoints'] / $mybb->settings['maxwarningpoints'] * 100); if ($warning_level > 100) { $warning_level = 100; } addCustomField($lang->warning_level, $warning_level . '%', $custom_fields_list); } if ($memprofile['website']) { $memprofile['website'] = htmlspecialchars_uni($memprofile['website']); addCustomField($lang->homepage, $memprofile['website'], $custom_fields_list); } if ($memprofile['icq']) { addCustomField($lang->icq_number, $memprofile['icq'], $custom_fields_list); } if ($memprofile['aim']) { addCustomField($lang->aim_screenname, $memprofile['aim'], $custom_fields_list); } if ($memprofile['yahoo']) { addCustomField($lang->yahoo_id, $memprofile['yahoo'], $custom_fields_list); } if ($memprofile['msn']) { addCustomField($lang->msn, $memprofile['msn'], $custom_fields_list); } $query = $db->simple_select("userfields", "*", "ufid='{$uid}'"); $userfields = $db->fetch_array($query); if ($mybb->usergroup['cancp'] == 1 || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['canmodcp'] == 1) { $field_hidden = '1=1'; } else { $field_hidden = "hidden=0"; } $query = $db->simple_select("profilefields", "*", "{$field_hidden}", array('order_by' => 'disporder')); while ($customfield = $db->fetch_array($query)) { $thing = explode("\n", $customfield['type'], "2"); $type = trim($thing[0]); $field = "fid{$customfield['fid']}"; $useropts = explode("\n", $userfields[$field]); $customfieldval = $comma = ''; if (is_array($useropts) && ($type == "multiselect" || $type == "checkbox")) { $customfieldval = $userfields[$field]; } else { $customfieldval = $parser->parse_badwords($userfields[$field]); } $customfield['name'] = htmlspecialchars_uni($customfield['name']); if ($customfieldval) { addCustomField($customfield['name'], $customfieldval, $custom_fields_list); } } if ($memprofile['signature'] && ($memprofile['suspendsignature'] == 0 || $memprofile['suspendsigtime'] < TIME_NOW)) { $sig_parser = array("allow_html" => $mybb->settings['sightml'], "allow_mycode" => $mybb->settings['sigmycode'], "allow_smilies" => $mybb->settings['sigsmilies'], "allow_imgcode" => $mybb->settings['sigimgcode'], "me_username" => $memprofile['username'], "filter_badwords" => 1); $memprofile['signature'] = $parser->parse_message($memprofile['signature'], $sig_parser); $lang->users_signature = $lang->sprintf($lang->users_signature, $memprofile['username']); addCustomField($lang->users_signature, $memprofile['signature'], $custom_fields_list); } // Get custom fields end $query = $db->simple_select("banned", "uid", "uid='{$uid}'"); $isbanned = !!$db->fetch_field($query, "uid"); $xmlrpc_user_info = array('user_id' => new xmlrpcval($memprofile['uid'], 'string'), 'username' => new xmlrpcval(basic_clean($memprofile['username']), 'base64'), 'user_name' => new xmlrpcval(basic_clean($memprofile['username']), 'base64'), 'user_type' => check_return_user_type($memprofile['username']), 'post_count' => new xmlrpcval($memprofile['postnum'], 'int'), 'reg_time' => new xmlrpcval(mobiquo_iso8601_encode($memprofile['regdate']), 'dateTime.iso8601'), 'timestamp_reg' => new xmlrpcval($memprofile['regdate'], 'string'), 'last_activity_time' => new xmlrpcval(mobiquo_iso8601_encode($memprofile['lastactive']), 'dateTime.iso8601'), 'timestamp' => new xmlrpcval($memprofile['lastactive'], 'string'), 'is_online' => new xmlrpcval($online, 'boolean'), 'accept_pm' => new xmlrpcval($memprofile['receivepms'], 'boolean'), 'display_text' => new xmlrpcval($usertitle, 'base64'), 'icon_url' => new xmlrpcval(absolute_url($memprofile['avatar']), 'string'), 'current_activity' => new xmlrpcval($location, 'base64')); if ($mybb->usergroup['canmodcp'] == 1 && $uid != $mybb->user['uid']) { $xmlrpc_user_info['can_ban'] = new xmlrpcval(ture, 'boolean'); } if ($isbanned) { $xmlrpc_user_info['is_ban'] = new xmlrpcval(ture, 'boolean'); } $xmlrpc_user_info['custom_fields_list'] = new xmlrpcval($custom_fields_list, 'array'); return new xmlrpcresp(new xmlrpcval($xmlrpc_user_info, 'struct')); }
$memlocaltime = gmdate($mybb->settings['timeformat'], TIME_NOW + $memprofile['timezone'] * 3600); $localtime = $lang->sprintf($lang->local_time_format, $memlocaldate, $memlocaltime); if ($memprofile['lastactive']) { $memlastvisitdate = my_date($mybb->settings['dateformat'], $memprofile['lastactive']); $memlastvisitsep = $lang->comma; $memlastvisittime = my_date($mybb->settings['timeformat'], $memprofile['lastactive']); } else { $memlastvisitdate = $lang->lastvisit_never; $memlastvisitsep = ''; $memlastvisittime = ''; } if ($memprofile['birthday']) { $membday = explode("-", $memprofile['birthday']); if ($memprofile['birthdayprivacy'] != 'none') { if ($membday[0] && $membday[1] && $membday[2]) { $lang->membdayage = $lang->sprintf($lang->membdayage, get_age($memprofile['birthday'])); if ($membday[2] >= 1970) { $w_day = date("l", mktime(0, 0, 0, $membday[1], $membday[0], $membday[2])); $membday = format_bdays($mybb->settings['dateformat'], $membday[1], $membday[0], $membday[2], $w_day); } else { $bdayformat = fix_mktime($mybb->settings['dateformat'], $membday[2]); $membday = mktime(0, 0, 0, $membday[1], $membday[0], $membday[2]); $membday = date($bdayformat, $membday); } $membdayage = $lang->membdayage; } elseif ($membday[2]) { $membday = mktime(0, 0, 0, 1, 1, $membday[2]); $membday = date("Y", $membday); $membdayage = ''; } else { $membday = mktime(0, 0, 0, $membday[1], $membday[0], 0);
date_default_timezone_set("America/Los_Angeles"); $user = strip_tags(trim(mysql_prep($_POST['username']))); $email = strip_tags(trim(mysql_prep($_POST['email']))); $mcuser = strip_tags(trim(mysql_prep($_POST['mcuser']))); $validmcuser = false; /*$ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, "http://www.minecraft.net/haspaid.jsp?user="******"-" . $_POST['month'] . "-" . $_POST['day']; $datejoined = date("Y/m/d H:i:s"); $age = get_age($dob); $pass = $_POST['pass']; $confirmpass = $_POST['confirmpass']; $hashed_pass = sha1($pass); $verifcode = randstring(); if (checkdate(intval($_POST['month']), intval($_POST['day']), intval($_POST['year']))) { if ($pass == $confirmpass) { if (!empty($user) && !empty($email) && !empty($pass) && !empty($mcuser) && $user != " " && $email != " " && $pass != " " && $mcuser != " ") { if ($age >= 13) { if (checkstr($user) == false) { if (filter_var($email, FILTER_VALIDATE_EMAIL)) { if ($mcuser != "") { $query = "SELECT id, username, email, minecraft_username FROM users\n\t\t\t\t\t\t\t\t\t\tWHERE username='******' OR email='{$email}' OR minecraft_username='******'"; } else { $query = "SELECT id, username, email, minecraft_username FROM users\n\t\t\t\t\t\t\t\t\t\tWHERE username='******' OR email='{$email}'"; }
/** * 活动信息导出 */ public function activity_export() { $user_activity = M('user_activity'); import('@.ORG.Page'); $arr = ""; $true_name = trim($this->_get('true_name')); #宝宝名称 if (!empty($true_name)) { $arr['cms_user.true_name'] = array('LIKE', "%" . $true_name . "%"); $this->assign("true_name", $this->_get('true_name')); } $region_id = intval($this->_get('region_id')); #城市 if ($region_id > 0) { $region_list = $user_activity->query("SELECT id FROM `cms_region` where pid={$region_id} and status=1"); foreach ($region_list as $rlist) { $arr_c1[] = $rlist['id']; } $str_c1 = implode(',', $arr_c1); $region_list = $user_activity->query("SELECT id FROM `cms_region` where pid in({$str_c1}) and status=1"); foreach ($region_list as $rlist2) { $arr_c1[] = $rlist2['id']; } $str_c2 = implode(',', $arr_c1); $arr['cms_user.region_id'] = array('in', $str_c2); $this->assign("region_id", $this->_get('region_id')); } $admin_id = intval($this->_get('admin_id')); #所属客服 if ($admin_id > 0) { $arr['cms_user.admin_id'] = array('eq', $admin_id); $this->assign("admin_id", $this->_get('admin_id')); } $pre_status = intval($this->_get('pre_status')); #预约状态 if ($pre_status != 3) { $arr['cms_user_activity.pre_status'] = array('eq', $pre_status); $this->assign("pre_status", $this->_get('pre_status')); } else { $this->assign("pre_status", 3); } $to_status = intval($this->_get('to_status')); #到店状态 if ($to_status != 3) { $arr['cms_user_activity.to_status'] = array('eq', $to_status); $this->assign("to_status", $this->_get('to_status')); } else { $this->assign("to_status", 3); } $source_id = intval($this->_get('source_id')); #到店状态 if ($source_id != 100) { $arr['cms_user.source_id'] = array('eq', $source_id); $this->assign("source_id", $this->_get('source_id')); } else { $this->assign("source_id", 100); } //$arr['cms_user.status']=array('eq',1); $arr['cms_user_activity.type'] = array('eq', 2); $user_arr = $user_activity->field('cms_user_activity.*,cms_user.sex,cms_user.birthday,cms_user.phone,cms_user.true_name')->join('LEFT JOIN cms_user ON cms_user.user_id=cms_user_activity.user_id')->order('cms_user_activity.create_time DESC')->select(); vendor('PHPExcel_1_7_8.Classes.PHPExcel'); vendor('PHPExcel_1_7_8.Classes.PHPExcel.IOFactory'); vendor('PHPExcel_1_7_8.Classes.PHPExcel.Worksheet'); //创建Excel对象 $objPHPExcel = new PHPExcel(); //设置Excel数据缓存方式为磁盘文件缓存(适用于大数据量处理,以减少对PHP自身内存的占用) $cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_discISAM; $cacheSettings = array('dir' => C('LEG_EXCEL_DATA_CACHE_DIR')); PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); //设置Excel元数据 $objPHPExcel->getProperties()->setCreator("客服管理系统"); $objPHPExcel->getProperties()->setLastModifiedBy("客服管理系统后台程序"); $objPHPExcel->getProperties()->setTitle("客服管理系统后台导出客服活动列表"); $objPHPExcel->getProperties()->setSubject("客服活动列表"); $objPHPExcel->getProperties()->setDescription("Exported document for Office 2007 XLSX, generated using PHP classes."); $objPHPExcel->getProperties()->setKeywords("office 2007 php"); $objPHPExcel->getProperties()->setCategory("Export result file"); //填充数据到活动的电子表格中 $objPHPExcel->setActiveSheetIndex(0); $objWorksheet = $objPHPExcel->getActiveSheet(); $objWorksheet->setCellValueByColumnAndRow(0, 1, 'ID'); $objWorksheet->setCellValueByColumnAndRow(1, 1, '宝宝名称'); $objWorksheet->setCellValueByColumnAndRow(2, 1, '性别'); $objWorksheet->setCellValueByColumnAndRow(3, 1, '宝宝年龄'); $objWorksheet->setCellValueByColumnAndRow(4, 1, '课程名称'); $objWorksheet->setCellValueByColumnAndRow(5, 1, '预约时间'); $objWorksheet->setCellValueByColumnAndRow(6, 1, '电话号码'); $objWorksheet->setCellValueByColumnAndRow(7, 1, '预约状态'); $objWorksheet->setCellValueByColumnAndRow(8, 1, '到店状态'); foreach ($user_arr as $key => $rs) { $key += 2; $objWorksheet->setCellValueByColumnAndRow(0, $key, $rs['id']); $objWorksheet->setCellValueByColumnAndRow(1, $key, $rs['true_name']); $objWorksheet->setCellValueByColumnAndRow(2, $key, $rs['sex'] == 1 ? '女' : '男'); $objWorksheet->setCellValueByColumnAndRow(3, $key, get_age($rs['birthday'])); $objWorksheet->setCellValueByColumnAndRow(4, $key, $rs['course']); $objWorksheet->setCellValueByColumnAndRow(5, $key, date("Y-m-d H:i:s", $rs['create_time'])); $objWorksheet->setCellValueByColumnAndRow(6, $key, $rs['phone']); $objWorksheet->setCellValueByColumnAndRow(7, $key, $rs['pre_status'] == 1 ? '已预约' : '未预约'); $objWorksheet->setCellValueByColumnAndRow(8, $key, $rs['to_status'] == 1 ? "已到店" : '未到店'); } //导出到文件中 $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); //直接输出到浏览器 header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Disposition: attachment;filename="ActivityUserList.xlsx"'); header('Cache-Control: max-age=0'); $objWriter->save('php://output'); }
<h2>date_range_string(<var>date1</var>, <var>date2</var>)</h2> <p>Creates a date range string (e.g. January 1-10, 2010).</p> <pre class="brush: php"> date_range_string('2010-08-01', '2010-08-05'); // returns <?php echo date_range_string(time() - 24 * 60 * 60, time()); ?> </pre> <h2>pretty_date(<var>timestamp</var>, <var>use_gmt</var>)</h2> <p>Creates a string based on how long from the current time the date provided.</p> <pre class="brush: php"> pretty_date(time() - (60 * 60)); // returns <?php echo pretty_date(time() - 60 * 60); ?> </pre> <h2>get_age(<var>bday_ts</var>, <var>[at_time_ts]</var>)</h2> <p>Returns an age based on a given date/timestamp. The second parameter is optional and by default will be the current date.</p> <pre class="brush: php"> get_age('2000-01-01'); // returns <?php echo get_age('2000-01-01'); ?> </pre>
<p> Mi nombre es <? echo $result["name"];?>, vivo en <? echo $result["city"];?>, <? echo $result["country"];?>, soy deportista de <? echo $result["sport"];?> y quiero tener la posibilidad de realizar una prueba en su Institución. </p> <p> Le hago llegar mi CVD (Currículum Vitae Deportivo) para que UD. pueda analizarlo y darme la oportunidad de poder ofrecer mis habilidades. </p> <!-- Fin Presentación--> <!--Datos Personales --> <p> Mis Datos Personales son: </p> <p> Apellido/s y Nombre/s: <? echo $result["name"];?> <br /> País, Ciudad: <? echo $result["country"];?>, <? echo $result["city"];?> (bandera del pais)<br /> Edad: <?php echo get_age($result["birth"]); ?> <br /> <!--Peso: <input type="text" class="inputbox" name="txt_peso" onkeypress="ValidKey(event,'number','unsigned')" value=""/> <br /> Altura: <input type="text" class="validator {v_required:true} inputbox" name="" onkeypress="ValidKey(event,'number','unsigned')" value=""/><br />--> Deporte: <? echo $result["sport"];?><br /> <?php if (!empty($result["position"])) { ?> Posición:<?php echo utf8_encode($result["position"]); ?> <br><?php } ?> Pasaporte: <? echo $result["passport"];?><br />
$count = 0; // plot the data points foreach ($datapoints as $data) { list($date, $height, $weight, $head_circ) = explode('-', $data); if ($date == "") { continue; } // only plot if we have both weight and heights. Skip if either is 0. // Rational is only well visit will need both, sick visit only needs weight // for some clinic. if ($weight == 0 || $height == 0) { continue; } // get age of patient at this data-point // to get data from function get_age including $age, $ageinYMD extract(get_age($dob, $date)); // exclude data points that do not belong on this chart // for example, a data point for a 18 month old can be excluded // from that patient's 2-20 yr chart $daysold = getPatientAgeInDays($dob, $date); if ($daysold > 365 * 2 && $charttype == "birth") { continue; } if ($daysold < 365 * 2 && $charttype == "2-20") { continue; } // calculate the x-axis (Age) value $x = $dot_x + $delta_x * ($age - $ageOffset); // Draw Height dot $y1 = $dot_y1 - $delta_y1 * ($height - $heightOffset); imagefilledellipse($im, $x, $y1, 10, 10, $color);
<?php include "../../configure.php"; include "../../connection/connection.php"; header('Content-type: text/html; charset=utf-8'); include "../../php/functions.php"; session_start(); $result = $data->get_result("SELECT Concat(`users_representatives`.`lastname`, ' ',\r\n\t\t\t\t\t\t\t\t\t\t `users_representatives`.`firstname`) AS `name`,\r\n\t\t\t\t\t\t\t\t\t\t users_representatives.city,\r\n\t\t\t\t\t\t\t\t\t\t users_representatives.birth,\r\n\t\t\t\t\t\t\t\t\t\t users_representatives.nacionality,\r\n\t\t\t\t\t\t\t\t\t\t Concat('(',`users_representatives`.`phone_pref1`, ')',\r\n\t\t\t\t\t\t\t\t\t\t '(',`users_representatives`.`phone_pref2`, ')',\r\n\t\t\t\t\t\t\t\t\t\t `users_representatives`.`phone`) AS `phone`,\r\n\t\t\t\t\t\t\t\t\t\t Concat('(',`users_representatives`.`cel_pref1`, ')',\r\n\t\t\t\t\t\t\t\t\t\t '(',`users_representatives`.`cel_pref2`, ')',\r\n\t\t\t\t\t\t\t\t\t\t `users_representatives`.`cel`) AS `cel`,\r\n\t\t\t\t\t\t\t\t\t\t users_representatives.website,\r\n\t\t\t\t\t\t\t\t\t\t users_representatives.work,\r\n\t\t\t\t\t\t\t\t\t (SELECT name FROM list_country WHERE codcountry=country) AS country\r\n\t\t\t\t\t\t\t\tFROM users_representatives\r\n\t\t\t\t\t\t\t\tWHERE coduser="******"coduser"]); $edad = get_age($result["birth"]); ?> <div> <!-- Asunto--> <p> Asunto: <input name="txt_name" type="hidden" value="<? echo $result["name"];?>" /> <? echo $result["name"];?> te quiere contactar un Representante de lexersports.com!!! </p> <!-- Fin Asunto--> <!-- Saludo--> <p> Hola <? $rst = $data->query("SELECT `users`.`email`, Concat(`users_sports`.`lastname`, ' ', `users_sports`.`firstname`) AS `name` FROM `users` INNER JOIN `users_sports` ON `users`.`coduser` = `users_sports`.`coduser` ORDER BY name");?> <select id="cbo_to" name="cbo_to"> <option value="0">Seleccione un Deportista</option> <? while( $row=mysql_fetch_array($rst) ){?> <option value="<? echo $row["email"];?>"><? echo utf8_encode($row["name"]);?></option> <? }?>
<h1>User Profile</h1> </div> <div class="container col-md-9 pull-left"> <div class="[ col-sm-6 col-md-offset-2 col-md-4 ]"> <div class="[ info-card ]"> <img style="width: 80%" height= "500px" src="./img/placeholder.jpg" /> <div class="[ info-card-details ] animate"> <div class="[ info-card-header ]"> <h1> <?php echo $row_name['forename']; ?> <?php echo $row_name['surname']; ?> : <?php echo "" . get_age($row_name['dob']) . ""; ?> </h1> <h3> <?php echo $row_name['location']; ?> </h3> </div> <div class="[ info-card-detail ]"> <!-- Description --> <p>My Qualifications go here please</p> <br></br> <table> <tr> <td> <div name="textNo" value="1">1</div>
public function ajaxGetUserInfo() { $user = M('user'); $word = $_REQUEST['q']; $map['status'] = array('eq', 1); $map['is_del'] = array('eq', 0); $map['true_name'] = array('like', '%' . $word . '%'); $userList = $user->field('user_id,sex,birthday,phone,true_name')->where($map)->limit(0, 9)->select(); foreach ($userList as $key => $value) { $userList[$key]['birthday'] = get_age($value['birthday']); if ($value['sex']) { $userList[$key]['sex'] = "女"; } else { $userList[$key]['sex'] = "男"; } } echo json_encode($userList); }
//-------------------- for ($i = 0; $i < count($record); $i++) { ?> <tr class=tr3 id=<?php echo $record[$i]->id; ?> > <td style="text-align:left; text-indent:12px;"><a href="<?php echo "/assistant/assistant.php?id={$record[$i]->id}"; ?> " target="_blank"><?php echo strip_tags($record[$i]->title); ?> </a></td> <td><?php get_age($record[$i]->age); ?> </td> <td><a href="?category=<?php echo $record[$i]->category_id; ?> " style="color:#0000FF"><?php echo $category->find($record[$i]->category_id)->name; ?> </a></td> <td><?php echo $record[$i]->created_at; ?> </td> <td> <a href="edit.php?id=<?php
} $player_details[$player->ID][$stat] = implode(', ', $player_teams); } break; case 'season': $seasons = get_the_terms($player->ID, 'wpcm_season'); if (is_array($seasons)) { $player_seasons = array(); foreach ($seasons as $season) { $player_seasons[] = $season->name; } $player_details[$player->ID][$stat] = implode(', ', $player_seasons); } break; case 'age': $player_details[$player->ID][$stat] = 'Varsta: ' . get_age(get_post_meta($player->ID, 'wpcm_dob', true)); break; case 'dob': $player_details[$player->ID][$stat] = date_i18n(get_option('date_format'), strtotime(get_post_meta($player->ID, 'wpcm_dob', true))); break; case 'height': $player_details[$player->ID][$stat] = $height; break; case 'weight': $player_details[$player->ID][$stat] = $weight; break; case 'hometown': $player_details[$player->ID][$stat] = '<img class="flag" src="' . WPCM_URL . 'assets/images/flags/' . $natl . '.png" /> ' . $hometown; break; case 'joined': $player_details[$player->ID][$stat] = date_i18n(get_option('date_format'), strtotime($player->post_date));
echo $img; ?> <article> <h4>Profilenavn: <?php echo $user->name; ?> </h4> <p>Profilenr. <?php echo $user->id; ?> - <?php echo @$own[$user->own]; ?> </p> <p>Alder: <?php echo get_age($user->day, $user->month, $user->year); ?> år</p> <p>Højde: <?php echo $user->height; ?> cm</p> <p>Vægt: <?php echo $user->weight; ?> kg</p> <p>Postnr. & By: <?php echo $user->code; ?> <?php echo $user->city;
<pre class="brush: php"> format_db_date(2010, 1, 1, 12, 10, 10); // returns <?=format_db_date(2010, 1, 1, 12, 10, 10)?> </pre> <h2>date_range_string(<var>date1</var>, <var>date2</var>)</h2> <p>Creates a date range string (e.g. January 1-10, 2010).</p> <pre class="brush: php"> date_range_string('2010-08-01', '2010-08-05'); // returns <?=date_range_string((time() - (24*60*60)), time())?> </pre> <h2>pretty_date(<var>timestamp</var>, <var>use_gmt</var>)</h2> <p>Creates a string based on how long from the current time the date provided.</p> <pre class="brush: php"> pretty_date(time() - (60 * 60)); // returns <?=pretty_date(time() - (60 * 60))?> </pre> <h2>get_age(<var>bday_ts</var>, <var>[at_time_ts]</var>)</h2> <p>Returns an age based on a given date/timestamp. The second parameter is optional and by default will be the current date.</p> <pre class="brush: php"> get_age('2000-01-01'); // returns <?=get_age('2000-01-01')?> </pre>
/** * print fact DATE TIME * * @param string $factrec gedcom fact record * @param boolean $anchor option to print a link to calendar * @param boolean $time option to print TIME value * @param string $fact optional fact name (to print age) * @param string $pid optional person ID (to print age) * @param string $indirec optional individual record (to print age) */ function print_fact_date($factrec, $anchor = false, $time = false, $fact = false, $pid = false, $indirec = false) { global $factarray, $pgv_lang, $SEARCH_SPIDER; $ct = preg_match("/2 DATE (.+)/", $factrec, $match); if ($ct > 0) { print " "; // link to calendar if ($anchor && empty($SEARCH_SPIDER)) { print get_date_url($match[1]); } else { print get_changed_date(trim($match[1])); } // time if ($time) { $timerec = get_sub_record(2, "2 TIME", $factrec); if (empty($timerec)) { $timerec = get_sub_record(2, "2 DATE", $factrec); } $tt = preg_match("/[2-3] TIME (.*)/", $timerec, $tmatch); if ($tt > 0) { print " - <span class=\"date\">" . $tmatch[1] . "</span>"; } } if ($fact and $pid) { // age of parents at child birth if ($fact == "BIRT") { print_parents_age($pid, $match[1]); } else { if ($fact != "CHAN") { if (!$indirec) { $indirec = find_person_record($pid); } // do not print age after death $deatrec = get_sub_record(1, "1 DEAT", $indirec); if (empty($deatrec) || compare_facts($factrec, $deatrec) != 1 || strstr($factrec, "1 DEAT")) { print get_age($indirec, $match[1]); } } } } print " "; } else { // 1 DEAT Y with no DATE => print YES // 1 DEAT N is not allowed // It is not proper GEDCOM form to use a N(o) value with an event tag to infer that it did not happen. $factrec = str_replace("\r\nPGV_OLD\r\n", "", $factrec); $factrec = str_replace("\r\nPGV_NEW\r\n", "", $factrec); $factdetail = preg_split("/ /", trim($factrec)); if (isset($factdetail)) { if (count($factdetail) == 3) { if (strtoupper($factdetail[2]) == "Y") { print $pgv_lang["yes"]; } } } } // gedcom indi age $ages = array(); $agerec = get_gedcom_value("AGE", 2, $factrec); $daterec = get_sub_record(2, "2 DATE", $factrec); if (empty($agerec)) { $agerec = get_gedcom_value("AGE", 3, $daterec); } $ages[0] = $agerec; // gedcom husband age $husbrec = get_sub_record(2, "2 HUSB", $factrec); if (!empty($husbrec)) { $agerec = get_gedcom_value("AGE", 3, $husbrec); } else { $agerec = ""; } $ages[1] = $agerec; // gedcom wife age $wiferec = get_sub_record(2, "2 WIFE", $factrec); if (!empty($wiferec)) { $agerec = get_gedcom_value("AGE", 3, $wiferec); } else { $agerec = ""; } $ages[2] = $agerec; // print gedcom ages foreach ($ages as $indexval => $agerec) { if (!empty($agerec)) { print "<span class=\"label\">"; if ($indexval == 1) { print $pgv_lang["husband"]; } else { if ($indexval == 2) { print $pgv_lang["wife"]; } else { print $factarray["AGE"]; } } print "</span>: "; $age = get_age_at_event($agerec); print PrintReady($age); print " "; } } }
$uid = $res->fields['uid']; $regdate = $res0->fields["regdate"]; $server = $_SERVER["SERVER_NAME"]; if ($regdate == "" || $regdate == null) { $avatar_url = "http://{$server}/uc_server/images/noavatar_middle.gif"; } else { $uid2 = $uid; if ($uid < 10) { $uid2 = "0" . $uid; } $y = date("Y", $regdate); $m = date("m", $regdate); $d = date("d", $regdate); $avatar_url = "http://{$server}/uc_server/data/avatar/{$y}/{$m}/{$d}/{$uid2}_avatar_middle.jpg"; } $age = get_age($birthyear, $birthmonth, $birthday); //获取用户UUID $sql3 = "select username from disc_ucenter_members where uid='{$tuid}'"; $res3 = $db->Execute($sql3); $uuid = $res3->fields["username"]; //用户注册号 //获取用户的积分,金钱,声望 $sql4 = "select * from disc_common_member_count where uid='{$tuid}'"; $res4 = $db->Execute($sql4); $money = $res4->fields["extcredits2"]; //金钱 $credit = $res4->fields["extcredits1"]; //声望 //用户发起的活动总数 $sql5 = "select count(*) as total from disc_forum_activity where uid='{$tuid}'"; $res5 = $db->Execute($sql5);
function get_brightlist($site = 0) { global $SDB, $DC; $site = $site == 1 ? 1 : 0; $result_array = $DC->get_cache("brightlist_new"); $year = date("Y"); $md = date("md"); if (empty($result_array)) { $query_string = "SELECT uid,start_date,end_date,location,match_work_location,match_work_sublocation,birth_year,birthday,nickname,work_location,work_sublocation,avatar,privacy FROM brightlist INNER JOIN user_search_f USING (uid) WHERE brightlist.status=1"; $result_array = array(); $query = $SDB->query($query_string); while ($result = $SDB->fetch_assoc($query)) { $age = get_age($result['birth_year'], $result['birth_day']); $result_array[$result['uid']] = array(0 => $result['start_date'], 1 => $result['end_date'], 2 => $result['location'], 'age' => $age, 'sex' => 'f', 'match_work_location' => $result['match_work_location'], 'match_work_sublocation' => $result['match_work_sublocation'], 'nickname' => $result['nickname'], 'work_location' => $result['work_location'], 'work_sublocation' => $result['work_sublocation'], 'avatar' => $result['avatar'], 'privacy' => $result['privacy']); } $query_string = "SELECT uid,start_date,end_date,location,match_work_location,match_work_sublocation,birth_year,birthday,nickname,work_location,work_sublocation,avatar,privacy FROM brightlist INNER JOIN user_search_m USING (uid) WHERE brightlist.status=1"; $query = $SDB->query($query_string); while ($result = $SDB->fetch_assoc($query)) { $age = get_age($result['birth_year'], $result['birth_day']); $result_array[$result['uid']] = array(0 => $result['start_date'], 1 => $result['end_date'], 2 => $result['location'], 'age' => $age, 'sex' => 'm', 'match_work_location' => $result['match_work_location'], 'match_work_sublocation' => $result['match_work_sublocation'], 'nickname' => $result['nickname'], 'work_location' => $result['work_location'], 'work_sublocation' => $result['work_sublocation'], 'avatar' => $result['avatar'], 'privacy' => $result['privacy']); } if (!$DC->set_cache("brightlist_new", $result_array, 600)) { $DC->update_cache("brightlist_new", $result_array, 600); } } return $result_array; }
$days = intval($left_time / 24 / 60 / 60); $remain = $left_time % 86400; $hours = intval($remain / 3600); $remain = $remain % 3600; $mins = intval($remain / 60); } $type = array(1 => "SugarBaby (M)", 2 => "SugarBaby (F)", 3 => "SugarDad", 4 => "SugarMom"); $html .= ' <li> <div class="infoLeft"> <div class="imgPeople3"> <a class="tooltip" href="' . $profile_link . '" ' . $data_reveal . '>' . $hide_text . '' . $img . '</a> </div> <div class="infoContent"> <h3 style="width: 115px;height: 22px; overflow: hidden;">' . $dating['name'] . '</h3> <span>Alder: ' . get_age($dating['day'], $dating['month'], $dating['year']) . ' år</span> <span>Højde: ' . $dating['height'] . ' cm</span> <span>Vægt: ' . $dating['weight'] . ' kg</span> <span>Postnr: ' . $dating['code'] . '</span> <span>By: ' . $dating['city'] . '</span> </div> </div> <div class="infoRight"> <div style="float:left;"><img src="' . base_url() . 'thumbnail/timthumb.php?src=' . base_url() . get_config_value('upload_deal_category_path') . $dating['white_icon'] . '&q=100&w=33&h=33"/></div> <a style="width: 180px; height: 45px; overflow: hidden;" href="' . $dating_link . '" ' . $data_reveal . ' class="titlePeo">' . $dating['title'] . '</a> <div class="clear"></div> <div class="timer"> <p class="timerDetail">' . $days . ' dage ' . $hours . ' timer ' . $mins . ' min</p> <span class="s10">inden sugar daten udløber</span> </div> <a href="' . $dating_link . '" ' . $data_reveal . '>' . implode(' ', array_slice(explode(' ', $dating['description']), 0, 10)) . '...' . '</a>
</td> </tr> <?php } if (get_option('wpcm_staff_profile_show_age') == 'yes') { ?> <tr> <th> <?php _e('Age', 'wp-club-manager'); ?> </th> <td> <?php echo get_age(get_post_meta($post->ID, 'wpcm_dob', true)); ?> </td> </tr> <?php } if (get_option('wpcm_staff_profile_show_season') == 'yes') { $seasons = get_the_terms($post->ID, 'wpcm_season'); if (is_array($seasons)) { $player_seasons = array(); foreach ($seasons as $value) { $player_seasons[] = $value->name; } ?> <tr>
/** * 处理影片列表信息导出 */ public function member_export() { $user_label = M('user_label'); # 用户标签 $labelList = $user_label->field('id,name,style')->where('is_del=0')->select(); $user = M('user'); import('@.ORG.Page'); $arr = ""; $true_name = trim($this->_get('true_name')); #宝宝名称 if (!empty($true_name)) { $arr['true_name'] = array('LIKE', "%" . $true_name . "%"); $this->assign("true_name", $this->_get('true_name')); } $user_label_id = intval($this->_get('user_label_id')); #标签 if ($user_label_id > 0) { $arr['user_label_id'] = array('eq', $user_label_id); $this->assign("user_label_id", $this->_get('user_label_id')); } $region_id = intval($this->_get('region_id')); #城市 if ($region_id > 0) { $region_list = $user->query("SELECT id FROM `cms_region` where pid={$region_id} and status=1"); foreach ($region_list as $rlist) { $arr_c1[] = $rlist['id']; } $str_c1 = implode(',', $arr_c1); $region_list = $user->query("SELECT id FROM `cms_region` where pid in({$str_c1}) and status=1"); foreach ($region_list as $rlist2) { $arr_c1[] = $rlist2['id']; } $str_c2 = implode(',', $arr_c1); $arr['region_id'] = array('in', $str_c2); $this->assign("region_id", $this->_get('region_id')); } $admin_id = intval($this->_get('admin_id')); #所属客服 if ($admin_id > 0) { $arr['admin_id'] = array('eq', $admin_id); $this->assign("admin_id", $this->_get('admin_id')); } $source_id = intval($this->_get('source_id')); #到店状态 if ($source_id != 100) { $arr['cms_user.source_id'] = array('eq', $source_id); $this->assign("source_id", $this->_get('source_id')); } else { $this->assign("source_id", 100); } if (!empty($_GET['start_time']) and !empty($_GET['end_time'])) { $arr['create_time'] = array(array('egt', strtotime($_GET['start_time'])), array('lt', strtotime($_GET['end_time']) + 24 * 3600)); $this->assign("end_time", $_GET['end_time']); $this->assign("start_time", $_GET['start_time']); } elseif (!empty($_GET['start_time']) and empty($_GET['end_time'])) { $arr['create_time'] = array('egt', strtotime($_GET['start_time'])); $this->assign("start_time", $_GET['start_time']); } elseif (!empty($_GET['end_time']) and empty($_GET['start_time'])) { $arr['create_time'] = array('lt', strtotime($_GET['end_time'])); $this->assign("end_time", $_GET['end_time']); } $arr['status'] = array('eq', 1); $arr['is_del'] = array('eq', 0); $user_arr = $user->where($arr)->order('user_id DESC')->select(); vendor('PHPExcel_1_7_8.Classes.PHPExcel'); vendor('PHPExcel_1_7_8.Classes.PHPExcel.IOFactory'); vendor('PHPExcel_1_7_8.Classes.PHPExcel.Worksheet'); //创建Excel对象 $objPHPExcel = new PHPExcel(); //设置Excel数据缓存方式为磁盘文件缓存(适用于大数据量处理,以减少对PHP自身内存的占用) $cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_discISAM; $cacheSettings = array('dir' => C('LEG_EXCEL_DATA_CACHE_DIR')); PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); //设置Excel元数据 $objPHPExcel->getProperties()->setCreator("客服管理系统"); $objPHPExcel->getProperties()->setLastModifiedBy("客服管理系统后台程序"); $objPHPExcel->getProperties()->setTitle("客服管理系统后台导出影片列表"); $objPHPExcel->getProperties()->setSubject("客户列表"); $objPHPExcel->getProperties()->setDescription("Exported document for Office 2007 XLSX, generated using PHP classes."); $objPHPExcel->getProperties()->setKeywords("office 2007 php"); $objPHPExcel->getProperties()->setCategory("Export result file"); //填充数据到活动的电子表格中 $objPHPExcel->setActiveSheetIndex(0); $objWorksheet = $objPHPExcel->getActiveSheet(); $objWorksheet->setCellValueByColumnAndRow(0, 1, '用户ID'); $objWorksheet->setCellValueByColumnAndRow(1, 1, '宝宝姓名'); $objWorksheet->setCellValueByColumnAndRow(2, 1, '标签'); $objWorksheet->setCellValueByColumnAndRow(3, 1, '宝宝年龄'); $objWorksheet->setCellValueByColumnAndRow(4, 1, '城市'); $objWorksheet->setCellValueByColumnAndRow(5, 1, '电话'); $objWorksheet->setCellValueByColumnAndRow(6, 1, '来源'); $objWorksheet->setCellValueByColumnAndRow(7, 1, '所属客服'); $objWorksheet->setCellValueByColumnAndRow(8, 1, '记录时间'); foreach ($user_arr as $key => $rs) { $key += 2; $objWorksheet->setCellValueByColumnAndRow(0, $key, $rs['user_id']); $objWorksheet->setCellValueByColumnAndRow(1, $key, $rs['true_name ']); $objWorksheet->setCellValueByColumnAndRow(2, $key, $labelList[$rs['user_label_id']]); $objWorksheet->setCellValueByColumnAndRow(3, $key, get_age($rs['birthday'])); $objWorksheet->setCellValueByColumnAndRow(4, $key, $rs['city_id']); $objWorksheet->setCellValueByColumnAndRow(5, $key, $rs['phone']); $objWorksheet->setCellValueByColumnAndRow(6, $key, $rs['source']); $objWorksheet->setCellValueByColumnAndRow(7, $key, $rs['admin_id']); $objWorksheet->setCellValueByColumnAndRow(8, $key, date("Y-m-d H:i:s", $rs['create_time'])); } //导出到文件中 $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); //直接输出到浏览器 header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Disposition: attachment;filename="UsersList.xlsx"'); header('Cache-Control: max-age=0'); $objWriter->save('php://output'); }
function _process_age_service_datas_for_line($datas) { $centre_array = array(); $centre_id_name_array = array(); $centre_array = array('0', '1'); $first_line_array = array('date', '< 6months', '6 - 12months', '1 - 2 years old', '2 - 3 years old', '> 3 years old'); $custom_centre_array = array('< 6months' => 0, '6 - 12months' => 0, '1 - 2 years old' => 0, '2 - 3 years old' => 0, '> 3 years old' => 0); $start_time = $this->input->get('from_date') ? strtotime($this->input->get('from_date')) : strtotime('-1 month'); $end_time = $this->input->get('to_date') ? strtotime($this->input->get('to_date')) : time(); $pre_line_chart = array(); foreach ($datas as $key => $data) { if (!isset($pre_line_chart[$data->payment_received_date][$data->dob])) { $pre_line_chart[$data->payment_received_date][$data->dob] = 0; } $pre_line_chart[$data->payment_received_date][$data->dob] += $data->service_amount; } $new_pre_line_chart = array(); foreach ($pre_line_chart as $key1 => $value1) { $new_pre_line_chart[$key1] = $custom_centre_array; foreach ($value1 as $k1 => $v1) { $age = get_age($k1); if ($age->years == 0 && $age->months < 6) { $new_pre_line_chart[$key1]['< 6months'] += $v1; } if ($age->years == 0 && $age->months >= 6 && $age->months <= 12) { $new_pre_line_chart[$key1]['6 - 12months'] += $v1; } if ($age->years != 0 && $age->years < 2) { $new_pre_line_chart[$key1]['1 - 2 years old'] += $v1; } if ($age->years != 0 && $age->years >= 2 && $age->years < 3) { $new_pre_line_chart[$key1]['2 - 3 years old'] += $v1; } if ($age->years != 0 && $age->years >= 3) { $new_pre_line_chart[$key1]['> 3 years old'] += $v1; } } } $pre_line_chart = $new_pre_line_chart; if ($this->input->get('interval') == 'monthly') { $interval = 2592000; } elseif ($this->input->get('interval') == 'weekly') { $interval = 604800; } else { $interval = 86400; } $interval_start = $start_time; $final_pre_line_chart = array(); for ($i = $start_time + $interval; $i <= $end_time; $i += $interval) { $interval_end = $i; if ($this->input->get('interval') == 'weekly' or $this->input->get('interval') == 'monthly') { $interval_index = date('M j', $interval_start) . '-' . date('M j', $interval_end); } else { $interval_index = date('M j', $interval_end); } $final_pre_line_chart[$interval_index] = $custom_centre_array; foreach ($pre_line_chart as $index => $val) { if (strtotime($index) >= $interval_start and strtotime($index) <= $interval_end) { $final_pre_line_chart[$interval_index] = sum_array($final_pre_line_chart[$interval_index], $val); } } $interval_start = $i; } if ($interval_start < $end_time) { if ($this->input->get('interval') == 'weekly' or $this->input->get('interval') == 'monthly') { $interval_index = date('M j', $interval_start) . '-' . date('M j', $end_time); } else { $interval_index = date('M j', $end_time); } $final_pre_line_chart[$interval_index] = $custom_centre_array; foreach ($pre_line_chart as $index => $val) { if (strtotime($index) >= $interval_start and strtotime($index) <= $end_time) { $final_pre_line_chart[$interval_index] = sum_array($final_pre_line_chart[$interval_index], $val); } } } $pre_line_chart = $final_pre_line_chart; $line_chart = array($first_line_array); foreach ($pre_line_chart as $keyz => $valuez) { $temp_array = array($keyz); foreach ($valuez as $k => $v) { $temp_array[] = $v; } $line_chart[] = $temp_array; } return $line_chart; }
function export_xls() { ini_set('memory_limit', '-1'); require "../assets/export-xls.class.modif.php"; $filename = 'LIST_INDIVIDUAL_' . date('Ymd_His') . '.xls'; $xls = new ExportXLS($filename); $header[] = "NO"; $header[] = "INDIVIDUAL CODE"; $header[] = "CAMPAIGN"; $header[] = "MOP ID"; $header[] = "FIRSTNAME"; $header[] = "LASTNAME"; $header[] = "NICKNAME"; $header[] = "SEX"; $header[] = "DAY OF BIRTH"; $header[] = "ID TYPE"; $header[] = "ID NUMBER"; $header[] = "TELEPHONE"; $header[] = "EMAIL"; $header[] = "FB"; $header[] = "TW"; $header[] = "ADDRESS"; $header[] = "CITY"; $header[] = "POS CODE"; $header[] = "BRAND"; $header[] = "BRAND 2"; $header[] = "SOURCE TYPE"; $header[] = "SOURCE USER"; $header[] = "SOURCE EMAIL"; $header[] = "SURVEY DATE"; $header[] = "UPLOAD DATE"; $header[] = "ENTRY DATE"; $header[] = "VERIFIKASI DATE"; $header[] = "REFERRED BY"; $header[] = "DRN NUMBER"; $header[] = "STATUS VERIFIKASI"; $header[] = "AGE"; $xls->addHeader($header); $result = $this->mdl_individual->export()->result(); $i = 1; foreach ($result as $r) { $row[] = $i++; $row[] = $r->id; $row[] = $r->campaign_id; $row[] = $r->mop_id; $row[] = $r->firstname; $row[] = $r->lastname; $row[] = $r->nickname; $row[] = $r->sex; $row[] = format_tanggal_excel($r->dob); $row[] = $r->id_type; $row[] = $r->id_number; $row[] = $r->tlp; $row[] = $r->email; $row[] = $r->fb; $row[] = $r->tw; $row[] = $r->address; $row[] = $r->city; $row[] = $r->pos_code; $row[] = $r->brand; $row[] = $r->brand_; $row[] = $r->source_type; $row[] = $this->mdl_sba->get_sba_name($r->source_user); $row[] = $r->source_user; $row[] = format_tanggal_excel($r->survey_date); $row[] = format_tanggal_excel($r->upload_date); $row[] = format_tanggal_excel($r->entry_date); $row[] = format_tanggal_excel($r->verifikasi_date); $row[] = $r->referred; $row[] = $r->drn_number; $row[] = $r->status_verifikasi; $row[] = get_age($r->dob); $xls->addRow($row); unset($row); } $xls->sendFile(); }
// Fetch the reputation for this user if ($user_permissions['usereputationsystem'] == 1 && $mybb->settings['enablereputation'] == 1) { $reputation = get_reputation($user['reputation']); } else { $reputation = "-"; } if ($mybb->settings['enablewarningsystem'] != 0 && $user_permissions['canreceivewarnings'] != 0) { $warning_level = round($user['warningpoints'] / $mybb->settings['maxwarningpoints'] * 100); if ($warning_level > 100) { $warning_level = 100; } $warning_level = get_colored_warning_level($warning_level); } $age = $lang->na; if ($user['birthday']) { $age = get_age($user['birthday']); } $table->construct_cell("<div style=\"width: 126px; height: 126px;\" class=\"user_avatar\"><img src=\"" . htmlspecialchars_uni($user['avatar']) . "\" style=\"margin-top: {$avatar_top}px\" width=\"{$scaled_dimensions['width']}\" height=\"{$scaled_dimensions['height']}\" alt=\"\" /></div>", array('rowspan' => 6, 'width' => 1)); $table->construct_cell("<strong>{$lang->email_address}:</strong> <a href=\"mailto:" . htmlspecialchars_uni($user['email']) . "\">" . htmlspecialchars_uni($user['email']) . "</a>"); $table->construct_cell("<strong>{$lang->last_active}:</strong> {$last_active}"); $table->construct_row(); $table->construct_cell("<strong>{$lang->registration_date}:</strong> {$reg_date}"); $table->construct_cell("<strong>{$lang->local_time}:</strong> {$local_time}"); $table->construct_row(); $table->construct_cell("<strong>{$lang->posts}:</strong> {$user['postnum']}"); $table->construct_cell("<strong>{$lang->age}:</strong> {$age}"); $table->construct_row(); $table->construct_cell("<strong>{$lang->posts_per_day}:</strong> {$posts_per_day}"); $table->construct_cell("<strong>{$lang->reputation}:</strong> {$reputation}"); $table->construct_row(); $table->construct_cell("<strong>{$lang->percent_of_total_posts}:</strong> {$percent_posts}");
echo site_url("ride_sharing/view/{$ride['schedule_id']}"); ?> ';"> <div class="sec1"> <div class="left"> <img src="<?php echo $user_img; ?> " /> </div> <div class="right"> <p><?php echo $ride['first_name'] . ' ' . $ride['last_name']; ?> <br/><?php echo get_age($ride['dob']); ?> years old</p> </div> </div> <div class="sec2"> <p><?php echo $ride['schedule_start_date'] . ' ' . $ride['ride_start_time']; ?> <br/><?php echo get_org_dest($ride, 'origin_name') . ' -> ' . get_org_dest($ride, 'dest_name'); ?> <br/>Departure :<?php echo get_org_dest($ride, 'origin_address'); ?> <br/>Destination :<?php