<script>
(function($) {
  $(document).ready(function() {
      $('#scheduleprofiles option').each(function (index) {
          if (index == 1)
          {
              $(this).html('<img src="/contents/socioboard/images/fb_icon.png">' + $(this).html());
          }
          //if (index == 2 || index == 3)
          //{
          //     $(this).html('<img src="/contents/socioboard/images/Fb_page-icon.png">' + $(this).html());
          //}
          if (index == 2) {
              $(this).html('<img src="/contents/socioboard/images/Fb_page-icon.png">' + $(this).html());
          }
           if (index == 3)
          {
               $(this).html('<img src="/contents/socioboard/images/twticon.png">' + $(this).html());
          }
           if (index == 4)
          {
               $(this).html('<img src="/contents/socioboard/images/link_icon.png">' + $(this).html());
          }
           if (index == 5)
          {
               $(this).html('<img src="/contents/socioboard/images/link_icon.png">' + $(this).html());
          }
      //$(this).html('<img src="http://jsfiddle.net/img/logo.png">' + $(this).html());
    })
  });
})(jQuery);
</script>
<style type="text/css">
    md-dialog {
        opacity: 1 !important;
    }
    ul.shinh li label {
        font-size: 15px;
        color: #333;
        padding: 0 10px;
        color: #ff4081;
    }
    ul.shinh li:hover {
        background: #e5e5e5;
        color: #ff4081;
        cursor: pointer;
        padding: 0 10px;
    }
    ul.shinh li label input {
        margin-right: 10px;
        height: 20px;
        width: 20px;
        background: transparent !important;
    }

    .iconprofile {
        position: absolute;
        top: 36px;
        z-index: 1;
        left: 44px;
    }
</style>
    
