function calcUserAge($data) { foreach ($data as $key => $value) { if (isset($data[$key]['Geburtstag'])) { $data[$key]['Alter'] = birthday($data[$key]['Geburtstag']) + 1; } } return $data; }
json("yes", "登录成功", $jsonres); /***** 更新access_token(待做) */ } else { $jsonres = array('headurl' => "" . $row_user['headurl'], 'name' => "" . $row_user['name'], 'sex' => $row_user['sex'] == 1 ? '男' : '女', 'age' => "" . $row_user['age'], 'province' => "" . $row_user['province'], 'city' => "" . $row_user['city'], 'umd5' => md5($row_user['uid']), 'pwd' => $row_user['pwd'], 'is_res' => 'no', 'zhiye' => "" . $row_user['zhiye'], 'qianming' => "" . $row_user['qianming']); json("yes", "登录成功", $jsonres); } /* if(empty($row_user['zaina'])){//判断是否接收登录回执 }else{ } */ } else { //该社会化帐号不存在 $age = birthday($birthday); $uid = sc_uuid(); //ios社会化登录 if ($os == 'ios') { $hx_user['username'] = md5($uid); $hx_user['password'] = md5($media_type . 'inipwd' . $media_uid); $hx_res = add_user($hx_user); if (empty($hx_res['error']) && $hx_res['entities'][0]['username'] == md5($uid)) { $insert = array("media_type" => $media_type, "media_uid" => $media_uid, "access_token" => $access_token, "province" => $province, "city" => $city, "birthday" => $birthday, "sex" => $sex, "age" => $age, "uid" => $uid, "umd5" => md5($uid), 'headurl' => $headurl, "name" => $name, 'zhiye' => "", 'qianming' => "", "pwd" => md5($media_type . 'inipwd' . $media_uid)); $jsonres = array('headurl' => "" . $headurl, 'name' => "" . $name, 'sex' => $sex == 1 ? '男' : '女', 'age' => "" . $age, 'province' => "" . $province, 'city' => "" . $city, 'umd5' => md5($uid), "pwd" => md5($media_type . 'inipwd' . $media_uid), 'zhiye' => "", 'qianming' => "", 'is_res' => 'yes'); $db->row_insert('user', $insert); //send_update(md5($uid));//发送内测消息 $umd5 = md5($uid); $send_content = "欢迎来到这里,我是小客服,填写真实资料和头像会获得ta的好感。\n聊天时请保持社交礼仪,如有用户恶意骚扰,请立即将其拉黑举报给我们"; send_txt($umd5, $send_content); json("yes", "登录成功", $jsonres);
include 'dbms/dbms_imp.php'; $today = date('-m-d'); // echo "$today"; // query to get todays birthday $query_bd = "SELECT `uniqueid` FROM `userdetail` WHERE `dob` LIKE '%{$today}%'"; $result = $connection->query($query_bd); $count = $result->num_rows; // getting the display functions include_once 'display/functions/amazing.func.php'; include_once 'display/functions/birthday.func.php'; include_once 'display/functions/birthday_comment.func.php'; if ($count == 0) { amazing('waiting for a birthday', "oh seems like there are no cakes and candles ", "#"); } else { while ($rows = $result->fetch_array()) { birthday($rows[0]); } birthday_comment(); } ?> <!--navigation panel for large database--> </div> <?php require 'footer.php'; ?> </main> <!--<div class="mdl-layout__obfuscator"></div>--> </div> <script src="material.min.js"></script> </div> </body>
public function pdfAction() { require_once '/Zend/Pdf.php'; require_once '/PS/utils.php'; if (!$this->_hasParam('id')) { return $this->_redirect('/analysis/index/page/1'); } $datos = new Application_Model_Analysis(); $row = $datos->getRow($this->_getParam('id')); if ($row) { $data = $row->toArray(); $contact = new Application_Model_Contacts(); $results = new Application_Model_Results(); $exa = $datos->BySpecialties($this->_getParam('id')); $customer = $contact->getRow($data['applicant_id'])->toArray(); $medico = $contact->getRow($data['medic_id'])->toArray(); $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); //$pdf = new Zend_Pdf(); if ($data['name'] == 1) { $pdf = Zend_Pdf::load('img/2.pdf'); } else { $pdf = Zend_Pdf::load('img/1.pdf'); } $page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4); //$pdf->pages[] = $page; $page = $pdf->pages[0]; /* //specify color $color = new Zend_Pdf_Color_HTML("navy"); $page->setFillColor($color); */ $fontT = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_TIMES); $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 10); $page->drawText($customer['first_name'] . ' ' . $customer['last_name'], 125, 712); $page->drawText(date('Y-m-d', strtotime($data['date_entered'])), 455, 712); $page->drawText(birthday($customer['birthdate']), 125, 700); $page->drawText($customer['gender'], 455, 700); $page->drawText($medico['first_name'] . ' ' . $medico['last_name'], 125, 685); $posY = 670; foreach ($exa as $key) { $posY -= 50; $page->setLineWidth(0.5); $page->drawLine(50, $posY + 15, 530, $posY + 15); $page->setLineWidth(0.5); $page->drawLine(50, $posY - 10, 530, $posY - 10); $page->drawText('Examen', 50, $posY); $page->drawText('Resultado', 280, $posY); $page->drawText('U.M.', 360, $posY); $page->drawText('Valores de Referencia', 400, $posY); $page->drawText($key['name'], 50, $posY - 25); $res = $results->getBy(array('analysis_id =?' => $key['analysis_id'], 'test_id =?' => $key['itest_id']))->toArray(); $posY -= 38.4; foreach ($res as $keyd) { $page->drawText($keyd['item_name'], 60, $posY); $page->drawText($keyd['result'], 280, $posY); $page->drawText($keyd['ref_val_unit'], 350, $posY); $page->drawText($keyd['ref_val_value'], 420, $posY); $posY -= 14.2; } $posY -= 20.2; $page->drawText('MUESTRA:', 280, $posY); $page->drawText('METODO DE PROCESO:', 280, $posY - 14); } if ($posY < 400) { $page2 = new Zend_Pdf_Page($page); $pdf->pages[] = $page2; } $page->drawText('OBSERVACIONES:', 50, 170); $page->drawText($data['note'], 50, 155); $this->getResponse()->setHeader('Content-Disposition', 'attachment; filename=result.pdf')->setHeader('Content-type', 'application/x-pdf'); echo $pdf->render(); } }
$this_menu .= ' | Cấu hình chung'; break; case '1': $tpl->assign(array('report_check1' => get_option('report') == 1 ? 'checked=""' : '', 'report_check0' => get_option('report') == 0 ? 'checked=""' : '', 'report_info' => get_option('report_info'))); $this_menu .= ' | Thông báo'; break; case '2': $tpl->assign(array('close_check1' => get_option('close') == 1 ? 'checked=""' : '', 'close_check0' => get_option('close') == 0 ? 'checked=""' : '', 'close_info' => get_option('close_info'))); $this_menu .= ' | Đóng cửa'; break; } break; case '13': $my = @mysql_fetch_array(@mysql_query("SELECT user_nick, user_fullname, user_email, user_sex, user_info, user_birthday, user_class FROM cnt_users WHERE id = " . $_SESSION['user']['id'])); $tpl->assign(array('my_nick' => $my['user_nick'], 'my_name' => $my['user_fullname'], 'my_email' => $my['user_email'], 'my_sex1' => $my['user_sex'] == 1 ? 'selected=""' : '', 'my_sex2' => $my['user_sex'] == 2 ? 'selected=""' : '', 'my_info' => $my['user_info'])); $birthday = birthday($my['user_birthday']); for ($i = 1; $i <= 31; $i++) { $tpl->assign(array('dd' => $i, 'my_dd' => $i == $birthday['d'] ? 'selected=""' : '')); $tpl->parse('list_dd'); } for ($i = 1; $i <= 12; $i++) { $tpl->assign(array('mm' => $i, 'my_mm' => $i == $birthday['m'] ? 'selected=""' : '')); $tpl->parse('list_mm'); } for ($i = 1940; $i <= 2010; $i++) { $tpl->assign(array('yyyy' => $i, 'my_yyyy' => $i == $birthday['y'] ? 'selected=""' : '')); $tpl->parse('list_yyyy'); } $class_list = @mysql_query("SELECT * FROM cnt_class ORDER BY id DESC"); while ($lclass = @mysql_fetch_array($class_list)) { $tpl->assign(array('lclass_id' => $lclass['id'], 'lclass_name' => $lclass['class_name'], 'my_class' => $my['user_class'] == $lclass['id'] ? 'selected=""' : ''));
// Retrieve members Profile $sql = "SELECT * FROM member_profile WHERE user_id = {$member_id}"; $query = mysql_query($sql); // if no member found redirect to home page with error code // get all values for display on members profile section $result = @mysql_fetch_array($query); if (@mysql_num_rows($query) > 0) { foreach ($result as $key => $value) { //$key = preg_replace('/[0-9]/','',$key); ${$key} = $value; } //create my age if ($birthday == '0000-00-00') { $my_age = $lang_private; } else { $my_age = birthday($birthday); } } } //__________________________________________________________________________________________________________________________________________ //______Get my Privacy Setting____________________________________________________________________________________________________________ $template = "themes/{$user_theme}/templates/inner_members_profile_ajax.htm"; //middle of page $sql = "SELECT * FROM privacy WHERE user_id = {$member_id}"; $result = @mysql_fetch_array(@mysql_query($sql)); //Public favorites if ($result['publicfavorites'] == 'no' && $user_id != $member_id) { if ($type == 2 || $type == 4 || $type == 7) { $template = "themes/{$user_theme}/templates/inner_none_existant_file.htm"; //just to give blank results }
$user_profile = $facebook->api('/me'); $birthday = $user_profile['birthday']; //calculate years of age (input string:DD-MM- YYYY) function birthday($birthday) { list($month, $day, $year) = explode("/", $birthday); $month_diff = date("m") - $month; $day_diff = date("d") - $day; $year_diff = date("Y") - $year; // If the birthday has not occured this year if ($day_diff < 0 || $month_diff < 0) { $year_diff--; } return $year_diff; } $birth = birthday($birthday); //echo $birth; include 'includes/db_register.php'; $select = mysql_select_db($database) or die(mysql_error()); $res = mysql_query("SELECT user_email FROM register_users WHERE user_email='{$user_profile['email']}'"); $row = mysql_num_rows($res); if ($row > 0) { $quey = "UPDATE \n\t\t\t\t\t\t\t\t\t\tregister_users\n\t\t\t\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tuser_name = '" . $firstname . "',\n\t\t\t\t\t\t\t\t\t\tuser_email ='" . $email . "',\n\t\t\t\t\t\t\t\t\t\tuser_age ='" . $age . "',\n\t\t\t\t\t\t\t\t\t\tuser_gender ='" . $sex . "',\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tWHERE user_id = " . $user_id; mysql_query($quey); } else { $query = "INSERT INTO register_users (user_name,user_age,user_gender, user_email) \n\t\t\t\tVALUES ('{$user_profile['first_name']}','{$birth}','{$user_profile['gender']}','{$user_profile['email']}')"; mysql_query($query) or die(mysql_error()); } } catch (FacebookApiException $e) { error_log($e); $user = null;