File: /home/nyiet8349bzl/Backup/sbc_back/homedir/public_html/old-myadmin/mytender/add.php
<?php
if (!defined('WEB_ROOT')) {
exit;
}
function pdflist()
{
if (isset($_GET['id']) && (int)$_GET['id'] > 0) {
$pdfid = (int)$_GET['id'];
$sql = "select pdf_title, pdf_url from mypdf where pdf_id='$pdfid'";
}
elseif (isset($_GET['view'])) {
$sql = "select pdf_title, pdf_url from mypdf"; }
$result = mysql_query($sql) or die("ERROR:".mysql_error());
$num_row = mysql_num_fields($result);
$row1 = mysql_num_rows($result);
while ($row = mysql_fetch_row($result))
{
print ('<option value="'.$row[1].'" >'.$row[0]."</option>");
}
}
?>
<div id="ptitle"> :.: Tender & Quotations >> Add New </div>
<form onload="pdflist()" action="processTender.php?action=add" method="post" enctype="multipart/form-data" onsubmit="return checkAddForm()" name="frmAdd" id="frmAdd">
<script>
function myshow()
{
var a = document.getElementById('opt').value;
document.getElementById('nwlink').value = 'http://www.sbsc.in/pdf/' + a;
if(document.getElementById('nwlink').value == 'pdf/Select PDF / DOC')
{document.getElementById('nwlink').value = '';}
}
</script>
<table width="90%" border="0" cellspacing="2" id="table1">
<tr>
<td align="center" colspan="3"> <p align="center" class="formTitle"><h2>Add New Tender</h2> </p> </td>
</tr>
<tr>
<td>Tender Title</td>
<td><input type="text" id="txtTitle" name="txtTitle" size="100" ></td>
<td> </td>
</tr>
<tr>
<td>Select PDF To Link</td>
<td><select id="opt" name="prodid" onchange="myshow()" style="width:300px;" >
<option selected >Select PDF / DOC</option>
<?php pdflist(); ?> </select></td>
<td></td>
</tr>
<tr>
<td valign="top">Links</td>
<td><input type="text" name="nwlink" id="nwlink" size="100" maxlength="100">
<br/>
<br/>
</td>
<td></td>
</tr>
</table>
<p align="center">
<input name="btnAdd" type="submit" id="btnAdd" value="Add" style="width:150px; height:30px; font-weight:bold;">
<input name="btnCancel" type="button" id="btnCancel" value="Cancel" onClick="window.location.href='index.php';" style="width:150px; height:30px; font-weight:bold;">
</p>
</form>