<div data-ng-controller="ScheduleMessageController">
            <!-- Page name -->

            <!--<div class="container">
                <div class="col m6">
                    <h4>Schedule Message</h4> 
                </div>
                <div class="col m6">
                    <a href="#/">Setting</a>
                </div>
            </div>-->



            <!-- START CONTENT -->
            <section id="content">
                <!-- Compose Email Structure -->
                <div class="row">
                    <div class="col s12 m12">
                        <ul class="tabs">
                            <li class="tab col s6"><a class="active" href="#sche_n">Scheduling</a></li>
                            <li class="tab col s6"><a href="#day_sche">Day wise scheduling</a></li>
                        </ul>
                    </div>
                    <!-- Normal scheduling -->       
                    <div id="sche_n" class="col s12">
                      <div class="card">
                        <div class="card-content">
                            <div class="row">
                               <form  name="scheduleform">
                                   <div class="col s12 m6">
                                       <div class="row">
                                           <div class="col s12">

                                               <ul class="col s12 shinh" id="checkboxdata" ng-if="!schedulemessage" style="max-height:250px; overflow-y:scroll;">
                                                   <li style="padding:5px 0;">
                                                       <label>
                                                   <!----------------<input  type="checkbox" style="visibility:visible;position:relative;left:5px; float:left" ng-model="allSelected" ng-model-options="{getterSetter: true}" />------------->
                                                           <input type="checkbox" style="visibility:visible;position:relative;left:5px; float:left" id="checkAll" onclick="check();" />
                                                           <span style="float:left;">Check All</span>
                                                       </label>
                                                   </li>
                                                   <!--<li ng-repeat="profile in lstProfiles |filter:query| filter:{profileType:0} | filter:{profileType:'!10'} | filter:{profileType:'!11'} | filter:{profileType:'!13' }" style="padding:5px 0;">
                                                       <label>
                                                           <input onclick="profile();" name="selector[]" class="subcheckbox" id="fb_{{profile.profileId}}" type="checkbox" style="visibility:visible;position: relative;left:5px;float:left" />
                                                           <img src="{{profile.profilePic}}" style="width:20px;float:left;margin-right: 5px;" />
                                                           <span style="float:left;">{{profile.profileName}}</span>
                                                           <span style="float:right;"><img ng-src="/contents/socioboard/images/fb_icon.png"></span>
                                                       </label>
                                                   </li>-->
                                                   <li ng-repeat="profile in lstProfiles |filter:query| filter:{profileType:1} | filter:{profileType:'!10'} | filter:{profileType:'!11'} | filter:{profileType:'!13'}" style="padding:5px 0;">
                                                       <label>
                                                           <input onclick="profile();" name="selector[]" class="subcheckbox" id="page_{{profile.profileId}}" type="checkbox" style="visibility:visible;position: relative;left:5px;float:left" />
                                                           <img src="{{profile.profilePic}}" style="width:20px;float:left;margin-right: 5px;" />
                                                           <span style="float:left;">{{profile.profileName}}</span>
                                                           <span style="float:right;"><img ng-src="/contents/socioboard/images/Fb_page-icon.png"></span>
                                                       </label>
                                                   </li>                                                                                                      
                                                   <li ng-repeat="profile in lstProfiles |filter:query| filter:{profileType:2}" style="padding:5px 0;">
                                                       <label>
                                                           <input name="selector[]" onclick="profile();" class="subcheckbox" id="tw_{{profile.profileId}}" type="checkbox" style="visibility:visible;position: relative;left:5px;float:left" />
                                                           <img src="{{profile.profilePic}}" style="width:20px;float:left;margin-right: 5px;" />
                                                           <span style="float:left;">{{profile.profileName}}</span>
                                                           <span style="float:right;"><img ng-src="/contents/socioboard/images/twticon.png"></span>
                                                       </label>
                                                   </li>
                                                   <li ng-repeat="profile in lstProfiles |filter:query | filter:{profileType:3} | filter:{profileType:'!13'}" style="padding:5px 0;">
                                                       <label>
                                                           <input name="selector[]" onclick="profile();" class="subcheckbox" id="lin_{{profile.profileId}}" type="checkbox" style="visibility:visible;position: relative;left:5px;float:left" />
                                                           <img src="{{profile.profilePic}}" style="width:20px;float:left;margin-right: 5px;" />
                                                           <span style="float:left;">{{profile.profileName}}</span>
                                                           <span style="float:right;"><img ng-src="/contents/socioboard/images/link_icon.png"></span>
                                                       </label>
                                                   </li>
                                                   <li ng-repeat="profile in lstProfiles |filter:query| filter:{profileType:4}" style="padding:5px 0;">
                                                       <label>
                                                           <input name="selector[]" onclick="profile();" class="subcheckbox" id="Cmpylinpage_{{profile.profileId}}" type="checkbox" style="visibility:visible;position: relative;left:5px;float:left" />
                                                           <img src="{{profile.profilePic}}" style="width:20px;float:left;margin-right: 5px;" />
                                                           <span style="float:left;">{{profile.profileName}}</span>
                                                           <span style="float:right;"><img ng-src="/contents/socioboard/images/link_icon.png"></span>
                                                       </label>
                                                   </li>
                                               </ul>


                                               <ul class="col s12 shinh" id="checkboxdata" ng-if="schedulemessage" style="max-height:250px; overflow-y:scroll;">
                                                   <li style="padding:5px 0;">
                                                       <label>
                                                           <!----------------<input  type="checkbox" style="visibility:visible;position:relative;left:5px; float:left" ng-model="allSelected" ng-model-options="{getterSetter: true}" />------------->
                                                           <input type="checkbox" style="visibility:visible;position:relative;left:5px; float:left" id="checkAll" onclick="check();" />
                                                           <span style="float:left;">Check All</span>
                                                       </label>
                                                   </li>
                                                   
                                                   <li ng-repeat="profile in lstProfiles |filter:query| filter:{profileType:0} | filter:{profileType:'!10'} | filter:{profileType:'!11'} | filter:{profileType:'!13' }" style="padding:5px 0;">
                                                       <label>
                                                           <input onclick="profile();" name="selector[]" class="subcheckbox" id="urlfb_{{profile.profileId}}" type="checkbox" style="visibility:visible;position: relative;left:5px;float:left" />
                                                           <img src="{{profile.profilePic}}" style="width:20px;float:left;margin-right: 5px;" />
                                                           <span style="float:left;">{{profile.profileName}}</span>
                                                           <span style="float:right;"><img ng-src="/contents/socioboard/images/fb_icon.png"></span>
                                                       </label>
                                                   </li>
                                                   <li  ng-repeat="profile in lstProfiles |filter:query| filter:{profileType:1} | filter:{profileType:'!10'} | filter:{profileType:'!11'} | filter:{profileType:'!13'}" style="padding:5px 0;">
                                                       <label>
                                                           <input onclick="profile();" name="selector[]" class="subcheckbox" id="urlpage_{{profile.profileId}}" type="checkbox" style="visibility:visible;position: relative;left:5px;float:left" />
                                                           <img src="{{profile.profilePic}}" style="width:20px;float:left;margin-right: 5px;" />
                                                           <span style="float:left;">{{profile.profileName}}</span>
                                                           <span style="float:right;"><img ng-src="/contents/socioboard/images/Fb_page-icon.png"></span>
                                                       </label>
                                                   </li>
                                                   <li ng-repeat="profile in lstProfiles |filter:query| filter:{profileType:2}" style="padding:5px 0;">
                                                       <label>
                                                           <input name="selector[]" onclick="profile();" class="subcheckbox" id="tw_{{profile.profileId}}" type="checkbox" style="visibility:visible;position: relative;left:5px;float:left" />
                                                           <img src="{{profile.profilePic}}" style="width:20px;float:left;margin-right: 5px;" />
                                                           <span style="float:left;">{{profile.profileName}}</span>
                                                           <span style="float:right;"><img ng-src="/contents/socioboard/images/twticon.png"></span>
                                                       </label>
                                                   </li>
                                                   <li ng-repeat="profile in lstProfiles |filter:query | filter:{profileType:3} | filter:{profileType:'!13'}" style="padding:5px 0;">
                                                       <label>
                                                           <input name="selector[]" onclick="profile();" class="subcheckbox" id="lin_{{profile.profileId}}" type="checkbox" style="visibility:visible;position: relative;left:5px;float:left" />
                                                           <img src="{{profile.profilePic}}" style="width:20px;float:left;margin-right: 5px;" />
                                                           <span style="float:left;">{{profile.profileName}}</span>
                                                           <span style="float:right;"><img ng-src="/contents/socioboard/images/link_icon.png"></span>
                                                       </label>
                                                   </li>
                                                   <li ng-repeat="profile in lstProfiles |filter:query| filter:{profileType:4}" style="padding:5px 0;">
                                                       <label>
                                                           <input name="selector[]" onclick="profile();" class="subcheckbox" id="Cmpylinpage_{{profile.profileId}}" type="checkbox" style="visibility:visible;position: relative;left:5px;float:left" />
                                                           <img src="{{profile.profilePic}}" style="width:20px;float:left;margin-right: 5px;" />
                                                           <span style="float:left;">{{profile.profileName}}</span>
                                                           <span style="float:right;"><img ng-src="/contents/socioboard/images/link_icon.png"></span>
                                                       </label>
                                                   </li>
                                               </ul>

                                               <!--<select multiple id="scheduleprofiles">
                                                   <option value="" disabled selected>Select Your Account</option>
                                                   <option ng-repeat="profile in lstProfiles | filter:{profileType:0}  | filter:{profileType:'!10'} | filter:{profileType:'!11'} | filter:{profileType:'!13'}" value="fb_{{profile.profileId}}" my-repeat-timeout-directive>  {{profile.profileName}} </option>
                                                   <option ng-repeat="profile in lstProfiles | filter:{profileType:1} | filter:{profileType:'!10'} | filter:{profileType:'!11'} | filter:{profileType:'!13'}" value="page_{{profile.profileId}}" my-repeat-timeout-directive>  {{profile.profileName}} </option>
                                                   <option ng-repeat="profile in lstProfiles | filter:{profileType:11}" value="page_{{profile.profileId}}" my-repeat-timeout-directive>  {{profile.profileName}} </option>
                                                   <option ng-repeat="profile in lstProfiles | filter:{profileType:2}" value="tw_{{profile.profileId}}" my-repeat-timeout-directive>  {{profile.profileName}} </option>
                                                   <option ng-repeat="profile in lstProfiles | filter:{profileType:3} | filter:{profileType:'!13'}" value="lin_{{profile.profileId}}" my-repeat-timeout-directive>  {{profile.profileName}} </option>
                                                   <option ng-repeat="profile in lstProfiles | filter:{profileType:4}" value="Cmpylinpage_{{profile.profileId}}" my-repeat-timeout-directive>  {{profile.profileName}} </option>
                                               </select>
                                               <label>Select Profiles</label>-->
                                           </div>
                                       </div>
                                       <!--<div class="row">
                                          
                                           <div class="input-field col s12 m4 l4">
                                           
                                               <input type="checkbox" class="filled-in" id="repeat_post" ng-model="hasChecked" ng-click="justChek(hasChecked)" />
                                               <label for="repeat_post">Repeat post</label>
                                           </div>
                                           <div class="input-field col s12 m4 l4">
                                               <input id="sche_day" type="number" min="0" ng-disabled="!hasChecked" class="validate">
                                               <label for="sche_day">Schedule at [ Days ]</label>
                                           </div>
                                           <div class="input-field col s12 m4 l4" ng-disabled="!hasChecked">
                                               <select id="timesRepeat">
                                                   <option value="">Choose time interval</option>
                                                   <option value=1>1</option>
                                                   <option value=2>2</option>
                                                   <option value=3>3</option>
                                               </select>
                                               <label>interval to repeat time</label>
                                           </div>
                                       </div>-->

                                       <div class="row no-space">
                                           <div class="input-field col s12">
                                               <div id="content" layout="column" flex>
                                                   <md-content flex layout="column" layout-align="center center" layout-padding>
                                                       <div layout="row" ng-form="demoForm">
                                                           <div layout-padding>
                                                               <div>
                                                                   <mdp-date-picker mdp-open-on-click required name="dateFormat" mdp-placeholder="(dd/mm/yyyy)" mdp-format="DD/MM/YYYY" ng-model="currentDate">
                                                                       <div ng-show="demoForm.dateFormat.$error.required">
                                                                           <div ng-message="required">This is required</div>
                                                                           <div ng-message="format">Invalid format</div>
                                                                       </div>
                                                                   </mdp-date-picker>
                                                               </div>
                                                           </div>
                                                           <div layout-padding>
                                                               <div>
                                                                   <mdp-time-picker mdp-open-on-click name="timeFormat" required ng-model="currentDate" mdp-format="HH:mm" mdp-placeholder="(hh/mm)">
                                                                       <div ng-show="demoForm.timeFormat.$error.required">
                                                                           <div ng-message="required">This is required</div>
                                                                           <div ng-message="format">Invalid format</div>
                                                                       </div>
                                                                   </mdp-time-picker>
                                                               </div>
                                                           </div>
                                                       </div>
                                                   </md-content>
                                               </div>
                                           </div>
                                       </div>
                                   </div>
                                   <div class="col s12 m6">
                                       <div class="row">
                                           <div class="input-field col s12">
                                               <div ng-if="!schedulemessage">
                                                   <textarea id="ScheduleMsg" class="materialize-textarea" ng-pattern="/^[a-z]+[@+!+#][a-z]*$/" ng-model="ScheduleMsg" required name="ScheduleMsgtxt" length="500"></textarea>
                                                   <label for="ScheduleMsg">Type Your Message Here</label>
                                               </div>
                                               <div ng-if="schedulemessage">                                                                                                                         
                                                   <textarea id="ScheduleMsg" disabled class="materialize-textarea active grey-text text-darken-4" ng-model="schedulemessage.url" ng-if="!grppost && !draftpost"  required name="ScheduleMsgtxt" length="500">{{schedulemessage.url}}</textarea>
                                                   <textarea id="ScheduleMsg" disabled class="materialize-textarea active grey-text text-darken-4" ng-model="schedulemessage.shareMessage" ng-if="grppost && !draftpost" required name="ScheduleMsgtxt" length="500">{{schedulemessage.shareMessage}}</textarea>                                                 
                                                   <textarea id="ScheduleMsg" class="materialize-textarea active" ng-model="schedulemessage.shareMessage" ng-if="draftpost" required name="ScheduleMsgtxt" length="500">{{schedulemessage.shareMessage}}</textarea>
                                                </div>
                                           </div>
                                           <span class="error-message" ng-show="scheduleform.ScheduleMsgtxt.$dirty && scheduleform.ScheduleMsgtxt.$invalid">
                                               <span style="color:red" ng-show="scheduleform.ScheduleMsgtxt.$error.required">Please enter Schedule Message</span>
                                           </span>

                                           <div class="col s12 m12 l12" >
                                               <p>Select your file [Ex: gif, jpeg, png, mp4, ...]</p>
                                           </div>
                                           <div class="col s12 m12 l12">
                                               <input type="hidden" id="imageUrl" value="{{schedulemessage.picUrl}}" />
                                               <div ng-if="schedulemessage">
                                                   <input type="file" id="input-file-now"  ng-if="schedulemessage.picUrl!=null" class="dropify" after-render data-default-file="{{schedulemessage.picUrl}}" />
                                                   <!--<input type="file" id="input-file-now" class="dropify" data-default-file="" />-->
                                               </div>
                                               <div ng-if="!schedulemessage">
                                                   <input type="file" id="input-file-now" class="dropify" after-render data-default-file="" />
                                               </div>

                                           </div>
                                       </div>
                                   </div>
                                   
                                   <!--week days start-->
                                   <!--<div class="row">
                                       <div class="input-field col s12 m4 l4">-->
                                           <!--<input type="checkbox" class="filled-in" id="repeat_post" ng-model="hasChecked" ng-click="repetition()"/> dont open it-->
                                           <!--<input type="checkbox" class="filled-in" id="on_of" ng-model="weekChecked" ng-click="weekdayChek(weekChecked)" />
                                           <label for="on_of">week days schedule</label>
                                       </div>
                                       <div class="col l5 m12 s12">
                                           <div class="card-content" ng-disabled="!weekChecked" >
                                               
                                               <div class="row no-space">
                                                   <div class="col l6 m6 s12 center">Monday</div>
                                                   <div class="col l6 m6 s12">
                                                       <div class="switch" ng-disabled="!weekChecked" >
                                                           <label>
                                                               Off
                                                               <input type="checkbox"  ng-model="SwitchedOn1" ng-if="numday < 0" ng-click="SwitchedOn(SwitchedOn1, 'Monday','0')">
                                                               <span class="lever"></span>
                                                               On
                                                           </label>
                                                       </div>
                                                   </div>
                                               </div>
                                               <div class="row no-space">
                                                   <div class="col l6 m6 s12 center">Tuesday</div>
                                                   <div class="col l6 m6 s12">
                                                       <div class="switch">
                                                           <label>
                                                               Off
                                                               <input type="checkbox" id="tue_val" ng-if="numday < 1" ng-disabled="!weekChecked" ng-model="SwitchedOn2" ng-click="SwitchedOn(SwitchedOn2,'Tuesday','1')">
                                                               <span class="lever"></span>
                                                               On
                                                           </label>
                                                       </div>
                                                   </div>
                                               </div>
                                               <div class="row no-space">
                                                   <div class="col l6 m6 s12 center">Wednesday</div>
                                                   <div class="col l6 m6 s12">
                                                       <div class="switch">
                                                           <label>
                                                               Off
                                                               <input type="checkbox" id="wed_val" ng-if="numday < 2" ng-disabled="!weekChecked" ng-model="SwitchedOn3" ng-click="SwitchedOn(SwitchedOn3,'Wednesday','2')">
                                                               <span class="lever"></span>
                                                               On
                                                           </label>
                                                       </div>
                                                   </div>
                                               </div>
                                               <div class="row no-space">
                                                   <div class="col l6 m6 s12 center">Thursday</div>
                                                   <div class="col l6 m6 s12">
                                                       <div class="switch">
                                                           <label>
                                                               Off
                                                               <input type="checkbox" id="thus_val" ng-if="numday < 3" ng-disabled="!weekChecked" ng-model="SwitchedOn4" ng-click="SwitchedOn(SwitchedOn4,'Thursday','3')">
                                                               <span class="lever"></span>
                                                               On
                                                           </label>
                                                       </div>
                                                   </div>
                                               </div>
                                               <div class="row no-space">
                                                   <div class="col l6 m6 s12 center">Friday</div>
                                                   <div class="col l6 m6 s12">
                                                       <div class="switch">
                                                           <label>
                                                               Off
                                                               <input type="checkbox" id="Fri_val" ng-if="numday < 4" ng-disabled="!weekChecked" ng-model="SwitchedOn5" ng-click="SwitchedOn(SwitchedOn5,'Friday','4')">
                                                               <span class="lever"></span>
                                                               On
                                                           </label>
                                                       </div>
                                                   </div>
                                               </div>
                                               <div class="row no-space">
                                                   <div class="col l6 m6 s12 center">Saturday</div>
                                                   <div class="col l6 m6 s12">
                                                       <div class="switch">
                                                           <label>
                                                               Off
                                                               <input type="checkbox" id="sat_val" ng-if="numday < 5" ng-disabled="!weekChecked" ng-model="SwitchedOn6" ng-click="SwitchedOn(SwitchedOn6,'Saturday','5')">
                                                               <span class="lever"></span>
                                                               On
                                                           </label>
                                                       </div>
                                                   </div>
                                               </div>
                                               <div class="row no-space">
                                                   <div class="col l6 m6 s12 center">Sunday</div>
                                                   <div class="col l6 m6 s12">
                                                       <div class="switch">
                                                           <label>
                                                               Off
                                                               <input type="checkbox" id="sun_val" ng-if="numday < 6" ng-disabled="!weekChecked" ng-model="SwitchedOn7" ng-click="SwitchedOn(SwitchedOn7,'Sunday','6')">
                                                               <span class="lever"></span>
                                                               On
                                                           </label>
                                                       </div>
                                                   </div>
                                               </div>

                                           </div>
                                       </div>
                                       <div class="col l7 m12 s12">
                                           <div class="card-content">
                                               <p>Post these x times <strong>Every Day</strong> :</p>
                                           </div>
                                       </div>
                                   </div>-->
                                   <!--week days End-->
                                   <!--date and time start-->
                                   
                                   <!--date and time end-->
                                         
                                    
                                   <!--<div ng-init="dispbtn= {{dispbtn}}"></div>-->
                                <div class="card-action" ng-if="!schedulemessage"  ng-show="dispbtn">
                                    <button ng-disabled="!((scheduleform.ScheduleMsgtxt.$dirty))" class="waves-effect waves-light btn grey darken-3" ng-click="schedulemsg()">Schedule</button>
                                    <button ng-disabled="!((scheduleform.ScheduleMsgtxt.$dirty))" class="waves-effect waves-light btn grey darken-2" ng-click="draftmsg()">Save To Draft</button>

                                    <button ng-disabled="!((scheduleform.ScheduleMsgtxt.$dirty))" class="waves-effect waves-light btn grey darken-2" ng-click="ComposeMessage()">Post Now</button>
                                </div>
                                   <div class="card-action" ng-if="schedulemessage" ng-show="dispbtn">
                                       <button  class="waves-effect waves-light btn grey darken-3" ng-model="schduledone" ng-click="schedulemsg()">Schedule</button>
                                       <button  class="waves-effect waves-light btn grey darken-2" ng-click="draftmsg()">Save To Draft</button>
                                       <button class="waves-effect waves-light btn grey darken-2" ng-click="ComposeMessage()">Post Now</button>
                                   </div>
                                   <div class="card-action" ng-show="!dispbtn">
                                       <a href="#" class="waves-effect waves-light btn grey darken-3">Wait</a>
                                   </div>
                               </form>
                            </div>
                        </div>
                       
                      </div>
                    </div>

                    <!-- Day wise scheduling start-->       
                    <div id="day_sche" class="col s12">
                        <div class="card">
                            <div class="card-content">
                                <div class="row">
                                    <form class="col s12" name="Dayscheduleform">
                                        <div class="row">
                                            <div class="col s12 m6">
                                                <div class="row">
                                                    <div class="col s12">

                                                        <ul class="col s12 shinh" id="checkboxdatadaywise" style="max-height:250px; overflow-y:scroll;">
                                                            <li style="padding:5px 0;">
                                                                <label>
                                                                    <!----------------<input  type="checkbox" style="visibility:visible;position:relative;left:5px; float:left" ng-model="allSelected" ng-model-options="{getterSetter: true}" />------------->
                                                                    <input type="checkbox" style="visibility:visible;position:relative;left:5px; float:left" id="checkAlldaywise" onclick="checkdaywise();" />
                                                                    <span style="float:left;">Check All</span>
                                                                </label>
                                                            </li>
                                                            <li ng-repeat="profile in lstProfiles |filter:query| filter:{profileType:0} | filter:{profileType:'!10'} | filter:{profileType:'!11'} | filter:{profileType:'!13' }" style="padding:5px 0;">
                                                                <label>
                                                                    <input onclick="profiledaywise();" name="selector[]" class="subcheckboxdaywise" id="fb_{{profile.profileId}}_SB" type="checkbox" style="visibility:visible;position: relative;left:5px;float:left" />
                                                                    <img src="{{profile.profilePic}}" style="width:20px;float:left;margin-right: 5px;" />
                                                                    <span style="float:left;">{{profile.profileName}}</span>
                                                                    <span style="float:right;"><img ng-src="/contents/socioboard/images/fb_icon.png"></span>
                                                                </label>
                                                            </li>
                                                            <li ng-repeat="profile in lstProfiles |filter:query| filter:{profileType:1} | filter:{profileType:'!10'} | filter:{profileType:'!11'} | filter:{profileType:'!13'}" style="padding:5px 0;">
                                                                <label>
                                                                    <input onclick="profiledaywise();" name="selector[]" class="subcheckboxdaywise" id="fb_{{profile.profileId}}_SB" type="checkbox" style="visibility:visible;position: relative;left:5px;float:left" />
                                                                    <img src="{{profile.profilePic}}" style="width:20px;float:left;margin-right: 5px;" />
                                                                    <span style="float:left;">{{profile.profileName}}</span>
                                                                    <span style="float:right;"><img ng-src="/contents/socioboard/images/Fb_page-icon.png"></span>
                                                                </label>
                                                            </li>
                                                            <li ng-repeat="profile in lstProfiles |filter:query| filter:{profileType:2}" style="padding:5px 0;">
                                                                <label>
                                                                    <input name="selector[]" onclick="profiledaywise();" class="subcheckboxdaywise" id="tw_{{profile.profileId}}_SB" type="checkbox" style="visibility:visible;position: relative;left:5px;float:left" />
                                                                    <img src="{{profile.profilePic}}" style="width:20px;float:left;margin-right: 5px;" />
                                                                    <span style="float:left;">{{profile.profileName}}</span>
                                                                    <span style="float:right;"><img ng-src="/contents/socioboard/images/twticon.png"></span>
                                                                </label>
                                                            </li>
                                                            <li ng-repeat="profile in lstProfiles |filter:query | filter:{profileType:3} | filter:{profileType:'!13'}" style="padding:5px 0;">
                                                                <label>
                                                                    <input name="selector[]" onclick="profiledaywise();" class="subcheckboxdaywise" id="lin_{{profile.profileId}}_SB" type="checkbox" style="visibility:visible;position: relative;left:5px;float:left" />
                                                                    <img src="{{profile.profilePic}}" style="width:20px;float:left;margin-right: 5px;" />
                                                                    <span style="float:left;">{{profile.profileName}}</span>
                                                                    <span style="float:right;"><img ng-src="/contents/socioboard/images/link_icon.png"></span>
                                                                </label>
                                                            </li>
                                                            <li ng-repeat="profile in lstProfiles |filter:query| filter:{profileType:4}" style="padding:5px 0;">
                                                                <label>
                                                                    <input name="selector[]" onclick="profiledaywise();" class="subcheckboxdaywise" id="Cmpylinpage_{{profile.profileId}}_SB" type="checkbox" style="visibility:visible;position: relative;left:5px;float:left" />
                                                                    <img src="{{profile.profilePic}}" style="width:20px;float:left;margin-right: 5px;" />
                                                                    <span style="float:left;">{{profile.profileName}}</span>
                                                                    <span style="float:right;"><img ng-src="/contents/socioboard/images/link_icon.png"></span>
                                                                </label>
                                                            </li>
                                                        </ul>

                                                        <!--<select multiple id="dayscheduleprofiles">
                                                            <option value="" disabled selected>Select Your Account</option>
                                                            <option ng-repeat="profile in lstProfiles | filter:{profileType:0}  | filter:{profileType:'!10'} | filter:{profileType:'!11'} | filter:{profileType:'!13'}" value="fb_{{profile.profileId}}" my-repeat-timeout-directive>  {{profile.profileName}} </option>
                                                            <option ng-repeat="profile in lstProfiles | filter:{profileType:1} | filter:{profileType:'!10'} | filter:{profileType:'!11'} | filter:{profileType:'!13'}" value="page_{{profile.profileId}}" my-repeat-timeout-directive>  {{profile.profileName}} </option>
                                                            <option ng-repeat="profile in lstProfiles | filter:{profileType:2}" value="tw_{{profile.profileId}}" my-repeat-timeout-directive>  {{profile.profileName}} </option>
                                                            <option ng-repeat="profile in lstProfiles | filter:{profileType:3} | filter:{profileType:'!13'}" value="lin_{{profile.profileId}}" my-repeat-timeout-directive>  {{profile.profileName}} </option>
                                                            <option ng-repeat="profile in lstProfiles | filter:{profileType:4}" value="Cmpylinpage_{{profile.profileId}}" my-repeat-timeout-directive>  {{profile.profileName}} </option>
                                                        </select>
                                                        <label>Select Profiles</label>-->
                                                    </div>
                                                </div>
                                                <!--date and time start-->
                                                <div class="row no-space">
                                                    <div class="input-field col s12">
                                                        <div id="content" layout="column" flex>
                                                            <md-content flex layout="column" layout-align="center center" layout-padding>
                                                                <div layout="row" ng-form="demoForm">
                                                                    <div layout-padding>
                                                                        <div>
                                                                            <mdp-time-picker mdp-open-on-click name="timeFormat" required ng-model="currentDate" mdp-format="HH:mm A" mdp-placeholder="(hh/mm)">
                                                                                <div ng-show="demoForm.timeFormat.$error.required">
                                                                                    <div ng-message="required">This is required</div>
                                                                                    <div ng-message="format">Invalid format</div>
                                                                                </div>
                                                                            </mdp-time-picker>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </md-content>
                                                        </div>
                                                    </div>
                                                </div>
                                                <!--date and time end-->
                                                <div class="row no-space">
                                                    <div class="input-field col s12 no-space">
                                                        <input type="checkbox" class="filled-in" id="repeat_post" ng-model="hasChecked" ng-click="repetition()" />
                                                        <input type="checkbox" class="filled-in" id="on_of" ng-model="weekChecked" ng-click="weekdayChek(weekChecked)" />
                                                        <label for="on_of">week days schedule</label>
                                                    </div>
                                                    <div class="col s12 no-space">
                                                        <div class="card-content" ng-disabled="!weekChecked">
                                                            <div class="row no-space">
                                                                <div class="col l6 m6 s12 center">Monday</div>
                                                                <div class="col l6 m6 s12">
                                                                    <div class="switch">
                                                                        <label>
                                                                            Off
                                                                            <input type="checkbox" ng-model="SwitchedOn1" ng-click="SwitchedOn(SwitchedOn1, 'Monday','1')"><!--ng-if="numday < 0" ng-disabled="!weekChecked"  -->
                                                                            <span class="lever"></span>
                                                                            On
                                                                        </label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="row no-space">
                                                                <div class="col l6 m6 s12 center">Tuesday</div>
                                                                <div class="col l6 m6 s12">
                                                                    <div class="switch">
                                                                        <label>
                                                                            Off
                                                                            <input type="checkbox" id="tue_val" ng-model="SwitchedOn2" ng-click="SwitchedOn(SwitchedOn2,'Tuesday','2')"><!--ng-if="numday < 1" ng-disabled="!weekChecked"-->
                                                                            <span class="lever"></span>
                                                                            On
                                                                        </label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="row no-space">
                                                                <div class="col l6 m6 s12 center">Wednesday</div>
                                                                <div class="col l6 m6 s12">
                                                                    <div class="switch">
                                                                        <label>
                                                                            Off
                                                                            <input type="checkbox" id="wed_val" ng-model="SwitchedOn3" ng-click="SwitchedOn(SwitchedOn3,'Wednesday','3')">   <!--ng-if="numday < 2" ng-disabled="!weekChecked"-->
                                                                            <span class="lever"></span>
                                                                            On
                                                                        </label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="row no-space">
                                                                <div class="col l6 m6 s12 center">Thursday</div>
                                                                <div class="col l6 m6 s12">
                                                                    <div class="switch">
                                                                        <label>
                                                                            Off
                                                                            <input type="checkbox" id="thus_val" ng-model="SwitchedOn4" ng-click="SwitchedOn(SwitchedOn4,'Thursday','4')">   <!--ng-if="numday < 3" ng-disabled="!weekChecked"-->
                                                                            <span class="lever"></span>
                                                                            On
                                                                        </label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="row no-space">
                                                                <div class="col l6 m6 s12 center">Friday</div>
                                                                <div class="col l6 m6 s12">
                                                                    <div class="switch">
                                                                        <label>
                                                                            Off
                                                                            <input type="checkbox" id="Fri_val" ng-model="SwitchedOn5" ng-click="SwitchedOn(SwitchedOn5,'Friday','5')">    <!--ng-if="numday < 4" ng-disabled="!weekChecked"-->
                                                                            <span class="lever"></span>
                                                                            On
                                                                        </label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="row no-space">
                                                                <div class="col l6 m6 s12 center">Saturday</div>
                                                                <div class="col l6 m6 s12">
                                                                    <div class="switch">
                                                                        <label>
                                                                            Off
                                                                            <input type="checkbox" id="sat_val" ng-model="SwitchedOn6" ng-click="SwitchedOn(SwitchedOn6,'Saturday','6')">  <!--ng-if="numday < 5" ng-disabled="!weekChecked"-->
                                                                            <span class="lever"></span>
                                                                            On
                                                                        </label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="row no-space">
                                                                <div class="col l6 m6 s12 center">Sunday</div>
                                                                <div class="col l6 m6 s12">
                                                                    <div class="switch">
                                                                        <label>
                                                                            Off
                                                                            <input type="checkbox" id="sun_val" ng-model="SwitchedOn7" ng-click="SwitchedOn(SwitchedOn7,'Sunday','0')">  <!--ng-if="numday < 6" ng-disabled="!weekChecked"-->
                                                                            <span class="lever"></span>
                                                                            On
                                                                        </label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col s12 m6">
                                                <div class="row">
                                                    <div class="input-field col s12">
                                                        <div ng-if="!schedulemessage">
                                                            <textarea id="dayScheduleMsg" class="materialize-textarea" ng-pattern="/^[a-z]+[@+!+#][a-z]*$/" ng-model="ScheduleMsg" required name="ScheduleMsgtxt" length="500"></textarea>
                                                            <label for="dayScheduleMsg">Type Your Message Here</label>
                                                        </div>
                                                        <div ng-if="schedulemessage">
                                                            <!--<textarea id="dayScheduleMsg" class="materialize-textarea active" ng-model="schedulemessage.shareMessage" ng-if="!grppost && !draftpost" required name="ScheduleMsgtxt" length="500">{{schedulemessage.shareMessage}}</textarea>
                                                            <textarea id="dayScheduleMsg" class="materialize-textarea active" ng-model="schedulemessage" ng-if="grppost" required name="ScheduleMsgtxt" length="500"></textarea>-->
                                                            <textarea id="dayScheduleMsg" class="materialize-textarea active" ng-model="schedulemessage.shareMessage" ng-if="draftpost" required name="ScheduleMsgtxt" length="500">{{schedulemessage.shareMessage}}</textarea>
                                                            <textarea id="dayScheduleMsg" disabled class="materialize-textarea active grey-text text-darken-4" ng-model="schedulemessage.url" ng-if="!grppost && !draftpost" required name="ScheduleMsgtxt" length="500">{{schedulemessage.url}}</textarea>
                                                            <textarea id="dayScheduleMsg" disabled class="materialize-textarea active grey-text text-darken-4" ng-model="schedulemessage.shareMessage" ng-if="grppost && !draftpost" required name="ScheduleMsgtxt" length="500">{{schedulemessage.shareMessage}}</textarea>     
                                                        </div>
                                                    </div>
                                                    <span class="error-message" ng-show="Dayscheduleform.ScheduleMsgtxt.$dirty && Dayscheduleform.ScheduleMsgtxt.$invalid">
                                                        <span style="color:red" ng-show="Dayscheduleform.ScheduleMsgtxt.$error.required">Please enter Schedule Message</span>
                                                    </span>
                                                </div>
                                                <div class="row section">
                                                    <div class="col s12 m12 l12">
                                                        <p>Select your file [Ex: gif, jpeg, png, mp4, ...]</p>
                                                    </div>
                                                    <div class="col s12 m12 l12">
                                                        <input type="hidden" id="dayimageUrl" value="{{schedulemessage.picUrl}}" />
                                                        <div ng-if="schedulemessage">
                                                            <input type="file" id="input-file-now" class="dropify" after-render data-default-file="{{schedulemessage.picUrl}}" />
                                                        </div>
                                                        <div ng-if="!schedulemessage">
                                                            <input type="file" id="input-file-now" class="dropify" after-render data-default-file="" />
                                                        </div>

                                                    </div>
                                                </div>
                                                <div class="row section">
                                                    <div class="col s12 m12 l12">
                                                        <div class="card-action" ng-if="!schedulemessage" ng-show="dispbtn">
                                                            <button ng-disabled="!((Dayscheduleform.ScheduleMsgtxt.$dirty))" class="waves-effect waves-light btn grey darken-3" ng-click="daywiseScheduleMsg()">day Schedule</button>
                                                            <button ng-disabled="!((Dayscheduleform.ScheduleMsgtxt.$dirty))" class="waves-effect waves-light btn grey darken-2" ng-click="draftmsg()">Save To Draft</button>
                                                        </div>
                                                        <div class="card-action" ng-if="schedulemessage" ng-show="dispbtn">
                                                            <button class="waves-effect waves-light btn grey darken-3" ng-model="schduledone" ng-click="daywiseScheduleMsg()">Schedule</button>
                                                            <button class="waves-effect waves-light btn grey darken-2" ng-click="draftmsg()">Save To Draft</button>
                                                        </div>
                                                        <div class="card-action" ng-show="!dispbtn">
                                                            <a href="#" class="waves-effect waves-light btn grey darken-3">Wait</a>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                    </form>
                                </div>
                            </div>

                        </div>
                    </div>
                <!-- Day wise scheduling end-->  
                </div>
            </section>
            <!-- END CONTENT -->               
    </div>
