Guest User

Untitled

a guest
Jun 7th, 2012
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 30.36 KB | None | 0 0
  1. <?php
  2.   /**
  3.    * Projects
  4.    *
  5.    * @package Freelance Manager
  6.    * @author wojoscripts.com
  7.    * @copyright 2011
  8.    * @version $Id: projects.php, v1.00 2011-06-05 10:12:05 gewa Exp $
  9.    */
  10.   if (!defined("_VALID_PHP"))
  11.       die('Direct access to this location is not allowed.');
  12. ?>
  13. <?php switch(Filter::$action): case "edit": ?>
  14. <?php $row = Core::getRowById("projects", Filter::$id);?>
  15. <?php if(!$user->checkProjectAccess($row->id)): print Filter::msgInfo(lang('NOACCESS'), false); return; endif;?>
  16. <?php $ptype = $content->getProjectTypes();?>
  17. <?php $tipoapp = $content->getTipoApp();?>
  18. <h1><img src="../images/projects.png" alt="" /><?php echo lang('PROJ_TITLE');?></h1>
  19. <p class="info"><?php echo lang('PROJ_INFO') . lang('REQFIELD1') . required() . lang('REQFIELD2');?></p>
  20. <div class="block-border">
  21.   <div class="block-header">
  22.     <ul class="idTabs" id="tabs">
  23.       <li><a href="#general"><?php echo lang('PROJECT');?></a></li>
  24.       <li><a href="#tasks"><?php echo lang('TASKS');?></a></li>
  25.       <li><a href="#submissions"><?php echo lang('SUBMISSIONS');?></a></li>
  26.       <li><a href="#files"><?php echo lang('FILES');?></a></li>
  27.     </ul>
  28.     <div class="clear"></div>
  29.     <h2><?php echo lang('PROJ_SUB') . $row->title;?></h2>
  30.   </div>
  31.   <div class="block-content">
  32.     <form action="" method="post" id="admin_form" name="admin_form">
  33.       <table width="100%" border="0" cellspacing="0" cellpadding="0">
  34.         <tr>
  35.           <td colspan="2"><div id="general" class="tab_content">
  36.               <table cellspacing="0" cellpadding="0" class="forms">
  37.                  <tr>
  38.                   <th><?php echo lang('tipo_apparecchio');?>: <?php echo required();?></th>
  39.                   <td><select name="tipo_apparecchio" class="custombox" style="width:250px">
  40.                       <option value=""><?php echo lang('tipo_apparecchio_SEL');?></option>
  41.                       <?php if ($tipoapp):?>
  42.                       <?php foreach ($tipoapp as $approw):?>
  43.                       <option value="<?php echo $approw->id;?>"<?php if($approw->id == $row->tipo_apparecchio)echo 'selected="selected"';?>><?php echo $approw->title;?></option>
  44.                       <?php endforeach;?>
  45.                       <?php unset($approw);?>
  46.                       <?php endif;?>
  47.                     </select></td>
  48.                 </tr>
  49.                 <tr>
  50.                 <th width="300"><?php echo lang('PROB_DICH');?>: <?php echo required();?></th>
  51.                   <td colspan="2"><textarea name="prob_dich" cols="20" rows="1" id="prob_dich_content"><?php echo $row->prob_dich;?></textarea></td>
  52.                 </tr>
  53.                 <tr>
  54.                   <th><?php echo lang('PROJ_TYPE');?>: <?php echo required();?></th>
  55.                   <td><select name="project_type" class="custombox" style="width:250px">
  56.                       <option value=""><?php echo lang('PROJ_TYPE_SEL');?></option>
  57.                       <?php if ($ptype):?>
  58.                       <?php foreach ($ptype as $prow):?>
  59.                       <option value="<?php echo $prow->id;?>"<?php if($prow->id == $row->project_type)echo 'selected="selected"';?>><?php echo $prow->title;?></option>
  60.                       <?php endforeach;?>
  61.                       <?php unset($prow);?>
  62.                       <?php endif;?>
  63.                     </select></td>
  64.                 </tr>
  65.                 <tr>
  66.                   <th><?php echo lang('PROJ_PRICE');?>: <?php echo required();?></th>
  67.                   <td><input name="cost" type="text" class="inputbox " size="10" value="<?php echo $row->cost;?>" /></td>
  68.                 </tr>
  69.                 <tr>
  70.                   <th><?php echo lang('PROJ_START');?>:</th>
  71.                   <td colspan="2"><input name="start_date" type="text" class="inputbox" id="start_date" size="25" value="<?php echo $row->start_date;?>"/></td>
  72.                 </tr>
  73.                 <tr>
  74.                   <th><?php echo lang('PROJ_END');?>:</th>
  75.                   <td><input name="end_date" type="text" class="inputbox" id="end_date" size="25" value="<?php echo $row->end_date;?>"/></td>
  76.                 </tr>
  77.                 <tr>
  78.                   <th><?php echo lang('PROJ_BILLSTSTUS');?>:</th>
  79.                   <td><?php echo $content->progressBarBilling($row->b_status, $row->cost);?>
  80.                   <?php /*?>
  81.                   <label for="b_status">Payment Amount:</label>
  82.                     <input type="text" id="b_status" style="border:0; color:#5AB814;font-weight:bold; background-color:transparent" name="b_status"/>
  83.                     <div id="b_status-range" style="width: 250px;margin-top:2px"></div>
  84.                     <?php */?>
  85.                     </td>
  86.                 </tr>
  87.                 <tr>
  88.                   <th><?php echo lang('PROJ_STATUS');?>:</th>
  89.                   <td><label for="p_status"><?php echo lang('PROJ_COMPSTSTUS');?>:</label>
  90.                     <input type="text" id="p_status" style="border:0; color:#0084FF;background-color:transparent" name="p_status"/>
  91.                     <div id="p_status-range" style="width: 250px;margin-top:2px"></div></td>
  92.                 </tr>
  93.                 <tr>
  94.                   <th><?php echo lang('PROJ_MANAGER');?>:</th>
  95.                   <td><select name="staff_id" class="custombox" style="width:250px">
  96.                       <?php foreach ($user->getUserList("9' or userlevel = '5") as $srow):?>
  97.                       <option value="<?php echo $srow->id;?>"<?php if($srow->id == $row->staff_id) echo 'selected="selected"';?>><?php echo $srow->name;?></option>
  98.                       <?php endforeach;?>
  99.                       <?php unset($srow);?>
  100.                     </select></td>
  101.                 </tr>
  102.               </table>
  103.             </div>
  104.             <div id="tasks" class="tab_content">
  105.               <?php $taskrow = $content->getTasksByProject();?>
  106.               <table cellpadding="0" cellspacing="0" class="display">
  107.                 <thead>
  108.                   <tr>
  109.                     <th width="20">#</th>
  110.                     <th class="left"><?php echo lang('TASK_NAME');?></th>
  111.                     <th class="left"><?php echo lang('TASK_PROGRESS');?></th>
  112.                     <th class="left"><?php echo lang('CREATED');?></th>
  113.                     <th><?php echo lang('EDIT');?></th>
  114.                   </tr>
  115.                 </thead>
  116.                 <?php if(!$taskrow):?>
  117.                 <tr>
  118.                   <td colspan="5"><?php echo Filter::msgInfo(lang('TASK_NOTASKS'),false);?></td>
  119.                 </tr>
  120.                 <?php else:?>
  121.                 <?php foreach ($taskrow as $trow):?>
  122.                 <tr>
  123.                   <th align="center"><?php echo $trow->id;?>.</th>
  124.                   <td><?php echo $trow->title;?></td>
  125.                   <td><?php echo $content->progressBarStatus($trow->progress);?></td>
  126.                   <td><?php echo Filter::dodate($core->short_date, $trow->created);?></td>
  127.                   <td align="center"><a href="index.php?do=tasks&amp;action=edit&amp;id=<?php echo $trow->id;?>"><img src="../images/edit.png" alt="" class="tooltip img-wrap2" title="<?php echo lang('EDIT').': '.$trow->title;?>"/></a></td>
  128.                 </tr>
  129.                 <?php endforeach;?>
  130.                 <?php unset($trow);?>
  131.                 <?php endif;?>
  132.               </table>
  133.             </div>
  134.             <div id="submissions" class="tab_content">
  135.               <?php $subrow = $content->getProjectSubmissions();?>
  136.               <table cellpadding="0" cellspacing="0" class="display">
  137.                 <thead>
  138.                   <tr>
  139.                     <th width="20">#</th>
  140.                     <th class="left"><?php echo lang('SUBS_NAME');?></th>
  141.                     <th class="left"><?php echo lang('SUBS_TYPE');?></th>
  142.                     <th class="left"><?php echo lang('STATUS');?></th>
  143.                     <th><?php echo lang('EDIT');?></th>
  144.                   </tr>
  145.                 </thead>
  146.                 <?php if(!$subrow):?>
  147.                 <tr>
  148.                   <td colspan="5"><?php echo Filter::msgInfo(lang('SUBS_NOSUBS'),false);?></td>
  149.                 </tr>
  150.                 <?php else:?>
  151.                 <?php foreach ($subrow as $brow):?>
  152.                 <tr>
  153.                   <th align="center"><?php echo $brow->id;?>.</th>
  154.                   <td><?php echo $brow->title;?></td>
  155.                   <td><?php echo $brow->s_type;?></td>
  156.                   <td><?php echo $content->projectSubmissionStatus($brow->status);?></td>
  157.                   <td align="center"><a href="index.php?do=submissions&amp;action=edit&amp;id=<?php echo $brow->id;?>"><img src="../images/edit.png" alt="" class="tooltip img-wrap2" title="<?php echo lang('EDIT').': '. $brow->title;?>"/></a></td>
  158.                 </tr>
  159.                 <?php endforeach;?>
  160.                 <?php unset($brow);?>
  161.                 <?php endif;?>
  162.               </table>
  163.             </div>
  164.             <div id="files" class="tab_content">
  165.               <?php $filerow = $content->getFilesByProject();?>
  166.               <table cellpadding="0" cellspacing="0" class="display">
  167.                 <thead>
  168.                   <tr>
  169.                     <th width="20">#</th>
  170.                     <th class="left"><?php echo lang('FILE_NAME');?></th>
  171.                     <th class="left"><?php echo lang('FILESIZE');?></th>
  172.                     <th class="left"><?php echo lang('DOWNLOAD');?></th>
  173.                     <th><?php echo lang('EDIT');?></th>
  174.                   </tr>
  175.                 </thead>
  176.                 <?php if(!$filerow):?>
  177.                 <tr>
  178.                   <td colspan="5"><?php echo Filter::msgInfo(lang('FILE_NOFILES'),false);?></td>
  179.                 </tr>
  180.                 <?php else:?>
  181.                 <?php foreach ($filerow as $frow):?>
  182.                 <tr>
  183.                   <th align="center"><?php echo $frow->id;?>.</th>
  184.                   <td><?php echo $frow->title;?></td>
  185.                   <td><?php echo getSize($frow->filesize);?></td>
  186.                   <td><a href="<?php echo UPLOADURL . 'data/' . $frow->filename;?>"><img src="../images/save.png" alt="" class="tooltip img-wrap2" title="<?php echo lang('DOWNLOAD');?>"/></a></td>
  187.                   <td align="center"><a href="index.php?do=files&amp;action=edit&amp;id=<?php echo $frow->id;?>"><img src="../images/edit.png" alt="" class="tooltip img-wrap2" title="<?php echo lang('EDIT').': '.$frow->title;?>"/></a></td>
  188.                 </tr>
  189.                 <?php endforeach;?>
  190.                 <?php unset($frow);?>
  191.                 <?php endif;?>
  192.               </table>
  193.           </div></td>
  194.         </tr>
  195.         <tr>
  196.           <td width="200" style="padding:5px"><input type="submit" name="dosubmit"  value="<?php echo lang('PROJ_UPDATE');?>" class="button button-green"/></td>
  197.           <td style="padding:5px"><a href="index.php?do=projects" class="button-alt button-gray"><?php echo lang('CANCEL');?></a></td>
  198.         </tr>
  199.       </table>
  200.       <input name="client_id" type="hidden" value="<?php echo $row->client_id;?>" />
  201.       <input name="id" type="hidden" value="<?php echo Filter::$id;?>" />
  202.     </form>
  203.   </div>
  204. </div>
  205. <?php echo Core::doForm("processProject");?>
  206. <script type="text/javascript">
  207.   $(document).ready(function() {
  208.     $("#bodycontent, #prob_dich_content").cleditor({
  209.     height:180,
  210.     width:700,
  211.     autoresize: true,});
  212.     $(".tab_content").hide();
  213.     $("#tabs li:first").addClass("selected").show();
  214.     $(".tab_content:first").show();
  215.     $("#tabs li").click(function () {
  216.         $("#tabs li").removeClass("selected");
  217.         $(this).addClass("selected");
  218.         $(".tab_content").hide();
  219.         var activeTab = $(this).find("a").attr("href");
  220.         $(activeTab).show();
  221.         return false;
  222.     });
  223.   });
  224. $(function() {
  225.     $( "#p_status-range" ).slider({
  226.         value:<?php echo $row->p_status;?>,
  227.         min: 0,
  228.         max: 100,
  229.         step: 5,
  230.         slide: function(event, ui) {
  231.             $("#p_status").val( ui.value + "%");
  232.         }
  233.     });
  234.     $("#p_status").val( $("#p_status-range").slider("value") + "%");
  235. });
  236. <?php /*?>
  237. $(function() {
  238.     $( "#b_status-range" ).slider({
  239.         value:<?php echo $row->b_status;?>,
  240.         min: 0,
  241.         max: <?php echo $row->cost;?>,
  242.         slide: function(event, ui) {
  243.             $("#b_status").val("<?php echo $core->cur_symbol;?>" + ui.value);
  244.         }
  245.     });
  246.     $("#b_status").val("<?php echo $core->cur_symbol;?>" + $("#b_status-range").slider("value"));
  247. });
  248. <?php */?>
  249. $(function () {
  250.     $("#start_date, #end_date").datepicker({
  251.         showOn: 'button',
  252.         buttonImage: '../images/calendar.png',
  253.         buttonImageOnly: true,
  254.         dateFormat: 'yy-mm-dd'
  255.     });
  256. });
  257. </script>
  258. <?php break;?>
  259. <?php case"add":?>
  260. <?php if($user->userlevel == 5): print Filter::msgInfo(lang('PROJ_NOPERM'), false); return; endif;?>
  261. <?php $ptype = $content->getProjectTypes();?>
  262. <?php $userlist = $user->getUserList(1);?>
  263. <?php $marcalist = $content->getMarca();?>
  264. <?php $tipoapp = $content->getTipoApp();?>
  265. <h1><img src="../images/projects.png" alt="" /><?php echo lang('PROJ_TITLE1');?></h1>
  266. <p class="info"><?php echo lang('PROJ_INFO1') . lang('REQFIELD1') . required() . lang('REQFIELD2');?></p>
  267. <div class="block-border">
  268.   <div class="block-content">
  269.     <form action="" method="post" id="admin_form" name="admin_form">
  270.       <table cellspacing="0" cellpadding="0" class="forms">
  271.         <thead>
  272.           <tr>
  273.             <th colspan="2" class="left"><?php echo lang('PROJ_SUB1');?></th>
  274.           </tr>
  275.         </thead>
  276.         <tr>
  277.        
  278.         <tr>
  279.           <th><?php echo lang('INVC_CNAME');?>: <?php echo required();?></th>
  280.           <td><select name="client_id" class="custombox" style="width:250px">
  281.               <option value="">--- <?php echo lang('INVC_CLIENTSELECT');?> ---</option>
  282.               <?php if($userlist):?>
  283.               <?php foreach ($userlist as $crow):?>
  284.               <option value="<?php echo $crow->id;?>"><?php echo $crow->name;?></option>
  285.               <?php endforeach;?>
  286.               <?php unset($crow);?>
  287.               <?php endif;?>
  288.             </select>
  289.     <a href="index.php?do=clients-rip&action=add"><img src="../images/client-overview.png" alt="" class="tooltip img-wrap2" title="<?php echo lang('PROJ_ADDCLIENTE');?>"/></a>
  290.             </td>
  291.         </tr>
  292.        
  293.                 <tr>
  294.           <th><?php echo lang('INVC_CNAME');?>: <?php echo required();?></th>
  295.           <td><select name="client_id" class="custombox" style="width:250px">
  296.               <option value="">--- <?php echo lang('INVC_CLIENTSELECT');?> ---</option>
  297.               <?php if($userlist):?>
  298.               <?php foreach ($userlist as $crow):?>
  299.               <option value="<?php echo $crow->id;?>"><?php echo $crow->name;?></option>
  300.               <?php endforeach;?>
  301.               <?php unset($crow);?>
  302.               <?php endif;?>
  303.             </select>
  304.             </td>
  305.         </tr>
  306.  
  307.          <tr>
  308.          <th width="300"><?php echo lang('PROB_DICH');?>: <?php echo required();?></th>
  309.          <td colspan="1"><textarea name="prob_dich" cols="20" rows="1" id="prob_dich_content"></textarea></td>
  310.         </tr>
  311.        
  312.         <tr>
  313.           <th><?php echo lang('PROJ_TYPE');?>: <?php echo required();?></th>
  314.           <td><select name="project_type" class="custombox" style="width:250px">
  315.               <option value="">--- Select Project Type ---</option>
  316.               <?php if ($ptype):?>
  317.               <?php foreach ($ptype as $prow):?>
  318.               <option value="<?php echo $prow->id;?>"><?php echo $prow->title;?></option>
  319.               <?php endforeach;?>
  320.               <?php unset($prow);?>
  321.               <?php endif;?>
  322.             </select></td>
  323.         </tr>
  324.         <tr>
  325.           <th><?php echo lang('PROJ_START');?>:</th>
  326.           <td><input name="start_date" type="text" class="inputbox" id="start_date" size="25" value="<?php echo date('Y-m-d');?>"/></td>
  327.         </tr>
  328.         <tr>
  329.           <th><?php echo lang('PROJ_END');?>:</th>
  330.           <td><input name="end_date" type="text" class="inputbox" id="end_date" size="25" value="<?php echo date('Y-m-d');?>"/></td>
  331.         </tr>
  332.                                                                                                                                    
  333.         <?php /*?>
  334.         <tr>
  335.           <th>Billing Status:</th>
  336.           <td><label for="b_status">Payment Amount:</label>
  337.             <input type="text" id="b_status" style="border:0; color:#5AB814;font-weight:bold; background-color:transparent" name="b_status"/>
  338.             <div id="b_status-range" style="width: 250px;margin-top:2px;margin-left:5px"></div></td>
  339.         </tr>
  340.         <?php */?>
  341.         <tr>
  342.           <th><?php echo lang('PROJ_STATUS');?>:</th>
  343.           <td><label for="p_status"><?php echo lang('PROJ_COMPSTSTUS');?>:</label>
  344.             <input type="text" id="p_status" style="border:0; color:#0084FF;background-color:transparent" name="p_status"/>
  345.             <div id="p_status-range" style="width:250px;margin-top:2px;margin-left:5px"></div></td>
  346.         </tr>
  347.         <tr>
  348.           <th><?php echo lang('PROJ_MANAGER');?>:</th>
  349.           <td><select name="staff_id" class="custombox" style="width:250px">
  350.               <?php foreach ($user->getUserList("9' or userlevel = '5") as $srow):?>
  351.               <option value="<?php echo $srow->id;?>"><?php echo $srow->name;?></option>
  352.               <?php endforeach;?>
  353.               <?php unset($srow);?>
  354.             </select></td>
  355.         </tr>
  356.         <tr>
  357.           <th><?php echo lang('PROJ_NOTIFY');?>:</th>
  358.           <td><?php echo lang('YES');?>
  359.             <input type="radio" name="notify_staff" value="1" />
  360.             <?php echo lang('NO');?>
  361.             <input name="notify_staff" type="radio" value="0" checked="checked" /></td>
  362.         </tr>
  363.         <tr>
  364.           <td><input name="submit" type="submit" value="<?php echo lang('PROJ_ADD');?>" class="button button-green"/></td>
  365.           <td><a href="index.php?do=projects" class="button-alt button-gray"><?php echo lang('CANCEL');?></a></td>
  366.         </tr>
  367.       </table>
  368.     </form>
  369.   </div>
  370. </div>
  371.  
  372. <?php echo Core::doForm("processProject");?>
  373. <script type="text/javascript">
  374.   $(document).ready(function() {
  375.     $("#bodycontent, #prob_dich_content").cleditor({height:250});
  376.   });
  377. <?php /*?>
  378. $(function() {
  379.     $( "#b_status-range" ).slider({
  380.         value:0,
  381.         min: 0,
  382.         max: 0,
  383.         slide: function(event, ui) {
  384.             $("#b_status").val("<?php echo $core->cur_symbol;?>" + ui.value);
  385.         }
  386.     });
  387.      $('#cost').change(function() {
  388.       $('#b_status-range').slider('option','max',parseInt($(this).val()));
  389.     });
  390.     $("#b_status").val("<?php echo $core->cur_symbol;?>" + $("#b_status-range").slider("value"));
  391. });
  392. <?php */?>
  393. $(function() {
  394.     $( "#p_status-range" ).slider({
  395.         value:0,
  396.         min: 0,
  397.         max: 100,
  398.         step: 5,
  399.         slide: function(event, ui) {
  400.             $("#p_status").val( ui.value + "%");
  401.         }
  402.     });
  403.     $("#p_status").val( $("#p_status-range").slider("value") + "%");
  404. });
  405.  
  406. $(function () {
  407.     $("#start_date, #end_date").datepicker({
  408.         showOn: 'button',
  409.         buttonImage: '../images/calendar.png',
  410.         buttonImageOnly: true,
  411.         dateFormat: 'yy-mm-dd'
  412.     });
  413. });
  414. </script>
  415. <?php break;?>
  416. <?php case"details":?>
  417. <?php $row = Core::getRowById("projects", Filter::$id);?>
  418. <?php $urow = Core::getRowById("users", $row->staff_id);?>
  419. <h1><img src="../images/projects.png" alt="" /><?php echo lang('PROJ_TITLE2');?></h1>
  420. <p class="info"><?php echo lang('PROJ_INFO2');?></p>
  421. <div class="block-border">
  422.   <div class="block-content">
  423.     <table cellspacing="0" cellpadding="0" class="forms">
  424.       <thead>
  425.         <tr>
  426.           <th colspan="2" class="left"><?php echo lang('PROJ_SUB2') . $row->title;?></th>
  427.         </tr>
  428.       </thead>
  429.        <tr>
  430.         <th width="200"><?php echo lang('PROB_DICH');?>:</th>
  431.         <td><?php echo $row->prob_dich;?></td>
  432.       </tr>
  433.         <tr>
  434.         <th><?php echo lang('tipo_apparecchio');?>:</th>
  435.         <td><?php echo getValue("title","tipo_apparecchio","id = '".$row->tipo_apparecchio."'");?></td>
  436.       </tr>
  437.       <tr>
  438.         <th width="200"><?php echo lang('PROB_DICH');?>:</th>
  439.         <td><?php echo $row->prob_dich;?></td>
  440.       </tr>
  441.       <tr>
  442.         <th><?php echo lang('PROJ_TYPE');?>:</th>
  443.         <td><?php echo getValue("title","project_types","id = '".$row->project_type."'");?></td>
  444.       </tr>
  445.       <?php if($user->userlevel == 9):?>
  446.       <tr>
  447.         <th><?php echo lang('PROJ_PRICE');?>:</th>
  448.         <td><?php echo $core->formatMoney($row->cost);?></td>
  449.       </tr>
  450.       <?php endif;?>
  451.       <tr>
  452.         <th><?php echo lang('PROJ_START');?>:</th>
  453.         <td><?php echo Filter::dodate($core->short_date, $row->start_date);?></td>
  454.       </tr>
  455.       <tr>
  456.         <th><?php echo lang('PROJ_END');?>:</th>
  457.         <td><?php echo Filter::dodate($core->short_date, $row->end_date);?></td>
  458.       </tr>
  459.       <tr>
  460.         <th><?php echo lang('PROJ_DESC');?>:</th>
  461.         <td><?php echo cleanOut($row->body);?></td>
  462.       </tr>
  463.       <tr>
  464.         <th><?php echo lang('PROJ_STATUS');?>:</th>
  465.         <td><div style="width:350px"><?php echo $content->progressBarStatus($row->p_status);?></div></td>
  466.       </tr>
  467.       <tr>
  468.         <th><?php echo lang('PROJ_BILLSTSTUS');?>:</th>
  469.         <td><div style="width:350px"><?php echo $content->progressBarBilling($row->b_status, $row->cost);?></div></td>
  470.       </tr>
  471.       <tr>
  472.         <th><?php echo lang('PROJ_MANAGER');?>:</th>
  473.         <td><?php echo $urow->fname.' '.$urow->lname;?></td>
  474.       </tr>
  475.       <tr>
  476.         <th><?php echo lang('PROJ_TASKS');?>:</th>
  477.         <td><?php $taskrow = $content->getTasksByProject();?>
  478.           <table cellpadding="0" cellspacing="0" class="display">
  479.             <thead>
  480.               <tr>
  481.                 <th width="20">#</th>
  482.                 <th width="350" class="left"><?php echo lang('TASK_NAME');?></th>
  483.                 <th class="left"><?php echo lang('TASK_PROGRESS');?></th>
  484.               </tr>
  485.             </thead>
  486.             <?php if(!$taskrow):?>
  487.             <tr>
  488.               <td colspan="3"><?php echo Filter::msgInfo(lang('TASK_NOTASKS'),false);?></td>
  489.             </tr>
  490.             <?php else:?>
  491.             <?php foreach ($taskrow as $trow):?>
  492.             <tr>
  493.               <td align="center"><?php echo $trow->id;?>.</td>
  494.               <td><a href="index.php?do=tasks&amp;action=edit&amp;id=<?php echo $trow->id;?>"><?php echo $trow->title;?></a></td>
  495.               <td><?php echo $content->progressBarStatus($trow->progress);?></td>
  496.             </tr>
  497.             <?php endforeach;?>
  498.             <?php unset($trow);?>
  499.             <?php endif;?>
  500.           </table></td>
  501.       </tr>
  502.       <tr>
  503.         <th><?php echo lang('PROJ_SUBS');?>:</th>
  504.         <td><?php $subrow = $content->getProjectSubmissions();?>
  505.           <table cellpadding="0" cellspacing="0" class="display">
  506.             <thead>
  507.               <tr>
  508.                 <th width="20">#</th>
  509.                 <th width="350" class="left"><?php echo lang('SUBS_NAME');?></th>
  510.                 <th class="left"><?php echo lang('SUBS_TYPE');?></th>
  511.               </tr>
  512.             </thead>
  513.             <?php if(!$subrow):?>
  514.             <tr>
  515.               <td colspan="3"><?php echo Filter::msgInfo(lang('SUBS_NOSUBS'),false);?></td>
  516.             </tr>
  517.             <?php else:?>
  518.             <?php foreach ($subrow as $brow):?>
  519.             <tr>
  520.               <td align="center"><?php echo $brow->id;?>.</td>
  521.               <td><a href="index.php?do=submissions&amp;action=edit&amp;id=<?php echo $brow->id;?>"><?php echo $brow->title;?></a></td>
  522.               <td><?php echo $brow->s_type;?></td>
  523.             </tr>
  524.             <?php endforeach;?>
  525.             <?php unset($brow);?>
  526.             <?php endif;?>
  527.           </table></td>
  528.       </tr>
  529.       <tr>
  530.         <th><?php echo lang('PROJ_FILES');?>:</th>
  531.         <td><?php $filerow = $content->getFilesByProject();?>
  532.           <table cellpadding="0" cellspacing="0" class="display">
  533.             <thead>
  534.               <tr>
  535.                 <th width="20">#</th>
  536.                 <th width="350" class="left"><?php echo lang('FILE_NAME');?></th>
  537.                 <th class="left"><?php echo lang('FILESIZE');?></th>
  538.                 <th class="left"><?php echo lang('DOWNLOAD');?></th>
  539.               </tr>
  540.             </thead>
  541.             <?php if(!$filerow):?>
  542.             <tr>
  543.               <td colspan="4"><?php echo Filter::msgInfo(lang('FILE_NOFILES'),false);?></td>
  544.             </tr>
  545.             <?php else:?>
  546.             <?php foreach ($filerow as $frow):?>
  547.             <tr>
  548.               <td align="center"><?php echo $frow->id;?>.</td>
  549.               <td><a href="index.php?do=files&amp;action=edit&amp;id=<?php echo $frow->id;?>"><?php echo $frow->title;?></a></td>
  550.               <td><?php echo getSize($frow->filesize);?></td>
  551.               <td><a href="<?php echo UPLOADURL . 'data/' . $frow->filename;?>"><img src="../images/save.png" alt="" class="tooltip img-wrap2" title="<?php echo lang('DOWNLOAD');?>"/></a></td>
  552.             </tr>
  553.             <?php endforeach;?>
  554.             <?php unset($frow);?>
  555.             <?php endif;?>
  556.           </table></td>
  557.       </tr>
  558.       <tr>
  559.         <td><a href="index.php?do=projects" class="button-alt button-blue"><?php echo lang('PROJ_BACK');?></a></td>
  560.         <td>&nbsp;</td>
  561.       </tr>
  562.     </table>
  563.   </div>
  564. </div>
  565. <?php break;?>
  566. <?php default: ?>
  567. <?php $projectrow = $content->getProjects();?>
  568. <?php $userlist = $user->getUserList(1);?>
  569. <h1><img src="../images/projects.png" alt="" /><?php echo lang('PROJ_TITLE3');?></h1>
  570. <p class="info"><?php echo lang('PROJ_INFO3');?></p>
  571. <div class="block-border">
  572.   <div class="block-content">
  573.     <table cellpadding="0" cellspacing="0" class="display">
  574.       <tr>
  575.         <td class="subtitle"><select name="select" class="custombox" id="clientfilter" style="width:200px">
  576.             <option value="NA">--- <?php echo lang('INVC_CLIENTSELECT');?> ---</option>
  577.             <?php if($userlist):?>
  578.             <?php foreach ($userlist as $crow):?>
  579.             <option value="<?php echo $crow->id;?>"<?php if($crow->id == get('sort')) echo 'selected="selected"';?>><?php echo $crow->name;?></option>
  580.             <?php endforeach;?>
  581.             <?php unset($crow);?>
  582.             <?php endif;?>
  583.           </select></td>
  584.         <td align="right" class="subtitle"><?php echo $pager->items_per_page();?> &nbsp;&nbsp; <?php echo $pager->jump_menu();?></td>
  585.       </tr>
  586.     </table>
  587.   </div>
  588. </div>
  589. <div class="block-border">
  590.   <div class="block-header">
  591.     <h2><?php if($user->userlevel == 9):?><span><a href="index.php?do=projects&amp;action=add" class="add"><?php echo lang('PROJ_ADD');?></a></span><?php endif;?><?php echo lang('PROJ_SUB3');?></h2>
  592.   </div>
  593.   <div class="block-content">
  594.     <table cellspacing="0" cellpadding="0" class="display">
  595.       <thead>
  596.         <tr>
  597.           <th width="20">#</th>
  598.           <th class="left"><?php echo lang('PROJ_TYPE');?></th>
  599.           <th class="left"><?php echo lang('INVC_CNAME');?></th>
  600.           <th class="left"><?php echo lang('PROJ_MANAGER');?></th>
  601.           <th class="left"><?php echo lang('CREATED');?></th>
  602.           <th class="left"><?php echo lang('STATUS');?></th>
  603.           <th class="left"><?php echo lang('BILLING');?></th>
  604.           <th class="right"><?php echo lang('ACTIONS');?></th>
  605.         </tr>
  606.       </thead>
  607.       <?php if($pager->display_pages()):?>
  608.       <tfoot>
  609.         <tr>
  610.           <td colspan="8"><?php echo $pager->display_pages();?></td>
  611.         </tr>
  612.       </tfoot>
  613.       <?php endif;?>
  614.       <?php if($projectrow == 0):?>
  615.       <tr>
  616.         <td colspan="8"><?php echo Filter::msgInfo(lang('PROJ_NOPROJECT'),false);?></td>
  617.       </tr>
  618.       <?php else:?>
  619.       <?php foreach ($projectrow as $row):?>
  620.       <tr>
  621.         <th align="center"><?php echo $row->pid;?>.</th>
  622.         <td><?php echo $row->title;?></td>
  623.         <td><?php echo $row->clientname;?></td>
  624.         <td><?php echo $row->staffname;?></td>
  625.         <td><?php echo Filter::dodate($core->short_date, $row->start_date);?></td>
  626.         <td><?php echo $content->progressBarStatus($row->p_status);?></td>
  627.         <td><?php if($row->recurring):?><?php echo $content->progressBarRecurring();?><?php else:?><?php echo $content->progressBarBilling($row->b_status, $row->cost);?><?php endif;?></td>
  628.         <td class="right"><a href="index.php?do=projects&amp;action=details&amp;id=<?php echo $row->pid;?>"><img src="../images/view.png" alt="" class="tooltip img-wrap2" title="<?php echo lang('PROJ_DETAILS');?>"/></a>
  629.           <?php if($user->userlevel == 9):?>
  630.               <a href="index.php?do=overview&amp;id=<?php echo $row->uid;?>"><img src="../images/client-overview.png" alt="" class="tooltip img-wrap2" title="<?php echo lang('PROJ_CLOVERVIEW');?>"/></a>
  631.               <?php if ($row->b_status == $row->cost):?>
  632.               <a href="index.php?do=invoices&amp;id=<?php echo $row->pid;?>"><img src="../images/project-paid.png" alt="" class="tooltip img-wrap2" title="<?php echo lang('PROJ_PAID');?>"/></a>
  633.               <?php else:?>
  634.               <a href="index.php?do=invoices&amp;action=add&amp;id=<?php echo $row->pid;?>"><img src="../images/payment-pending.png" alt="" class="tooltip img-wrap2" title="<?php echo lang('PROJ_INVOICE');?>"/></a>
  635.               <?php endif;?>
  636.           <?php endif;?>
  637.           <a href="index.php?do=submissions&amp;id=<?php echo $row->pid;?>"><img src="../images/project-submission.png" alt="" class="tooltip img-wrap2" title="<?php echo lang('PROJ_SUBS');?>"/></a>
  638.           <?php if($user->userlevel == 9):?>
  639.           <a href="index.php?do=timebilling&amp;action=add&amp;id=<?php echo $row->pid;?>"><img src="../images/time.png" alt="" class="tooltip img-wrap2" title="<?php echo lang('BILL_ADD_B');?>"/></a>
  640.           <a href="index.php?do=projects&amp;action=edit&amp;id=<?php echo $row->pid;?>"><img src="../images/edit.png" alt="" class="tooltip img-wrap2" title="<?php echo lang('EDIT').': '.$row->title;?>" /></a> <a href="javascript:void(0);" class="delete" id="item_<?php echo $row->pid;?>" rel="<?php echo $row->title;?>"><img src="../images/delete.png" alt="" class="tooltip img-wrap2" title="<?php echo lang('DELETE').': '.$row->title;?>" /></a> <?php endif;?></td>
  641.       </tr>
  642.       <?php endforeach;?>
  643.       <?php unset($row);?>
  644.       <?php endif;?>
  645.     </table>
  646.   </div>
  647. </div>
  648. <?php echo Core::doDelete(lang('PROJ_DELETE'),"deleteProject");?>
  649. <script type="text/javascript">
  650. // <![CDATA[  
  651. $(document).ready(function () {
  652.     $('#clientfilter').change(function () {
  653.         var res = $("#clientfilter option:selected").val();
  654.         (res == "NA" ) ? window.location.href = 'index.php?do=projects' : window.location.href = 'index.php?do=projects&sort=' + res;
  655.     })
  656. });
  657. // ]]>
  658. </script>
  659. <?php break;?>
  660. <?php endswitch;?>
Advertisement
Add Comment
Please, Sign In to add comment