Expand|Select|Wrap|Line Numbers
- <html>
- <head>
- <h2 align=center>Blank Tapes Status Form</h2>
- <br><title>Blank tapes status</title>
- </head>
- <body>
- <br><br>
- <form name=tapes_status method=post>
- <center>
- <fieldset style='width:40%'><legend>Blank_Tapes_Status_Form</legend>
- <table align=center border=1 >
- <tr><td><font face=Verdana size=3><b>Channel</b></font></td>
- <td><input type=channeltextbox size=20 id=channels readonly name=channels style="width:100px" value="<?php echo $ChannelName?>"></td>
- <td><font face=Verdana size=3><b>Total Recieved</b></font></td>
- <td><input type=totalrecievedtextbox size=20 id=totalrecieved name=totalrecieved style="width:100px" onclick=Total_recieved_tapes()></td> </tr>
- <tr><td><font face=Verdana size=3><b>Format</b></font></td>
- <td><select id=format name=format size=1 style="width:155px">
- <option>[Select One]</option><?php Format();?>
- </select></td>
- <td><font face=Verdana size=3><b>Total Issued</b></font></td>
- <td><input type=totalissuedtextbox size=20 id=totalissued name=totalissued style="width:100px" onclick=Total_issued_tapes()></td></tr>
- <td><input type=radio id=optStatus checked name=optStatus style='width: 40px height: 20px' onclick=fnReload("B")>Blank <br></td>
- <td><input type=radio id=optStatus name=optStatus style='width: 40px; height: 20px' onclick=fnReload("R")>Re-Use</td>
- <td><font face=Verdana size=3><b>Available Tapes</b></font></td>
- <td><input type=textbox size=20 id=availabletapes name=availabletapes style="width:100px" onclick=Available_tapes()></td>
- </tr>
- </table>
- </center>
- </fieldset>
- <?php ReUse_Details(); ?>
- <!--</fieldset>-->
- <br><br><br><br><br>
- <?php
- function Format()
- {
- $dbconnect=pg_connect("host=10.10.1.3 dbname=Tape_Library user=postgres password=post123") or
- die("could not connect to the database");
- $query = "select tms003_typecode,tms003_typename from tms_master_tapformat";
- $result = pg_query($query) or die ("Could not Open Records") . pg_last_error();
- while($row = pg_fetch_row($result))
- {
- echo "<option value='" . $row[0] . "'>";
- echo $row[1];
- echo "</option>";
- }
- pg_free_result($result);
- }
- function ReUse_Details()
- {
- $dbconnect = pg_connect("host=10.10.1.3 dbname=Tape_Library user=postgres password=post123") or
- die('Could not Open COnnection...') . pg_last_error();
- $query=" select distinct(tms010_barcode),tms010_reassign_count,tms021_assign_date from
- tms_trans_tapesassign_details left outer join tms_trans_reassign_details on
- tms010_barcode=tms021_barcode and tms021_channel_id=tms010_channel_id
- where tms010_channel_id='H0002' and tms010_tapeformat_id= '2'
- and tms010_available_flag='Y' ";
- if ($_GET['status'] == "B") //Blank
- {
- $query = $query . " and tms010_balnk_flag='Y'";
- $query = $query . " and tms010_reassigned_flag='N'";
- }
- else
- if ($_GET['status'] == "R") //Reuse
- {
- $query = $query . " and tms010_reassigned_flag='Y'";
- }
- $query = $query . " and tms010_content_flag='N'";
- $query = $query . " and tms010_delete_flag='OK' ";
- $result = pg_query($query) or die('Could not Open Recordset...') . pg_last_error();
- echo"<br><br><br><br><br>";
- echo "<table border=1 align=center>";
- echo "<tr><th>SR.NO</th>";
- echo " <th>Tape Number</th>";
- echo " <th>Date</th>";
- echo "</tr>";
- $count = 1;
- while($row = pg_fetch_row($result))
- {
- echo "<tr><td>" . $count . "</td>";
- echo "<td>" . $row[0] . "</td>";
- echo "<td>" . $row[1] . "</td>";
- echo "</tr>";
- $count++;
- }
- $query="SELECT * FROM tms_trans_reassign_details where tms021_channel_id='H0006' and tms021_channel_assign_to='H0005' and tms021_tapeformat_id='2' ";
- echo "</table>";
- pg_free_result($result);
- pg_close($dbconnect);
- }
- function Blank()
- {
- $dbconnect = pg_connect("host=10.10.1.3 dbname=Tape_Library user=postgres password=post123") or
- die('Could not Open COnnection...') . pg_last_error();
- $query = "select sum(tms019_no_of_tapes_issue_rec) as temp from tms_trans_closing_balance where tms019_channel='H0006' and tms019_tape_format='CD-R' and tms019_status='ISU' ";
- $result = pg_query($query) or die('Could not Open Recordset...') . pg_last_error();
- echo"<br><br><br><br><br>";
- echo "<table border=1 align=center>";
- echo "<tr><th>SR.NO</th>";
- echo " <th>Tape Number</th>";
- echo " <th>Date</th>";
- echo "</tr>";
- $count = 1;
- while($row = pg_fetch_row($result))
- {
- echo "<tr><td>" . $count . "</td>";
- echo "<td>" . $row[0] . "</td>";
- echo "<td>" . $row[1] . "</td>";
- echo "</tr>";
- $count++;
- }
- echo "</table>";
- pg_free_result($result);
- pg_close($dbconnect);
- }
- ?>
- <br><br><br><br>
- <table align=center><tr><td>
- <input type='submit' name='exit' id='exit' value='EXIT' style="width:75px" onclick='window.close()'><td></tr></table>
- </form>
- <script language=javascript>
- var stat = "<?php echo $_GET['status']; ?>";
- if (stat == "B")
- {
- tapes_status.optStatus[0].checked = true;
- }
- else
- {
- tapes_status.optStatus[1].checked = true;
- }
- function fnReload(stat)
- {
- var redir = "blank_tapes_status.php?status=" + stat;
- alert(redir);
- window.open(redir, "_top");
- }
- function Total_recieved_tapes()
- {
- var recieved_tapes = tapes_status.optStatus.value;
- tapes_status.totalrecieved.value = recieved_tapes;
- }
- function Total_issued_tapes()
- {
- var issued_tapes = tapes_status.optStatus.value;
- tapes_status.totalissued.value = issued_tapes;
- }
- function Available_tapes()
- {
- var aval_tapes = tapes_status.optStatus.value;
- tapes_status.availabletapes.value = aval_tapes;
- }
- </script>
- </body>
- </html>