| 15261 |
anikendra |
1 |
<div class="container">
|
|
|
2 |
<?php echo $this->Form->create('NotificationCampaign'); ?>
|
|
|
3 |
<div class="row">
|
|
|
4 |
<div class="col-lg-12">
|
|
|
5 |
<h3>Raw sql to fetch users</h3>
|
|
|
6 |
<?php echo $this->Form->input('sql',array('type'=>'textarea','id'=>'UserSql'));?>
|
|
|
7 |
</div>
|
|
|
8 |
</div>
|
| 15583 |
anikendra |
9 |
<div class="mt20 row">
|
|
|
10 |
<!--<div class="col-lg-10 updatesql">SELECT User.id,User.email,Brand.brand FROM users User LEFT JOIN brand_preferences Brand ON User.id = Brand.user_id WHERE (Brand.brand = 'Micromax' AND Brand.category_id = 3) OR Brand.brand IS NULL</div>-->
|
|
|
11 |
<ul class="list list-unstyled sqlrules">
|
| 15834 |
anikendra |
12 |
<li>
|
|
|
13 |
<div class="label label-info">Unique users with brand preferences set as Micromax or not set at all</div>
|
|
|
14 |
<div class="clearfix"></div>
|
| 19373 |
naman |
15 |
<div class="col-lg-10 updatesql">SELECT User.id, User.email, Brand.brand FROM users User LEFT JOIN brand_preferences Brand ON User.id = Brand.user_id LEFT JOIN devices d ON d.user_id = User.id WHERE (Brand.brand = 'Micromax' AND Brand.category_id =3) OR Brand.brand IS NULL GROUP BY d.imeinumber order by User.id DESC</div>
|
| 15583 |
anikendra |
16 |
<div class="col-lg-2">
|
|
|
17 |
<button type="button" class="btn btn-primary sqlslecter">Use This</button>
|
|
|
18 |
</div>
|
|
|
19 |
</li>
|
| 15834 |
anikendra |
20 |
<li>
|
|
|
21 |
<div class="label label-info">All unique Users</div>
|
|
|
22 |
<div class="clearfix"></div>
|
| 21104 |
amit.gupta |
23 |
<div class="col-lg-10 updatesql">SELECT distinct d1.user_id from devices d1 left join devices d2 on (d1.imeinumber = d2.imeinumber and d1.created < d2.created) where d2.id is null</div>
|
| 15583 |
anikendra |
24 |
<div class="col-lg-2">
|
|
|
25 |
<button type="button" class="btn btn-primary sqlslecter">Use This</button>
|
|
|
26 |
</div>
|
|
|
27 |
</li>
|
| 21258 |
amit.gupta |
28 |
<li>
|
|
|
29 |
<div class="label label-info">Test Notification</div>
|
|
|
30 |
<div class="clearfix"></div>
|
| 21259 |
amit.gupta |
31 |
<div class="col-lg-10 updatesql">SELECT distinct d1.user_id from devices d1 left join devices d2 on (d1.imeinumber = d2.imeinumber and d1.created < d2.created) where d2.id is null and d1.user_id in (168,14,47,30916)</div>
|
| 21258 |
amit.gupta |
32 |
<div class="col-lg-2">
|
|
|
33 |
<button type="button" class="btn btn-primary sqlslecter">Use This</button>
|
|
|
34 |
</div>
|
|
|
35 |
</li>
|
| 15834 |
anikendra |
36 |
<li>
|
|
|
37 |
<div class="label label-info">Unique users with price preferences set in range of 5000 or not set at all</div>
|
|
|
38 |
<div class="clearfix"></div>
|
| 15721 |
anikendra |
39 |
<div class="col-lg-10 updatesql">SELECT User.id, User.email, ifnull(P.min_price,0), ifnull(P.max_price,0) FROM users User LEFT JOIN price_preferences P ON User.id = P.user_id LEFT JOIN devices d ON d.user_id = User.id WHERE (P.min_price <= 5000 AND P.max_price >= 5000 AND P.category_id =3) OR P.min_price is NULL GROUP BY d.imeinumber order by User.id DESC</div>
|
| 15583 |
anikendra |
40 |
<div class="col-lg-2">
|
|
|
41 |
<button type="button" class="btn btn-primary sqlslecter">Use This</button>
|
|
|
42 |
</div>
|
|
|
43 |
</li>
|
| 15834 |
anikendra |
44 |
<li>
|
|
|
45 |
<div class="label label-info">Unique users with Samsung in brand preferences or clicks or filters or search terms or orders</div>
|
|
|
46 |
<div class="clearfix"></div>
|
|
|
47 |
<div class="col-lg-10 updatesql">select User.id from users User LEFT JOIN devices d ON d.user_id = User.id where User.id in (select userids from pushnotificationusergroups where brand = 'Samsung') GROUP BY d.imeinumber order by User.id DESC</div>
|
| 15721 |
anikendra |
48 |
<div class="col-lg-2">
|
|
|
49 |
<button type="button" class="btn btn-primary sqlslecter">Use This</button>
|
|
|
50 |
</div>
|
|
|
51 |
</li>
|
| 15834 |
anikendra |
52 |
<li>
|
|
|
53 |
<div class="label label-info">Unique users with Samsung in brand preferences or clicks or filters or search terms or orders and price preference in range of 5000</div>
|
|
|
54 |
<div class="clearfix"></div>
|
|
|
55 |
<div class="col-lg-10 updatesql">select User.id from users User LEFT JOIN devices d ON d.user_id = User.id where User.id in (select userids from pushnotificationusergroups where brand = 'Samsung' and category_id = 3 and min_price < 5000 and 5000 < max_price) GROUP BY d.imeinumber order by User.id DESC</div>
|
| 15721 |
anikendra |
56 |
<div class="col-lg-2">
|
|
|
57 |
<button type="button" class="btn btn-primary sqlslecter">Use This</button>
|
|
|
58 |
</div>
|
| 15834 |
anikendra |
59 |
</li>
|
| 17458 |
manish.sha |
60 |
<li>
|
|
|
61 |
<div class="label label-info">Unique users with Samsung in brand preferences or clicks or filters or search terms or orders or product views</div>
|
|
|
62 |
<div class="clearfix"></div>
|
|
|
63 |
<div class="col-lg-10 updatesql">select User.id from users User LEFT JOIN devices d ON d.user_id = User.id where User.id in (select distinct user_id from newuserlinkssegmentation where brand = 'Samsung') GROUP BY d.imeinumber order by User.id DESC</div>
|
|
|
64 |
<div class="col-lg-2">
|
|
|
65 |
<button type="button" class="btn btn-primary sqlslecter">Use This</button>
|
|
|
66 |
</div>
|
|
|
67 |
</li>
|
| 15583 |
anikendra |
68 |
</ul>
|
| 15261 |
anikendra |
69 |
</div>
|
|
|
70 |
<div class="row">
|
|
|
71 |
<h3>Enter message</h3>
|
|
|
72 |
<?php //echo $this->Form->create('User',array('action'=>'push')); ?>
|
|
|
73 |
<?php echo $this->Form->input('name',array('label'=>'Campaign Name','required'=>true));?>
|
|
|
74 |
<?php echo $this->Form->input('title');?>
|
| 19313 |
manas |
75 |
<?php echo $this->Form->input('notification_long_text',array('type'=>'textarea','id'=>'notification_long_text'));?>
|
| 21258 |
amit.gupta |
76 |
<?php echo $this->Form->input('image', array('label'=>'Image Url'));?>
|
| 15261 |
anikendra |
77 |
<?php echo $this->Form->input('type',array('type'=>'select','options' => array('url'=>'Url','native'=>'Native','update'=>'Update')));?>
|
|
|
78 |
<?php echo $this->Form->input('url');?>
|
|
|
79 |
<?php echo $this->Form->input('expiresat',array('type'=>'datetime'));?>
|
| 17489 |
manish.sha |
80 |
<?php echo $this->Form->input('sendsms',array('type'=>'checkbox'));?>
|
| 19075 |
naman |
81 |
<?php $notitype=array("GENERAL_NOTIFICATION"=>"GENERAL_NOTIFICATION","BATCH_CREDIT"=>"BATCH_CREDIT");
|
|
|
82 |
echo $this->Form->input('notification_type', array('options'=>$notitype, 'selected'=>'GENERAL_NOTIFICATION'));?>
|
| 17432 |
manish.sha |
83 |
<?php echo $this->Form->input('messagetext', array('size'=>130,'maxlength'=>130,'placeholder'=>' Max Length 130 Character(s)'));?>
|
| 15261 |
anikendra |
84 |
<button type="submit" class="btn btn-success btn-block notifyusers">Send</button>
|
|
|
85 |
</div>
|
|
|
86 |
<?php echo $this->Form->end();?>
|
| 19313 |
manas |
87 |
</div>
|