admin_dashboard.blade.php 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  1. @extends('layouts.master')
  2. @section('style')
  3. <link href="{{URL::asset('assets/css/jquery.datetimepicker.css')}}" rel="stylesheet" type="text/css"/>
  4. <style type="text/css">
  5. .cls-overflow{
  6. height: 800px;
  7. overflow: scroll;
  8. }
  9. .cls-overflow-one{
  10. height: 200px;
  11. overflow: scroll;
  12. }
  13. .info-box {
  14. display: block;
  15. min-height: 90px;
  16. background: #fff;
  17. width: 100%;
  18. box-shadow: 0 1px 1px rgba(0,0,0,0.1);
  19. border-radius: 2px;
  20. margin-bottom: 15px;
  21. }
  22. .info-box-icon {
  23. border-top-left-radius: 2px;
  24. border-top-right-radius: 0;
  25. border-bottom-right-radius: 0;
  26. border-bottom-left-radius: 2px;
  27. display: block;
  28. float: left;
  29. height: 90px;
  30. width: 90px;
  31. text-align: center;
  32. font-size: 45px;
  33. line-height: 90px;
  34. background: rgba(0,0,0,0.2);
  35. }
  36. .info-box-content {
  37. padding: 5px 10px;
  38. margin-left: 90px;
  39. }
  40. .info-box-text {
  41. text-transform: uppercase;
  42. }
  43. .progress-description, .info-box-text {
  44. display: block;
  45. font-size: 14px;
  46. white-space: nowrap;
  47. overflow: hidden;
  48. text-overflow: ellipsis;
  49. }
  50. .info-box-number {
  51. display: block;
  52. font-weight: bold;
  53. font-size: 18px;
  54. }
  55. .bg-success{
  56. background-color: #00a65a !important;
  57. color: #fff;
  58. }
  59. .ng-red{
  60. background-color: #dd4b39 !important;
  61. }
  62. </style>
  63. @endsection
  64. @section('content')
  65. <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  66. <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
  67. <!-- Main content -->
  68. <section class="content">
  69. <!-- Main row -->
  70. <div class="row">
  71. <div class="col-md-12">
  72. <div class="row">
  73. <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
  74. <div class="info-box">
  75. <span class="info-box-icon bg-aqua"><i class="fa fa-users"></i></span>
  76. <div class="info-box-content">
  77. <span class="info-box-text">Total Client</span>
  78. <span class="info-box-number">{{ $clients }}</span>
  79. </div>
  80. <!-- /.info-box-content -->
  81. </div>
  82. </div>
  83. <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
  84. <div class="info-box">
  85. <span class="info-box-icon bg-success"><i class="fa fa-info"></i></span>
  86. <div class="info-box-content">
  87. <span class="info-box-text">Monthly Invoice</span>
  88. <span class="info-box-number">{{ $ttl_invoice }}</span>
  89. </div>
  90. <!-- /.info-box-content -->
  91. </div>
  92. </div>
  93. <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
  94. <div class="info-box">
  95. <span class="info-box-icon bg-red"><i class="fa fa-info"></i></span>
  96. <div class="info-box-content">
  97. <span class="info-box-text">Monthly Overdue Invoice</span>
  98. <span class="info-box-number"><a href="{{ url('invoice?code=&status=0&counsellor=&client=&overdue=true') }}" title='View All'>{{ $ttl_due_invoice }}</a></span>
  99. </div>
  100. <!-- /.info-box-content -->
  101. </div>
  102. </div>
  103. </div>
  104. <div class="row">
  105. <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
  106. <div class="info-box">
  107. <span class="info-box-icon bg-red"><i class="fa fa-money"></i></span>
  108. <div class="info-box-content">
  109. <span class="info-box-text">All Time Due</span>
  110. <?php
  111. $new_due=(float) $dues;
  112. ?>
  113. <span class="info-box-number">{{ number_format($new_due, 2) }}</span>
  114. </div>
  115. <!-- /.info-box-content -->
  116. </div>
  117. </div>
  118. <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
  119. <div class="info-box">
  120. <span class="info-box-icon bg-success"><i class="fa fa-money"></i></span>
  121. <?php
  122. $new_collection=(float) $monthly_collected;
  123. ?>
  124. <div class="info-box-content">
  125. <span class="info-box-text">Received This Month</span>
  126. <span class="info-box-number">{{ number_format($new_collection, 2) }}</span>
  127. </div>
  128. <!-- /.info-box-content -->
  129. </div>
  130. </div>
  131. <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
  132. <div class="info-box">
  133. <span class="info-box-icon bg-red"><i class="fa fa-money"></i></span>
  134. <div class="info-box-content">
  135. <span class="info-box-text">Invoiced This Month</span>
  136. <?php
  137. $new_month_due=(float) $all_month_due;
  138. ?>
  139. <span class="info-box-number">{{ number_format($new_month_due, 2) }}</span>
  140. </div>
  141. <!-- /.info-box-content -->
  142. </div>
  143. </div>
  144. </div>
  145. <div class="row">
  146. <div class="col-md-8">
  147. <div class="panel panel-default">
  148. <div class="panel-heading">
  149. <h3 class="panel-title">Income Expense Report</h3>
  150. </div>
  151. <div class="panel-body">
  152. <div class="chart">
  153. <canvas id="lineChart" style="height:250px"></canvas>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. <div class="col-md-4">
  159. <div class="panel panel-default">
  160. <div class="panel-heading">
  161. <h3 class="panel-title">Balance</h3>
  162. </div>
  163. <div class="panel-body">
  164. @if($banks !='')
  165. <table class="table table-striped">
  166. <thead>
  167. <tr>
  168. <th class="text-center">Name</th>
  169. <th class="text-center">Amount</th>
  170. </tr>
  171. </thead>
  172. <tbody>
  173. @foreach($banks as $bank)
  174. <tr>
  175. <td>{{ $bank['bank_name'] }}</td>
  176. <td class="text-center">{{ number_format($bank['balance'], 2) }}</td>
  177. </tr>
  178. @endforeach
  179. </tbody>
  180. </table>
  181. @else
  182. <h2>{{ "No Records Found" }}</h2>
  183. @endif
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. <style>
  189. #sortable { list-style-type: none; margin-top:2%; height: auto }
  190. #sortable .test {padding: 0.4em; padding-left: 1.5em; height: auto;margin:2%;background:#fff }
  191. #sortable .test span { margin-left: -1.3em;margin-top:2%;
  192. text-transform: uppercase; }
  193. #save{
  194. cursor: pointer;
  195. }
  196. </style>
  197. <?php
  198. /*
  199. ?>
  200. @foreach($all as $info)
  201. <div class="col-md-6" id="sortable">
  202. <section class="panel tasks-widget">
  203. <header class="panel-heading text-center">
  204. {{$info->name}}
  205. </header>
  206. <header class="panel-heading text-center" style="background:#d9534f;margin-top:2%;color:#fff">
  207. Deadline Missed
  208. </header>
  209. <?php
  210. $missed = App\Models\Task::where('user_id',$info->id)->where('status','!=',6)->whereDay('dead_line', '<=', date('d'))->get();
  211. ?>
  212. @if(count($missed) > 0)
  213. @foreach($missed as $p)
  214. <li class="test ui-state-default">
  215. <span class="task-color">{{$p->name}}</span>
  216. (Assign: {{date("d-m-Y H:i", strtotime($p->assign_time))}} # Estimated: {{$p->estimated_time}} )
  217. </li>
  218. @endforeach
  219. @endif
  220. <header class="panel-heading text-center" style="background:#f0ad4e;margin-top:2%;color:#fff">
  221. Deadline Today
  222. </header>
  223. <?php
  224. $deadline_today = App\Models\Task::where('user_id',$info->id)->where('status','!=',6)->whereDate('dead_line', '=', date('Y-m-d'))->get();
  225. ?>
  226. @if(count($deadline_today) > 0)
  227. @foreach($deadline_today as $p)
  228. <li class="test ui-state-default">
  229. <span class="task-color">{{$p->name}}</span>
  230. (Assign: {{date("d-m-Y H:i", strtotime($p->assign_time))}} # Estimated: {{$p->estimated_time}} )
  231. </li>
  232. @endforeach
  233. @endif
  234. <header class="panel-heading text-center" style="background:#d9534f;margin-top:2%;color:#fff">
  235. Pending Task
  236. </header>
  237. <?php
  238. $pen = App\Models\Task::where('user_id',$info->id)->where('status',1)->get();
  239. ?>
  240. @if(count($pen) > 0)
  241. @foreach($pen as $p)
  242. <li class="test ui-state-default">
  243. <span class="task-color">{{$p->name}}</span>
  244. (Assign: {{date("d-m-Y H:i", strtotime($p->assign_time))}} # Estimated: {{$p->estimated_time}} )
  245. </li>
  246. @endforeach
  247. @endif
  248. <header class="panel-heading text-center" style="background:#31b0d5;margin-top:2%;color: #fff">
  249. In Progress
  250. </header>
  251. <?php
  252. $in_proecss = App\Models\Task::where('user_id',$info->id)->where('status',2)->get();
  253. ?>
  254. @if(count($in_proecss) > 0)
  255. @foreach($in_proecss as $p)
  256. <li class="test ui-state-default">
  257. <span class="task-color">{{$p->name}}</span>
  258. (Assign: {{date("d-m-Y H:i", strtotime($p->assign_time))}} # Estimated: {{$p->estimated_time}} )
  259. </li>
  260. @endforeach
  261. @endif
  262. <header class="panel-heading text-center" style="background:#449d44;margin-top:2%;color: #fff">
  263. Completed
  264. </header>
  265. <?php
  266. $completed = App\Models\Task::where('user_id',$info->id)
  267. ->where('status',6)->whereDate('closing_time', '=', date('Y-m-d'))->get();
  268. ?>
  269. @if(count($completed) > 0)
  270. @foreach($completed as $p)
  271. <li class="test ui-state-default">
  272. <span class="task-color">{{$p->name}}</span>
  273. (Assign: {{date("d-m-Y H:i", strtotime($p->assign_time))}} # Estimated: {{$p->estimated_time}} )
  274. </li>
  275. @endforeach
  276. @endif
  277. <header class="panel-heading text-center" style="background:#449d44;margin-top:2%;color: #fff">
  278. Completed Yesterday
  279. </header>
  280. <?php
  281. $completed_yes = App\Models\Task::where('user_id',$info->id)
  282. ->where('status',6)->whereDate('closing_time', '!=', date('Y-m-d'))->get();
  283. ?>
  284. @if(count($completed_yes) > 0)
  285. @foreach($completed_yes as $p)
  286. <li class="test ui-state-default">
  287. <span class="task-color">{{$p->name}}</span>
  288. (Assign: {{date("d-m-Y H:i", strtotime($p->assign_time))}} # Estimated: {{$p->estimated_time}} )
  289. </li>
  290. @endforeach
  291. @endif
  292. </section>
  293. </div>
  294. @endforeach
  295. <?php
  296. */
  297. ?>
  298. </div>
  299. <!--
  300. <?php
  301. ?>
  302. <?php
  303. if(!empty($all1)){
  304. ?>
  305. <div class="col-md-12">
  306. <section class="panel tasks-widget">
  307. <header class="panel-heading text-center" style="background:#fff;margin-top:2%;color:#333">
  308. Vendors's Work Today
  309. </header>
  310. </section>
  311. @foreach($all1 as $info1)
  312. <div class="col-md-6" id="sortable">
  313. <section class="panel tasks-widget">
  314. <header class="panel-heading text-center">
  315. {{$info1->name}}
  316. </header>
  317. <?php
  318. $pen1 = App\Models\Task::where('user_id',$info1->id)->where('status',1)->get();
  319. ?>
  320. @if(count($pen1) != 0)
  321. <header class="panel-heading text-center" style="background:#d9534f;margin-top:2%;color:#fff">
  322. Pending Task
  323. </header>
  324. @foreach($pen1 as $p1)
  325. <li class="test ui-state-default">
  326. <span class="task-color">{{$p1->name}}</span>
  327. (Assign: {{date("d-m-Y H:i", strtotime($p1->assign_time))}} # Estimated: {{$p1->estimated_time}} )
  328. </li>
  329. @endforeach
  330. @endif
  331. <?php
  332. $in_proecss1 = App\Models\Task::where('user_id',$info1->id)->where('status',2)->get();
  333. ?>
  334. @if(count($in_proecss1) != 0)
  335. <header class="panel-heading text-center" style="background:#31b0d5;margin-top:2%;color: #fff">
  336. In Progress
  337. </header>
  338. @foreach($in_proecss1 as $p1)
  339. <li class="test ui-state-default">
  340. <span class="task-color">{{$p1->name}}</span>
  341. (Assign: {{date("d-m-Y H:i", strtotime($p1->assign_time))}} # Estimated: {{$p1->estimated_time}} )
  342. </li>
  343. @endforeach
  344. @endif
  345. <?php
  346. $completed1 = App\Models\Task::where('user_id',$info1->id)
  347. ->where('status',3)->whereDate('closing_time', '=', date('Y-m-d'))->get();
  348. ?>
  349. @if(count($completed1) != 0)
  350. <header class="panel-heading text-center" style="background:#449d44;margin-top:2%;color: #fff">
  351. Completed
  352. </header>
  353. @foreach($completed1 as $p1)
  354. <li class="test ui-state-default">
  355. <span class="task-color">{{$p1->name}}</span>
  356. (Assign: {{date("d-m-Y H:i", strtotime($p1->assign_time))}} # Estimated: {{$p1->estimated_time}} )
  357. </li>
  358. @endforeach
  359. @endif
  360. </section>
  361. </div>
  362. @endforeach
  363. </div>
  364. <?php
  365. }
  366. ?>
  367. </div>
  368. <div class="row">
  369. <div class="col-md-6">
  370. <section class="panel tasks-widget">
  371. <header class="panel-heading">
  372. In-Process Task
  373. </header>
  374. <div class="cls-overflow table-responsive project-list">
  375. <table class="table table-striped">
  376. <tbody>
  377. @if(!empty($in_process_task))
  378. <?php $count=1; ?>
  379. @foreach($in_process_task as $pt)
  380. <tr>
  381. <td>
  382. {{$count++ .") "}}
  383. <a style="color: #1ab394;" href="{{url("admin/project_details/$pt->proj_id")}}">
  384. {{$pt->name}} -
  385. </a>
  386. <span style="color:green;">
  387. {{@$pt->proj_name->name}} -
  388. </span>
  389. <span style="color:red;">
  390. @if(!empty($pt->user->name))
  391. {{$pt->user->name}}
  392. @else
  393. {{"Not assigned"}}
  394. @endif
  395. </span> -
  396. {{date("d-m-Y H:i", strtotime($pt->start_time))}} # {{$pt->estimated_time}}
  397. </td>
  398. </tr>
  399. @endforeach
  400. @endif
  401. </tbody>
  402. </table>
  403. <hr>
  404. </hr>
  405. </div>
  406. <div class="panel-body">
  407. <div class=" add-task-row">
  408. </div>
  409. <div class="table-foot">
  410. </div>
  411. </div>
  412. </section>
  413. </div>
  414. <div class="col-md-6">
  415. <section class="panel tasks-widget">
  416. <header class="panel-heading">
  417. Completed Today
  418. </header>
  419. <div class="cls-overflow table-responsive project-list">
  420. <table class="table table-striped">
  421. <tbody>
  422. @if(!empty($pending_task))
  423. <?php $count = 1; ?>
  424. @foreach($pending_task as $pt)
  425. <tr>
  426. <td>
  427. {{$count++ .") "}}
  428. <a style="color: #1ab394;" href="{{url("admin/project_details/$pt->proj_id")}}">
  429. {{$pt->name}}
  430. </a> -
  431. <span style="color: green;">
  432. {{$pt->proj_name?$pt->proj_name->name:''}} -
  433. </span>
  434. <span style="color:red;">
  435. @if($pt->user)
  436. @if(!empty($pt->user->name))
  437. {{$pt->user->name}} -
  438. @else
  439. <span style="color:#FF6000;">
  440. {{"Not assigned"}} -
  441. </span>
  442. @endif
  443. @endif
  444. </span>
  445. {{date("d-m-Y H:i", strtotime($pt->closing_time))}}
  446. </td>
  447. </tr>
  448. @endforeach
  449. @endif
  450. </tbody>
  451. </table>
  452. <hr>
  453. </hr>
  454. </div>
  455. <div class="panel-body">
  456. <div class=" add-task-row">
  457. </div>
  458. <div class="table-foot">
  459. </div>
  460. </div>
  461. </section>
  462. </div>
  463. </div>-->
  464. </section>
  465. <!-- row end -->
  466. <!-- /.content -->
  467. <!-- Add note modal -->
  468. <div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  469. <div class="modal-dialog" role="document">
  470. <div class="modal-content">
  471. <div class="modal-header">
  472. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  473. <h4 class="modal-title" id="gridSystemModalLabel">Add User</h4>
  474. </div>
  475. <div class="modal-body">
  476. <form role="form" action="{{url('admin/add_note')}}" method="POST">
  477. {!! csrf_field() !!}
  478. <div class="form-group">
  479. <label for="Add new Project">
  480. Note
  481. </label>
  482. <textarea name="note" rows="5" class="form-control" id="new-project" placeholder="Write down your important notes..." ></textarea>
  483. </div>
  484. <div class="form-group">
  485. <label for="Add new Project">
  486. Select Date Time
  487. </label>
  488. <input name="date_time" class="form-control" id="datetimepicker" type="text">
  489. </div>
  490. <div class="form-group">
  491. <button class="btn btn-info" type="submit">
  492. Submit
  493. </button>
  494. </div>
  495. </form>
  496. </div>
  497. <div class="modal-footer">
  498. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  499. </div>
  500. </div><!-- /.modal-content -->
  501. </div><!-- /.modal-dialog -->
  502. </div>
  503. <!-- Modal assign task -->
  504. <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
  505. <div class="modal-dialog modal-lg">
  506. <div class="modal-content">
  507. <div class="modal-header">
  508. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  509. <h4 class="modal-title" id="gridSystemModalLabel">Assign Task</h4>
  510. </div>
  511. <div class="modal-body">
  512. <div class="row">
  513. <script src="{{URL::asset('assets/ckeditor/ckeditor.js')}}"></script>
  514. <div class="col-md-7">
  515. <b>Assinged users:</b>
  516. <div class="assinged-users">
  517. </div>
  518. </div>
  519. <div class="col-md-5">
  520. <input type="hidden" name="id_task_id" id="id_task_id" value="">
  521. <div class="form-group">
  522. <label for="Add new Project">
  523. User
  524. </label>
  525. <select name="user_id" id="id_user_id" class="form-control cls-proj-user">
  526. </select>
  527. </div>
  528. <div class="form-group">
  529. <label for="Add new Project">
  530. Estimated Time
  531. </label>
  532. <br>
  533. <input type="text" id="id_estimated_time" name="estimated_time" class="form-control">
  534. </div>
  535. <div class="form-group">
  536. <button class="btn btn-primary assign-task-user">Assign</button>
  537. </div>
  538. </div>
  539. </div>
  540. <div class="row">
  541. <div class="col-md-12">
  542. <div style="margin-bottom:10px;">
  543. <b>Details:</b> <span class="cls-task-details"></span>
  544. </div>
  545. <textarea class="form-control" name="comment_txt" id="comment_txt" cols="" rows="2" placeholder="Post comment here"></textarea>
  546. <button class="btn btn-success add-task-comment" style="margin-top:5px;">Post Comment</button>
  547. <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>
  548. <br><br>
  549. <b>Comments:</b><br>
  550. <div class="comments-cls" style="height:400px;overflow:scroll;">
  551. </div>
  552. </div>
  553. </div>
  554. <div class="row">
  555. <div class="col-md-12">
  556. <br/>
  557. <b>Activity Logs:</b><br>
  558. <div class="show-logs" style="height:150px;overflow:scroll;">
  559. </div>
  560. </div>
  561. </div>
  562. </div>
  563. <div class="modal-footer">
  564. <div class="row">
  565. <div class="col-md-10">
  566. Change status to:
  567. <button data-id='2' class="btn btn-primary cls-change-created btn-xs">In-process</button>
  568. <span class="show-change-btn">
  569. <button data-id='3' class="btn btn-primary cls-change-created btn-xs">Completed</button>
  570. <button data-id='4' class="btn btn-primary cls-change-created btn-xs">Checking</button>
  571. <button data-id='5' class="btn btn-primary cls-change-created btn-xs">Bug-fixing</button>
  572. <button data-id='6' class="btn btn-primary cls-change-created btn-xs">Done</button>
  573. </span>
  574. </div>
  575. <div class="col-md-2">
  576. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  577. </div>
  578. </div>
  579. </div>
  580. </div>
  581. </div>
  582. </div>
  583. <!-- Assign task finished -->
  584. @endsection
  585. @section('script')
  586. <script src="{{URL::asset('assets/js/jquery.datetimepicker.full.min.js')}}" type="text/javascript"></script>
  587. <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.bundle.min.js" type="text/javascript"></script>
  588. <script type="text/javascript">
  589. //jQuery('#datetimepicker').datetimepicker();
  590. $('.bs-example-modal-lg').on('shown.bs.modal', function () {
  591. datePicker1();
  592. });
  593. function datePicker1(){
  594. $( "#id_estimated_time" ).datetimepicker({
  595. });
  596. }
  597. jQuery('#datetimepicker').datetimepicker({
  598. format:'Y-m-d H:i:s',
  599. lang:'ru'
  600. });
  601. $(document).ready(function() {
  602. var timeout = setTimeout("location.reload(true);",600000);
  603. function resetTimeout() {
  604. clearTimeout(timeout);
  605. timeout = setTimeout("location.reload(true);",600000);
  606. }
  607. $('.cls-assign').click(function(event)
  608. {
  609. var proj_id = $('.cls-project-id').val();
  610. var task_id = $(this).data('task_id');
  611. $('#id_task_id').val(task_id);
  612. $.ajax({
  613. url: "{{url('admin/user_list_for_task_assign')}}",
  614. type: 'POST',
  615. data: {proj_id: proj_id, task_id: task_id},
  616. })
  617. .done(function(data) {
  618. var status = data[4];
  619. if(status > 1)
  620. {
  621. $('.show-change-btn').show();
  622. }
  623. else{
  624. $('.show-change-btn').hide();
  625. }
  626. $('.cls-proj-user').html(data[0]);
  627. $('.assinged-users').html(data[1]);
  628. $('.show-logs').html(data[2]);
  629. $('.comments-cls').html(data[3]);
  630. $('.cls-task-details').html(data[5]);
  631. $('#id_estimated_time').val(data[6]);
  632. });
  633. });
  634. $('.assign-task-user').click(function(event)
  635. {
  636. //url('admin/task_assign_to_user')
  637. //var id_estimated_time = $('#id_estimated_time').val();
  638. var id_estimated_time = $('#id_estimated_time').val();
  639. //var min = $('#id_estimated_time_min').val();
  640. //var id_estimated_time = hours+":"+min+":00";
  641. var id_user_id = $('#id_user_id').val();
  642. var id_task_id = $('#id_task_id').val();
  643. if(id_estimated_time !=''){
  644. $.ajax({
  645. url: "{{url('admin/task_assign_to_user')}}",
  646. type: 'POST',
  647. data: {id_estimated_time: id_estimated_time,id_user_id: id_user_id,id_task_id: id_task_id},
  648. })
  649. .done(function(data) {
  650. $('.assinged-users').html(data);
  651. });
  652. }
  653. else{
  654. alert('Please define time estimate!');
  655. }
  656. });
  657. $('.assinged-users').on('click','.remove-task-assign-user',function(){
  658. var id = $(this).prev('input').val();
  659. var task_id = $('#id_task_id').val();
  660. $.ajax({
  661. url: "{{url('admin/remove_assign_task_user')}}",
  662. type: 'POST',
  663. data: {id: id,task_id: task_id},
  664. })
  665. .done(function(data) {
  666. $('.assinged-users').html(data);
  667. });
  668. });
  669. $('.add-task-comment').click(function(event) {
  670. var comment = $('#comment_txt').val();
  671. var task_id = $('#id_task_id').val();
  672. if(comment.length > 0){
  673. $.ajax({
  674. url: "{{url('admin/add_task_comment')}}",
  675. type: 'POST',
  676. data: {comment: comment,task_id: task_id},
  677. })
  678. .done(function(data) {
  679. $('.comments-cls').html(data);
  680. });
  681. }
  682. else{
  683. alert('Please fill-up comment field.');
  684. }
  685. });
  686. $('.comments-cls').on('click','.edit_comment',function(){
  687. var id = $(this).data('id');
  688. $.ajax({
  689. url: '{{url('admin/edit_comment_form')}}',
  690. type: 'POST',
  691. data: {id: id},
  692. })
  693. .done(function(data) {
  694. $('.modal-edit').modal('show');
  695. $('.update-comment').val(data['comment']);
  696. $('.update-comment-id').val(data['id']);
  697. });
  698. });
  699. $('.comments-cls').on('click','.remove_comment',function(){
  700. var id = $(this).data('id');
  701. var task_id = $('#id_task_id').val();
  702. $.ajax({
  703. url: "{{url('admin/remove_comment')}}",
  704. type: 'POST',
  705. data: {id: id,task_id: task_id},
  706. })
  707. .done(function(data) {
  708. $('.comments-cls').html(data);
  709. });
  710. });
  711. $('.save-updated-comment').click(function(event) {
  712. var id = $('.update-comment-id').val();
  713. var comment = $('.update-comment').val();
  714. var task_id = $('#id_task_id').val();
  715. $.ajax({
  716. url: '{{url('admin/save_update_comment')}}',
  717. type: 'POST',
  718. data: {id: id,comment: comment,task_id: task_id},
  719. })
  720. .done(function(data) {
  721. $('.modal-edit').modal('hide');
  722. $('.comments-cls').html(data);
  723. $('.update-comment').val('');
  724. alert('Data updated successfully!');
  725. });
  726. });
  727. $('.cls-change-created').click(function(event)
  728. {
  729. if(confirm("Are you sure you want to change status ?"))
  730. {
  731. var task_id = $('#id_task_id').val();
  732. var status = $(this).data('id');
  733. $.ajax({
  734. url: "{{url('admin/change_to_process')}}",
  735. type: 'POST',
  736. data: {task_id: task_id, status: status},
  737. })
  738. .done(function(data) {
  739. if(data == 'Yes'){
  740. alert('Status Changed !!');
  741. location.reload();
  742. }
  743. else{
  744. alert('Status Not Changed !!');
  745. }
  746. });
  747. }
  748. });
  749. $('.upload-cls').click(function(event)
  750. {
  751. var id = $('.cls-project-id').val();
  752. $('.cls-proj-id').val(id);
  753. });
  754. $('.cls-pm').click(function(event) {
  755. var id = $(this).val();
  756. var pm_status;
  757. if($(this).attr('checked')){
  758. pm_status = 1 ; //check
  759. }
  760. else{
  761. pm_status = 0 ; //uncheck
  762. }
  763. $.ajax({
  764. url: "{{url('admin/make_pm')}}",
  765. type: 'POST',
  766. data: {id: id,pm_status: pm_status},
  767. })
  768. .done(function(data) {
  769. alert(data);
  770. });
  771. });
  772. $('.add-task-comment-doc').click(function(event) {
  773. var task_id = $('#id_task_id').val();
  774. $('.cls-task-doc-id').val(task_id);
  775. });
  776. $('.attatch-close-btn').click(function(event) {
  777. location.reload();
  778. });
  779. $('.attatchment-doc-comment').click(function(event) {
  780. //this event only for fetch the comments after close
  781. //attatchemnt dropzone.
  782. var comment = '';
  783. var task_id = $('#id_task_id').val();
  784. $.ajax({
  785. url: "{{url('admin/add_task_comment')}}",
  786. type: 'POST',
  787. data: {comment: comment,task_id: task_id},
  788. })
  789. .done(function(data){
  790. $('.comments-cls').html(data);
  791. });
  792. });
  793. });
  794. $(document).ready(function() {
  795. var timeout = setTimeout("location.reload(true);",600000);
  796. function resetTimeout() {
  797. clearTimeout(timeout);
  798. timeout = setTimeout("location.reload(true);",600000);
  799. }
  800. new Chart(document.getElementById("lineChart"), {
  801. type: 'bar',
  802. data: {
  803. labels: ["January", "February", "March", "April", "May", "June", "July","August","September","October","November","December"],
  804. datasets: [
  805. {
  806. label: "Income",
  807. backgroundColor: "#3e95cd",
  808. data: {{ $revenue_amount }}
  809. }, {
  810. label: "Expense",
  811. backgroundColor: "#8e5ea2",
  812. data: {{ $exp_amount }}
  813. }
  814. ]
  815. },
  816. options: {
  817. title: {
  818. display: true,
  819. text: 'Income Expense Report'
  820. }
  821. }
  822. });
  823. });
  824. </script>
  825. @endsection