<div class="content-wrapper" ng-if="!myAccess.tipList">
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-6 offset-sm-1 offset-md-2 offset-lg-3 mt-5">
                <div class="alert alert-warning alert-dismissible">
                    <h5><i class="icon fas fa-ban"></i> 	!</h5>
                    Unauthorised Access.
                </div>
            </div>
        </div>
    </div>
</div>
<div class="content-wrapper" ng-if="myAccess.tipList">
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1 class="text-indigo">
                        <go-back/>
                        <i class="fas fa-envelope"></i> {{createButton.heading}}
                    </h1>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item"><a ng-href="{{baseurl}}/dashboard">Home</a></li>
                        <li class="breadcrumb-item"><a ng-href="{{baseurl}}/tip/list">Tip</a></li>
                        <li class="breadcrumb-item active">Add</li>
                    </ol>
                </div>
            </div>
        </div><!-- /.container-fluid -->
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-sm-12">
                <div class="card card-indigo card-outline">
                    <div class="card-body">
                        <div class="row">
                            <div class="col-sm-12 col-md-6">
                                <div class="form-group">
                                    <div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
                                       <!-- <input type="checkbox" class="custom-control-input" id="customSwitch1" ng-model="showAll">
                                        <label class="custom-control-label" ng-if="!showAll" for="customSwitch1">Show All Fields</label>
                                        <label class="custom-control-label" ng-if="showAll" for="customSwitch1">Show Only Required Fields</label>-->
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="title">Title</label>
                                    <input type="text" id="title" class="form-control" required="required" ng-model="tip.title" placeholder="Title">
                                </div>
                              
                                <div class="form-group">
                                    <label for="body">Body</label>
                                    <textarea class="form-control" rows="2" id="body" ng-model="tip.body" placeholder="Body"></textarea>
                                </div>
                                <div class="form-group">
                                    <label for="valid_till">Valid Till</label>
									<input type=text date-picker
                                           placeholder='Valid Till(YYYY-MM-DD)'
                                           dateformat='dd-mm-yy' 
                                           class='form-control' id="valid_till"
                                           ng-model='tip.valid_till'>
                                </div>
                                <div class="form-group">
                                    <label for="status">Status</label>
									<select id="status" class="form-control custom-select" ng-model="tip.status">
											<option>Select</option>
											<option value="active">Active</option>
											<option value="inactive">Inactive</option>
                                    </select>
                                </div>
								<div class="form-group">
                                    <label for="uploadimage">Image</label>
								<input type="file" file-model="tip.uploadimage" id="uploadimage"  class="form-control fileinput">
								</div>
                            </div>
                            </div>
                        </div>
                    </div>
                    <div class="card-footer">
                        <div class="col-12">
                            <button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#modal-default">Cancel</button>
                            <button type="submit" ng-click="createTip()" class="btn btn-success float-right">
                                <i class="fas {{createButton.icon}}"></i> {{createButton.text}}
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <div class="modal fade" id="modal-default">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-body">
                    <p>Are you sure to leave this page!</p>
                </div>
                <div class="modal-footer justify-content-between">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-indigo" data-dismiss="modal" ng-click="goTo($event,'tipList')">Proceed</button>
                </div>
            </div>
        </div>
    </div>
</div>
