/** * 为CURD提供关联数据 */ public function assignRelateData() { $this->location = province($this->province_id) . city($this->city_id); // $this->doctorNum = $this->doctor->count(); // $this->departmentNum = $this->department->count(); $this->agencyNum = $this->getAllAgency()->count(); $this->deviceNum = $this->getCurrentDevice()->count(); }
public function showServer() { return ' <dl> <dt>Name:</dt><dd>' . $this->name . '</dd> <dt>IP:</dt><dd>' . $this->ip . '</dd> <dt>Location:</dt><dd>' . city($this->latitude, $this->longitude) . '</dd> <dt>Rules:</dt><dd>ETF2L 6 vs. 6</dd> </dl>'; }
function cities($citiesInput) { $citiesArray = explode("\n", trim($citiesInput)); $citiesOutput = "<ul>\n"; foreach ($citiesArray as $value) { $thisCity = trim($value); if ($thisCity) { $citiesOutput .= "\t<li>" . city($thisCity) . "</li>\n"; } } $citiesOutput .= "</ul>\n"; print $citiesOutput; }
/** * @param $mid 模型ID * @param $content 内容 * @return array 处理完成,返回数组 */ public function parse($mid, $content) { if (empty($content)) { return array(); } $fieldRes = $this->where('modelid', $mid)->query(); $ncontent = array(); foreach ($fieldRes as $field) { if ($field['formtype'] == 'pictures') { $content[$field['name']] = unserialize($content[$field['name']]); } elseif ($field['formtype'] == 'areaSelect') { $area = explode(',', $content[$field['name']]); $level = 0; $content[$field['name']] = array(); foreach ($area as $id) { if ($id != null) { if ($level == 0) { $content[$field['name']]['province'] = array('id' => $id, 'name' => province($id)); } elseif ($level == 1) { $content[$field['name']]['city'] = array('id' => $id, 'name' => city($id)); } elseif ($level == 2) { $content[$field['name']]['district'] = array('id' => $id, 'name' => district($id)); } } $level++; } } elseif ($field['formtype'] == 'tags') { //如果类型是tags则将此字段设置为数组 $content[$field['name']] = explode(',', $content[$field['name']]); } //处理转义 $ncontent[$field['name']] = $this->stripslashes($content[$field['name']]); } unset($content); return $ncontent; }
break; case 'anunturi': require "assets/includes/anunturi.php"; break; case 'users': require "assets/includes/users.php"; break; case 'dealers': require "assets/includes/dealers.php"; break; case 'raportate': require "assets/includes/raportate.php"; break; case 'city': require "assets/includes/city.php"; city(); break; case 'marci': require "assets/includes/marci.php"; marci(); break; case 'modele': require "assets/includes/modele.php"; break; case 'setari': require "assets/includes/setari.php"; break; case 'config': require "assets/includes/config.php"; break; case 'prelucrari':
function address() { $box_number = mt_rand(100, 999); $road = road(); $city = city(); $state = 'NC'; $zip = '28000'; $add['line1'] = "{$box_number} {$road}"; $add['city'] = $city; $add['county'] = '095'; // not figuring this yet $add['state'] = $state; $add['zip'] = $zip; return $add; }
?> </b></p> <?php cities("\n\tAllamuchy\n\tAsbury\n\tAsbury\n\tBelvidere\n\tBlairstown\n\tBroadway\n\tButtzville\n\tChangewater\n\tColumbia\n\tDelaware\n\tFrelinghuysen Township\n\tGreat Meadows\n\tHackettstown\n\tHarmony Township\n\tHope\n\tIndependence Township\n\tJohnsonburg\n\tJohnsonburg\n\tLiberty\n\tMansfield\n\tMilford\n\tOxford\n\tPhillipsburg\n\tPort Murray\n\tStewartsville\n\tVienna\n\tWashington\n\tWhite Township\n"); ?> <p><b><?php echo city('Union County'); ?> </b></p> <?php cities("\n\tChatham\n\tMadison\n\tSummit\n"); ?> <p><b><?php echo city('Middlesex County'); ?> </b></p> <?php cities("\n\tDunellen\n\tEdison\n\tMiddlesex\n\tNew Brunswick\n\tPiscataway\n"); ?> <p><b>Pennsylvania Cities</b></p> <?php cities("\n\tEaston, PA\n\tAllentown, PA\n\tStroudsburg, PA\n"); ?> <p>Please note that not ALL cities and counties we service are listed. If you have any questions about our services in your area, please <a href="mailto:drg@artofperio.com">contact us</a>.</p> </div> <?php /*