Subversion Repositories SmartDukaan

Rev

Rev 14781 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<div class="container">
        <div class="row">
                <div class="col-lg-12">
                        <h3>Raw sql to fetch users</h3>
                        <?php echo $this->Form->create('User'); ?>                              
                        <?php echo $this->Form->input('sql',array('type'=>'textarea'));?>
                        <?php echo $this->Form->end(__('Submit')); ?>
                </div>
        </div>
        <div class="row well">          
                <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>
                <div class="col-lg-2">
                        <button type="button" class="btn btn-primary sqlslecter">Use This</button>
                </div>
        </div>
        <hr/>
        <?php if(!empty($users)):?>
                <h3>Enter message and choose users</h3>         
                <?php echo $this->Form->create('User',array('action'=>'push')); ?>                              
                <?php echo $this->Form->input('name',array('label'=>'Campaign Name','required'=>true));?>
                <?php echo $this->Form->input('title');?>
                <?php echo $this->Form->input('message');?>
                <?php echo $this->Form->input('type',array('type'=>'select','options' => array('url'=>'Url','native'=>'Native','update'=>'Update')));?>
                <?php echo $this->Form->input('url');?>
                <?php echo $this->Form->input('expiresat',array('type'=>'datetime'));?>
                <?php echo $this->Form->input('sendsms',array('type'=>'checkbox'));?>
                <?php echo $this->Form->input('messagetext');?>
                <button type="button" class="btn btn-success notifyusers">Send</button>
                <div class="row">
                        <div class="col-lg-6">Email</div>
                        <div class="col-lg-6"><input type="checkbox" class="pushtoalll" value="1"/> 
                </div>
                <?php foreach ($users as $key => $user) :?>
                <div class="row">
                        <div class="col-lg-6"><?php echo $user['User']['email'];?></div>
                        <div class="col-lg-6"><input type="checkbox" name="userIds[]" class="userIds" value="<?php echo $user['User']['id'];?>"/></div>
                </div>
                <?php endforeach;?>
                <?php echo $this->Form->end();?>
        <?php endif;?>
</div>