Posts

php - count in model scopes() function -

i'm trying count total matches found in scopes , scope works , returns every other column, except count() public function scopes() { return array( 'test'=> array( 'alias' => 'd', 'select'=> array('d.id, d.picture, d.store, d.address, d.postcode, d.city, d.state, count(*) totalads'), 'join' => 'join `ads` v', 'condition'=>'d.is_new="0" , v.pending!="1" , d.id = v.id', 'group'=>'v.id' ), } in view i'm trying data using $data->totalads error when use print_r($data->totalads) the error property "store.totalads" not defined. i'm using yii 1.1.15 as error states, totalads not defined. you define totalads statistical relation in class...

sql - MYSQL | Subtract one field from another but 1 field is created of subquery -

select e.`employee_id`, e.`full_name`, le.`no_of_leaves` allocatedleaves, mllt.`leave_type` leavetypename, (select count(*) leave_approval employee_id = 1 , month(approval_date) = 11 group approval_date) totalleavestaken, le.`no_of_leaves` - totalleavestaken balance employee e inner join leave_entitlement le on e.`employee_id` = le.`employee_id` inner join `ml_leave_type` mllt on mllt.`ml_leave_type_id` = le.`ml_leave_type_id` left join leave_approval la on e.`employee_id` = la.`employee_id` left join leave_application lapp on lapp.`application_id` = la.`leave_application_id` left join ml_leave_type mlltla on mlltla.`ml_leave_type_id` = lapp.`ml_leave_type_id` error code: 1054 unknown column 'totalleavestaken' in 'field list' this have tried do, got error.. le.`no_of_leaves` - totalleavestaken balance im not in databases, have subtract 1 field another, first field ok, second field generated of subquery. dont want run subquery again, possible way subtraction ...

java - Dealing with ArrayOfXsdAnyType -

my wsdl file element looks this <element name="gethemodialysishospitalresponse"> <complextype ><sequence><element name="gethemodialysishospitalreturn" type="impl:arrayof_xsd_anytype"/></sequence> </complextype> </element> when try data in soap ui i’m getting response request <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://serviceimpl.com.echannelling"> <soapenv:header/> <soapenv:body> <ser:gethemodialysishospital/> </soapenv:body> </soapenv:envelope> response <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <soapenv:body> <gethemodialysishospitalresponse xmlns="http://serviceimpl.com.echannelling"...

javascript - How do I gather multiple jQuery objects into one jQuery object? -

say have these variables: var container = $("div#my-awesome-section"); var foo_input = $("input[name=foo]", container); var bar_input = $("input[name=bar]", container); i want bind event handler both inputs. hoped work: $([foo_input, bar_input]).on("keypress", function() { /* ... */ }); but alas, no. there convenient way of gathering multiple jquery objects 1 purposes this? use in add() in jquery adding jquery object foo_input.add(bar_input).on("keypress", function() { /* ... */ });

html - Encrypting src attribute of iframe control -

this question has answer here: what practice approach hide private url? 2 answers i using iframe load pdf file temporary location , looks shown below <iframe id="mypdf" width="100%" height="100%" src="config\temp\tmp_report_0.pdf"></iframe> this load pdf file browser window, inside iframe. question how can hide 'src' value being visible user when right click , select 'view source' browser. the intention here enrcypt/hide 'src' value users. suggestions? you can use generic handler hide file location. inside handler serve file base on url parameter. here basic example: <iframe id="mypdf" width="100%" height="100%" src="openreport.ashx?reportid=2129938212"></iframe> now can/must encrypt url parameter avoid download report...

database - Multi valued column in SQL -

i created table boat contains following columns: bname, type, price, oname . however, type column should 1 of following: sailboat, houseboat, or deckboat. how can reflect on create table statement. i've searched , came statement i'm not sure if it's right or not: create table boat ( bname varchar(255), btype int, price double, oname varchar(255), primary key (bname), foreign key (btype) references botype(id) ); create table botype ( id int primary key, type varchar(255) ) is best way it? you can try this: mycol varchar(10) not null check (mycol in('moe', 'curley', 'larry')) here more details on mssql "check constraints": http://technet.microsoft.com/en-us/library/ms188258%28v=sql.105%29.aspx

Adding pre-defined static SVG to a Leaflet map doesn't work -

i need add control contains several pre-defined svg elements. display contours of regions off-shore europe. have different zoom levels. hovering on main country should highlight corresponding off-shore regions. clicking on 1 of them moves main map region. other this, no behaviour required. the svg not render. class svg-control using l.control.extend: l.insets = l.control.extend({ options: { position: 'bottomleft' }, initialize: function () { this._insets = { "fr93":{translate: {x: 118, y:-485}, paths:["m-66 513l-76 531l-80 535l-89 533l-94 536l-99 533l-95 529l-93 521l-97 513l-98 504l-91 494l-81 498l-68 507l-66 512z"]}, "fr91_2":{translate: {x: 192, y:-353}, paths:["m-177 373l-178 370l-175 372l-177 373z", "m-179 375l-180 376l-180 371l-179 375z","m-173 394l-174 389l-170 393l-171 394z"]} } }, onadd: function (map) { // create dom elem...