<script>
    function closeModel() {
        jQuery('input:checkbox').removeAttr('checked');
    }
    $(document).ready(function () {
        Materialize.updateTextFields();
    });
    function closeModel() {
        jQuery('input:checkbox').removeAttr('checked');
    }
    
    function check() {
        var flag = $('#checkAll').is(":checked");
        $('#checkboxdata input:checkbox').each(function () {
            $(this).prop('checked', flag);
        });
    }


    function profile() {
        var count = 0;
        $("#checkboxdata :checkbox").each(function () {
            if (this.id != 'checkAll') {
                if (!($("#" + this.id).prop('checked'))) {
                    count++;
                }
            }
        });

        if (count > 0) {
            //alert("no "+count);
            $("#checkAll").prop('checked', false);
        }
        if (count == 0) {
            //alert("yess " + count);
            $("#checkAll").prop('checked', true);
        }
    }
</script>

<script>
    function closeModel() {
        jQuery('input:checkbox').removeAttr('checked');
    }
    $(document).ready(function () {
        Materialize.updateTextFields();
    });
    function closeModeldaywise() {
        jQuery('input:checkbox').removeAttr('checked');
    }

    function checkdaywise() {
        var flag = $('#checkAlldaywise').is(":checked");
        $('#checkboxdatadaywise input:checkbox').each(function () {
            $(this).prop('checked', flag);
        });
    }


    function profiledaywise() {
        var count = 0;
        $("#checkboxdatadaywise :checkbox").each(function () {
            if (this.id != 'checkAlldaywise') {
                if (!($("#" + this.id).prop('checked'))) {
                    count++;
                }
            }
        });

        if (count > 0) {
            $("#checkAlldaywise").prop('checked', false);
        }
        if (count == 0) {
            $("#checkAlldaywise").prop('checked', true);
        }
    }
</script>
