123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922 |
- @extends('layouts.master')
- @section('style')
- <link href="{{URL::asset('assets/css/jquery.datetimepicker.css')}}" rel="stylesheet" type="text/css"/>
-
- <style type="text/css">
- .cls-overflow{
- height: 800px;
- overflow: scroll;
- }
- .cls-overflow-one{
- height: 200px;
- overflow: scroll;
- }
- .info-box {
- display: block;
- min-height: 90px;
- background: #fff;
- width: 100%;
- box-shadow: 0 1px 1px rgba(0,0,0,0.1);
- border-radius: 2px;
- margin-bottom: 15px;
- }
- .info-box-icon {
- border-top-left-radius: 2px;
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
- border-bottom-left-radius: 2px;
- display: block;
- float: left;
- height: 90px;
- width: 90px;
- text-align: center;
- font-size: 45px;
- line-height: 90px;
- background: rgba(0,0,0,0.2);
- }
- .info-box-content {
- padding: 5px 10px;
- margin-left: 90px;
- }
- .info-box-text {
- text-transform: uppercase;
- }
- .progress-description, .info-box-text {
- display: block;
- font-size: 14px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .info-box-number {
- display: block;
- font-weight: bold;
- font-size: 18px;
- }
- .bg-success{
- background-color: #00a65a !important;
- color: #fff;
- }
- .ng-red{
- background-color: #dd4b39 !important;
- }
- </style>
- @endsection
- @section('content')
- <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
- <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
- <!-- Main content -->
- <section class="content">
- <!-- Main row -->
- <div class="row">
- <div class="col-md-12">
- <div class="row">
- <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
- <div class="info-box">
- <span class="info-box-icon bg-aqua"><i class="fa fa-users"></i></span>
-
- <div class="info-box-content">
- <span class="info-box-text">Total Client</span>
- <span class="info-box-number">{{ $clients }}</span>
- </div>
- <!-- /.info-box-content -->
- </div>
- </div>
-
- <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
- <div class="info-box">
- <span class="info-box-icon bg-success"><i class="fa fa-info"></i></span>
-
- <div class="info-box-content">
- <span class="info-box-text">Monthly Invoice</span>
- <span class="info-box-number">{{ $ttl_invoice }}</span>
- </div>
- <!-- /.info-box-content -->
- </div>
- </div>
-
- <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
- <div class="info-box">
- <span class="info-box-icon bg-red"><i class="fa fa-info"></i></span>
-
- <div class="info-box-content">
- <span class="info-box-text">Monthly Overdue Invoice</span>
-
- <span class="info-box-number"><a href="{{ url('invoice?code=&status=0&counsellor=&client=&overdue=true') }}" title='View All'>{{ $ttl_due_invoice }}</a></span>
- </div>
- <!-- /.info-box-content -->
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
- <div class="info-box">
- <span class="info-box-icon bg-red"><i class="fa fa-money"></i></span>
-
- <div class="info-box-content">
- <span class="info-box-text">All Time Due</span>
- <?php
- $new_due=(float) $dues;
- ?>
- <span class="info-box-number">{{ number_format($new_due, 2) }}</span>
- </div>
- <!-- /.info-box-content -->
- </div>
- </div>
-
- <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
- <div class="info-box">
- <span class="info-box-icon bg-success"><i class="fa fa-money"></i></span>
- <?php
- $new_collection=(float) $monthly_collected;
- ?>
- <div class="info-box-content">
- <span class="info-box-text">Received This Month</span>
- <span class="info-box-number">{{ number_format($new_collection, 2) }}</span>
- </div>
- <!-- /.info-box-content -->
- </div>
- </div>
-
- <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
- <div class="info-box">
- <span class="info-box-icon bg-red"><i class="fa fa-money"></i></span>
-
- <div class="info-box-content">
- <span class="info-box-text">Invoiced This Month</span>
- <?php
- $new_month_due=(float) $all_month_due;
- ?>
- <span class="info-box-number">{{ number_format($new_month_due, 2) }}</span>
- </div>
- <!-- /.info-box-content -->
- </div>
- </div>
- </div>
-
- <div class="row">
- <div class="col-md-8">
- <div class="panel panel-default">
- <div class="panel-heading">
- <h3 class="panel-title">Income Expense Report</h3>
- </div>
- <div class="panel-body">
- <div class="chart">
- <canvas id="lineChart" style="height:250px"></canvas>
- </div>
- </div>
- </div>
- </div>
- <div class="col-md-4">
- <div class="panel panel-default">
- <div class="panel-heading">
- <h3 class="panel-title">Balance</h3>
- </div>
- <div class="panel-body">
- @if($banks !='')
- <table class="table table-striped">
- <thead>
- <tr>
- <th class="text-center">Name</th>
- <th class="text-center">Amount</th>
- </tr>
- </thead>
- <tbody>
- @foreach($banks as $bank)
- <tr>
- <td>{{ $bank['bank_name'] }}</td>
- <td class="text-center">{{ number_format($bank['balance'], 2) }}</td>
- </tr>
- @endforeach
- </tbody>
- </table>
- @else
- <h2>{{ "No Records Found" }}</h2>
- @endif
- </div>
- </div>
- </div>
- </div>
-
-
- <style>
- #sortable { list-style-type: none; margin-top:2%; height: auto }
- #sortable .test {padding: 0.4em; padding-left: 1.5em; height: auto;margin:2%;background:#fff }
- #sortable .test span { margin-left: -1.3em;margin-top:2%;
- text-transform: uppercase; }
- #save{
- cursor: pointer;
- }
- </style>
- <?php
- /*
- ?>
- @foreach($all as $info)
- <div class="col-md-6" id="sortable">
- <section class="panel tasks-widget">
- <header class="panel-heading text-center">
- {{$info->name}}
- </header>
- <header class="panel-heading text-center" style="background:#d9534f;margin-top:2%;color:#fff">
- Deadline Missed
- </header>
- <?php
- $missed = App\Models\Task::where('user_id',$info->id)->where('status','!=',6)->whereDay('dead_line', '<=', date('d'))->get();
- ?>
- @if(count($missed) > 0)
- @foreach($missed as $p)
- <li class="test ui-state-default">
- <span class="task-color">{{$p->name}}</span>
- (Assign: {{date("d-m-Y H:i", strtotime($p->assign_time))}} # Estimated: {{$p->estimated_time}} )
- </li>
- @endforeach
- @endif
-
- <header class="panel-heading text-center" style="background:#f0ad4e;margin-top:2%;color:#fff">
- Deadline Today
- </header>
- <?php
- $deadline_today = App\Models\Task::where('user_id',$info->id)->where('status','!=',6)->whereDate('dead_line', '=', date('Y-m-d'))->get();
- ?>
- @if(count($deadline_today) > 0)
- @foreach($deadline_today as $p)
- <li class="test ui-state-default">
- <span class="task-color">{{$p->name}}</span>
- (Assign: {{date("d-m-Y H:i", strtotime($p->assign_time))}} # Estimated: {{$p->estimated_time}} )
- </li>
- @endforeach
- @endif
- <header class="panel-heading text-center" style="background:#d9534f;margin-top:2%;color:#fff">
- Pending Task
- </header>
- <?php
- $pen = App\Models\Task::where('user_id',$info->id)->where('status',1)->get();
- ?>
- @if(count($pen) > 0)
- @foreach($pen as $p)
- <li class="test ui-state-default">
- <span class="task-color">{{$p->name}}</span>
- (Assign: {{date("d-m-Y H:i", strtotime($p->assign_time))}} # Estimated: {{$p->estimated_time}} )
- </li>
- @endforeach
- @endif
- <header class="panel-heading text-center" style="background:#31b0d5;margin-top:2%;color: #fff">
- In Progress
- </header>
- <?php
- $in_proecss = App\Models\Task::where('user_id',$info->id)->where('status',2)->get();
- ?>
- @if(count($in_proecss) > 0)
- @foreach($in_proecss as $p)
- <li class="test ui-state-default">
- <span class="task-color">{{$p->name}}</span>
- (Assign: {{date("d-m-Y H:i", strtotime($p->assign_time))}} # Estimated: {{$p->estimated_time}} )
- </li>
- @endforeach
- @endif
- <header class="panel-heading text-center" style="background:#449d44;margin-top:2%;color: #fff">
- Completed
- </header>
- <?php
- $completed = App\Models\Task::where('user_id',$info->id)
- ->where('status',6)->whereDate('closing_time', '=', date('Y-m-d'))->get();
- ?>
- @if(count($completed) > 0)
- @foreach($completed as $p)
- <li class="test ui-state-default">
- <span class="task-color">{{$p->name}}</span>
- (Assign: {{date("d-m-Y H:i", strtotime($p->assign_time))}} # Estimated: {{$p->estimated_time}} )
- </li>
- @endforeach
- @endif
- <header class="panel-heading text-center" style="background:#449d44;margin-top:2%;color: #fff">
- Completed Yesterday
- </header>
- <?php
- $completed_yes = App\Models\Task::where('user_id',$info->id)
- ->where('status',6)->whereDate('closing_time', '!=', date('Y-m-d'))->get();
- ?>
- @if(count($completed_yes) > 0)
- @foreach($completed_yes as $p)
- <li class="test ui-state-default">
- <span class="task-color">{{$p->name}}</span>
- (Assign: {{date("d-m-Y H:i", strtotime($p->assign_time))}} # Estimated: {{$p->estimated_time}} )
- </li>
- @endforeach
- @endif
- </section>
- </div>
- @endforeach
- <?php
- */
- ?>
- </div>
-
- <!--
- <?php
-
- ?>
- <?php
- if(!empty($all1)){
- ?>
- <div class="col-md-12">
- <section class="panel tasks-widget">
- <header class="panel-heading text-center" style="background:#fff;margin-top:2%;color:#333">
- Vendors's Work Today
- </header>
- </section>
- @foreach($all1 as $info1)
- <div class="col-md-6" id="sortable">
- <section class="panel tasks-widget">
- <header class="panel-heading text-center">
- {{$info1->name}}
- </header>
- <?php
- $pen1 = App\Models\Task::where('user_id',$info1->id)->where('status',1)->get();
- ?>
- @if(count($pen1) != 0)
- <header class="panel-heading text-center" style="background:#d9534f;margin-top:2%;color:#fff">
- Pending Task
- </header>
- @foreach($pen1 as $p1)
- <li class="test ui-state-default">
- <span class="task-color">{{$p1->name}}</span>
- (Assign: {{date("d-m-Y H:i", strtotime($p1->assign_time))}} # Estimated: {{$p1->estimated_time}} )
- </li>
- @endforeach
- @endif
- <?php
- $in_proecss1 = App\Models\Task::where('user_id',$info1->id)->where('status',2)->get();
- ?>
- @if(count($in_proecss1) != 0)
- <header class="panel-heading text-center" style="background:#31b0d5;margin-top:2%;color: #fff">
- In Progress
- </header>
-
- @foreach($in_proecss1 as $p1)
- <li class="test ui-state-default">
- <span class="task-color">{{$p1->name}}</span>
- (Assign: {{date("d-m-Y H:i", strtotime($p1->assign_time))}} # Estimated: {{$p1->estimated_time}} )
- </li>
- @endforeach
- @endif
- <?php
- $completed1 = App\Models\Task::where('user_id',$info1->id)
- ->where('status',3)->whereDate('closing_time', '=', date('Y-m-d'))->get();
- ?>
- @if(count($completed1) != 0)
- <header class="panel-heading text-center" style="background:#449d44;margin-top:2%;color: #fff">
- Completed
- </header>
- @foreach($completed1 as $p1)
- <li class="test ui-state-default">
- <span class="task-color">{{$p1->name}}</span>
- (Assign: {{date("d-m-Y H:i", strtotime($p1->assign_time))}} # Estimated: {{$p1->estimated_time}} )
- </li>
- @endforeach
- @endif
- </section>
- </div>
- @endforeach
- </div>
- <?php
- }
- ?>
- </div>
-
- <div class="row">
- <div class="col-md-6">
- <section class="panel tasks-widget">
- <header class="panel-heading">
- In-Process Task
- </header>
- <div class="cls-overflow table-responsive project-list">
- <table class="table table-striped">
-
- <tbody>
- @if(!empty($in_process_task))
- <?php $count=1; ?>
- @foreach($in_process_task as $pt)
- <tr>
- <td>
- {{$count++ .") "}}
- <a style="color: #1ab394;" href="{{url("admin/project_details/$pt->proj_id")}}">
- {{$pt->name}} -
- </a>
- <span style="color:green;">
- {{@$pt->proj_name->name}} -
- </span>
- <span style="color:red;">
- @if(!empty($pt->user->name))
- {{$pt->user->name}}
- @else
- {{"Not assigned"}}
- @endif
- </span> -
-
- {{date("d-m-Y H:i", strtotime($pt->start_time))}} # {{$pt->estimated_time}}
- </td>
- </tr>
- @endforeach
- @endif
- </tbody>
- </table>
- <hr>
- </hr>
- </div>
- <div class="panel-body">
- <div class=" add-task-row">
- </div>
- <div class="table-foot">
-
- </div>
- </div>
- </section>
- </div>
- <div class="col-md-6">
- <section class="panel tasks-widget">
- <header class="panel-heading">
- Completed Today
- </header>
- <div class="cls-overflow table-responsive project-list">
- <table class="table table-striped">
-
- <tbody>
- @if(!empty($pending_task))
- <?php $count = 1; ?>
- @foreach($pending_task as $pt)
- <tr>
- <td>
- {{$count++ .") "}}
- <a style="color: #1ab394;" href="{{url("admin/project_details/$pt->proj_id")}}">
- {{$pt->name}}
- </a> -
- <span style="color: green;">
- {{$pt->proj_name?$pt->proj_name->name:''}} -
- </span>
- <span style="color:red;">
- @if($pt->user)
- @if(!empty($pt->user->name))
- {{$pt->user->name}} -
- @else
- <span style="color:#FF6000;">
- {{"Not assigned"}} -
- </span>
- @endif
- @endif
- </span>
-
- {{date("d-m-Y H:i", strtotime($pt->closing_time))}}
- </td>
- </tr>
- @endforeach
- @endif
- </tbody>
- </table>
- <hr>
- </hr>
- </div>
- <div class="panel-body">
- <div class=" add-task-row">
- </div>
- <div class="table-foot">
-
- </div>
- </div>
- </section>
- </div>
- </div>-->
-
- </section>
- <!-- row end -->
- <!-- /.content -->
- <!-- Add note modal -->
- <div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
- <h4 class="modal-title" id="gridSystemModalLabel">Add User</h4>
- </div>
- <div class="modal-body">
- <form role="form" action="{{url('admin/add_note')}}" method="POST">
- {!! csrf_field() !!}
- <div class="form-group">
- <label for="Add new Project">
- Note
- </label>
- <textarea name="note" rows="5" class="form-control" id="new-project" placeholder="Write down your important notes..." ></textarea>
- </div>
- <div class="form-group">
- <label for="Add new Project">
- Select Date Time
- </label>
- <input name="date_time" class="form-control" id="datetimepicker" type="text">
- </div>
- <div class="form-group">
- <button class="btn btn-info" type="submit">
- Submit
- </button>
- </div>
- </form>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
- </div>
- </div><!-- /.modal-content -->
- </div><!-- /.modal-dialog -->
- </div>
- <!-- Modal assign task -->
- <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
- <div class="modal-dialog modal-lg">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
- <h4 class="modal-title" id="gridSystemModalLabel">Assign Task</h4>
- </div>
- <div class="modal-body">
- <div class="row">
- <script src="{{URL::asset('assets/ckeditor/ckeditor.js')}}"></script>
- <div class="col-md-7">
- <b>Assinged users:</b>
- <div class="assinged-users">
-
- </div>
- </div>
- <div class="col-md-5">
-
- <input type="hidden" name="id_task_id" id="id_task_id" value="">
-
- <div class="form-group">
- <label for="Add new Project">
- User
- </label>
- <select name="user_id" id="id_user_id" class="form-control cls-proj-user">
-
- </select>
- </div>
- <div class="form-group">
- <label for="Add new Project">
- Estimated Time
- </label>
- <br>
- <input type="text" id="id_estimated_time" name="estimated_time" class="form-control">
-
- </div>
- <div class="form-group">
- <button class="btn btn-primary assign-task-user">Assign</button>
- </div>
-
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <div style="margin-bottom:10px;">
- <b>Details:</b> <span class="cls-task-details"></span>
- </div>
- <textarea class="form-control" name="comment_txt" id="comment_txt" cols="" rows="2" placeholder="Post comment here"></textarea>
- <button class="btn btn-success add-task-comment" style="margin-top:5px;">Post Comment</button>
- <button class="btn btn-success add-task-comment-doc" style="margin-top:5px;" data-toggle="modal" data-target="#add_doc_task_modal">Attach Documnet</button>
- <br><br>
- <b>Comments:</b><br>
- <div class="comments-cls" style="height:400px;overflow:scroll;">
-
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <br/>
- <b>Activity Logs:</b><br>
- <div class="show-logs" style="height:150px;overflow:scroll;">
-
- </div>
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <div class="row">
- <div class="col-md-10">
- Change status to:
- <button data-id='2' class="btn btn-primary cls-change-created btn-xs">In-process</button>
- <span class="show-change-btn">
- <button data-id='3' class="btn btn-primary cls-change-created btn-xs">Completed</button>
- <button data-id='4' class="btn btn-primary cls-change-created btn-xs">Checking</button>
- <button data-id='5' class="btn btn-primary cls-change-created btn-xs">Bug-fixing</button>
- <button data-id='6' class="btn btn-primary cls-change-created btn-xs">Done</button>
- </span>
- </div>
- <div class="col-md-2">
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- Assign task finished -->
- @endsection
- @section('script')
- <script src="{{URL::asset('assets/js/jquery.datetimepicker.full.min.js')}}" type="text/javascript"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.bundle.min.js" type="text/javascript"></script>
- <script type="text/javascript">
- //jQuery('#datetimepicker').datetimepicker();
- $('.bs-example-modal-lg').on('shown.bs.modal', function () {
- datePicker1();
- });
-
- function datePicker1(){
- $( "#id_estimated_time" ).datetimepicker({
- });
- }
- jQuery('#datetimepicker').datetimepicker({
- format:'Y-m-d H:i:s',
- lang:'ru'
- });
- $(document).ready(function() {
- var timeout = setTimeout("location.reload(true);",600000);
- function resetTimeout() {
- clearTimeout(timeout);
- timeout = setTimeout("location.reload(true);",600000);
- }
- $('.cls-assign').click(function(event)
- {
- var proj_id = $('.cls-project-id').val();
- var task_id = $(this).data('task_id');
- $('#id_task_id').val(task_id);
-
- $.ajax({
- url: "{{url('admin/user_list_for_task_assign')}}",
- type: 'POST',
- data: {proj_id: proj_id, task_id: task_id},
- })
- .done(function(data) {
- var status = data[4];
- if(status > 1)
- {
- $('.show-change-btn').show();
- }
- else{
- $('.show-change-btn').hide();
- }
-
- $('.cls-proj-user').html(data[0]);
- $('.assinged-users').html(data[1]);
- $('.show-logs').html(data[2]);
- $('.comments-cls').html(data[3]);
- $('.cls-task-details').html(data[5]);
- $('#id_estimated_time').val(data[6]);
- });
-
- });
-
- $('.assign-task-user').click(function(event)
- {
- //url('admin/task_assign_to_user')
- //var id_estimated_time = $('#id_estimated_time').val();
- var id_estimated_time = $('#id_estimated_time').val();
- //var min = $('#id_estimated_time_min').val();
- //var id_estimated_time = hours+":"+min+":00";
-
- var id_user_id = $('#id_user_id').val();
- var id_task_id = $('#id_task_id').val();
-
- if(id_estimated_time !=''){
- $.ajax({
- url: "{{url('admin/task_assign_to_user')}}",
- type: 'POST',
- data: {id_estimated_time: id_estimated_time,id_user_id: id_user_id,id_task_id: id_task_id},
- })
- .done(function(data) {
- $('.assinged-users').html(data);
- });
- }
- else{
- alert('Please define time estimate!');
- }
-
- });
-
-
- $('.assinged-users').on('click','.remove-task-assign-user',function(){
-
- var id = $(this).prev('input').val();
- var task_id = $('#id_task_id').val();
-
- $.ajax({
- url: "{{url('admin/remove_assign_task_user')}}",
- type: 'POST',
- data: {id: id,task_id: task_id},
- })
- .done(function(data) {
- $('.assinged-users').html(data);
- });
-
- });
-
- $('.add-task-comment').click(function(event) {
-
- var comment = $('#comment_txt').val();
- var task_id = $('#id_task_id').val();
-
- if(comment.length > 0){
- $.ajax({
- url: "{{url('admin/add_task_comment')}}",
- type: 'POST',
- data: {comment: comment,task_id: task_id},
- })
- .done(function(data) {
-
- $('.comments-cls').html(data);
- });
- }
- else{
- alert('Please fill-up comment field.');
- }
-
- });
- $('.comments-cls').on('click','.edit_comment',function(){
-
- var id = $(this).data('id');
-
- $.ajax({
- url: '{{url('admin/edit_comment_form')}}',
- type: 'POST',
- data: {id: id},
- })
- .done(function(data) {
- $('.modal-edit').modal('show');
- $('.update-comment').val(data['comment']);
- $('.update-comment-id').val(data['id']);
- });
-
- });
-
- $('.comments-cls').on('click','.remove_comment',function(){
-
- var id = $(this).data('id');
- var task_id = $('#id_task_id').val();
-
- $.ajax({
- url: "{{url('admin/remove_comment')}}",
- type: 'POST',
- data: {id: id,task_id: task_id},
- })
- .done(function(data) {
- $('.comments-cls').html(data);
- });
- });
-
- $('.save-updated-comment').click(function(event) {
-
- var id = $('.update-comment-id').val();
- var comment = $('.update-comment').val();
- var task_id = $('#id_task_id').val();
-
- $.ajax({
- url: '{{url('admin/save_update_comment')}}',
- type: 'POST',
- data: {id: id,comment: comment,task_id: task_id},
- })
- .done(function(data) {
- $('.modal-edit').modal('hide');
- $('.comments-cls').html(data);
- $('.update-comment').val('');
- alert('Data updated successfully!');
- });
-
- });
-
- $('.cls-change-created').click(function(event)
- {
- if(confirm("Are you sure you want to change status ?"))
- {
- var task_id = $('#id_task_id').val();
- var status = $(this).data('id');
-
-
- $.ajax({
- url: "{{url('admin/change_to_process')}}",
- type: 'POST',
- data: {task_id: task_id, status: status},
- })
- .done(function(data) {
-
- if(data == 'Yes'){
- alert('Status Changed !!');
- location.reload();
- }
- else{
- alert('Status Not Changed !!');
- }
- });
-
- }
- });
-
- $('.upload-cls').click(function(event)
- {
- var id = $('.cls-project-id').val();
- $('.cls-proj-id').val(id);
- });
-
- $('.cls-pm').click(function(event) {
-
- var id = $(this).val();
- var pm_status;
-
- if($(this).attr('checked')){
- pm_status = 1 ; //check
- }
- else{
- pm_status = 0 ; //uncheck
- }
-
- $.ajax({
- url: "{{url('admin/make_pm')}}",
- type: 'POST',
- data: {id: id,pm_status: pm_status},
- })
- .done(function(data) {
- alert(data);
- });
-
- });
-
- $('.add-task-comment-doc').click(function(event) {
- var task_id = $('#id_task_id').val();
- $('.cls-task-doc-id').val(task_id);
- });
-
- $('.attatch-close-btn').click(function(event) {
-
- location.reload();
- });
-
- $('.attatchment-doc-comment').click(function(event) {
-
- //this event only for fetch the comments after close
- //attatchemnt dropzone.
- var comment = '';
- var task_id = $('#id_task_id').val();
-
- $.ajax({
- url: "{{url('admin/add_task_comment')}}",
- type: 'POST',
- data: {comment: comment,task_id: task_id},
- })
- .done(function(data){
-
- $('.comments-cls').html(data);
- });
- });
- });
- $(document).ready(function() {
- var timeout = setTimeout("location.reload(true);",600000);
- function resetTimeout() {
- clearTimeout(timeout);
- timeout = setTimeout("location.reload(true);",600000);
- }
- new Chart(document.getElementById("lineChart"), {
- type: 'bar',
- data: {
- labels: ["January", "February", "March", "April", "May", "June", "July","August","September","October","November","December"],
- datasets: [
- {
- label: "Income",
- backgroundColor: "#3e95cd",
- data: {{ $revenue_amount }}
- }, {
- label: "Expense",
- backgroundColor: "#8e5ea2",
- data: {{ $exp_amount }}
- }
- ]
- },
- options: {
- title: {
- display: true,
- text: 'Income Expense Report'
- }
- }
- });
-
- });
- </script>
- @endsection
|