noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
dashboard.php
Go to the documentation of this file.
00001 <?php
00002 //This file is part of NOALYSS and is under GPL 
00003 //see licence.txt
00004 ?><!-- left div -->
00005 <div id="calendar_box_div" class="box">
00006 <?php echo HtmlInput::title_box(_('Calendrier'),'cal_div','none');?>
00007 <?php echo HtmlInput::calendar_zoom($obj); ?>
00008 <?php echo $cal->display('short'); ?>
00009 </div>
00010 <div id="todo_listg_div" class="box"> <?php echo HtmlInput::title_box(_('Pense-Bête'),"todo_listg_div",'none')?>
00011 
00012 <?php
00013 /*
00014  * Todo list
00015  */
00016 echo dossier::hidden();
00017 if ( isset($_REQUEST['save_todo_list'])) {
00018   /* Save the new elt */
00019   $add_todo=new Todo_List($cn);
00020   $add_todo->set_parameter('id',$_REQUEST['tl_id']);
00021   $add_todo->set_parameter('title',$_REQUEST['p_title']);
00022   $add_todo->set_parameter('desc',$_REQUEST['p_desc']);
00023   $add_todo->set_parameter('date',$_REQUEST['p_date_todo']);
00024   $add_todo->save();
00025 }
00026 $todo=new Todo_List($cn);
00027 $array=$todo->load_all();
00028 
00029 echo HtmlInput::button('add',_('Ajout'),'onClick="add_todo()"','smallbutton');
00030 if ( ! empty ($array) )  {
00031   echo '<table id="table_todo" class="sortable" width="100%">';
00032   echo '<tr><th class=" sorttable_sorted_reverse">Date <span id="sorttable_sortrevind">&nbsp;&blacktriangle;</span></th><th>Titre</th><th></th>';
00033   $nb=0;
00034   $today=date('d.m.Y');
00035 
00036   foreach ($array as $row) {
00037     if ( $nb % 2 == 0 ) $odd='class="odd" '; else $odd='class="even" ';
00038     if ( strcmp($today,$row['str_tl_date'])==0) { $odd.=' style="background-color:#FFEA00"';}
00039     $nb++;
00040     echo '<tr id="tr'.$row['tl_id'].'" '.$odd.'>'.
00041       '<td sorttable_customkey="'.$row['tl_date'].'">'.
00042       $row['str_tl_date'].
00043       '</td>'.
00044       '<td>'.
00045       '<a class="line" href="javascript:void(0)" onclick="todo_list_show(\''.$row['tl_id'].'\')">'.
00046       htmlspecialchars($row['tl_title']).
00047       '</a>'.
00048        '</td>'.
00049       '<td>'.
00050       HtmlInput::button('del','X','onClick="todo_list_remove('.$row['tl_id'].')"','smallbutton').
00051       '</td>'.
00052       '</tr>';
00053   }
00054   echo '</table>';
00055 }
00056 ?>
00057 </div>
00058 
00059 <div id="situation_div" class="box"> 
00060     <?php echo HtmlInput::title_box(_("Situation"),"situation_div",'none')?>
00061     <table class='result'>
00062                 <tr>
00063                         <th>
00064 
00065                         </th>
00066                         <th>
00067                             <?php echo date('d.m.y'); ?>
00068                         </th>
00069                         <th>
00070                             <?php echo _('En retard') ?>
00071                         </th>
00072                 </tr>
00073                 <tr>
00074                         <td>
00075                                 <?php echo _("Action"); ?>
00076                         </td>
00077                         <td>
00078                                 <?php if (count($last_operation)>0): ?>
00079                                 <A class="mtitle" style="color:red;text-decoration:underline;font-weight: bolder;"onclick="display_detail('action_now_div')">
00080                                         <span class="notice">
00081                                         <?php echo count($last_operation) ?>
00082                                         &nbsp;<?php echo _("détail"); ?>
00083                                         </span>
00084                                 </A>
00085                         <?php else: ?>
00086                                  0
00087                         <?php endif; ?>
00088                         </td>
00089 
00090                         <td >
00091                         <?php if (count($late_operation)>0): ?>
00092                                 <A class="mtitle"  style="color:red;text-decoration:underline;;font-weight: bolder" onclick="display_detail('action_late_div')">
00093                                 <span class="notice"><?php echo count($late_operation) ?>
00094                                         &nbsp;<?php echo _("détail"); ?>
00095                                 </span>
00096                                 </A>
00097                         <?php else: ?>
00098                                  0
00099                         <?php endif; ?>
00100                         </td>
00101 
00102                 </tr>
00103                 <tr>
00104                         <td>
00105                                 <?php echo _("Paiement fournisseur"); ?>
00106                         </td>
00107                         <td >
00108                         <?php if (count($supplier_now)>0): ?>
00109                                 <A class="mtitle"  style="color:red;text-decoration:underline;font-weight: bolder" onclick="display_detail('supplier_now_div')">
00110                                 <span class="notice"><?php echo count($supplier_now) ?>&nbsp;<?php echo _("détail"); ?></span>
00111                                         
00112                                 </A>
00113                         <?php else: ?>
00114                                  0
00115                         <?php endif; ?>
00116                         </td>
00117                         <td >
00118                         <?php if (count($supplier_late)>0): ?>
00119                                 <A class="mtitle"  style="color:red;text-decoration:underline;font-weight: bolder" onclick="display_detail('supplier_late_div')">
00120                                 <span class="notice"><?php echo count($supplier_late) ?>&nbsp;<?php echo _("détail"); ?></span>
00121                                         
00122                                 </A>
00123                         <?php else: ?>
00124                                  0
00125                         <?php endif; ?>
00126                         </td>
00127                 </tr>
00128                 <tr>
00129                         <td>
00130                                 <?php echo _("Paiement client"); ?>
00131                         </td>
00132                         <td>
00133                                 <?php if (count($customer_now)>0): ?>
00134                                 <A class="mtitle"  style="color:red;text-decoration:underline;font-weight: bolder" onclick="display_detail('customer_now_div')">
00135                                 <span class="notice"><?php echo count($customer_now) ?>&nbsp;<?php echo _("détail"); ?></span>
00136                                         
00137                                 </A>
00138                         <?php else: ?>
00139                                  0
00140                         <?php endif; ?>
00141                         </td>
00142                         <td>
00143                                 <?php if (count($customer_late)>0): ?>
00144                                 <A class="mtitle"  style="color:red;text-decoration:underline;font-weight: bolder" onclick="display_detail('customer_late_div')">
00145                                 <span class="notice"><?php echo count($customer_late) ?>&nbsp;<?php echo _("détail"); ?></span>
00146                                         
00147                                 </A>
00148                         <?php else: ?>
00149                                  0
00150                         <?php endif; ?>
00151                         </td>
00152                 </tr>
00153         </table>
00154 </div>
00155 
00156 <!-- Mini rapport -->
00157 <?php
00158 /*
00159  * Mini Report
00160  */
00161 $report=$g_user->get_mini_report();
00162 
00163 $rapport=new Acc_Report($cn);
00164 $rapport->id=$report;
00165 if ( $rapport->exist() == false ) {
00166   $g_user->set_mini_report(0);
00167   $report=0;
00168 }
00169 
00170 if ( $report != 0 ) : ?>
00171 <div id="report_div" class="box"><?php echo HtmlInput::title_box($rapport->get_name(),'report_div','none');?>
00172 <?php    
00173   $exercice=$g_user->get_exercice();
00174   if ( $exercice == 0 ) {
00175     alert(_('Aucune periode par defaut'));
00176   } else {
00177     $periode=new Periode($cn);
00178     $limit=$periode->limit_year($exercice);
00179 
00180     $result=$rapport->get_row($limit['start'],$limit['end'],'periode');
00181     $ix=0;
00182     echo '<table border="0" width="100%">';
00183     foreach ($result as $row) {
00184       $ix++;
00185           $class=($ix%2==0)?' class="even" ':' class="odd" ';
00186       echo '<tr '.$class.'>';
00187 
00188       echo '<td> '.$row['desc'].'</td>'.
00189         '<td style="text-align:right">'.nbm($row['montant'])." &euro;</td>";
00190       echo '</tr>';
00191     }
00192     echo '</table>';
00193   }
00194   ?>
00195   </div>
00196 <?php
00197   else :
00198 ?>
00199   <div id="report_div" class="box"> <?php echo HtmlInput::title_box(_('Aucun rapport défini'),'report_div','none')?>
00200 <p>
00201   <a href="javascript:void(0)" class="cell" onclick="set_preference('<?php echo dossier::id()?>')"><?php echo _('Cliquez ici pour mettre à jour vos préférences')?></a>
00202 <p>
00203 </div>
00204 <?php
00205 endif;
00206 ?>
00207 
00208     
00209 <div id="action_late_div"  class="inner_box" style="display:none;margin-left:25%;top:25%;width: 50%;min-height:50%;overflow: auto;">
00210         <?php
00211                 echo HtmlInput::title_box(_("Action en retard"), "action_late_div","hide")
00212         ?>
00213         <ol>
00214         <?php if (count($late_operation)> 0) :
00215 
00216         for($i=0;$i<count($late_operation);$i++):
00217         ?>
00218         <li>
00219                 <?php echo HtmlInput::detail_action($late_operation[$i]['ag_id'],h($late_operation[$i]['ag_ref']))?>
00220         <span>
00221         <?php echo smaller_date($late_operation[$i]['ag_timestamp_fmt'])?>
00222         </span>
00223                 <span  style="font-weight: bolder ">
00224                         <?php echo h($late_operation[$i]['vw_name'])?>
00225                 </span>
00226         <span>
00227         <?php echo h(mb_substr($late_operation[$i]['ag_title'],0,50,'UTF-8'))?>
00228         </span>
00229         <span style="font-style: italic">
00230         <?php echo $late_operation[$i]['dt_value']?>
00231         </span>
00232         </li>
00233         <?php endfor;?>
00234         </ol>
00235         <?php else : ?>
00236         <h2 class='notice'><?php echo _("Aucune action en retard")?></h2>
00237         <?php endif; ?>
00238         </div>
00239 
00240         <div id="action_now_div" class="inner_box" style="display:none;margin-left:25%;width: 50%;top:25%;min-height:50%;overflow: auto;">
00241         <?php
00242                 echo HtmlInput::title_box(_("Action pour aujourd'hui"), "action_now_div","hide")
00243         ?>
00244         <ol>
00245         <?php
00246         if (count($last_operation)> 0) :
00247         for($i=0;$i<count($last_operation);$i++):
00248         ?>
00249         <li>
00250                 <?php echo HtmlInput::detail_action($last_operation[$i]['ag_id'],h($last_operation[$i]['ag_ref']))?>
00251         <span>
00252         <?php echo smaller_date($last_operation[$i]['ag_timestamp_fmt'])?>
00253         </span>
00254                 <span  style="font-weight: bolder ">
00255                         <?php echo h($last_operation[$i]['vw_name'])?>
00256                 </span>
00257         <span>
00258         <?php echo h(mb_substr($last_operation[$i]['ag_title'],0,50,'UTF-8'))?>
00259         </span>
00260         <span style="font-style: italic">
00261         <?php echo $last_operation[$i]['dt_value']?>
00262         </span>
00263         </li>
00264         <?php endfor;?>
00265         </ol>
00266 <?php endif; ?>
00267         </div>
00268         <?php display_dashboard_operation($supplier_now,_("Fournisseurs à payer aujourd'hui"),'supplier_now_div'); ?>
00269         <?php display_dashboard_operation($supplier_late,_("Fournisseurs en retad"),'supplier_late_div'); ?>
00270         <?php display_dashboard_operation($customer_now,_("Encaissement clients aujourd'hui"),'customer_now_div'); ?>
00271         <?php display_dashboard_operation($customer_late,_("Clients en retard"),'customer_late_div'); ?>
00272 </div>
00273 
00274 
00275 
00276 <div id="last_operation_box_div" class="box">
00277 <?php echo HtmlInput::title_box(_('Dernières opérations'),"last_operation_box_div",'none')?>
00278 
00279 <table style="width: 100%">
00280 <?php
00281 for($i=0;$i<count($last_ledger);$i++):
00282         $class=($i%2==0)?' class="even" ':' class="odd" ';
00283 ?>
00284 <tr <?php echo $class ?>>
00285         <td><?php echo   smaller_date($last_ledger[$i]['jr_date_fmt'])?>
00286         </td>
00287         <td>
00288                 <?php echo $last_ledger[$i]['jrn_def_code']?>
00289         </td>
00290 <td>
00291    <?php echo h(mb_substr($last_ledger[$i]['jr_comment'],0,40,'UTF-8'))?>
00292 </td>
00293 <td>
00294 <?php echo HtmlInput::detail_op($last_ledger[$i]['jr_id'], $last_ledger[$i]['jr_internal'])?>
00295 </td>
00296 <td class="num">
00297 <?php echo nbm($last_ledger[$i]['jr_montant'])?>
00298 </td>
00299 
00300 </tr>
00301 <?php endfor;?>
00302 </table>
00303     
00304 </div>
00305 
00306 
00307 <div id="add_todo_list" class="box">
00308         <script charset="utf-8" type="text/javascript" language="javascript">
00309                 new Draggable($('add_todo_list'),{});
00310         </script>
00311 <form method="post">
00312 <?php
00313 $wDate=new IDate('p_date_todo');
00314 $wDate->id='p_date_todo';
00315 $wTitle=new IText('p_title');
00316 $wDesc=new ITextArea('p_desc');
00317 $wDesc->heigh=5;
00318 $wDesc->width=40;
00319 echo HtmlInput::title_box("Note","add_todo_list","hide");
00320 echo _("Date")." ".$wDate->input().'<br>';
00321 echo _("Titre")." ".$wTitle->input().'<br>';
00322 echo _("Description")."<br>".$wDesc->input().'<br>';
00323 echo dossier::hidden();
00324 echo HtmlInput::hidden('tl_id',0);
00325 echo HtmlInput::submit('save_todo_list',_('Sauve'),'onClick="$(\'add_todo_list\').hide();return true;"');
00326 echo HtmlInput::button('hide',_('Annuler'),'onClick="$(\'add_todo_list\').hide();return true;"');
00327 ?>
00328 </form>
00329 </div>
00330 
00331 <script type="text/javascript" language="javascript" charset="utf-8">
00332 function display_detail(div) {
00333         $(div).style.display="block";
00334         //Effect.Grow(div,{});
00335 }
00336 try {
00337 var array=Array('customer_now_div','customer_late_div','supplier_now_div','supplier_late_div','action_now_div','action_late_div');
00338 var i=0;
00339 for  (i=0;i < array.length;i++) {
00340         new Draggable(array[i],{});
00341         }
00342 } catch (e) { alert(e.getMessage);}
00343 </script>
 All Data Structures Namespaces Files Functions Variables Enumerations