/** * 主页 * @return null null */ public function index() { echo 'Moudle: Home' . '<br />'; echo 'Controller: Index' . '<br />'; echo 'Action: index' . '<br />'; $links = getAddress(); $this->assign('address', $links); $this->display(); }
public function saveIntoPublisherInfo($objPublisherInfo) { $query = "INSERT INTO publisher_info(pub_id, organisation_name, address, city, pincode) values(:PUB_ID, :ORGANISATION_NAME, :ADDRESS, :CITY, :PINCODE)"; try { $dbconn = $this->getConnection(); $stmt = $dbconn->prepare($query); $stmt->bindValue(':PUB_ID', $objPublisherInfo->getPubId()); $stmt->bindValue(':ORGANISATION_NAME', $objPublisherInfo->getOrganisationName()); $stmt->bindValue(':ADDRESS', $objPublisherInfo > getAddress()); $stmt->bindValue(':CITY', $objPublisherInfo->getCity()); $stmt->bindValue(':PINCODE', $objPublisherInfo->getPincode()); $stmt->execute(); } catch (Exception $ex) { $this->throwPDOException($e); } }
function createVCard($array) { $return = 'BEGIN:VCARD' . PHP_EOL; $return .= 'VERSION:2.1' . PHP_EOL; $return .= getName($array) . PHP_EOL; $return .= getFormatedName($array) . PHP_EOL; $return .= getPhoto($array); $return .= getTelephonePrivate($array); $return .= getMobilePrivate($array); //$return .= 'TEL;WORK;VOICE:(0221) 9999123' . PHP_EOL; //$return .= 'TEL;HOME;VOICE:(0221) 1234567' . PHP_EOL; $return .= getAddress($array); $return .= getEmail($array); $return .= date('Y-m-d H:i:s') . PHP_EOL; $return .= 'END:VCARD' . PHP_EOL; return $return; }
function sendBtc($id, $amount) { #Send btc from id to address $bitcoin = new jsonRPCClient("http://{$bitcoin_user}:{$bitcoin_pass}@127.0.0.1:8332/"); if ($bitcoin->getbalance() < $amount) { return -1; } if (!debit($id, $amount)) { return -2; } $address = getAddress($id); if ($address == -1) { return -3; } $comment = getUsernameById($id); $bitcoin->sendtoaddress($address, $amount, $comment); return 0; }
public function index() { echo 'Moudle: Home' . '<br />'; echo 'Controller: Chart' . '<br />'; echo 'Action: index' . '<br />'; $nums = I('numbers'); if (I('numbers') <= 0) { $nums = 15; } // 链接地址 $links = getAddress(); $this->assign('address', $links); // 开奖数据 $kjh = M('kjh'); $result = $kjh->limit($nums)->order('qh DESC')->select(); $result = array_reverse($result); // 开奖号码经过处理返回表格形式的数组 $d = numbersFormat($result); $this->assign('kjh', $d); $this->display(); }
$address_id = filter_input(INPUT_POST, 'address_id'); $fullname = filter_input(INPUT_POST, 'fullname'); $email = filter_input(INPUT_POST, 'email'); $address = filter_input(INPUT_POST, 'address'); $phone = filter_input(INPUT_POST, 'phone'); $website = filter_input(INPUT_POST, 'website'); $birthday = filter_input(INPUT_POST, 'birthday'); $image = filter_input(INPUT_POST, 'upfile'); $img = uploadProductImage(); // function to update database updateNoImg($address_group_id, $address_id, $user_id, $fullname, $email, $address, $phone, $website, $img); } else { $address_id = filter_input(INPUT_GET, 'address_id'); } //fill variables from database function $results = getAddress($address_id, $user_id); $address_group_id = $results['address_group_id']; $fullname = $results['fullname']; $email = $results['email']; $address = $results['address']; $phone = $results['phone']; $website = $results['website']; $birthday = $results['birthday']; $image = $results['image']; // /* statment selects from database */ // $stmt = $db->prepare("SELECT * FROM address WHERE address_id = :address_id AND user_id = :user_id"); // // /* binds results into array */ // $binds = array( // ":address_id" => $address_id, // ":user_id" => $user_id
function readEntryLog($log) { if (!count($log)) { return array(); } $return = array(); if ($log['log_action'] == 'add') { $middlestring = _('set to'); } else { $middlestring = _('changed to'); } foreach ($log['log_data'] as $index => $value) { if ($index != 'rev_num') { switch ($index) { case 'entry_name': if ($value == '') { $return[] = _('Entry name') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Entry name') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'entry_title': if ($value == '') { $return[] = _('Entry title') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Entry title') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'time_start': $return[] = _('Start time') . ' ' . $middlestring . ' <i>' . date('H:i d-m-Y', $value) . '</i>'; break; case 'time_end': $return[] = _('End time') . ' ' . $middlestring . ' <i>' . date('H:i d-m-Y', $value) . '</i>'; break; case 'area_id': $area = getArea($value); if (count($area)) { $return[] = _('Area') . ' ' . $middlestring . ' <i>' . $area['area_name'] . '</i>'; } else { $return[] = _('Area') . ' ' . $middlestring . ' <i>--' . _('Name not found') . '--</i>'; } break; case 'room_id': $value = splittIDs($value); if (!count($value)) { $return[] = _('Room') . ' ' . $middlestring . ' <i>' . _('Whole area') . '</i>'; } else { $values = array(); foreach ($value as $id) { if ($id == '0') { $values[] = _('Whole area'); } else { $thisone = getRoom($id); if (count($thisone)) { $values[] = $thisone['room_name']; } } } $return[] = _('Room') . ' ' . $middlestring . ' <i>' . implode(', ', $values) . '</i>'; } break; case 'user_assigned': $value = splittIDs($value); if (!count($value)) { $return[] = _('Users assigned') . ' ' . $middlestring . ' <i>' . _('Nobody') . '</i>'; } else { $values = array(); foreach ($value as $id) { if ($id == '0') { $values[] = _('Nobody'); } else { $thisone = getUser($id); if (count($thisone)) { $values[] = $thisone['user_name']; } } } $return[] = _('Users assigned') . ' ' . $middlestring . ' <i>' . implode(', ', $values) . '</i>'; } break; case 'user_assigned2': if ($value == '') { $return[] = _('Manual user assigned') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Manual user assigned') . ' ' . $middlestring . ' "' . $value . '"'; } break; /* * Not in use... case 'customer_name': $return .= _('Customer').' '.$middlestring.' "'.$value.'"'; break;*/ /* * Not in use... case 'customer_name': $return .= _('Customer').' '.$middlestring.' "'.$value.'"'; break;*/ case 'customer_id': if ($value == 0) { $return[] = _('Customer') . ' <i>' . _('not set') . '</i>'; } else { $customer = getCustomer($value); if (count($customer)) { $return[] = _('Customer') . ' ' . $middlestring . ' <i>' . $customer['customer_name'] . '</i>'; } else { $return[] = _('Customer ID') . ' ' . $middlestring . ' "' . $value . '"'; } } break; /* * Not in use... case 'customer_municipal': $return .= _('Municipal').' '.$middlestring.' "'.$value.'"'; break;*/ /* * Not in use... case 'customer_municipal': $return .= _('Municipal').' '.$middlestring.' "'.$value.'"'; break;*/ case 'customer_municipal_num': require "libs/municipals_norway.php"; if (isset($municipals[$value])) { $return[] = _('Municipal') . ' ' . $middlestring . ' <i>' . $municipals[$value] . '</i>'; } elseif ($value == '') { $return[] = _('Municipal') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Municipal') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'contact_person_name': if ($value == '') { $return[] = _('Contact person') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Contact person') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'contact_person_phone': if ($value == '') { $return[] = _('Contact persons phone number') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Contact persons phone number') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'contact_person_email': if ($value == '') { $return[] = _('Contact persons email') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Contact persons email') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'num_person_child': if ($value == "" || $value == 0) { $return[] = _('Number of children') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Number of children') . ' ' . $middlestring . ' ' . $value; } break; case 'num_person_adult': if ($value == "" || $value == 0) { $return[] = _('Number of adults') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Number of adults') . ' ' . $middlestring . ' ' . $value; } break; case 'num_person_count': if ($value == "" || $value == 0) { $return[] = _('Count these numbers') . ' ' . $middlestring . ' <i>' . _('not count in booking system / Datanova / cash register') . '</i>'; } else { $return[] = _('Count these numbers') . ' ' . $middlestring . ' <i>' . _('count in booking system') . '</i>'; } break; case 'program_description': if ($value == '') { $return[] = _('Program description') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Program description') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'service_alco': if ($value) { $return[] = _('Alcohol') . ' <i>' . _('is to be served') . '</i>'; } else { $return[] = _('Alcohol') . ' <i>' . _('is not to be served') . '</i>'; } break; case 'service_description': if ($value == '') { $return[] = _('Service description') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Service description') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'comment': if ($value == '') { $return[] = _('Comment') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Comment') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'infoscreen_txt': if ($value == '') { $return[] = _('Text on infoscreen') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Text on infoscreen') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'invoice': if ($value) { $return[] = _('Invoice') . ' <i>' . _('should be made') . '</i>'; } else { $return[] = _('Invoice') . ' <i>' . _('should not be made') . '</i>'; } break; case 'invoice_info': case 'invoice_internal_comment': if ($value == '') { $return[] = _('Invoice') . ' - ' . _('Internal comment') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Invoice') . ' - ' . _('Internal comment') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'invoice_comment': if ($value == '') { $return[] = _('Invoice') . ' - ' . _('Comment') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Invoice') . ' - ' . _('Comment') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'invoice_ref_your': if ($value == '') { $return[] = _('Invoice') . ' - ' . _('Your reference') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Invoice') . ' - ' . _('Your reference') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'invoice_electronic': if ($value) { $return[] = _('Invoice') . ' <i>' . _('is to be sendt by e-mail') . '</i> (' . _('E-delivery') . ')'; } else { $return[] = _('Invoice') . ' <i>' . _('is to be sendt by regular mail') . '</i> (' . _('Not') . ' ' . strtolower(_('E-delivery')) . ')'; } break; case 'invoice_email': if ($value == '') { $return[] = _('Invoice') . ' - ' . _('E-mail') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Invoice') . ' - ' . _('E-mail') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'invoice_address_id': if ($value == 0) { $return[] = _('Invoice') . ' - ' . _('Address') . ' <i>' . _('not set') . '</i>'; } else { $address = getAddress($value); if (count($address)) { $return[] = _('Invoice') . ' - ' . _('Address') . ' ' . $middlestring . ' <i>' . str_replace("\n", ', ', $address['address_full']) . '</i>'; } else { $return[] = _('Invoice') . ' - ' . _('Address') . ' ' . $middlestring . ' "' . $value . '"'; } } break; case 'invoice_content': if (!is_array($value)) { $return[] = _('Invoice') . ' - ' . _('Content') . ' has got syntax error in the log.'; } else { foreach ($value as $linenr => $line) { $return[] = _('Invoice') . ' - ' . _('Content') . ' - ' . _('line') . ' <i>' . $linenr . '</i> ' . $middlestring . ': ' . _('name') . ': <i>' . $line['name'] . '</i>, ' . 'pris/stk: <i>' . $line['belop_hver'] . '</i>, ' . _('amount') . ': <i>' . $line['antall'] . '</i>, ' . _('tax') . ': <i>' . $line['mva'] * 100 . '%</i>, ' . 'sum u/MVA: <i>' . $line['belop_sum_netto'] . '</i>'; } } break; case 'program_id': if ($value == 0) { $return[] = _('Fixed program') . ' <i>' . _('not set') . '</i>'; } else { $program = getProgram($value); if (count($program)) { $return[] = _('Fixed program') . ' ' . $middlestring . ' <i>' . $program['program_name'] . '</i>'; } else { $return[] = _('ID of fixed program') . ' ' . $middlestring . ' "' . $value . '"'; } } break; case 'entry_type_id': if ($value == 0) { $return[] = _('Entry type') . ' <i>' . _('not set') . '</i>'; } else { $entry_type = getEntryType($value); if (count($entry_type)) { $return[] = _('Entry type') . ' ' . $middlestring . ' <i>' . $entry_type['entry_type_name'] . '</i>'; } else { $return[] = _('ID of entry type') . ' ' . $middlestring . ' "' . $value . '"'; } } break; case 'confirm_id': $return[] = '<a href="entry_confirm_view.php?confirm_id=' . $value . '">' . _('Confirmation sent') . '</a>'; break; case 'confirm_comment': $return[] = _('Comment') . ': ' . $value; break; default: if (substr($index, 0, 11) == 'email_faild') { $return[] = _('Confirmation was <b>not sent</b> to') . ' <i>' . $value . '</i>'; break; } elseif (substr($index, 0, 5) == 'email') { $return[] = _('Confirmation was sent to') . ' <i>' . $value . '</i>'; break; } if (is_array($value)) { $return[] = $index . ' = ' . print_r($value, true); } else { $return[] = $index . ' = ' . $value; } break; } } } return $return; }
<?php session_start(); if (!isset($_SESSION['user']) || $_SESSION['user']->u_status != 1) { header("Location: index.php"); exit; } include 'functions.php'; $page = 'profile'; $address = getAddress($_SESSION['user']->u_zip); $age = getAge($_SESSION['user']->u_birthday); $membershipDuration = displayDate($_SESSION['user']->u_register_date, '2'); $userTimeline = getUserTimeline($_SESSION['user']->u_id); if ($_SESSION['user']->u_gender == 'Male') { $genderIcon = 'fa-male'; } else { if ($_SESSION['user']->u_gender == 'Female') { $genderIcon = 'fa-female'; } else { $genderIcon = 'fa-genderless'; } } $dietStatus = dietStatus(); $isUpUpdateRequired = isUpUpdateRequired(); if ($dietStatus) { $dietStats = getDietStats(); if ($dietStats->ds_progress == 'P') { $icon_diet_progres_class = 'fa fa-smile-o fa-2x'; $progress_status = ''; } else { if ($dietStats->ds_progress == 'N') {
<?php session_start(); require('db.class.php/db.class.php'); $DB = new DB(); function getAddress(){ /*** check for https ***/ $protocol = $_SERVER['HTTPS'] == 'on' ? 'https' : 'http'; /*** return the full address ***/ return $protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; } if(isset($_REQUEST['logout'])){ unset($_SESSION['loggedin']); } if(!isset($_SESSION['loggedin']) || strlen(trim($_SESSION['loggedin'])) == 0){ $_SESSION['referer'] = getAddress(); header('Location: /riot/jobtracker/login.php'); } ?>
} echo '</td> </tr>' . chr(10); echo '<tr> <td align="right"><b>' . _('E-mail') . ':</b> </td> <td>'; echo $entry['invoice_email']; echo '</td> </tr>' . chr(10); echo '<tr> <td align="right"><b>' . _('Address') . ':</b> </td> <td>'; if ($entry['invoice_address_id'] == 0) { echo '<i>' . _('Non selected') . '</i>'; } else { $address = getAddress($entry['invoice_address_id']); if (count($address)) { echo nl2br($address['address_full']); } else { echo _('Address not found'); } } echo '</td> </tr>' . chr(10); echo '<tr> <td align="right"><b>' . _('Your referance') . ':</b> </td> <td>'; echo $entry['invoice_ref_your']; echo '</td> </tr>' . chr(10); echo '<tr>
echo ' <img id="image" src="http://graph.facebook.com/' . $pid . '/picture?type=large" class="avatar" style="padding: 5px">'; echo ' </div>'; echo ' <div class="wall-right">'; echo ' <div style="height: 50%; white-space: nowrap;">'; echo ' <span style="padding-right: 5px; float: right; color: rgba(0,0,0,0.45);">'; $d = substr($j2['time'], 0, 10); if ($d == date('Y-m-d')) { echo ' 今天 '; } else { if ($d == date('Y-m-d', strtotime('yesterday'))) { echo ' 昨天 '; } else { echo ' ' . $d . ' '; } } echo substr($j2['time'], strrpos($j2['time'], ' '), 6); echo '</span>'; echo ' <span style="float: left;"><b>乘客: ' . $name . '</b></span><br/>'; echo ' </div>'; echo ' <div style="height: 50%;">'; echo ' <span style="float: left;">共乘距離: ' . $dis . '公尺</span><br/>'; echo ' <button class="mdl-button mdl-js-button mdl-button--icon" style="color: #00AAAA; float: right;"><i class="material-icons">info</i></button>'; echo ' <span style="text-align: left; color: rgba(0,0,0,0.75);">起點:<br/>' . getAddress(json_encode($path[0])) . '號<br/></span>'; echo ' <span style="text-align: left; color: rgba(0,0,0,0.75);">終點:<br/>' . getAddress(json_encode($path[count($path) - 1])) . '號</span>'; echo ' </div>'; echo ' </div>'; echo '</div>'; $index++; } } }
switch ($step) { case "send": $tts = 0; $start = microtime(true); $dontlog = 0; if (!($handler = @fopen('logs/list' . $list_id . '-msg' . $msg_id . '.txt', 'a+'))) { $dontlog = 1; } $limit = $row_config_globale['sending_limit']; $mail = new PHPMailer(); $mail->CharSet = $row_config_globale['charset']; $mail->PluginDir = "include/lib/"; $newsletter = getConfig($cnx, $list_id, $row_config_globale['table_listsconfig']); $mail->From = $newsletter['from_addr']; $mail->FromName = strtoupper($row_config_globale['charset']) == "UTF-8" ? $newsletter['from_name'] : iconv("UTF-8", $row_config_globale['charset'], $newsletter['from_name']); $addr = getAddress($cnx, $row_config_globale['table_email'], $list_id, $begin, $limit); switch ($row_config_globale['sending_method']) { case "smtp": $mail->IsSMTP(); $mail->Host = $row_config_globale['smtp_host']; if ($row_config_globale['smtp_auth']) { $mail->SMTPAuth = true; $mail->Username = $row_config_globale['smtp_login']; $mail->Password = $row_config_globale['smtp_pass']; } break; case "smtp_gmail": $mail->IsSMTP(); $mail->SMTPAuth = true; $mail->SMTPSecure = 'tls'; $mail->Host = "smtp.gmail.com";
<?php require_once 'connect.php'; switch ($_GET["queryName"]) { case "getAddress": getAddress($_GET["customerId"]); break; } //------------------------------------------------------------------------------------------------------------- // HIGHEST SLIDE //------------------------------------------------------------------------------------------------------------- function getAddress($customerId) { $query = mysql_query("SELECT address FROM customer WHERE customerId = '" . $customerId . "';"); $result = mysql_fetch_array($query); echo $_GET['callback'] . '(' . "{'address' :'" . $result['address'] . "'}" . ')'; } ?>
function templateAssignEntry($var, $entry) { global ${$var}; if (count($entry)) { ${$var}->assign('entry_id', $entry['entry_id']); ${$var}->assign('entry_name', $entry['entry_name']); ${$var}->assign('entry_title', $entry['entry_title']); ${$var}->assign('confirm_email', $entry['confirm_email']); if ($entry['confirm_email']) { ${$var}->assign('confirm_email2', _('yes')); } else { ${$var}->assign('confirm_email2', _('no')); } ${$var}->assign('entry_type_id', $entry['entry_type_id']); if ($entry['entry_type_id'] == 0) { $entry_type = _('Non selected'); } else { $entry_type = getEntryType($entry['entry_type_id']); if (count($entry_type)) { $entry_type = $entry_type['entry_type_name']; } else { $entry_type = 'ERROR'; } } ${$var}->assign('entry_type', $entry_type); ${$var}->assign('num_person_child', $entry['num_person_child']); ${$var}->assign('num_person_adult', $entry['num_person_adult']); ${$var}->assign('num_person_count', $entry['num_person_count']); if ($entry['num_person_count']) { ${$var}->assign('num_person_count2', _('yes')); } else { ${$var}->assign('num_person_count2', _('no')); } ${$var}->assign('program_id', $entry['program_id']); $program = getProgram($entry['program_id']); if (count($program)) { ${$var}->assign('program_id_name', $program['program_name']); ${$var}->assign('program_id_desc', $program['program_desc']); } else { ${$var}->assign('program_id_name', ''); ${$var}->assign('program_id_desc', ''); } ${$var}->assign('program_description', $entry['program_description']); ${$var}->assign('service_alco', $entry['service_alco']); if ($entry['service_alco']) { ${$var}->assign('service_alco2', _('yes')); } else { ${$var}->assign('service_alco2', _('no')); } ${$var}->assign('service_description', $entry['service_description']); ${$var}->assign('comment', $entry['comment']); ${$var}->assign('infoscreen_txt', $entry['infoscreen_txt']); ${$var}->assign('time_start', $entry['time_start']); ${$var}->assign('time_end', $entry['time_end']); ${$var}->assign('room_id', $entry['room_id']); // Room $rooms = array(); if (!count($entry['room_id'])) { $rooms[] = _('Whole area'); } elseif (count($entry['room_id']) == '1') { // Single room foreach ($entry['room_id'] as $rid) { if ($rid == '0') { $rooms[] = _('Whole area'); } else { $room = getRoom($rid); if (count($room)) { $rooms[] = $room['room_name']; } else { $rooms[] = 'ERROR'; } } } } else { foreach ($entry['room_id'] as $rid) { if ($rid != '0') { $room = getRoom($rid); if (count($room)) { $rooms[] = $room['room_name']; } else { $rooms[] = 'ERROR'; } } } } if (!count($rooms)) { $rooms[] = _('Whole area'); } ${$var}->assign('room', implode(', ', $rooms)); ${$var}->assign('rooms', $rooms); ${$var}->assign('area_id', $entry['area_id']); // Area $area = getArea($entry['area_id']); if (count($area)) { $area = $area['area_name']; } else { $area = 'ERROR'; } ${$var}->assign('area', $area); ${$var}->assign('user_assigned', $entry['user_assigned']); ${$var}->assign('user_assigned2', $entry['user_assigned2']); // User_assigned_names $names = array(); $names2 = array(); foreach ($entry['user_assigned'] as $user_id) { if ($user_id != 0) { $user = getUser($user_id); if (count($user)) { $names[] = $user['user_name']; $names2[] = '<a href="user.php?user_id=' . $user['user_id'] . '">' . $user['user_name'] . '</a>'; } else { $names[] = 'ERROR'; $names2[] = 'ERROR'; } } } if ($entry['user_assigned2'] != '') { $names[] = $entry['user_assigned2']; $names2[] = $entry['user_assigned2']; } if (!count($names)) { $names[] = _('Nobody'); $names2[] = _('Nobody'); ${$var}->assign('user_assigned_any', false); } else { ${$var}->assign('user_assigned_any', true); } ${$var}->assign('user_assigned_names', implode(', ', $names)); ${$var}->assign('user_assigned_names2', implode(', ', $names2)); ${$var}->assign('customer_id', $entry['customer_id']); ${$var}->assign('customer_name', $entry['customer_name']); ${$var}->assign('contact_person_name', $entry['contact_person_name']); ${$var}->assign('contact_person_phone', $entry['contact_person_phone']); ${$var}->assign('contact_person_email', $entry['contact_person_email']); ${$var}->assign('customer_municipal_num', $entry['customer_municipal_num']); ${$var}->assign('customer_municipal', $entry['customer_municipal']); ${$var}->assign('created_by', $entry['created_by']); // created_by_name $user = getUser($entry['created_by']); if (count($user)) { ${$var}->assign('created_by_name', $user['user_name']); } else { ${$var}->assign('created_by_name', ''); } ${$var}->assign('time_created', $entry['time_created']); ${$var}->assign('edit_by', $entry['edit_by']); // Edit_by_names $names = array(); foreach ($entry['edit_by'] as $user_id) { $user = getUser($user_id); if (count($user)) { $names[] = $user['user_name']; } else { $names[] = 'ERROR'; } } if (!count($names)) { $names[] = _('Nobody'); } ${$var}->assign('edit_by_names', implode(', ', $names)); ${$var}->assign('time_last_edit', $entry['time_last_edit']); ${$var}->assign('user_last_edit', $entry['user_last_edit']); $user = getUser($entry['user_last_edit']); if (count($user)) { ${$var}->assign('user_last_edit_name', $user['user_name']); } else { ${$var}->assign('user_last_edit_name', ''); } ${$var}->assign('rev_num', $entry['rev_num']); ${$var}->assign('invoice', $entry['invoice']); if ($entry['invoice'] == '1') { ${$var}->assign('invoice2', true); ${$var}->assign('invoice3', _('yes')); } else { ${$var}->assign('invoice2', false); ${$var}->assign('invoice3', _('no')); } ${$var}->assign('invoice_status', $entry['invoice_status']); switch ($entry['invoice_status']) { case '0': ${$var}->assign('invoice_status2', _('not to be made')); break; case '1': ${$var}->assign('invoice_status2', 'skal lages, ikke klar'); break; case '2': ${$var}->assign('invoice_status2', 'skal lages, klar til fakturering'); break; case '3': ${$var}->assign('invoice_status2', 'faktura laget og sendt'); break; case '4': ${$var}->assign('invoice_status2', 'betalt'); break; } ${$var}->assign('invoice_electronic', $entry['invoice_electronic']); if ($entry['invoice_electronic'] == '1') { ${$var}->assign('invoice_electronic2', true); ${$var}->assign('invoice_electronic3', _('yes')); } else { ${$var}->assign('invoice_electronic2', false); ${$var}->assign('invoice_electronic3', _('no')); } ${$var}->assign('invoice_email', $entry['invoice_email']); ${$var}->assign('invoice_comment', $entry['invoice_comment']); ${$var}->assign('invoice_internal_comment', $entry['invoice_internal_comment']); ${$var}->assign('invoice_ref_your', $entry['invoice_ref_your']); ${$var}->assign('invoice_address_id', $entry['invoice_address_id']); $invoice_address = getAddress($entry['invoice_address_id']); if (count($invoice_address)) { ${$var}->assign('invoice_address', $invoice_address['address_full']); } else { ${$var}->assign('invoice_address', ''); } ${$var}->assign('invoice_content', $entry['invoice_content']); ${$var}->assign('mva_vis', $entry['mva_vis']); ${$var}->assign('mva', $entry['mva']); ${$var}->assign('mva_grunnlag', $entry['mva_grunnlag']); ${$var}->assign('mva_grunnlag_sum', $entry['mva_grunnlag_sum']); ${$var}->assign('faktura_belop_sum', $entry['faktura_belop_sum']); ${$var}->assign('faktura_belop_sum_mva', $entry['faktura_belop_sum_mva']); ${$var}->assign('eks_mva_tot', $entry['eks_mva_tot']); ${$var}->assign('grunnlag_mva_tot', $entry['grunnlag_mva_tot']); } }
<?php // grab array of library name ids (login names) $name_id = getNameIDs(); // loop through these for the panel display for ($i = 0; $i < count($name_id); $i++) { // smaller functions used for future flexibility $nameid = $name_id[$i]; $id = getID($name_id[$i]); $url = getURL($name_id[$i]); $name = getName($name_id[$i]); $building = getBuilding($name_id[$i], 'at '); $description = getDescription($name_id[$i]); $notes = getHoursNotes($name_id[$i]); $map = getMapCode($name_id[$i]); $address = getAddress($name_id[$i]); $phone = getPhone($name_id[$i]); $accessurl = getAccessURL($name_id[$i]); $currentdate = date('Y-m-d'); $currenttime = date('H:i:s'); ?> <a name="view-<?php echo $nameid; ?> "></a> <div id="<?php echo $nameid; ?> " class="branch">
public function setFrom( $x ) { $this-> setFromName(getName($x)); $this-> setFromAddress(getAddress($x)); }
function sentora_LoginLink($params) { echo '<a href="' . getAddress($params) . '/" target="_blank" style="color:#cc0000">Login to Control Panel</a>'; }
<?php function getAddress() { $apiAddr = ["url" => "http://api.ipify.org/?format=json"]; $response = json_decode(file_get_contents($apiAddr["url"]), true); echo $response["ip"]; } ?> <html> <head> <title>SHOW YOUR GLOBAL IP ADRESS</title> </head> <body> <p>YOUR GLOBAL IP ADDRESS IS <b><?php getAddress(); ?> </b></p> </body> </html>
echo '(BID' . $id . ') UKJENT BOOKING (ikke funnet i databasen)'; } else { echo date('d-m-Y', $thisentry['time_start']) . ' - ' . '<a href="entry.php?entry_id=' . $thisentry['entry_id'] . '">' . $thisentry['entry_name'] . '</a>' . ' (BID' . $id . ')'; } echo '<br>'; break; } } exit; } foreach ($to_invoice as $invoice_var => $invoice_value) { $invoice->{$invoice_var} = $invoice_value; } $new_datafrom = true; if ($invoice->invoice_to_address_id > 0) { $address = getAddress($invoice->invoice_to_address_id); if (count($address)) { $invoice->invoice_to_line1 = $address['address_line_1']; $invoice->invoice_to_line2 = $address['address_line_2']; $invoice->invoice_to_line3 = $address['address_line_3']; $invoice->invoice_to_line4 = $address['address_line_4']; $invoice->invoice_to_line5 = $address['address_line_5']; $invoice->invoice_to_line6 = $address['address_line_6']; $invoice->invoice_to_line7 = $address['address_line_7']; } else { $invoice->invoice_to_address_id = ''; } } else { $invoice->invoice_to_address_id = ''; } if ($invoice->invoice_to_customer_id > 0) {
$company = trim($_GET['company']); $rawlat = trim($_GET['lat']); $rawlng = trim($_GET['lng']); $latlng = getSnappedLatLng($rawlat, $rawlng); $lat = $latlng[0]; $lng = $latlng[1]; $mVehicle = new Vehicle($vehicle); if ($mVehicle == null || $mVehicle->getCompany() != $company) { $setupResponse->status = "FAILURE"; $error = new Error(); $error->reason = "VEHICLE ERROR"; $error->message = "No such vehicle exists"; $result->error = $error; } else { if ($mVehicle->getIMEI() == $imei) { $addressInfo = getAddress($lat, $lng); $address = $addressInfo->results[0]->formatted_address; $city = getCity($addressInfo->results[0]); //echo $address." ".$city; if ($city != "" && $mVehicle->getCurrentCity() != $city) { $vehicleId = $mVehicle->getId(); $driver = $mVehicle->getDriver(); Notification::addLocationNotification($driver, $vehicleId, $lat, $lng, $city); } if (isset($_GET['accuracy']) && $_GET['accuracy'] <= 20) { if ($mVehicle->setLocation($lat, $lng, $address, $city) && $mVehicle->addTrack($lat, $lng, $address)) { $setupResponse->status = "SUCCESS"; $setupResponse->request = "location, track"; } } else { if ($mVehicle->setLocation($lat, $lng, $address, $city)) {
} //make sure we always get some data (default to a Weather feed) /** * getAddress * @get the full url of the current page (protocol + host + request URI including parameters) * @return string */ function getAddress() { //$protocol = $_SERVER['HTTPS'] == 'on' ? 'https' : 'http'; /*** check for https ***/ $protocol = 'https'; return $protocol . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; /*** return the full address ***/ } //parse the passed in URL using parameterized query object (could add validation here, see: http://www.scriptol.com/how-to/parsing-url.php ) $arr = parse_url(getAddress()); //use PHP convenience function for full address $parameters = $arr["query"]; parse_str($parameters, $param); //$format = $param['f']; //examples: &f=xml | &f=json | &f=html (for more MIME-Types, see: http://en.wikipedia.org/wiki/Mime_type) $format = 'json'; //$encoding = $param['e']; //examples: &e=utf-8 | &e=iso-8859-1 | &e=Shift-JIS (for more Character Encodings, see: http://en.wikipedia.org/wiki/Character_encoding) //$e = (!empty($encoding)) ? $encoding : "utf-8"; //might want to limit allowed charset/encoding types $e = 'utf-8'; header('Cache-Control: no-cache, must-revalidate'); //force fresh request header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Set your return content type, based on the expected response type... switch ($format) { case "xml": case "xsl":
function transfer($details, $fromAccount = true) { // The sending account and the database: global $verifiedAccount, $dz; if (!isset($details['ToAddress'])) { // Get an address for the username (inline updates details): getAddress($details); } // Get the commodity: $commodity = $details['Commodity']; // The amount too: $amount = $details['Amount']; // Get the to address: $toAddress = $details['ToAddress']; // Is this an internal transfer? (I.e. within this same bank): $internalTransfer = !$toAddress; $balance = null; // Is it coming from the bank itself, or from an account? if ($fromAccount) { // Find a suitable 'from' balance. // (There should only ever be one. Just in case though, we don't want to lock more than one row): $balance = $dz->get_row('select `ID` from `Bank.Account.Balances` where `Account`=' . $verifiedAccount . ' and `Commodity`="' . $commodity . '" and `Amount`>=' . $amount); if (!$balance) { // Not enough funds in the right currency. error('account/nofunds'); } // Lock the amount in that balance row. // If a locked amount is present at startup then a crash occured during a transaction. // If it's severe, the balances can be rebuilt from the transaction history. $locked = $dz->query('update `Bank.Account.Balances` set `LockedAmount`=`LockedAmount`+' . $amount . ',`Amount`=`Amount`-' . $amount . ' where `ID`=' . $balance['ID'] . ' and `Amount`>=' . $amount); // Did we successfully lock? if (!$locked) { // Not enough funds in the right currency. error('account/nofunds'); } // Ok! We've locked the balance. // Create a transaction row: $dz->query('insert into `Bank.Transactions`(`Account`,`Type`,`Reference`,`ItemInformation`,`Amount`,`Commodity`,`Username`,`Title`,`TimeAt`,`Name`) values(' . $verifiedAccount . ',2,"' . escape($details['Reference'], false) . '","' . escape($details['ItemInformation'], false) . '",' . $amount . ',"' . $commodity . '","' . $details['Username'] . '","' . escape($details['Title'], false) . '",' . time() . ',"' . escape($details['Name'], false) . '")'); } if ($internalTransfer) { // It's an internal transaction. // Name needs to be changed first (it's the name of the sender, which we don't know at this point): $details['Name'] = ''; // Update the receiving account: receive($details); } else { // Interbank transfer. // Need to select some suitable balances to use to send with. // For now, we'll just assume that a single balance can be found that has enough in it: $balanceRow = $dz->get_row('select `Bank.Balances`.`Key`,`Bank.Balances`.`Private`,`Root.Balances`.`Balance` from `Bank.Balances` left join `Root.Balances` on `Root.Balances`.`Key`=`Bank.Balances`.`Key` where `Root.Balances`.`Commodity`="' . $commodity . '" and `Root.Balances`.`Balance`>=' . $amount); if (!$balanceRow) { // This bank doesn't have a single balance with enough funds in it. // A more advanced implementation would combine multiple balances to ensure there's enough. // For now though, and to avoid making the consumer freak out, we'll just say the transaction amount is too high: error('amount/toohigh'); } // Get the from address: $fromAddress = bin2hex($balanceRow['Key']); // Get the target group: $toGroup = $details['ToGroup']; if (strlen($toAddress) != 130) { // It's binary. $toAddress = bin2hex($toAddress); } // Perform a global transfer now: globalTransfer($fromAddress, $toAddress, $toGroup, $amount, $balanceRow['Balance'], $balanceRow['Private']); } // Success! if ($balance) { // Now unlock the amount in the sender: $dz->query('update `Bank.Account.Balances` set `LockedAmount`=`LockedAmount`-' . $amount . ' where ID=' . $balance['ID']); } }
} echo '<HTML> <HEAD> <TITLE>JM-booking</TITLE><LINK REL="stylesheet" href="default/mrbs.css" type="text/css"> <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1"> <script type="text/javascript" src="js/bsn.AutoSuggest_2.1.3_comp.js"></script> </HEAD> <body> '; $invoice_address_full = ''; $invoice_address_id = ''; if ($data['customer_address_id_invoice'] != 0) { $invoice_address_id = $data['customer_address_id_invoice']; $thisADDR = getAddress($data['customer_address_id_invoice']); if (count($thisADDR)) { $invoice_address_full = $thisADDR['address_full']; } } if (!isset($_GET['returnToInvoiceCreate'])) { echo '<script language="javascript"> function chooseCustomer () { if (top.opener && !top.opener.closed) { thisid = top.opener.document.getElementById(\'customer_id\'); thisid.value = \'' . $data['customer_id'] . '\'; thisname = top.opener.document.getElementById(\'customer_name\');
function getAddressFromEntry($entry, $key) { if ($entry[$key . '_id'] == 0) { return ''; } else { $address = getAddress($entry[$key . '_id']); if (!count($address)) { // -> No address found return ''; } else { // -> Address found, returning full address return $address['address_full']; } } }
if (argsLen($args, 1)) { getCrew($args[0]); } else { incorrect(); } break; case 'getCrewCycle': if (argsLen($args, 1)) { getCrewCycle($args[0]); } else { incorrect(); } break; case 'getAddress': if (argsLen($args, 1)) { getAddress($args[0]); } else { incorrect(); } break; case 'getWorksite': if (argsLen($args, 1)) { getWorksite($args[0]); } else { incorrect(); } break; case 'getPosition': if (argsLen($args, 1)) { getPosition($args[0]); } else {
/** * returns 'getAdress' * leiab addressi atribuutid 'street, 'city', 'country' * @author rainer, armin * @param string $street * @param string $city * @param string $country * @return number välja * @echo 'Kuu Paide Soome' */ function getAddress($street = '', $city = '', $country = '') { if (mb_strlen($street) > 10) { $modifiedStreet = ucfirst($street); } else { if (mb_strlen($street) > 5) { $modifiedStreet = strlen($street); } else { mb_strlen($street) < 5; } } $rowOfStreet = '<br/>' . $modifiedStreet; $country = ucfirst($country); $address = $street + ' ' + $city + ' ' + $country; return $address; } $street = "Oja"; echo 'Ja ilusad aadressid on ' . getAddress(Jalaka, Kihnu, Eesti); echo 'Istu. Tubli. Viis.'; echo getAddress('Kuu', 'Paide', 'Soome'); // $target= 'city'
$location_list = getLocations(); $entry_styles = array('1' => '手持ち出店', '2' => '手持ち出店(プロ)', '3' => '車出店', '4' => '車出店(プロ)'); $booth_fee_list = array(0, 500, 1000, 1500, 2000, 2500, 3000); $event_numbers = array(); // \DB::query('TRUNCATE TABLE fleamarkets')->execute(); // \DB::query('TRUNCATE TABLE fleamarket_entry_styles')->execute(); // \DB::query('TRUNCATE TABLE fleamarket_abouts')->execute(); // \DB::query('TRUNCATE TABLE locations')->execute(); for ($i = 1; $i <= 2000; $i++) { $group_code = array_rand($group_codes); $group_code_name = $group_codes[$group_code]; $register_type = array_rand($register_types); // 開催地情報 $location_name = array_rand($location_list, 1); $location = $location_list[$location_name]; list($prefecture, $address) = getAddress($location); $prefecture_id = array_search($prefecture, $prefectures); $location_line = array('branch_id' => null, 'name' => $location_name, 'zip' => '100-0001', 'prefecture_id' => $prefecture_id, 'address' => $address, 'googlemap_address' => $location, 'register_type' => $register_types[$register_type], 'created_user' => 0, 'updated_user' => null, 'created_at' => \Date::forge()->format('mysql')); $location = \Model_Location::forge($location_line); $location->save(); $location_id = $location->location_id; // フリマ情報 if (isset($event_numbers[$group_code])) { $event_number = ++$event_numbers[$group_code]; } else { $event_number = $event_numbers[$group_code] = 1; } $event_status = array_rand($event_statuses); $event_reservation_status = array_rand($event_reservation_statuses); $event_month = array_rand($event_months); $event_day = array_rand($event_days);
if ($config['sendback']) { $client->sendtoaddress(getAddress($trans), $trans['amount'] - $trans['amount'] * $config['fee']); } else { $client->sendtoaddress($config['ownaddress'], $trans['amount'] - $trans['amount'] * $config['fee']); } mysql_query("INSERT INTO `transactions` (`id`, `amount`, `topay`, `address`, `state`, `tx`, `date`) VALUES (NULL, '" . $trans['amount'] . "', '0', '0', '3', '" . $trans['txid'] . "', " . time() . ");"); print $trans['amount'] + " - Payment has been sent to you!\n"; continue; } } $query = mysql_query('SELECT * FROM `transactions` WHERE `tx` = "' . $trans['txid'] . '";'); if (!mysql_fetch_assoc($query)) { $amount = $trans['amount']; $topay = $amount * (1.0 + $config['income']); print "Transaction added! [" . $amount . "]\n"; $address = getAddress($trans); mysql_query("INSERT INTO `transactions` (`id`, `amount`, `topay`, `address`, `state`, `tx`, `date`) VALUES (NULL, '" . $amount . "', '" . $topay . "', '" . $address . "', '0', '" . $trans['txid'] . "', " . time() . ");"); } } $query = mysql_query("SELECT SUM(amount) FROM `transactions`;"); $query = mysql_fetch_row($query); $money = $query[0]; $query = mysql_query("SELECT SUM(topay) FROM `transactions` WHERE `state` > 0;"); $query = mysql_fetch_row($query); $money -= $query[0]; $query = mysql_query("SELECT * FROM `transactions` WHERE `state` = 0 AND `topay` > 0 ORDER BY `id` ASC;"); while ($row = mysql_fetch_assoc($query)) { print "Money: " . $money . "\n"; if ($money < $row['topay']) { break; }
$pagetitle = "Contacts"; $navtitle = 'Contacts'; $keywords = ''; $description = ''; include "/srv/athenace/lib/shared/common.php"; include "/srv/athenace/lib/intranet/common.php"; include "/srv/athenace/lib/shared/functions_form.php"; $pagetitle = "Contacts"; include "../tmpl/header.php"; ?> <h1>Contacts</h1> <?php if (isset($_GET['id']) && is_numeric($_GET['id'])) { $sqltext = "SELECT * FROM contacts,address WHERE contacts.addsid=address.addsid AND contactsid=?"; // print $sqltext; $q = $db->select($sqltext, array($_GET['id']), 'i'); $r = $q[0]; tablerow("Name", $r->fname . ' ' . $r->sname); tablerow("Company Name", $r->co_name); tablerow("Role", $r->role); tablerow("Notes", $r->notes); $addsid = $r->addsid; $adds = getAddress($r->addsid); include "/srv/athenace/lib/shared/adds.view.php"; } ?> <?php include "../tmpl/footer.php";
// Should the from username be private? $privateUsername = safe('customer_privacy', VALID_NUMBER, $merchant, true); if ($privateUsername) { // Clear the from username: $fromUsername = ''; } // Get the item info (discounts are optional): $products = safe('products', VALID_ARRAY, $data); $discounts = safe('discounts', VALID_ARRAY, $data, true); // Notify is typically the information that goes on the back of a receipt. // It's a good place to add things like promotions or available deals. $notify = escape(safe('notify', true, $merchant, true)); $itemInfo = cleanProducts($products, $discounts, $notify); // Get an address to send to: $transferData = array('Commodity' => $priceCommodity, 'Amount' => $total, 'ItemInformation' => $itemInfo, 'Reference' => $reference, 'Username' => $toUsername, 'Title' => $title, 'Name' => $toName); if ($toAddress) { // Put the address in the transfer data: $transferData['ToAddress'] = $toAddress; // Get the group ID: $transferData['ToGroup'] = safe('group', VALID_NUMBER, $merchant); } else { // Get an address: getAddress($transferData); } $addr = $transferData['ToAddress']; $toGroup = $transferData['ToGroup']; // Add it to the database and assign an ID. $dz->query('insert into `Bank.Checkouts.Pending`(`CheckoutData`,`Reference`,`ItemInformation`,`Amount`,`Commodity`,`Username`,`Title`,`Name`,`ToAddress`,`ToGroup`,`FromUsername`) values ("' . escape($rawData, false) . '","' . $reference . '","' . escape($itemInfo, false) . '",' . $total . ',"' . $priceCommodity . '","' . $toUsername . '","' . $title . '","' . $toName . '",unhex("' . $addr . '"),' . $toGroup . ',"' . $fromUsername . '")'); $id = $dz->insert_id(); // Output the summary which will be displayed to the user: echo '{"id":' . $id . ',"merchant":{"name":"' . $toName . '"},"commodity":{"tag":"' . $priceCommodity . '","name":"' . $comRow['Name_en'] . '","divisor":' . $comRow['Divisor'] . '},"total":' . $total . ',"delay":' . $delay . ',"ready":' . $ready . ',"title":"' . $title . '"}';