Odyssey
imp_cuissues.prg
1 <?php
2 $monLibrary= dirname(__FILE__) . "/../library";
3 require_once("$monLibrary/cu_top.i");
4 require_once("$monLibrary/ck_hticket.i");
5 require_once("$monLibrary/cu_pass.i");
6 
7  if (!CheckPerm($link, $Hu, basename($_SERVER['SCRIPT_NAME']), $_SERVER['REMOTE_ADDR'])) {
8  // ** Permissions failed
9  // ** redirect to new page
10  header("Location: /hcuadm/hcu_noperm.prg");
11  exit;
12  }
13 
14 $dms_ok=array('act'=>'string','addRows'=>'string','btnAddRows'=>'string',
15 'col00'=>'string','col01'=>'string','col02'=>'string','col03'=>'string',
16 'col04'=>'string','col05'=>'string','col06'=>'string','col07'=>'string',
17 'col08'=>'string','col09'=>'string','col10'=>'string','col11'=>'string',
18 'col12'=>'string','col13'=>'string','col14'=>'string',
19 'Continue_Step1'=>'string','cu_show_opt'=>'string',
20 'direction_to_move'=>'string','dtl_active'=>'string','dtl_assigned'=>'string',
21 'dtl_complete'=>'string','dtl_contact'=>'string','dtl_cu_name'=>'string',
22 'dtl_cu_user'=>'string','dtl_entry'=>'string','dtl_issue'=>'string',
23 'dtl_notes'=>'string','dtl_status'=>'string','item_complete_date_'=>'prefix_s',
24 'item_del_'=>'prefix_s','item_desc_'=>'prefix_s','item_id_'=>'prefix_s',
25 'item_title_'=>'prefix_s','mnt_notes'=>'string','mnt_sel_assgn'=>'string',
26 'mnt_sel_cu'=>'string','mnt_sel_status'=>'string','mnt_track_id'=>'string',
27 'mnt_txt_active'=>'string','mnt_txt_complete'=>'string',
28 'mnt_txt_contact'=>'string','mnt_txt_contact_email'=>'string',
29 'mnt_txt_contact_phone'=>'string','mnt_txt_entry'=>'string',
30 'mnt_txt_iss'=>'string','mnt_txt_last_activity'=>'string',
31 'mnt_txt_next_contact'=>'string','reset_fields'=>'string',
32 'row_to_move'=>'string','save_mnt'=>'string','sel_assgn'=>'string',
33 'sel_comp_act'=>'string','sel_comp_comp'=>'string','sel_comp_ent'=>'string',
34 'sel_comp_last'=>'string','sel_comp_nex'=>'string','sel_cu'=>'string',
35 'sel_fld0'=>'prefix_s','sel_iss'=>'string','sel_ord0'=>'prefix_s',
36 'sel_status'=>'string','show_step'=>'string','step1_sel_cu'=>'string',
37 'step1_sel_issue'=>'string','total_rows'=>'string','track_id'=>'string',
38 'trk_num'=>'string','txt_active'=>'string','txt_complete'=>'string',
39 'txt_enter'=>'string','txt_iss'=>'string','txt_last_activity'=>'string',
40 'txt_next_contact'=>'string','Update_Info'=>'string','view_cu'=>'string',
41 'view_rpt'=>'string');
42 
43 dms_import($dms_ok);
44 
45 #
46 $imgdoc="$infourl/hcuadm/cuimage.prg?act=4";
47 $bpdoc="$infourl/hcuadm/cusso.prg?act=4";
48 $ssodoc="$infourl/hcuadm/cusso.prg?act=5";
49 $rtsearch="http://checkcomposer.com/frmBankSearch.aspx";
50 $toolbar = "|&nbsp;";
51 $toolbar .= "&nbsp;<a href='$imgdoc' target='_imgdoc'>Image Vendors</a>&nbsp;|&nbsp;";
52 $toolbar .= "&nbsp;<a href='$ssodoc' target='_ssodoc'>SSO Vendors</a>&nbsp;|&nbsp;";
53 $toolbar .= "&nbsp;<a href='$bpdoc' target='_bpdoc'>BillPay Vendors</a>&nbsp;|&nbsp;";
54 $toolbar .= "&nbsp;<a href='$rtsearch' target='_rtsearch'>R&amp;T Lookup</a>&nbsp;|&nbsp;";
55 #
56 
57  $self = $_SERVER['PHP_SELF'];
58 
59  $dbh = $link;
60 
61  /* ***** GLOBALS ****** */
62  // These are the available status for the projects
63  $status_list[] = "Issue Complete";
64  $status_list[] = "Waiting on DMS Staff";
65  $status_list[] = "Waiting on Client";
66  $status_list[] = "Waiting on Vendor";
67 
68 
69  // These are the available employee lists that will show up as the assignees
70  $emp_list[] = "Joe";
71  $emp_list[] = "Miki";
72  $emp_list[] = "Cerise";
73  $emp_list[] = "Tyler";
74  $emp_list[] = "Jayme";
75  $emp_list[] = "Kim";
76  $emp_list[] = "Gary";
77  $emp_list[] = "Manny";
78  $emp_list[] = "Mark";
79  $emp_list[] = "Mike";
80  $emp_list[] = "Elaine";
81  $emp_list[] = "Samuel";
82  $emp_list[] = "Paul";
83  $emp_list[] = "Jan";
84  $emp_list[] = "Kip";
85 
86  $form_err = "";
87  $form_msgn = "";
88  cu_header("CU Issues Report");
89 
90  /* Types of activity allowed by this script for variable 'act'
91  4 - General View Screen of Open Issues for clients on implementation
92  20 - View the detail associated with a particular issue
93  */
94 
95  // Reset all instances of the values
96  $myparams = "fld_trk_num=&fld_txt_iss=&fld_sel_cu=&fld_sel_status=&fld_sel_assgn=&fld_sel_comp_ent=&fld_txt_enter=&fld_sel_comp_comp=&fld_txt_complete=&fld_sel_comp_act=&fld_sel_comp_last=&fld_sel_comp_next=&fld_txt_active=&fld_txt_last_activity=&fld_txt_next_contact=&fld_sel_fld01=&fld_sel_fld02=&fld_sel_fld03=&fld_sel_fld04=&fld_col00=Y&fld_col01=Y&fld_col02=Y&fld_col03=Y&fld_col04=Y&fld_col05=Y&fld_col06=Y&fld_col07=Y&fld_col08=Y&fld_col09=Y&fld_col10=Y&fld_col11=Y&fld_col12=N&fld_col13=Y&fld_col14=N";
97  parse_str ($myparams);
98 
99  if (!isset($act)) {
100  $act = 4;
101  } else {
102  $act = intval($_REQUEST['act']);
103  }
104 
105  $sql = "";
106 
107  switch ($act) {
108  case "4": // This is ONLY a listing of NON-COMPLETED items
109  // This is where the report is actually Running from -- RUN IT HERE
110 
111  $conf_sql = ""; // Configurable sql statement
112  $conf_ord = ""; // Configurable Order by statement
113  $sql = "SELECT cutrack.track_id,
114  cutrack.user_name,
115  cutrack.issue,
116  cutrack.status,
117  cutrack.assigned_to,
118  cutrack.contact,
119  cutrack.contact_email,
120  cutrack.contact_phone,
121  to_char(cutrack.entry_date, 'MM/DD/YYYY') as entry_date,
122  to_char(cutrack.active_date, 'MM/DD/YYYY') as active_date,
123  to_char(cutrack.last_activity_date, 'MM/DD/YYYY') as last_activity_date,
124  to_char(cutrack.next_contact_date, 'MM/DD/YYYY') as next_contact_date,
125  to_char(cutrack.complete_date, 'MM/DD/YYYY') as complete_date,
126  cutrack.notes,
127  cuinfo.name
128  FROM cutrack
129  JOIN cuinfo on cuinfo.user_name = cutrack.user_name ";
130  $sql .= " WHERE complete_date is NULL ";
131 
132 // This limited to clients on implementation list
133 // changed 7/15/15 to show all open issues
134 // WHERE (cuinfo.date_live is null or
135 // (coalesce(cuinfo.system_options,0)
136 // & $SYS_TYPE_UPGRADE) = $SYS_TYPE_UPGRADE) ";
137 
138  $rows_sql = " SELECT count(cutrack.track_id) as row_count
139  FROM cutrack
140  JOIN cuinfo on cuinfo.user_name = cutrack.user_name
141  WHERE cutrack.track_id <> 0 ";
142  $rows_sql .= " AND complete_date is NULL ";
143 
144  $ob_desc = array (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
145  // This OPTION will show the results like the implementation screen where you can order and such
146 
147  // ** Also -- check to see if this will be viewed for a particular credit union
148  if (isset($_GET['sel_cu'])) {
149  $sql .= " AND cutrack.user_name= '" . prep_save($sel_cu) . "' ";
150  $rows_sql .= " AND cutrack.user_name= '" . prep_save($sel_cu) . "' ";
151  }
152 
153 
154  // Determine the Ordering of the records
155  $ob_fldid = (intval($_GET['ob']) < 1 || intval($_GET['ob'] > 15) ? 2 : intval($_GET['ob']));
156  $order_sql = " ORDER BY " . get_field(intval($ob_fldid));
157 
158  if (intval($_GET['d']) == 1)
159  $order_sql .= " desc ";
160  else
161  $ob_desc[$ob_fldid] = "1";
162 
163  $sql .= $order_sql;
164 
165  $track_rs = db_query($sql, $dbh);
166 
167  $rows_rs = db_query($rows_sql, $dbh);
168  list($rec_rows) = db_fetch_array($rows_rs, 0);
169  db_free_result($rows_rs);
170 
171  // ****** SECOND *****
172  // LOAD THE ROWS ONTO THE FORM DISPLAYING THE COLUMNS
173  // THAT WERE SELECTED TO BE VIEWED
174  // Count the visible columns
175  $vis_col = 15;
176  // ** VIEW RECORDS
177 ?>
178  <form action="<?php echo $self; ?>" method="get">
179  <input type="hidden" name="act" value="<?php echo $act; ?>">
180  <?php if ($act == 4 && isset($_GET['sel_cu'])): ?>
181  <input type="hidden" name="sel_cu" value="<?php echo $_GET['sel_cu']; ?>">
182  <?php endif; ?>
183  <center>
184  <table cellpadding="3" cellspacing="0" border="0" width="99%" class="dmsbg"><tr><td>
185  <table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor=white>
186  <tr>
187  <td class="ahd" align="center" colspan="<?php echo $vis_col; ?>">
188  CU Issue Report
189 <?php
190  if ($act == 4 && isset($_GET['sel_cu'])) {
191  echo " for " . $_GET['sel_cu'];
192  }
193 ?>
194  </td>
195  </tr>
196  <?php
197  if (strlen($form_msg) > 0) {
198  $form_msg = trim($form_msg);
199  print <<< form_error
200  <tr>
201  <td class='msg' colspan='$vis_col' align='center'>
202  $form_msg
203  </td>
204  </tr>
205 form_error;
206  }
207  ?>
208  <tr>
209  <?php
210  // Determine the columns that will be visible
211  $fld_col00 = "N";
212  $fld_col01 = "Y";
213  $fld_col02 = "Y";
214  $fld_col03 = "Y";
215  $fld_col04 = "Y";
216  $fld_col05 = "Y";
217  $fld_col06 = "Y";
218  $fld_col07 = "N";
219  $fld_col08 = "N";
220  $fld_col09 = "Y";
221  $fld_col10 = "N";
222  $fld_col11 = "Y";
223  $fld_col12 = "N";
224  $fld_col13 = "Y";
225  $fld_col14 = "N";
226 
227  ?>
228  <td class="hdr">&nbsp;</td>
229  <td class="hdr"><a href="<?php echo $self; ?>?act=<?php echo $act; ?>&ob=2&d=<?php echo $ob_desc[2]; ?>">Issue</a></td>
230  <td class="hdr"><a href="<?php echo $self; ?>?act=<?php echo $act; ?>&ob=1&d=<?php echo $ob_desc[1]; ?>">CU Code</a></td>
231  <td class="hdr"><a href="<?php echo $self; ?>?act=<?php echo $act; ?>&ob=3&d=<?php echo $ob_desc[3]; ?>">CU Name</a></td>
232  <td class="hdr"><a href="<?php echo $self; ?>?act=<?php echo $act; ?>&ob=4&d=<?php echo $ob_desc[4]; ?>">Status</a></td>
233  <td class="hdr"><a href="<?php echo $self; ?>?act=<?php echo $act; ?>&ob=5&d=<?php echo $ob_desc[5]; ?>">Assigned To</a></td>
234  <td class="hdr"><a href="<?php echo $self; ?>?act=<?php echo $act; ?>&ob=6&d=<?php echo $ob_desc[6]; ?>">Entered On</a></td>
235  <td class="hdr"><a href="<?php echo $self; ?>?act=<?php echo $act; ?>&ob=11&d=<?php echo $ob_desc[11]; ?>">Last Activity</a></td>
236  <td class="hdr"><a href="<?php echo $self; ?>?act=<?php echo $act; ?>&ob=9&d=<?php echo $ob_desc[9]; ?>">CU Contact</a></td>
237  <td class="hdr"><a href="<?php echo $self; ?>?act=<?php echo $act; ?>&ob=13&d=<?php echo $ob_desc[13]; ?>">Email</a></td>
238  <?php
239  print <<< js_code
240  <script language="javascript">
241  <!--
242  function view_detail(track_id) {
243  var newwin = null;
244  // This function will open a new window and view the vendor information
245  var url = "$self?act=20&view=" + track_id;
246  var height = window.screen.availHeight - 50;
247  var width = window.screen.availWidth - 5;
248  newwin = window.open(url, "DetailInfo", "width=" + width + ", height=" + height + ", resizable=yes, scrollbars=yes, status=no, menubar=no, location=no, top=0, left=0");
249  //newwin = window.open(url, "DetailInfo", "width=200, height=200, resizable=yes, scrollbars=yes, status=yes, menubar=yes, location=yes, top=0, left=0");
250  }
251  // -->
252  </script>
253 js_code;
254  ?>
255  </tr>
256 
257 
258  <?php if ($rec_rows == 0): ?>
259  <tr>
260  <td class="ahd" align="center" colspan="<?php echo $vis_col; ?>">
261  No Records Found
262  </td>
263  </tr>
264  <?php else: ?>
265  <?php
266  $row_cnt = 0;
267  while($track_row = db_fetch_array($track_rs, $row_cnt++)):
268  $row_class = ($row_class == "odd" ? "even" : "odd"); ?>
269 
270  <tr class="<?php echo $row_class; ?>">
271  <td class="td7" nowrap>
272  <a href="javascript:view_detail('<?php echo $track_row['track_id']; ?>')" onMouseOver="status='View Details for (<?php echo trim($track_row['user_name']); ?>)<?php echo trim($track_row['issue']); ?>'; return true;" onMouseOut="status='';" ><img src="/monitor/images/glass.gif" border=0></a>
273  </td>
274  <?php if ($fld_col00 == "Y"): ?>
275  <td class="usul">&nbsp;<?php echo dms_disphtml($track_row['track_id']); ?></td>
276  <?php endif; ?>
277  <?php if ($fld_col02 == "Y"): ?>
278  <td class="usul">&nbsp;<?php echo dms_disphtml($track_row['issue']); ?></td>
279  <?php endif; ?>
280  <?php if ($fld_col01 == "Y"): ?>
281  <td class="usul">&nbsp;<?php echo dms_disphtml($track_row['user_name']); ?></td>
282  <?php endif; ?>
283  <?php if ($fld_col03 == "Y"): ?>
284  <td class="usul">&nbsp;<?php echo dms_disphtml($track_row['name']); ?></td>
285  <?php endif; ?>
286  <?php if ($fld_col04 == "Y"): ?>
287  <td class="usul">&nbsp;<?php echo dms_disphtml($track_row['status']); ?></td>
288  <?php endif; ?>
289  <?php if ($fld_col05 == "Y"): ?>
290  <td class="usul">&nbsp;<?php echo dms_disphtml($track_row['assigned_to']); ?></td>
291  <?php endif; ?>
292  <?php if ($fld_col06 == "Y"): ?>
293  <td class="usul">&nbsp;<?php echo $track_row['entry_date']; ?></td>
294  <?php endif; ?>
295  <?php if ($fld_col07 == "Y"): ?>
296  <td class="usul">&nbsp;<?php echo $track_row['active_date']; ?></td>
297  <?php endif; ?>
298  <?php if ($fld_col11 == "Y"): ?>
299  <td class="usul">&nbsp;<?php echo $track_row['last_activity_date']; ?></td>
300  <?php endif; ?>
301  <?php if ($fld_col12 == "Y"): ?>
302  <td class="usul">&nbsp;<?php echo $track_row['next_contact_date']; ?></td>
303  <?php endif; ?>
304  <?php if ($fld_col08 == "Y"): ?>
305  <td class="usul">&nbsp;<?php echo $track_row['complete_date']; ?></td>
306  <?php endif; ?>
307  <?php if ($fld_col09 == "Y"): ?>
308  <td class="usul">&nbsp;<?php echo dms_disphtml($track_row['contact']); ?></td>
309  <?php endif; ?>
310  <?php if ($fld_col13 == "Y"): ?>
311  <td class="usul">&nbsp;<a href="mailto:<?php echo dms_disphtml($track_row['contact_email']); ?>"><?php echo dms_disphtml($track_row['contact_email']); ?></a></td>
312  <?php endif; ?>
313  <?php if ($fld_col14 == "Y"): ?>
314  <td class="usul">&nbsp;<?php echo dms_disphtml($track_row['contact_phone']); ?></td>
315  <?php endif; ?>
316  <?php if ($fld_col10 == "Y"): ?>
317  <td class="usul">&nbsp;<?php echo dms_disphtml($track_row['notes']); ?></td>
318  <?php endif; ?>
319  </tr>
320  <?php endwhile; ?>
321  <?php endif; ?>
322  <tr>
323  <td class="ahd" colspan="<?php echo $vis_col; ?>" >
324  &nbsp;&nbsp;&nbsp;&nbsp;
325  <a href="/hcuadm/imp_menu.prg" target="_top">Return to Implementation</a>
326  &nbsp;&nbsp;&nbsp;&nbsp;
327  </td>
328  </tr>
329  </table>
330  </td></tr></table>
331  </form>
332  </body>
333  </html>
334 <?php
335  break;
336  case "12":
337  // **** ISSUE MAINTENANCE FORM
338  // If we are editing -- then load the information here
339 
340  $myparams = "fld_track_id=&fld_mnt_txt_iss=&fld_mnt_sel_cu=&fld_mnt_sel_status=&fld_mnt_sel_assgn=&fld_mnt_sel_contact=&fld_mnt_txt_entry=&fld_mnt_txt_active=&fld_mnt_txt_last_activity=&fld_mnt_txt_next_contact&fld_mnt_txt_complete=&fld_mnt_notes=";
341  parse_str ($myparams);
342  if (isset($_GET['view'])) {
343  // We are attempting to LOAD information from the database
344  $cu_show_opt = 0;
345  $sql = "SELECT track_id,
346  user_name,
347  issue,
348  status,
349  assigned_to,
350  contact,
351  contact_email,
352  contact_phone,
353  to_char(entry_date, 'MM/DD/YYYY') as entry_date,
354  to_char(active_date, 'MM/DD/YYYY') as active_date,
355  to_char(last_activity_date, 'MM/DD/YYYY') as last_activity_date,
356  to_char(next_contact_date, 'MM/DD/YYYY') as next_contact_date,
357  to_char(complete_date, 'MM/DD/YYYY') as complete_date,
358  notes
359  FROM cutrack
360  WHERE track_id = '" . intval($_GET['view']) . "' ";
361  $view_rs = db_query($sql, $dbh);
362  $view_row = db_fetch_array($view_rs, 0);
363  db_free_result($view_rs);
364 
365  $fld_mnt_track_id = $view_row['track_id'];
366  $fld_mnt_txt_iss = $view_row['issue'];
367  $fld_mnt_sel_cu = trim($view_row['user_name']);
368  $fld_mnt_sel_status = trim($view_row['status']);
369  $fld_mnt_sel_assgn = trim($view_row['assigned_to']);
370  $fld_mnt_txt_contact = $view_row['contact'];
371  $fld_mnt_txt_contact_email = $view_row['contact_email'];
372  $fld_mnt_txt_contact_phone = $view_row['contact_phone'];
373  $fld_mnt_txt_entry = $view_row['entry_date'];
374  $fld_mnt_txt_active = $view_row['active_date'];
375  $fld_mnt_txt_last_activity = $view_row['last_activity_date'];
376  $fld_mnt_txt_next_contact = $view_row['next_contact_date'];
377  $fld_mnt_txt_complete = $view_row['complete_date'];
378  $fld_mnt_notes = $view_row['notes'];
379  } else {
380  // Load an Empty screen -- for a new issue
381  $cu_show_opt = 1;
382  $fld_mnt_txt_entry = date("m/d/Y");
383  $fld_mnt_txt_active = date("m/d/Y");
384  $cu_show_opt = 0;
385  }
386 
387  print_set_date();
388 ?>
389 
390  <form action="<?php echo $self; ?>" method="post">
391  <?php if (isset($_POST['view_cu']) || isset($_GET['view_cu'])):?>
392  <input type="hidden" name="view_cu" value="1">
393  <?php endif; ?>
394  <input type="hidden" name="act" value="12">
395  <input type="hidden" name="mnt_track_id" value="<?php echo $fld_mnt_track_id; ?>">
396  <center>
397  <table cellpadding="3" cellspacing="0" border="0" width="100%" class="dmsbg"><tr><td>
398  <table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor=white>
399  <tr>
400  <td colspan="2" class="barb" align="center">CU Issue Tracking</td>
401  </tr>
402  <?php
403  if (strlen($form_err) > 0) {
404  print <<< form_error
405  <tr>
406  <td class='err' colspan='4' align='center'>
407  Errors were found saving the information. Please review errors and try again<br>
408  $form_err<br>
409  </td>
410  </tr>
411 form_error;
412  } elseif (strlen($form_msg) > 0) {
413  print <<< form_error
414  <tr>
415  <td class='msg' colspan='4' align='center'>
416  $form_msg
417  </td>
418  </tr>
419 form_error;
420  }
421  ?>
422  <?php if (isset($_POST['Continue_Step1']) || isset($_POST['show_step'])): ?>
423  <tr>
424  <td class="hdr" align="left">
425  <input type="hidden" name="show_step" value="1">
426  <span class="instr_2">Step 2.</span>
427  </td>
428  <td class="hdr">
429  Complete the form and use the 'Save CU Issue' button.
430  </td>
431  </tr>
432  <?php endif; ?>
433  <tr>
434  <td class="hdr" align="right" width="20%">
435  TRACKING NUMBER:
436  </td>
437  <td class="dtl" width="80%">&nbsp;
438  <?php
439  if ($fld_mnt_track_id == "")
440  echo "NEW TRACKING REQUEST";
441  else
442  echo $fld_mnt_track_id;
443  ?>
444  </td>
445  </tr>
446 
447 
448 
449  <tr>
450  <td class="hdr" align="right">
451  CREDIT UNION:
452  </td>
453  <td class="dtl">&nbsp;
454  <?php if ($cu_show_opt == 1): ?>
455  <select name="mnt_sel_cu" size="1">
456  <option value="">All Credit Unions</option>
457  <?php
458  $sql = "SELECT user_name, name
459  FROM cuinfo
460  ORDER BY user_name ";
461  $cu_rs = db_query($sql, $dbh);
462  $row_idx = 0;
463  while (list($cu_code, $cu_name) = db_fetch_array($cu_rs, $row_idx++)) {
464  $cu_code = dms_disphtml($cu_code);
465  $cu_name = dms_disphtml($cu_name);
466  print "<option value=\"$cu_code\"" . ($fld_mnt_sel_cu == $cu_code ? "SELECTED" : "") . ">$cu_code: $cu_name</option>";
467  }
468  db_free_result($cu_rs);
469  ?>
470  </select>
471  <?php else: ?>
472  <?php echo dms_disphtml(get_cuname($fld_mnt_sel_cu)); ?>
473  <input type="hidden" name="mnt_sel_cu" value="<?php echo dms_disphtml($fld_mnt_sel_cu); ?>">
474  <?php endif; ?>
475  <input type="hidden" name="cu_show_opt" value="<?php echo dms_disphtml($cu_show_opt); ?>">
476  </td>
477  </tr>
478  <tr>
479  <td class="hdr" align="right">ISSUE:</td>
480  <td class="dtl">&nbsp;
481  <input type="text" name="mnt_txt_iss" value="<?php echo dms_disphtml($fld_mnt_txt_iss); ?>" maxlength="90" size="50">
482  </td>
483  </tr>
484  <tr>
485  <td class="hdr" align="right">
486  STATUS:
487  </td>
488  <td colspan="1" class="dtl">&nbsp;
489  <select name="mnt_sel_status" size="1">
490  <option value="">Show All</option>
491  <?php
492  foreach ($status_list as $value) {
493  print "<option value=\"$value\"" . (trim($fld_mnt_sel_status) == trim($value) ? "SELECTED" : "") . ">$value</option>";
494  }
495  ?>
496  </select>
497  </td>
498  </tr>
499  <tr>
500  <td class="hdr" align="right">
501  ASSIGNED TO:
502  </td>
503  <td colspan="1" class="dtl">&nbsp;
504  <select name="mnt_sel_assgn" size="1">
505  <option value="">Any Assignee</option>
506  <?php
507  foreach ($emp_list as $value) {
508  print "<option value=\"$value\"" . ($fld_mnt_sel_assgn == $value? "SELECTED" : "") . ">$value</option>";
509  }
510  ?>
511  </select>
512  </td>
513  </tr>
514  <tr>
515  <td class="hdr" align="right">
516  CU CONTACT:
517  </td>
518  <td colspan="1" class="dtl">&nbsp;
519  <input type="text" name="mnt_txt_contact" value="<?php echo dms_disphtml($fld_mnt_txt_contact); ?>" maxlength="80" size="50">
520  </td>
521  </tr>
522  <tr>
523  <td class="hdr" align="right">
524  CONTACT EMAIL :
525  </td>
526  <td colspan="1" class="dtl">&nbsp;
527  <input type="text" name="mnt_txt_contact_email" value="<?php echo dms_disphtml($fld_mnt_txt_contact_email); ?>" maxlength="50" size="50">
528  </td>
529  </tr>
530  <tr>
531  <td class="hdr" align="right">
532  CONTACT PHONE :
533  </td>
534  <td colspan="1" class="dtl">&nbsp;
535  <input type="text" name="mnt_txt_contact_phone" value="<?php echo dms_disphtml($fld_mnt_txt_contact_phone); ?>" maxlength="20" size="20">
536  </td>
537  </tr>
538 
539 
540 
541  <tr>
542  <td class="hdr" align="right">
543  ENTERED ON:
544  </td>
545  <td class="dtl" align="left">&nbsp;
546  <input type="text" name="mnt_txt_entry" value="<?php echo dms_disphtml($fld_mnt_txt_entry); ?>" size="12" maxlength="10">
547  <a href="javascript:set_date('mnt_txt_entry')" style="{color: blue;}"><img src="/monitor/images/admin_tack.gif" alt="Set Date" border=0></a>&nbsp;&nbsp;
548  </td>
549  </tr>
550  <tr>
551  <td class="hdr" align="right">
552  ACTIVE ON:
553  </td>
554  <td class="dtl" align="left">&nbsp;
555  <input type="text" name="mnt_txt_active" value="<?php echo dms_disphtml($fld_mnt_txt_active); ?>" size="12" maxlength="10">
556  <a href="javascript:set_date('mnt_txt_active')" style="{color: blue;}"><img src="/monitor/images/admin_tack.gif" alt="Set Date" border=0></a>&nbsp;&nbsp;
557  </td>
558  </tr>
559  <tr>
560  <td class="hdr" align="right">
561  LAST ACTIVITY DATE:
562  </td>
563  <td class="dtl" align="left">&nbsp;
564  <input type="text" name="mnt_txt_last_activity" value="<?php echo dms_disphtml($fld_mnt_txt_last_activity); ?>" size="12" maxlength="10">
565  <a href="javascript:set_date('mnt_txt_last_activity')" style="{color: blue;}"><img src="/monitor/images/admin_tack.gif" alt="Set Date" border=0></a>&nbsp;&nbsp;
566  </td>
567  </tr>
568  <tr>
569  <td class="hdr" align="right">
570  NEXT CONTACT DATE:
571  </td>
572  <td class="dtl" align="left">&nbsp;
573  <input type="text" name="mnt_txt_next_contact" value="<?php echo dms_disphtml($fld_mnt_txt_next_contact); ?>" size="12" maxlength="10">
574  <a href="javascript:set_date('mnt_txt_next_contact')" style="{color: blue;}"><img src="/monitor/images/admin_tack.gif" alt="Set Date" border=0></a>&nbsp;&nbsp;
575  </td>
576  </tr>
577  <tr>
578  <td class="hdr" align="right">
579  COMPLETED ON:
580  </td>
581  <td class="dtl" align="left">&nbsp;
582  <input type="text" name="mnt_txt_complete" value="<?php echo dms_disphtml($fld_mnt_txt_complete); ?>" size="12" maxlength="10">
583  <a href="javascript:set_date('mnt_txt_complete')" style="{color: blue;}"><img src="/monitor/images/admin_tack.gif" alt="Set Date" border=0></a>&nbsp;&nbsp;
584  </td>
585  </tr>
586  <tr>
587  <td class="hdr" align="right" valign="top">
588  NOTES:
589  </td>
590  <td class="dtl" align="left">&nbsp;
591  <textarea name="mnt_notes" rows="15" cols="50"><?php echo dms_disphtml($fld_mnt_notes); ?></textarea>
592  </td>
593  </tr>
594  <tr>
595  <td class="dtl">
596  <a href="/hcuadm/imp_menu.prg" target="_top">Return to Implementation</a>
597  <br>
598  <a href="/hcuadm/cuissues_report.prg?act=4<?php if (isset($_GET['view_cu'])) echo "&sel_cu=" . urlencode($fld_mnt_sel_cu); ?>">Open Issues</a>
599  <br>
600  <a href="/hcuadm/cuissues_report.prg">Report CU Issues</a>
601  </td>
602  <td class="dtl">
603  </td>
604  </tr>
605  <tr>
606  <td colspan="2">
607  <table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor=white>
608  <tr>
609  <td colspan=3 nowrap align="center" class="dtl"><hr>
610  <?php echo $toolbar; ?><br>&nbsp;
611  </td>
612  </tr>
613  <tr>
614  <td colspan=3 nowrap align="center" class="bar">
615  Items Required for Issue
616  </td>
617  </tr>
618  <tr>
619  <td align="center" class="hdr" width="5%">
620  Row
621  </td>
622  <td align="left" class="hdr" width="30%">
623  Title
624  </td>
625  <td align=left class='hdr' width="50%">
626  Description
627  </td>
628  </tr>
629  <?php
630  $RGB = "odd";
631  $addblankrows = 0;
632 
633  if (isset($_POST['total_rows'])) {
634  $total_rows = $_POST['total_rows'];
635  // Loop here the number of times we need to see the detail
636  $row_idx = 0;
637  $field_idx = 0;
638  $row_up = 0;
639  $row_dwn = 0;
640  $skip_rows = 1;
641  // Loop here the number of times we need to see the detail
642  for ($loop_idx = 1; $loop_idx <= $total_rows; $loop_idx++) {
643 
644  $row_idx = $loop_idx + $row_up; // THIS IS ADJUST ON UP MOVEMENTS
645  $field_idx = $loop_idx + $row_dwn;
646  // handle the case for moving a row up
647 
648 
649  // *** CHECK FOR MOVING A ROW UP -- AND PRINT IF FOUND
650  if (($_POST['direction_to_move'] == "UP" &&
651  intval($_POST['row_to_move']) > $skip_rows) &&
652  intval($_POST['row_to_move']) == ($loop_idx + $skip_rows)) {
653  print_item_line ($row_idx, $_POST["item_id_" . ($row_idx + $skip_rows)], dms_disphtml(trim($_POST["item_title_" . ($row_idx + $skip_rows)])), dms_disphtml(trim($_POST["item_desc_" . ($row_idx + $skip_rows)])), $_POST["item_del_" . ($row_idx + $skip_rows)], $RGB, dms_disphtml(trim($_POST["item_complete_date_" . ($row_idx + $skip_rows)])));
654  $row_up = 1;
655  $row_idx = $loop_idx + $row_up;
656  $RGB = ($RGB == "odd" ? "even" : "odd");
657  }
658 
659  // *** CHECK FOR MOVING A LINE DOWN
660  if (($_POST['direction_to_move'] == "DOWN" &&
661  intval($_POST['row_to_move']) > 0) &&
662  intval($_POST['row_to_move']) == $loop_idx &&
663  intval($_POST['row_to_move']) < $total_rows) {
664  $row_dwn = 1; // ADJUST THE NEXT ROW TO PRINT VALUE
665  $field_idx = $loop_idx + $row_dwn;
666 
667  }
668 
669  // **** PRINT THE REGULAR LINE
670  if ($_POST['direction_to_move'] == "" ||
671  ($_POST['direction_to_move'] == "UP" && intval($_POST['row_to_move']) <= 1) ||
672  ($_POST['direction_to_move'] == "UP" && intval($_POST['row_to_move']) != $loop_idx) ||
673  ($_POST['direction_to_move'] == "DOWN" && $loop_idx != (intval($_POST['row_to_move']) + $skip_rows))) {
674  print_item_line ($row_idx, $_POST["item_id_$field_idx"], dms_disphtml(trim($_POST["item_title_$field_idx"])), dms_disphtml(trim($_POST["item_desc_$field_idx"])), $_POST["item_del_$field_idx"], $RGB, dms_disphtml(trim($_POST["item_complete_date_$field_idx"])));
675  // print_item_line ($loop_idx, $_POST["item_id_$loop_idx"], $_POST["item_title_$loop_idx"] , $_POST["item_desc_$loop_idx"], $_POST["item_del_$loop_idx"], $RGB);
676  $RGB = ($RGB == "odd" ? "even" : "odd");
677  }
678 
679 
680  // *** HERE POSSIBLY PRINT THE ROW MOVING DOWN
681  if (($_POST['direction_to_move'] == "DOWN" && intval($_POST['row_to_move']) > 0) && intval($_POST['row_to_move']) == ($loop_idx - $skip_rows)) {
682 
683  print_item_line ($row_idx, $_POST["item_id_" . ($loop_idx - $skip_rows)], dms_disphtml(trim($_POST["item_title_" . ($loop_idx - $skip_rows)])) , dms_disphtml(trim($_POST["item_desc_" . ($loop_idx - $skip_rows)])), $_POST["item_del_" . ($loop_idx - $skip_rows)], $RGB, dms_disphtml(trim($_POST["item_complete_date_" . ($loop_idx - $skip_rows)])));
684  $row_dwn = 0;
685  $RGB = ($RGB == "odd" ? "even" : "odd");
686  //$row_idx = $loop_idx + $row_dwn;
687  }
688 
689  // *** RESET ANY VALUES AFTER THE ADJUSTED ROW HAS BEEN DEALT WITH
690  if (($_POST['direction_to_move'] == "UP" && intval($_POST['row_to_move']) == $loop_idx)) {
691  $row_up = 0;
692  }
693 
694 
695 // print_item_line ($loop_idx, $_POST["item_id_$loop_idx"], dms_disphtml(trim($_POST["item_title_$loop_idx"])) , dms_disphtml(trim($_POST["item_desc_$loop_idx"])), $_POST["item_del_$loop_idx"], $RGB, "");
696 // $RGB = ($RGB == "odd" ? "even" : "odd");
697  }
698  $addblankrows = 0;
699  } elseif (isset($_POST['Continue_Step1'])) {
700  if (intval($_POST['step1_sel_issue']) > 0) {
701  // ** TEMPLATE LOADING
702  $total_rows = 0;
703  // LOAD FROM THE DATABASE
704  $sql = "SELECT *
705  FROM cuissuesitem
706  WHERE issue_id = '" . intval($_POST['step1_sel_issue']) . "'
707  ORDER BY view_order ";
708  $item_rs = db_query($sql, $dbh);
709  $item_row = 0;
710  while ($item_row = db_fetch_array($item_rs, $item_rows++)) {
711  print_item_line ($item_rows, 0, dms_disphtml($item_row['title']), dms_disphtml($item_row['item_desc']), "", $RGB, "");
712  $RGB = ($RGB == "odd" ? "even" : "odd");
713  $total_rows++;
714  }
715  db_free_result($item_rs);
716  // When loading from database -- Load 3 extra spots
717  }
718  $addblankrows = 3;
719  } else {
720  // ** ISSUE DATABASE LOADING
721  $sql = "SELECT trackitem_id,
722  track_id,
723  title,
724  item_desc,
725  to_char(complete_date, 'MM/DD/YYYY') as complete_date
726  FROM cutrackitem
727  WHERE track_id = '$fld_mnt_track_id'
728  ORDER BY view_order ";
729  $det_rs = db_query($sql, $dbh);
730  $total_rows = 0;
731  while ($det_row = db_fetch_array($det_rs, $total_rows)) {
732  $total_rows++;
733  print_item_line ($total_rows, $det_row['trackitem_id'], dms_disphtml($det_row['title']) , dms_disphtml($det_row['item_desc']), "", $RGB, $det_row['complete_date']);
734  $RGB = ($RGB == "odd" ? "even" : "odd");
735  }
736  $addblankrows = 3;
737  }
738  if (isset($_POST['addRows']) && isset($_POST['btnAddRows'])) {
739  $addblankrows = $_POST['addRows'];
740  }
741  if ($addblankrows > 0) {
742  // Add that many rows
743  for ($loop_idx = 1; $loop_idx <= $addblankrows; $loop_idx++) {
744  $total_rows++;
745  print_item_line ($total_rows, "", "" , "", "", $RGB, "");
746  $RGB = ($RGB == "odd" ? "even" : "odd");
747  }
748  }
749  ?>
750 
751  <tr>
752  <td colspan=3 nowrap align="right" class="dtl">
753  <hr>
754  </td>
755  </tr>
756  <tr>
757  <td class="dtl">&nbsp;</td>
758  <td nowrap align="left" class="dtl">
759  &nbsp;
760  </td>
761  <td nowrap align="right" class="dtl" colspan="1">
762  </td>
763  </tr>
764  </table>
765  </td>
766  </tr>
767  </table>
768  </td></tr></table>
769 <?php
770  break;
771  case "20":
772  // This should allow easy viewing
773  if (isset($_GET['view'])) {
774  $track_id = intval($_GET['view']);
775  } else {
776  $track_id = intval($_POST['track_id']);
777  }
778  // ** NOTES
779  // ** STATUS
780  // ** COMPLETE DATE
781  // ** DETAIL ITEMS --
782 
783  $sql = "SELECT cuinfo.name,
784  issue,
785  status,
786  assigned_to,
787  contact,
788  to_char(entry_date, 'MM/DD/YYYY') as entry_date,
789  to_char(active_date, 'MM/DD/YYYY') as active_date,
790  to_char(complete_date, 'MM/DD/YYYY') as complete_date,
791  notes,
792  cutrack.user_name
793  FROM cutrack
794  JOIN cuinfo on cuinfo.user_name = cutrack.user_name
795  WHERE track_id = '$track_id' ";
796  $track_rs = db_query($sql, $dbh);
797  $track_row = db_fetch_array($track_rs, 0);
798  db_free_result($track_rs);
799 
800  $fld_cu_name = trim($track_row['name']);
801  $fld_cu_user = trim($track_row['user_name']);
802  $fld_issue = trim($track_row['issue']);
803  $fld_status = trim($track_row['status']);
804  $fld_assigned_to = trim($track_row['assigned_to']);
805  $fld_contact = trim($track_row['contact']);
806  $fld_entry = trim($track_row['entry_date']);
807  $fld_active = trim($track_row['active_date']);
808  $fld_complete = trim($track_row['complete_date']);
809  $fld_notes = trim($track_row['notes']);
810 
811  print_set_date();
812 ?>
813  <form action="<?php echo $self; ?>" method="post">
814  <center>
815  <table cellpadding="3" cellspacing="0" border="0" width="95%" class="dmsbg"><tr><td>
816  <table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor=white>
817  <tr>
818  <td colspan="2" class="barb" align="center"><?php echo $fld_issue; ?> for <?php echo $fld_cu_name; ?><br><?php echo $fld_status; ?>
819 </td>
820  </tr>
821  <tr>
822  <td colspan="2" class="barb" align="right">
823  <a href="javascript:window.close();" class="barb">Close Window</a><br>&nbsp;
824  </td>
825  </tr>
826  <tr>
827  <td class="" valign="top">
828  <table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor=white>
829  <tr>
830  <td class="hdr">
831  Entered On:
832  </td>
833  <td class="dtl"> <?php echo dms_disphtml($fld_entry); ?>
834  </td>
835  </tr>
836  <tr>
837  <td class="hdr" valign="top">
838  Notes:
839  </td>
840  <td class="dtl">
841  <textarea name="dtl_notes" rows="15" cols="35"><?php echo dms_disphtml($fld_notes); ?></textarea>
842  </td>
843  </tr>
844  </table>
845  </td>
846  <td class="dtl" valign="top">
847  <table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor=white>
848  <tr>
849  <td align="left" class="hdr" >
850  Description
851  </td>
852  <td class="hdr" >&nbsp;</td>
853  <td class="hdr" >&nbsp;</td>
854  </tr>
855 
856  <?php
857  $RGB = "odd";
858  $addblankrows = 0;
859 
860  // ** ISSUE DATABASE LOADING
861  $sql = "SELECT trackitem_id,
862  track_id,
863  title,
864  item_desc,
865  to_char(complete_date, 'MM/DD/YYYY') as complete_date
866  FROM cutrackitem
867  WHERE track_id = '$track_id'
868  ORDER BY view_order ";
869  $det_rs = db_query($sql, $dbh);
870  $total_rows = 0;
871  while ($det_row = db_fetch_array($det_rs, $total_rows)) {
872  $total_rows++;
873  print_line_cond ($total_rows, $det_row['trackitem_id'], dms_disphtml($det_row['title']) , dms_disphtml($det_row['item_desc']), "", $RGB, $det_row['complete_date']);
874  $RGB = ($RGB == "odd" ? "even" : "odd");
875  }
876  ?>
877  <tr>
878  <td colspan=3 align="right" class="dtl">
879  <hr>
880  </td>
881  </tr>
882  <tr>
883  <td class="dtlr" colspan="3">&nbsp;
884  </td>
885  </tr>
886  </table>
887  </td>
888  </tr>
889  </table>
890  </td></tr></table>
891 
892 <?php
893  break;
894  }
895 
896 
897 
898  // Included Functions for this script
899 
900  function get_comp($value="") {
901 
902  switch ($value) {
903  case "1":
904  $ret_comp = "<";
905  break;
906  case "2":
907  $ret_comp = "<=";
908  break;
909  case "3":
910  $ret_comp = "=";
911  break;
912  case "4":
913  $ret_comp = ">";
914  break;
915  case "5":
916  $ret_comp = ">=";
917  break;
918  case "6":
919  $ret_comp = "<>";
920  break;
921  default:
922  $ret_comp = "";
923  }
924 
925  return $ret_comp;
926  }
927 
928 
929 
930  function get_field($value) {
931  switch (intval($value)) {
932  case 0:
933  $ret_field = " cutrack.track_id ";
934  break;
935  case 1:
936  $ret_field = " cutrack.user_name ";
937  break;
938  case 2:
939  $ret_field = " cutrack.issue ";
940  break;
941  case 3:
942  $ret_field = " cuinfo.name ";
943  break;
944  case 4:
945  $ret_field = " cutrack.status ";
946  break;
947  case 5:
948  $ret_field = " cutrack.assigned_to ";
949  break;
950  case 6:
951  $ret_field = " cutrack.entry_date ";
952  break;
953  case 7:
954  $ret_field = " cutrack.active_date ";
955  break;
956  case 8:
957  $ret_field = " cutrack.complete_date ";
958  break;
959  case 9:
960  $ret_field = " cutrack.contact ";
961  break;
962 /*
963  case 10:
964  $ret_field = " cutrack.notes ";
965  break;
966 */
967  case 11:
968  $ret_field = " cutrack.last_activity_date ";
969  break;
970  case 12:
971  $ret_field = " cutrack.next_contact_date ";
972  break;
973  case 13:
974  $ret_field = " cutrack.contact_email ";
975  break;
976  case 14:
977  $ret_field = " cutrack.contact_phone ";
978  break;
979  default:
980  $ret_field = "";
981  }
982 
983  return $ret_field;
984  }
985 
986 
987  function add_order($cur_stmt, $stmt) {
988  // This will create a string to add to the where clause
989  // If there is already a value it adds the "," portion
990 
991  if (strlen($cur_stmt) == 0)
992  return $stmt;
993  else
994  return ", " . $stmt;
995  }
996  function get_desc($value) {
997  if ($value == "Y")
998  return " DESC ";
999  else
1000  return "";
1001  }
1002  function get_cuname($user_name) {
1003  global $dbh;
1004  // ** LOAD CREDIT UNION NAME
1005  $sql = "SELECT name
1006  FROM cuinfo
1007  WHERE user_name = '" . prep_save($user_name) . "' ";
1008  $cu_rs = db_query($sql, $dbh);
1009  list($ret_val) = db_fetch_array($cu_rs, 0);
1010  $ret_val = trim($ret_val);
1011 
1012  db_free_result($iss_rs);
1013 
1014  return $ret_val;
1015  }
1016  function print_item_line ($row_id, $field_id, $title_val, $desc_val, $del_val, $row_class, $comp_date_val) {
1017  // This is the function to add a line to the row
1018 
1019 
1020  $del_val = ($del_val == "Y" ? "CHECKED" : "");
1021 
1022  // If there is a VALID line item ID field, then show the complete box, otherwise show the delete checkbox
1023  if (intval($field_id) > 0) {
1024  $row_opt = "<nobr><span class=\"usu\">Complete on</span> <input type=\"text\" name=\"item_complete_date_$row_id\" value=\"$comp_date_val\" maxlength=\"10\" size=\"10\">";
1025  $row_opt .= "<a href=\"javascript:set_date('item_complete_date_$row_id')\" style=\"{color: blue;}\"><img src=\"/monitor/images/admin_tack.gif\" alt=\"Set Date\" border=0></a></nobr>";
1026  } else {
1027  $row_opt = "<span class=\"usu\">Delete?</span><input type=\"checkbox\" name=\"item_del_$row_id\" value=\"Y\" $del_val>";
1028  }
1029  print <<< Print_Row
1030  <tr class="$row_class">
1031  <td valign="top" class="usu" align="center" nowrap>
1032  $row_id
1033  </td>
1034  <td valign="top" align="left" class="">
1035  <input type="hidden" name="item_id_$row_id" value="$field_id">
1036  <input type="text" name="item_title_$row_id" size="35" maxlength="50" value="$title_val">
1037  $row_opt
1038  </td>
1039  <td align=left class='' valign='top'>
1040  <textarea rows=3 cols=30 name="item_desc_$row_id">$desc_val</textarea>
1041  </td>
1042 <!--
1043  <td align="center" valign="top">
1044  $row_opt
1045  </td>
1046 -->
1047  </tr>
1048 Print_Row;
1049  }
1050  function print_line_cond ($row_id, $field_id, $title_val, $desc_val, $del_val, $row_class, $comp_date_val) {
1051  // This is the function to add a line to the row
1052 
1053 
1054  $del_val = ($del_val == "Y" ? "CHECKED" : "");
1055 
1056  // If there is a VALID line item ID field, then show the complete box, otherwise show the delete checkbox
1057  if (intval($field_id) <= 0) {
1058  $row_opt = "<span class=\"usu\">Delete?</span><br><input type=\"checkbox\" name=\"item_del_$row_id\" value=\"Y\" $del_val>";
1059  print <<< Print_Row
1060  <tr class="$row_class">
1061  <td class="usu" align="center" valign="top" nowrap>
1062  $row_id
1063  </td>
1064  <td align="left" class="" valign="top">
1065  <input type="hidden" name="item_id_$row_id" value="$field_id">
1066  <input type="text" name="item_title_$row_id" size="30" maxlength="50" value="$title_val">
1067  <br>
1068  <textarea rows=3 cols=30 name="item_desc_$row_id">$desc_val</textarea>
1069  </td>
1070  <td align="center" valign="top">
1071  $row_opt
1072  </td>
1073  </tr>
1074 Print_Row;
1075  } else {
1076  $row_opt = "<span class=\"usu\"><nobr>Completed On:</nobr></span><br><nobr><input type=\"text\" name=\"item_complete_date_$row_id\" value=\"$comp_date_val\" maxlength=\"10\" size=\"10\"> <a href=\"javascript:set_date('item_complete_date_$row_id')\" style=\"{color: blue;}\"><img src=\"/monitor/images/admin_tack.gif\" alt=\"Set Date\" border=0></a></nobr>";
1077  print <<< Print_Row
1078  <tr class="$row_class">
1079  <td class="usu" align="center" valign="top" nowrap>
1080  $row_id
1081  </td>
1082  <td align="left" class="usu" valign="top">
1083  <input type="hidden" name="item_id_$row_id" value="$field_id">
1084  <input type="hidden" name="item_title_$row_id" value="$title_val">
1085  <span class="usub">$title_val</span>
1086  <br>
1087  <input type="hidden" name="item_desc_$row_id" value="$desc_val">
1088  $desc_val
1089  </td>
1090  <td align="center" valign="top">
1091  $row_opt
1092  </td>
1093  </tr>
1094 Print_Row;
1095  }
1096  }
1097 
1098 
1099  // save_date will format the date string (including surrounding "'"), but if the date string is empty it will return null
1100  function dms_save_date($date) {
1101  if (strlen(trim($date)) == 0)
1102  return "null";
1103  else
1104  return "'" . dateformat("Y-m-d", $date) . "'";
1105 
1106  }
1107 
1108 
1109  function print_set_date() {
1110 
1111  $today_date = date('m/d/Y');
1112  print <<< js_code
1113  <script language="javascript">
1114  <!--
1115  function set_date(datefield) {
1116  var type;
1117  var cur_form = document.forms[0];
1118 
1119  if (cur_form.elements[datefield]) {
1120  if (cur_form.elements[datefield].type == "text") {
1121  // Make sure we are modifying a text field
1122  // Now set the value of the date field to todays date
1123  cur_form.elements[datefield].value = "$today_date";
1124  }
1125  }
1126  }
1127  // -->
1128  </script>
1129 js_code;
1130  }
1131 ?>