Advertisement
Guest User

admin_c1.php

a guest
Feb 11th, 2013
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.48 KB | None | 0 0
  1.  
  2. <?php
  3.  
  4. session_start();
  5. // display_errors = On;
  6. // error_reporting(E_ALL);
  7. // ini_set('display_errors',1);
  8. // ini_set("log_errors", 1);
  9. // ini_set('error_log', dirname(__FILE__) .'\ERROR_LOG.PHP');
  10. //include 'THIS-IS-A-TEST-TO-SEE-IF-THE-_____ERROR_LOG_____.PHP IS WORKING';
  11.  
  12.  
  13. if ( ! isset($_SESSION['usertype']) =='Admin')
  14. {
  15. echo "You are not authorized to use this website. Try to obtain the necessary rights to use it!";
  16. exit;
  17. }
  18.  
  19. //session_start();
  20. if ( $_SESSION['usertype'] == 'Admin')
  21.  
  22.  
  23. //if(true)
  24. //the following variables hold the firstname and lastname of the logged in user. This can be used to append with the notes the user adds
  25. {
  26. $user = $_SESSION['firstname']." ".$_SESSION['lastname'];
  27. require 'connect_sql.php';
  28. $recent_ID_query = mysql_query("SELECT MAX(ID) FROM c1_report");
  29.  
  30. $recent_ID = mysql_result($recent_ID_query,0);
  31.  
  32. if($recent_ID == '')
  33. $recent_ID ='1';
  34. else
  35. $recent_ID = $recent_ID + 1;
  36. ?>
  37.  
  38. <!DOCTYPE HTML>
  39. <html>
  40. <head>
  41. <html lang="en">
  42.  
  43. <meta charset="utf-8">
  44. <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
  45.  
  46. <link rel="stylesheet" href="css/ui-lightness/jquery-ui-1.8.22.custom.css">
  47. <link rel ="stylesheet" type ="text/css" href ="css/style.css">
  48.  
  49.  
  50. <div class="Add New User">
  51.  
  52. <!-- title -->
  53. <title> Report </title>
  54. <link rel="shortcut icon" type="image/x-icon" href="images/base.gif" />
  55.  
  56. <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
  57. <script type="text/javascript" src = "//ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js"></script>
  58.  
  59. <style>
  60. body { font-size: 62.5%; }
  61. label, input { display:block; }
  62. input.text { margin-bottom:12px; width:95%; padding: .4em; }
  63. fieldset { padding:0; border:0; margin-top:25px; }
  64. h1 { font-size: 1.2em; margin: .6em 0; }
  65.  
  66. .ui-dialog .ui-state-error { padding: .3em; }
  67. .validateTips { border: 1px solid transparent; padding: 0.3em; }
  68. </style>
  69.  
  70. <script>
  71. $(function() {
  72. var canBeAdded = false;
  73. $("#email").change(function() {
  74. var tips = $( ".validateTips" );
  75. var email = $("#email").val();
  76. email = email.toLowerCase();
  77.  
  78. function check_valid_company()
  79. {
  80. var email = $("#email").val();
  81. email = email.toLowerCase();
  82. if(email.indexOf("@gmail.com") != -1 || email.indexOf("@yahoo.com") != -1 )
  83. return true;
  84.  
  85. else
  86. return false;
  87.  
  88. }
  89.  
  90. function updateTips( t ) {
  91. tips
  92. .text( t )
  93. .addClass( "ui-state-highlight" );
  94. setTimeout(function() {
  95. tips.removeClass( "ui-state-highlight", 1500 );
  96. }, 500 );
  97. }
  98. if(email.length >= 3)
  99. {
  100. $.ajax({
  101. type: "POST",
  102. url: "email_check_indb.php",
  103. data: "email="+ email,
  104. success: function(msg){
  105.  
  106. $("#create-user").ajaxComplete(function(event, request, settings){
  107.  
  108. if(msg == 'OK')
  109. {
  110. if(!check_valid_company())
  111. {
  112. $("#email").addClass( "ui-state-error" );
  113. updateTips( "Not a valid email type to be added to the system for this company." );
  114. }
  115. else{
  116.  
  117. $("#email").removeClass( "ui-state-error" );
  118.  
  119. updateTips("Email can be added to the system");
  120. canBeAdded = true;
  121. }
  122. }
  123. else
  124. {
  125. updateTips("Email already in database");
  126. canBeAdded = false;
  127. $("#email").addClass( "ui-state-error" );
  128. }});}});}
  129. else
  130. {
  131. $("#email").removeClass( "ui-state-error" );
  132. canBeAdded = false;
  133. }});
  134.  
  135. $("#dialog:ui-dialog").ready(function() {
  136. $("#estimated_start_on").datepicker();
  137. });
  138. $("#dialog:ui-dialog").ready(function() {
  139. $("#actual_start_on").datepicker();
  140. });
  141.  
  142. $("#dialog:ui-dialog").ready(function() {
  143. $("#estimated_researchready_for_service").datepicker();
  144. });
  145. $("#dialog:ui-dialog").ready(function() {
  146. $("#actual_researchready_for_service").datepicker();
  147. });
  148.  
  149. $( "#dialog:ui-dialog" ).dialog( "destroy" );
  150.  
  151.  
  152. var firstname = $('#firstname'),
  153. lastname = $('#lastname'),
  154. email = $('#email'),
  155. internalnotes = $( "#internalnotes" ),
  156. statusnotes = $("#statusnotes"),
  157. estimatedresearchhours = $( "#estimatedresearchhours" ),
  158. title = $("#title"),
  159. description = $("#description"),
  160. actualresearchhours = $("#actualresearchhours"),
  161. estimateddevhours = $("#estimateddevhours"),
  162. actualdevhours = $("#actualdevhours"),
  163. estimatedqahours = $("#estimatedqahours"),
  164. actualqahours = $("#actualqahours"),
  165. estimated_start_on = $("#estimated_start_on"),
  166. actual_start_on = $("#actual_start_on"),
  167.  
  168. estimated_researchready_for_service = $("#estimated_researchready_for_service"),
  169. actual_researchready_for_service = $("#actual_researchready_for_service"),
  170. environment = $('#environment'),
  171. businessowner = $('#businessowner'),
  172. internalproductowner = $('#internalproductowner'),
  173. billable = $('#billable'),
  174. status = $('#status'),
  175. priority = $('#priority'),
  176. ranking = $('#ranking'),
  177. team = $('#team'),
  178. statusnotes = $('#statusnotes'),
  179. internalnotes = $('#internalnotes'),
  180. allFields = $( [] ).add(firstname).add(lastname).add(email).add( internalnotes ).add(statusnotes).add( estimatedresearchhours ).add(title).add(description).add(actualresearchhours ).add(estimateddevhours).add(actualdevhours).add(estimatedqahours).add(actualqahours).add(estimated_start_on).add(actual_start_on).add(estimated_researchready_for_service).add(actual_researchready_for_service).add(environment).add(businessowner).add(internalproductowner).add(billable).add(status).add(priority).add(ranking).add(team).add(statusnotes).add(internalnotes),
  181. tips = $( ".validateTips" );
  182.  
  183. function updateTips( t ) {
  184. tips
  185. .text( t )
  186. .addClass( "ui-state-highlight" );
  187. setTimeout(function() {
  188. tips.removeClass( "ui-state-highlight", 1500 );
  189. }, 500 );
  190. }
  191.  
  192. function timedRefresh(timeoutPeriod) {
  193. setTimeout("location.reload(true);",timeoutPeriod);
  194. }
  195.  
  196. function check_valid_company(o)
  197. {
  198. var email = o.val();
  199. email = email.toLowerCase();
  200. if(email.indexOf("@gmail.com") != -1 || email.indexOf("@yahoo.com") != -1)
  201. {
  202. return true;
  203.  
  204. }
  205. else
  206. {
  207. o.addClass( "ui-state-error" );
  208. updateTips( "Not a valid email type to be added to the system for this company." );
  209. return false;
  210. }
  211. }
  212. function check_logintype(){
  213. var login_type = $('input:radio[name=Login_Type]:checked').val();
  214. if(login_type == null || login_type ==""){
  215. updateTips("Login Type should be selected");
  216. return false;
  217. }
  218. else{
  219. return true;
  220. }
  221. }
  222.  
  223. function checkLength( o, n, min, max ) {
  224. if ( o.val().length > max || o.val().length < min ) {
  225. o.addClass( "ui-state-error" );
  226. updateTips( "Length of " + n + " must be between " +
  227. min + " and " + max + "." );
  228. return false;
  229. } else {
  230. return true;
  231. }
  232. }
  233. function checkEmpty(o){
  234. if(o.length>0)
  235. return true;
  236. else
  237. return false;
  238. }
  239.  
  240. function checkRegexp( o, regexp, n ) {
  241. if ( !( regexp.test( o.val() ) ) ) {
  242. o.addClass( "ui-state-error" );
  243. updateTips( n );
  244. return false;
  245. } else {
  246. return true;
  247. }
  248. }
  249. function Random() {
  250. return Math.floor(Math.random() * 1000);
  251. }
  252. function checkUser(o){
  253. if(canBeAdded == true)
  254. return true;
  255. else{
  256. updateTips("Email already exists in the database");
  257. o.addClass( "ui-state-error" );
  258. return false;
  259. }
  260. }
  261. $( "#addnewitem-form" ).dialog({
  262. autoOpen: false,
  263. closeOnEscape : true,
  264. height: 500,
  265. show : 'fade',
  266. width: 360,
  267. modal: false,
  268. resizable : false,
  269. buttons: {
  270. "Submit": function() {
  271. var bValid = true;
  272.  
  273. var ID_check = $("#ID").val();
  274. var title = $("#title").val();
  275. var description = $("#description").val();
  276. var environment = $("#environment").val();
  277. var businessowner = $("#businessowner").val();
  278. var internalproductowner = $("#internalproductowner").val();
  279. var billable = $("#billable").val();
  280. var status = $("#status").val();
  281. var estimatedresearchhours = $("#estimatedresearchhours").val();
  282. var actualresearchhours = $("#actualresearchhours").val();
  283. var estimateddevhours = $("#estimateddevhours").val();
  284. var actualdevhours = $("#actualdevhours").val();
  285. var estimatedqahours = $("#estimatedqahours").val();
  286. var actualqahours = $("#actualqahours").val();
  287. var priority = $("#priority").val();
  288. var ranking = $("#ranking").val();
  289. var estimated_start_on = $("#estimated_start_on").val();
  290. var actual_start_on = $("#actual_start_on").val();
  291. var estimated_researchready_for_service = $("#estimated_researchready_for_service").val();
  292. var actual_researchready_for_service = $("#actual_researchready_for_service").val();
  293. var team = $("#team").val();
  294.  
  295. var statusnotes = $("#statusnotes").val();
  296. var internalnotes = $("#internalnotes").val();
  297. var isEdit = $("#isEdit").val();
  298. var username = $("#username").val();
  299.  
  300. var varData = 'ID=' + ID_check + '&title=' + title+'&description=' + description + '&environment=' + environment + '&businessowner=' + businessowner + '&internalproductowner=' + internalproductowner + '&billable=' + billable + '&status=' + status + '&estimatedresearchhours=' + estimatedresearchhours + '&actualresearchhours=' + actualresearchhours + '&estimateddevhours=' + estimateddevhours + '&actualdevhours=' + actualdevhours + '&actualqahours=' + actualqahours +'&estimatedqahours=' + estimatedqahours+ '&priority=' + priority + '&ranking=' + ranking + '&estimated_start_on=' + estimated_start_on + '&actual_start_on=' + actual_start_on + '&estimated_researchready_for_service=' + estimated_researchready_for_service +'&actual_researchready_for_service=' + actual_researchready_for_service + '&team=' + team + '&statusnotes=' + statusnotes +'&internalnotes=' + internalnotes + '&username='+username;
  301.  
  302.  
  303. if(bValid && (isEdit == "N") )
  304. {
  305.  
  306. $.ajax({
  307. type: "POST",
  308. url:'add_new_item_cnt_todb.php',
  309. data: varData,
  310. success: function() {
  311. alert("Item with ID "+ ID_check + " will be added shortly.");
  312. }
  313.  
  314. });
  315. timedRefresh(3000);
  316.  
  317. $( this ).dialog( "close" );
  318. }
  319. else if(bValid && ( isEdit === "Y" )){
  320. varData = varData + '&username=' + $("#username").val();
  321.  
  322. $.ajax({
  323. type: "POST",
  324. url:'admin_edit_to_cntdb.php',
  325. data: varData,
  326. success: function() {
  327.  
  328. }
  329.  
  330. });
  331. timedRefresh(3000);
  332.  
  333. $( this ).dialog( "close" );
  334.  
  335.  
  336. }
  337.  
  338. },
  339. Cancel: function() {
  340. $( this ).dialog( "close" );
  341. }
  342. },
  343. close: function() {
  344.  
  345. }
  346. });
  347.  
  348. $( "#dialog-form" ).dialog({
  349. autoOpen: false,
  350. closeOnEscape : true,
  351. height: 400,
  352. show : 'fade',
  353. width: 350,
  354. modal: true,
  355. resizable : false,
  356. buttons: {
  357. "Create an account": function() {
  358. var bValid = true;
  359. allFields.removeClass( "ui-state-error" );
  360.  
  361. bValid = bValid && checkLength( firstname, "First Name", 3, 16 );
  362. bValid = bValid && checkLength( lastname, "Last Name", 3, 16 );
  363. bValid = bValid && checkLength( email, "email", 6, 80 );
  364. bValid = bValid && check_logintype();
  365. bValid = bValid && checkRegexp(email, /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/, "eg. abc@def.com" );
  366. bValid = bValid && check_valid_company(email);
  367. bValid = bValid && checkUser(email);
  368.  
  369. var fname = $( "#firstname" ).val();
  370. var lname = $("#lastname").val();
  371. var mail = $( "#email" ).val();
  372.  
  373. var logintype = $('input:radio[name=Login_Type]:checked').val();
  374.  
  375. var varData = 'firstname=' + fname + '&lastname=' + lname + '&email=' + mail + '&logintype=' + logintype;
  376.  
  377.  
  378.  
  379. if(bValid)
  380. {
  381. $.ajax({
  382. type: "POST",
  383. url:'sendActivation.php',
  384. data: varData,
  385. success: function(msg) {
  386. if(msg == 'OK')
  387. {
  388.  
  389. alert('Email sent to ' + fname + '. Please advice ' + fname + ' to check spam/junk folder for activation link.');
  390. }
  391. else if(msg == 'Mail not sent'){
  392.  
  393. alert('Mail server is down. ' + fname + ' was not added to the system. Please try adding later.');
  394. }
  395. else{
  396. alert ("User already exists in the system, can't be added again.");
  397. }
  398.  
  399. }
  400. });
  401. canBeAdded = false;
  402. $( this ).dialog( "close" );
  403. }
  404.  
  405. },
  406. Cancel: function() {
  407. allFields.val( "" ).removeClass( "ui-state-error" );
  408. updateTips("All form fields are required");
  409. $( this ).dialog( "close" );
  410. }
  411. },
  412. close: function() {
  413. updateTips("All form fields are required");
  414. allFields.val( "" ).removeClass( "ui-state-error" );
  415. }
  416. });
  417.  
  418. $( "#create-user" )
  419. .button()
  420. .click(function() {
  421. $( "#dialog-form" ).dialog( "open" );
  422. });
  423.  
  424. $( "#add-new-item" )
  425. .button()
  426. .click(function() {
  427. $( "#dialog:ui-dialog" ).dialog( "destroy" );
  428. $( "#addnewitem-form" ).dialog( "open" );
  429.  
  430. $("#addnewitem-form").dialog('option', 'title', 'Add New Item');
  431.  
  432. $("#addnewitem-form").get($("#isEdit").val("N"));
  433.  
  434. $( "#addnewitem-form" ).dialog( "open" );
  435. $("#addnewitem-form").get($("#title").val(""));
  436. $("#addnewitem-form").get($("#description").val(""));
  437. $("#addnewitem-form").get($("#environment").val(""));
  438. $("#addnewitem-form").get($("#businessowner").val(""));
  439. $("#addnewitem-form").get($("#internalproductowner").val(""));
  440. $("#addnewitem-form").get($("#billable").val(""));
  441. $("#addnewitem-form").get($("#status").val(""));
  442. $("#addnewitem-form").get($("#estimatedresearchhours").val(""));
  443. $("#addnewitem-form").get($("#actualresearchhours").val(""));
  444. $("#addnewitem-form").get($("#estimateddevhours").val(""));
  445. $("#addnewitem-form").get($("#actualdevhours").val(""));
  446. $("#addnewitem-form").get($("#estimatedqahours").val(""));
  447. $("#addnewitem-form").get($("#actualqahours").val(""));
  448. $("#addnewitem-form").get($("#priority").val(""));
  449. $("#addnewitem-form").get($("#ranking").val(""));
  450. $("#addnewitem-form").get($("#estimated_start_on").val(""));
  451. $("#addnewitem-form").get($("#actual_start_on").val(""));
  452. $("#addnewitem-form").get($("#estimated_researchready_for_service").val(""));
  453. $("#addnewitem-form").get($("#actual_researchready_for_service").val(""));
  454. $("#addnewitem-form").get($("#team").val(""));
  455.  
  456.  
  457. });
  458. $(".edit").button().click(function(){
  459. $( "#dialog:ui-dialog" ).dialog( "destroy" );
  460. var id = this.id;
  461.  
  462. var n = id.split("+");
  463.  
  464. $( "#addnewitem-form" ).dialog( "open" );
  465. $("#addnewitem-form").dialog('option', 'title', 'Edit Item');
  466. $("#addnewitem-form").get($("#ID").val(n[0]));
  467. $("#addnewitem-form").get($("#title").val(n[1]));
  468. $("#addnewitem-form").get($("#description").val(n[2]));
  469. $("#addnewitem-form").get($("#environment").val(n[3]));
  470. $("#addnewitem-form").get($("#businessowner").val(n[4]));
  471. $("#addnewitem-form").get($("#internalproductowner").val(n[5]));
  472. $("#addnewitem-form").get($("#billable").val(n[6]));
  473. $("#addnewitem-form").get($("#status").val(n[7]));
  474. $("#addnewitem-form").get($("#estimatedresearchhours").val(n[11]));
  475. $("#addnewitem-form").get($("#actualresearchhours").val(n[12]));
  476. $("#addnewitem-form").get($("#estimateddevhours").val(n[13]));
  477. $("#addnewitem-form").get($("#actualdevhours").val(n[14]));
  478. $("#addnewitem-form").get($("#estimatedqahours").val(n[15]));
  479. $("#addnewitem-form").get($("#actualqahours").val(n[16]));
  480. $("#addnewitem-form").get($("#priority").val(n[8]));
  481. $("#addnewitem-form").get($("#ranking").val(n[9]));
  482. $("#addnewitem-form").get($("#estimated_start_on").val(n[17]));
  483. $("#addnewitem-form").get($("#actual_start_on").val(n[18]));
  484. $("#addnewitem-form").get($("#estimated_researchready_for_service").val(n[19]));
  485. $("#addnewitem-form").get($("#actual_researchready_for_service").val(n[20]));
  486. $("#addnewitem-form").get($("#team").val(n[10]));
  487. $("#addnewitem-form").get($("#isEdit").val("Y"));
  488. $("#addnewitem-form").get($("#username").val(n[21]));
  489. });
  490.  
  491. });
  492.  
  493. function scroll_header()
  494. {
  495. var scrOfY = 0;
  496. if(typeof(window.pageYOffset) == 'number')
  497. {
  498. //Netscape compliant
  499. scrOfY = window.pageYOffset;
  500. }
  501. else if(document.body && document.body.scrollTop)
  502. {
  503. //DOM compliant
  504. scrOfY = document.body.scrollTop;
  505. }
  506. else if(document.documentElement && document.documentElement.scrollTop)
  507. {
  508. //IE6 standards compliant mode
  509. scrOfY = document.documentElement.scrollTop;
  510. }
  511. document.getElementById('header').style.top=scrOfY;
  512. }
  513.  
  514.  
  515.  
  516.  
  517. </script>
  518.  
  519. </head>
  520. <body onscroll="scroll_header();">
  521. <!-- title -->
  522. <title> Report view </title>
  523. <link rel="shortcut icon" type="image/x-icon" href="images/base.gif" />
  524. <link href="style_admin.css" rel="stylesheet" type="text/css">
  525.  
  526. <div id="container">
  527.  
  528. <div id="header">
  529.  
  530. <img src="images/main_logo.png" border="0" style="position: relative;left:450px;top:10px" height="80%" />
  531.  
  532. <br /> <br />
  533.  
  534. <a href="index.html" style="position: relative;left:1333px;top:-110px">Logout</a>
  535. <a href="admin_select.php" style="position: relative;left:1276px;top:-75px">View a different client report</a>
  536. <a href="phpexcel/Tests/down_admin_cnt.php" style="position: relative;left:1048px;top:-40px">Download as Excel</a>
  537. </div>
  538.  
  539.  
  540.  
  541.  
  542. <div class="Add New User">
  543.  
  544. <div id="dialog-form" title="Add New User">
  545. <p class="validateTips"><big>All form fields are required</big></p>
  546.  
  547. <form>
  548. <fieldset>
  549.  
  550. <label for="first_name"><b><big>First Name</big></b></label>
  551. <input type="text" name="firstname" id = "firstname" class="text ui-widget-content ui-corner-all" />
  552.  
  553. <label for="last_name"><b><big>Last Name</big></b></label>
  554. <input type="text" name="lastname" id = "lastname" class="text ui-widget-content ui-corner-all" />
  555.  
  556. <label for="email"><b><big>Email</big></b></label>
  557. <input type="text" name="email" id="email" class="text ui-widget-content ui-corner-all" />
  558.  
  559. <label for="logintype"><b><big>Login Type</big></b></label><br/>
  560.  
  561. <input type="radio" class = "radio" name="Login_Type" value="Business Owner" id = "Login_Type" />Business Owner
  562. <input type="radio" class = "radio" name="Login_Type" value="Business User" id = "Login_Type" />Business User<br />
  563.  
  564. </fieldset>
  565. </form>
  566. </div>
  567. <div style="position: relative;">
  568. <button id="create-user" style="left:122px;top:-105px" >Add New User</button>
  569.  
  570. </div>
  571.  
  572.  
  573. <div class="demo-description">
  574. </div>
  575.  
  576. <div class="Add New Item">
  577.  
  578. <div id="addnewitem-form" title="Add New Item">
  579. <form>
  580. <fieldset>
  581.  
  582. <label for="ID"><b><big>ID </big></b></label>
  583. <input type="text" name="ID" value = "<?php echo $recent_ID;?>" id = "ID" disabled="disabled" class="text ui-widget-content ui-corner-all" /><br />
  584.  
  585. <label for="Title"><b><big>Title</big></b></label>
  586. <input type = "text" name="title" id = "title" value = "" class="text ui-widget-content ui-corner-all" >
  587. <br>
  588. <label for="Description"><b><big>Description</big></b></label>
  589. <input type = "text" name="description" id = "description" value = "" class="text ui-widget-content ui-corner-all" >
  590.  
  591. <br>
  592. <label for="environment"><b><big>Environment</big></b></label>
  593. <select id = "environment" class="text ui-widget-content ui-corner-all">
  594. <option value=""></option>
  595. <option value="Windows">Windows</option>
  596. <option value="Win 2008">Win 2008</option>
  597. <option value="Win 7">Win 7</option>
  598. <option value="Win Vista">Win Vista</option>
  599. <option value ="Linux">Linux</option>
  600. <option value = "Win 7/Linux">Win 7/Linux</option>
  601. <option value = "All">All</option>
  602. </select><br><br>
  603. <label for="businessowner"><b><big>Business Owner</big></b></label>
  604. <select id = "businessowner" class="text ui-widget-content ui-corner-all">
  605. <option value=""></option>
  606. <option value = "Jose Arteaga">Jose Arteaga</option>
  607. <option value = "Gus Barazza">Gus Barazza</option>
  608.  
  609.  
  610.  
  611. </select><br><br>
  612. <label for="internalproductowner"><b><big>Internal Product Owner</big></b></label>
  613. <select id = "internalproductowner" class="text ui-widget-content ui-corner-all">
  614. <option value = ""></option>
  615. <option value = "D">D</option>
  616. <option value = "A>A</option>
  617. <option value = "Du">Du</option>
  618. <option value = "V">V</option>
  619. <option value = "K">K</option>
  620. </select><br><br>
  621. <label for="billable"><b><big>Billable</big></b></label>
  622. <select id = "billable" class="text ui-widget-content ui-corner-all">
  623. <option value=""></option>
  624. <option value = "Yes">Yes</option>
  625. <option value = "No">No</option>
  626. <option value = "TBD">TBD</option>
  627. </select><br><br>
  628. <label for="status"><b><big>Status</big></b></label>
  629. <select id = "status" class="text ui-widget-content ui-corner-all">
  630. <option value=""></option>
  631. <option value = "Implementing">Implementing</option>
  632. <option value = "Pending">Pending</option>
  633. <option value = "Testing">Testing</option>
  634. <option value = "Design Review">Design Review</option>
  635. <option value = "Blocked">Blocked</option>
  636. <option value = "Completed">Completed</option>
  637. <option value = "Investigating">Investigating</option>
  638. <option value = "New">New</option>
  639. <option value = "Postponed">Postponed</option>
  640. <option value = "closed">closed</option>
  641. </select><br><br>
  642. <label for="estimatedresearchhours"><b><big>Estimated Research Hours</big></b></label>
  643. <input type = "text" name = "estimatedhours" id = "estimatedresearchhours" class="text ui-widget-content ui-corner-all"><br>
  644. <label for="actualresearchhours"><b><big>Actual Research Hours</big></b></label>
  645. <input type = "text" name ="actualhours" id = "actualresearchhours" class="text ui-widget-content ui-corner-all"><br>
  646. <label for="estimateddevhours"><b><big>Estimated Dev Hours</big></b></label>
  647. <input type = "text" name = "estimateddevhours" id = "estimateddevhours" class="text ui-widget-content ui-corner-all"><br>
  648. <label for="actualdevhours"><b><big>Actual Dev Hours</big></b></label>
  649. <input type = "text" name = "actualdevhours" id = "actualdevhours" class="text ui-widget-content ui-corner-all"><br>
  650. <label for="estimataedqahours"><b><big>Estimated QA Hours</big></b></label>
  651. <input type = "text" name = "estimatedqahours" id = "estimatedqahours" class="text ui-widget-content ui-corner-all"><br>
  652. <label for="actualqahours"><b><big>Actual QA Hours</big></b></label>
  653. <input type = "text" name = "actualqahours" id = "actualqahours" class="text ui-widget-content ui-corner-all"><br>
  654. <label for="last_name"><b><big>Priority</big></b></label>
  655. <select id = "priority" class="text ui-widget-content ui-corner-all">
  656. <option value=""></option>
  657. <option value = "1-Urgent">1-Urgent</option>
  658. <option value = "2-High">2-High</option>
  659. <option value = "3-Medium">3-Medium</option>
  660. <option value = "4-Low">4-Low</option>
  661. </select><br><br>
  662. <label for="ranking"><b><big>Ranking</big></b></label>
  663. <select id = "ranking" class="text ui-widget-content ui-corner-all">
  664. <option value=""></option>
  665. <option value = "1">1</option>
  666. <option value = "2">2</option>
  667. <option value = "3">3</option>
  668. <option value = "4">4</option>
  669. <option value = "5">5</option>
  670. <option value = "6">6</option>
  671. <option value = "7">7</option>
  672. </select><br><br>
  673. <label for="estimated_start_on"><b><big>Estimated Start On</big></b></label>
  674. <input id="estimated_start_on" class="text ui-widget-content ui-corner-all" />
  675. <label for="actual_start_on"><b><big>Actual Start On</big></b></label>
  676. <input id="actual_start_on" class="text ui-widget-content ui-corner-all" />
  677. <label for="estimated_researchready_for_service"><b><big>Estimated Ready for Service</big></b></label>
  678. <input id="estimated_researchready_for_service" class="text ui-widget-content ui-corner-all" />
  679. <label for="actual_researchready_for_service"><b><big>Actual Ready for Service</big></b></label>
  680. <input id="actual_researchready_for_service" class="text ui-widget-content ui-corner-all" />
  681.  
  682.  
  683. <input type="hidden" name="isEdit" value="isEdit" id = "isEdit" />
  684. <input type ="hidden" name = "username" value = "<?php echo $user;?>" id = "username" />
  685. <label for="statusnotes"><b><big>Status Notes:</big></b></label>
  686. <textarea rows="4" cols="50" id = "statusnotes" class="text ui-widget-content ui-corner-all"></textarea><br><br>
  687. <label for="internalnotes"><b><big>Internal Notes:</big></b></label>
  688. <textarea rows="4" cols="50" id = "internalnotes" class="text ui-widget-content ui-corner-all"></textarea><br><br>
  689. <label for="team"><b><big>Team</big></b></label>
  690. <select id = "team" class="text ui-widget-content ui-corner-all">
  691. <option value=""></option>
  692. <option value = "D">D</option>
  693. <option value = "G">G</option>
  694. <option value = "I">I</option>
  695. <option value = "A">A</option>
  696. <option value = "Not Specified">Not Specified</option>
  697. </select><br><br>
  698.  
  699. </fieldset>
  700. </form>
  701. </div>
  702.  
  703.  
  704. <div style="position: relative;">
  705. <button id="add-new-item" style="left:122px;top:-90px" >Add New Item</button>
  706. </div>
  707.  
  708. <script src="sorttable.js" type="text/javascript"></script>
  709. <style type="text/css">
  710.  
  711. </style>
  712. <table id="table" class = "sortable" >
  713. <thead>
  714. <th class="sorttable_nosort" >History</th>
  715. <th>ID</th>
  716. <th>Title</th>
  717. <th>Description</th>
  718. <th>Environment</th>
  719. <th>Business Owner</th>
  720. <th>Internal Product Owner</th>
  721. <th>Billable</th>
  722. <th>Status</th>
  723. <th>Priority</th>
  724. <th>Ranking</th>
  725. <th>Team</th>
  726. <th>Estimated Research Hours</th>
  727. <th>Actual Resarch Hours</th>
  728. <th>Estimated Dev Hours</th>
  729. <th>Actual Dev Hours</th>
  730. <th>Estimated QA Hours</th>
  731. <th>Actual QA Hours</th>
  732. <th>Estimated Start On</th>
  733. <th>Actual Start On</th>
  734. <th>Estimated Ready For Service</th>
  735. <th>Actual Ready For Service</th>
  736. <th class="sorttable_nosort" >Internal Notes</th>
  737. <th class="sorttable_nosort" >Status Notes</th>
  738. <th class="sorttable_nosort" >Comments From BO</th>
  739. <th class="sorttable_nosort" >Edit</th>
  740. <th class="sorttable_nosort" >Attachments</th>
  741. </thead>
  742.  
  743. <tr>
  744. <td></td>
  745. <td></td>
  746. <td></td>
  747. <td></td>
  748. <td>
  749.  
  750. <script language="JavaScript" type="text/JavaScript">
  751. function formSubmit()
  752. {
  753. document.getElementById("report_filter").submit();
  754. }
  755. </script>
  756.  
  757. <form method="post" id="report_filter" action="" >
  758. <select name="try" onchange="formSubmit();">
  759. <option value="all"> All </option>
  760. <option value="Windows"> Windows </option>
  761. <option value="Win 2008"> Win 2008 </option>
  762. <option value="Win 7"> Win 7 </option>
  763. <option value="Win Vista"> Win Vista </option>
  764. <option value ="Linux"> Linux </option>
  765. <option value = "Win 7/Linux"> Win 7/Linux </option>
  766. </select>
  767. </form>
  768. </td>
  769. </tr>
  770.  
  771.  
  772.  
  773. <?php
  774.  
  775.  
  776. if(!(isset($_POST["try"])))
  777. echo "none";
  778. else
  779. echo "ok ".$_POST["try"];
  780.  
  781. require 'index-001.php';
  782. _show_setup();
  783. die;
  784.  
  785.  
  786.  
  787. $host="***";
  788. $username="^^";
  789. $password="%%";
  790. $database="##";
  791. $connection=mysql_connect(##,##,###);
  792. mysql_connect($host,$username,$password);
  793. @mysql_select_db($database) or die( "Unable to select database");
  794.  
  795. //error_reporting(E_ALL);
  796. //ini_set('display_errors', TRUE);
  797. //ini_set('display_startup_errors', TRUE);
  798.  
  799. $first=$_SESSION['firstname'];
  800. $last=$_SESSION['lastname'];
  801.  
  802.  
  803. $query="SELECT * FROM c1_report";
  804. $result=mysql_query($query);
  805. $query1="SELECT * FROM c1_notes";
  806. $result1=mysql_query($query1);
  807.  
  808. $num=mysql_numrows($result);
  809. $num1=mysql_numrows($result1);
  810.  
  811.  
  812. echo "<font size = '5'; face = 'calibri'; color='black'; > <center> <i> <a style='position:relative;left:338px;top:-8px'>Welcome ".$user."! </a> </i> </center> </font>";
  813. echo "</br> ";
  814. //mysql_close();
  815. $i=0;
  816.  
  817. while ($i < $num){
  818.  
  819. $j=0;
  820. $f[$i][$j]=mysql_result($result,$i,"ID");
  821. $j++;
  822. $f[$i][$j]=mysql_result($result,$i,"title");
  823. $j++;
  824. $f[$i][$j]=mysql_result($result,$i,"description");
  825. $j++;
  826. $f[$i][$j]=mysql_result($result,$i,"environment");
  827. $j++;
  828. $f[$i][$j]=mysql_result($result,$i,"bo");
  829. $j++;
  830. $f[$i][$j]=mysql_result($result,$i,"intprodowner");
  831. $j++;
  832. $f[$i][$j]=mysql_result($result,$i,"billable");
  833. $j++;
  834. $f[$i][$j]=mysql_result($result,$i,"status");
  835. $j++;
  836. $f[$i][$j]=mysql_result($result,$i,"priority");
  837. $j++;
  838. $f[$i][$j]=mysql_result($result,$i,"ranking");
  839. $j++;
  840. $f[$i][$j]=mysql_result($result,$i,"team");
  841. $j++;
  842. $f[$i][$j]=mysql_result($result,$i,"estresearchhours");
  843. $j++;
  844. $f[$i][$j]=mysql_result($result,$i,"actualresearchhours");
  845. $j++;
  846. $f[$i][$j]=mysql_result($result,$i,"estdevhours");
  847. $j++;
  848. $f[$i][$j]=mysql_result($result,$i,"actualdevhours");
  849. $j++;
  850. $f[$i][$j]=mysql_result($result,$i,"estqahours");
  851. $j++;
  852. $f[$i][$j]=mysql_result($result,$i,"actualqahours");
  853. $j++;
  854. $f[$i][$j]=mysql_result($result,$i,"eststarton");
  855. $j++;
  856. $f[$i][$j]=mysql_result($result,$i,"actualstarton");
  857. $j++;
  858. $f[$i][$j]=mysql_result($result,$i,"estreadyforservice");
  859. $j++;
  860. $f[$i][$j]=mysql_result($result,$i,"actualreadyforservice");
  861. $j++;
  862. $f[$i][$j]=mysql_result($result1,$i,"internalnotes");
  863. $j++;
  864. $f[$i][$j]=mysql_result($result1,$i,"statusnotes");
  865. $j++;
  866. $f[$i][$j]=mysql_result($result1,$i,"bocomments");
  867. $i++;
  868. }
  869. ?>
  870.  
  871.  
  872. <?php
  873. $i=0;
  874. while ($i < $num) {
  875.  
  876. ?>
  877.  
  878. <tr>
  879. <form method=post action='' name=f1>
  880.  
  881.  
  882. <td>
  883.  
  884. <a href="javascript:void(0);" NAME="History" title="History"
  885. onClick=window.open("getHistory_cnt.php?id=<?php echo $f[$i][0]; ?>","Ratting","width=650,height=300,left=150,top=200,toolbar=1,status=1,scrollbars=1");>History</a>
  886.  
  887.  
  888. </td>
  889.  
  890. </form>
  891. <td><?php echo htmlentities($f[$i][0]); ?></td>
  892. <td><?php echo htmlentities($f[$i][1]); ?></td>
  893. <td><?php echo htmlentities($f[$i][2]); ?></td>
  894. <td><?php echo htmlentities($f[$i][3]); ?></td>
  895. <td><?php echo htmlentities($f[$i][4]); ?></td>
  896. <td><?php echo htmlentities($f[$i][5]); ?></td>
  897. <td><?php echo htmlentities($f[$i][6]); ?></td>
  898. <td><?php echo htmlentities($f[$i][7]); ?></td>
  899. <td><?php echo htmlentities($f[$i][8]); ?></td>
  900. <td><?php echo htmlentities($f[$i][9]); ?></td>
  901. <td><?php echo htmlentities($f[$i][10]); ?></td>
  902. <td><?php echo htmlentities($f[$i][11]); ?></td>
  903. <td><?php echo htmlentities($f[$i][12]); ?></td>
  904. <td><?php echo htmlentities($f[$i][13]); ?></td>
  905. <td><?php echo htmlentities($f[$i][14]); ?></td>
  906. <td><?php echo htmlentities($f[$i][15]); ?></td>
  907. <td><?php echo htmlentities($f[$i][16]); ?></td>
  908. <td><?php echo htmlentities($f[$i][17]); ?></td>
  909. <td><?php echo htmlentities($f[$i][18]); ?></td>
  910. <td><?php echo htmlentities($f[$i][19]); ?></td>
  911. <td><?php echo htmlentities($f[$i][20]); ?></td>
  912.  
  913. <td>
  914.  
  915. <a href="javascript:void(0);" NAME="Internal Notes Window" title="Internal Notes"
  916. onClick=window.open("internal_notes_cnt.php?id=<?php echo $f[$i][0]; ?>","Ratting","width=550,height=300,left=150,top=200,toolbar=1,status=1,scrollbars=1");>View</a>
  917. </td>
  918.  
  919.  
  920. <td>
  921. <a href="javascript:void(0);" NAME="Status Notes Window" title="Status Notes"
  922. onClick=window.open("status_notes_cnt.php?id=<?php echo $f[$i][0]; ?>","Ratting","width=550,height=300,left=150,top=200,toolbar=1,status=1,scrollbars=1");>View</a>
  923. </td>
  924.  
  925. <td>
  926.  
  927. <a href="javascript:void(0);" NAME="BO Comments Window" title="BO Comments"
  928. onClick=window.open("bocomments_cnt.php?id=<?php echo $f[$i][0]; ?>","Ratting","width=550,height=300,left=150,top=200,toolbar=1,status=1,scrollbars=1");>View</a>
  929. </td>
  930.  
  931.  
  932.  
  933. <td>
  934. <button class="edit" name="edit" value="edit" style="font-size:12px" id = "<?php echo htmlentities($f[$i][0])."+".htmlentities($f[$i][1])."+".htmlentities($f[$i][2])."+".htmlentities($f[$i][3])."+".htmlentities($f[$i][4])."+".htmlentities($f[$i][5])."+".htmlentities($f[$i][6])."+".htmlentities($f[$i][7])."+".htmlentities($f[$i][8])."+".htmlentities($f[$i][9])."+".htmlentities($f[$i][10])."+".htmlentities($f[$i][11])."+".htmlentities($f[$i][12])."+".htmlentities($f[$i][13])."+".htmlentities($f[$i][14])."+".htmlentities($f[$i][15])."+".htmlentities($f[$i][16])."+".htmlentities($f[$i][17])."+".htmlentities($f[$i][18])."+".htmlentities($f[$i][19])."+".htmlentities($f[$i][20])."+".$user;?>">Edit</button>
  935. </td>
  936.  
  937.  
  938. <td>
  939. <form method ="post">
  940. <input type=button value="Upload" onClick="window.open('uploads_cnt/upload_file_form_cnt_mult.php?id=<?php echo $f[$i][0]; ?>&first=<?php echo $first; ?>&last=<?php echo $last; ?>','Ratting','width=450,height=300,left=150,top=200,toolbar=1,status=1,')" style="width: 74px"/>
  941. </form>
  942.  
  943. <?php
  944.  
  945. //$query3="select * from hdq_report where ID='".$f[$i][0]."' and uploadname IS NULL";
  946.  
  947. //$result3=mysql_query($query3);
  948.  
  949. //echo mysql_num_rows($result3);
  950.  
  951.  
  952. //if(mysql_num_rows($result3)!=0)
  953. $dd="uploads_cnt/dir_cnt_".$f[$i][0];
  954. if(!is_dir($dd))
  955. {
  956. ?>
  957.  
  958. <b>No Attachments</b></td>
  959.  
  960. <?php
  961. }
  962. else
  963. {
  964.  
  965. ?>
  966.  
  967. <form method ="post">
  968. <input type=button value="Download" onClick="window.open('uploads_cnt/download_upl_name.php?id=<?php echo $f[$i][0]; ?>','Ratting','width=1000,height=500,left=150,top=200,toolbar=1,status=1,scrollbars=1')" />
  969. </form>
  970. </td>
  971.  
  972. <?php
  973. }
  974. ?>
  975.  
  976.  
  977. </tr>
  978.  
  979. <?php
  980. $i++;
  981. }
  982. ?>
  983.  
  984. </table>
  985. </div>
  986. </div>
  987.  
  988. </body>
  989. </html>
  990.  
  991.  
  992. <?php
  993. }
  994. else
  995.  
  996. echo "You are not authorized to use this website. Try to obtain the necessary rights to use it!";
  997.  
  998. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement