<div class="col-md-12 " ng-controller="EditSmsCampaignController">
    <ul class="breadcrumb">
        <li><a href="#/sms/viewcampaign">{{'label.view.viewcampaign' | translate}}</a></li>
        <li class="active">{{'label.anchor.editsmscampaign' | translate}}</li>
    </ul>
    <br/>
    <div  class="col-sm-12 form-horizontal well">
        <div>
            <form name="editsmscampaign" novalidate="" class="form-horizontal" rc-submit="submit()">
                <api-validate></api-validate>
                <fieldset>
                    <legend>{{'label.heading.createsmscampaign' | translate}}</legend>
                    <div class="form-group">
                        <label class="control-label col-sm-2">{{ 'label.input.campaignname' | translate }}<span class="required">*</span></label>
                        <div class="col-sm-3">
                            <input type="text" name="campaignName" required late-Validate ng-model="formData.campaignName" class="form-control" ></textarea>
                        </div>
                        <div class="col-sm-3" >
                            <form-validate valattributeform="editsmscampaign" valattribute="campaignName"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-2">
                            {{'label.input.campaigntype' | translate}} <span class="required">*</span>
                        </label>

                        <div class="col-sm-3">
                            <div >
                                <select  id="campaignType" ng-model="campaignType"  class="form-control"
                                        ng-options="smsCampaignType.name for smsCampaignType in smsCampaignTypes"
                                        name="campaignType" required>
                                    <option value="" style="display:none;">--{{'label.menu.selectcampaigntype' | translate}}--</option>
                                </select>
                            </div>
                        </div>

                        <div class="col-sm-3" >
                            <form-validate valattributeform="editsmscampaign" valattribute="campaigntype"/>
                        </div>
                    </div>
                    <div class="form-group" ng-switch="campaignType.value" ng-show="campaignType.value==2">
                        <label class="control-label col-sm-2">{{ 'label.input.recurrencestartdate' | translate }}<span
                                class="required">*</span></label>

                        <div class="col-sm-3"  ng-switch-when="2">
                            <input id="recurrenceStartDate" name="recurrenceStartDate" sort type="text" datepicker-pop="dd MM yyyy" ng-model="formData.recurrenceStartDate"
                                   class="form-control" is-open="opened" min="minDate" max="restrictDate" required/>
                        </div>

                        <div class="col-sm-3" >
                            <form-validate valattributeform="createsmscampaign" valattribute="recurrenceStartDate"/>
                        </div>
                    </div>
                    <div class="form-group" ng-switch="campaignType.value" ng-show="campaignType.value==2">
                        <label class="control-label col-sm-2">{{ 'label.input.recurrence' | translate }}<span
                                class="required">*</span></label>

                        <div class="col-sm-3"  ng-switch-when="2">
                            <input type="text" name="recurrence" required late-Validate ng-model="formData.recurrence" class="form-control" ></textarea>
                        </div>

                        <div class="col-sm-3" >
                            <form-validate valattributeform="createsmscampaign" valattribute="recurrence"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-2">
                            {{'label.input.useevent' | translate}} <span class="required">*</span>
                        </label>

                        <div class="col-sm-3">
                            <div >
                                <select chosen="reports" id="runReportId" ng-model="formData.runReportId"  class="form-control"
                                        ng-options="report.report_id as report.report_name for report in reports" value="{{report}}"
                                        name="runReportId" required late-Validate ng-change="changeReport(formData.report)">
                                    <option value="" style="display:none;">--{{'label.menu.selectevent' | translate}}--</option>
                                </select>
                            </div>
                        </div>

                        <div class="col-sm-3" >
                            <form-validate valattributeform="editsmscampaign" valattribute="reportId"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-2" for="textarea">{{ 'label.input.message' | translate }}<span
                                class="required">*</span></label>
                        <div class="col-sm-3">
                            <textarea rows="3"  required late-Validate name="message" class="form-control" id="textarea" ng-model="formData.message"></textarea>
                        </div>

                        <div class="col-sm-3" >
                            <form-validate valattributeform="editsmscampaign" valattribute="message"/>
                        </div>
                    </div>
                    <div class="col-md-offset-2">
                        <a id="cancel" href="#/sms/viewcampaign" class="btn btn-default">{{'label.button.cancel' | translate}}</a>
                        <button id="save" type="submit" class="btn btn-primary"  has-permission='UPDATE_SMS_CAMPAIGN'>{{'label.button.update' | translate}}</button>
                    </div>
                </fieldset>
            </form>
        </div>


    </div>
</div>