386 lines
11 KiB
PHP
386 lines
11 KiB
PHP
|
<?php
|
||
|
|
||
|
include('pop_up_top.php');
|
||
|
|
||
|
$TABLENAME='bank_master';
|
||
|
|
||
|
$this_script='bank_master.php';
|
||
|
|
||
|
?>
|
||
|
|
||
|
<?php
|
||
|
|
||
|
if(isset($acn) && $acn=='delete')
|
||
|
|
||
|
{
|
||
|
|
||
|
if($bank_id)
|
||
|
|
||
|
mysqli_query($conn,"DELETE FROM $TABLENAME WHERE bank_id='".$bank_id."'");
|
||
|
|
||
|
}
|
||
|
if($frmacn=="Update")
|
||
|
|
||
|
{
|
||
|
|
||
|
$query_prefix='UPDATE ';
|
||
|
|
||
|
$query_suffix=" WHERE bank_id='".$bank_id."'";
|
||
|
|
||
|
$query_additional="";
|
||
|
$query_main=" SET Bank_name='".addslashes($Bank_name)."', branch='".$branch."',bank_address='".addslashes($bank_address)."',ac_no ='".$ac_no."', swift_code ='".$swift_code."', micr ='".$micr."', modified_by='".$_SESSION['user_id']."'";
|
||
|
|
||
|
$msg="Tender Type Updated Successfully";
|
||
|
|
||
|
}
|
||
|
|
||
|
elseif($frmacn=="Add")
|
||
|
|
||
|
{
|
||
|
|
||
|
$query_prefix='INSERT INTO ';
|
||
|
|
||
|
$query_suffix="";
|
||
|
|
||
|
$query_main=" SET firm_id='".$firm_id."',Bank_name='".addslashes($Bank_name)."', branch='".$branch."',bank_address='".addslashes($bank_address)."',ac_no ='".$ac_no."', swift_code ='".$swift_code."', micr ='".$micr."', modified_by='".$_SESSION['user_id']."'";
|
||
|
|
||
|
$msg="Bank Information Added Successfully";
|
||
|
|
||
|
}
|
||
|
|
||
|
$sql=$query_prefix.$TABLENAME.$query_main.$query_additional.$query_suffix;
|
||
|
|
||
|
$res=@mysqli_query($conn,$sql);
|
||
|
|
||
|
//echo "<script>location.replace('$this_script?msg=$msg')</script>";
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
?>
|
||
|
<link href="includes/css-js/admin.css" rel="stylesheet" type="text/css" />
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
|
||
|
<td height="350" valign="top" style="padding:10px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||
|
|
||
|
<tr>
|
||
|
|
||
|
<td><fieldset class="bdr1" >
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<center>
|
||
|
|
||
|
|
||
|
|
||
|
<?php if($acn=='add' || $acn=='update'|| $acn=='view') { ?>
|
||
|
|
||
|
<?php
|
||
|
|
||
|
if($acn=='update'|| $acn=='view')
|
||
|
|
||
|
{
|
||
|
|
||
|
$sql=@mysqli_query($conn,"SELECT * FROM $TABLENAME WHERE bank_id='".$bank_id."'");
|
||
|
|
||
|
$row=@mysqli_fetch_array($sql);
|
||
|
|
||
|
@extract($row);
|
||
|
|
||
|
}
|
||
|
|
||
|
?>
|
||
|
|
||
|
<form name="f1" method="post" action="#" onsubmit=" return validateForm();">
|
||
|
|
||
|
<table width="100%" border="0" cellspacing="0" cellpadding="4" >
|
||
|
<tr><td colspan="2" align="center" width="25%" style="color:#293D3D; font-size:16px;"><b>Bank Detail<hr></b></td></tr>
|
||
|
<tr>
|
||
|
|
||
|
<td colspan="2" align="center">
|
||
|
<span class="txt">
|
||
|
|
||
|
<?php
|
||
|
|
||
|
if($msg)
|
||
|
|
||
|
echo $msg;
|
||
|
|
||
|
?>
|
||
|
|
||
|
</span></td>
|
||
|
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td width="55%" align="left" class="bdr_td"><span style="color:#293D3D; font-size:10px;" ><b>Firm</b></span></td>
|
||
|
<?php
|
||
|
if($acn=='update'|| $acn=='view'){
|
||
|
?>
|
||
|
<td align="left" class="bdr_td"><select class="selectbox" name="firm_id" id="firm_id" style="width:170px;" disabled>
|
||
|
<option value="">--Select--</option>
|
||
|
<?php
|
||
|
$sql_firm ="select firm_id,firm_name from tbl_firms ";
|
||
|
//echo $sql_firm;
|
||
|
generate_options($sql_firm,$firm_id,'firm_id','firm_name','');
|
||
|
?>
|
||
|
</select></td>
|
||
|
|
||
|
<?php } else {?>
|
||
|
<td align="left" class="bdr_td"><select class="selectbox" name="firm_id" id="firm_id" style="width:170px;" onchange="return checkFirm();">
|
||
|
<option value="">--Select--</option>
|
||
|
<?php
|
||
|
$sql_firm ="select firm_id,firm_name from tbl_firms ";
|
||
|
//echo $sql_firm;
|
||
|
generate_options($sql_firm,$firm_id,'firm_id','firm_name','');
|
||
|
?>
|
||
|
</select></td>
|
||
|
<?php } ?>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td width="55%" align="left" class="bdr_td"><span style="color:#293D3D; font-size:10px;" ><b>Bank Name</b></span></td>
|
||
|
<?php
|
||
|
if($acn=='update'|| $acn=='view'){
|
||
|
?>
|
||
|
<td align="left" class="bdr_td"><input type="text" name="Bank_name" size="45" value="<?php echo stripslashes($Bank_name)?>" class="textbox1" style="width:100%" ></td>
|
||
|
<?php }
|
||
|
else{
|
||
|
?>
|
||
|
<td align="left" class="bdr_td"><input type="text" name="Bank_name" size="45" value="<?php echo stripslashes($Bank_name)?>" class="textbox1" style="width:100%" onclick="return checkFirm();"></td>
|
||
|
<?php } ?>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
|
||
|
<td width="55%" align="left" class="bdr_td"><span style="color:#293D3D; font-size:10px;" ><b>Branch</b></span></td>
|
||
|
<td align="left" class="bdr_td"><input type="text" name="branch" size="45" value="<?php echo $branch?>" class="textbox1" style="width:100%"></td>
|
||
|
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td width="55%" align="left" class="bdr_td"><span style="color:#293D3D; font-size:10px;" ><b>Bank Address</b></span></td>
|
||
|
<td align="left" class="bdr_td"><input type="text" name="bank_address" size="45" value="<?php echo stripslashes($bank_address)?>" class="textbox1" style="width:100%"></td>
|
||
|
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td width="55%" align="left" class="bdr_td"><span style="color:#293D3D; font-size:10px;" ><b>A/C No</b></span></td>
|
||
|
<td align="left" class="bdr_td"><input type="text" onkeypress="return numbersonly(this,event, true);" name="ac_no" size="45" value="<?php echo $ac_no?>" class="textbox1" style="width:100%"></td>
|
||
|
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td width="55%" align="left" class="bdr_td"><span style="color:#293D3D; font-size:10px;" ><b>Swift Code</b></span></td>
|
||
|
<td align="left" class="bdr_td"><input type="text" name="swift_code" size="45" value="<?php echo $swift_code?>" class="textbox1" style="width:100%"></td>
|
||
|
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td width="55%" align="left" class="bdr_td"><span style="color:#293D3D; font-size:10px;" ><b>MICR</b></span></td>
|
||
|
<td align="left" class="bdr_td"><input type="text" name="micr" size="45" value="<?php echo $micr?>" class="textbox1" style="width:100%"></td>
|
||
|
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="center" class="bdr_td" colspan="2" >
|
||
|
|
||
|
<?php if($acn=='update') { ?>
|
||
|
|
||
|
<input type="submit" name="frmacn" value="Update" class="submitbutton" style="background-color:#CCFF33;">
|
||
|
|
||
|
<?php } else if($acn=='add'){ ?>
|
||
|
|
||
|
<input type="submit" name="frmacn" value="Add" class="submitbutton" style="background-color:#CCFF33;">
|
||
|
|
||
|
<?php } ?>
|
||
|
<input type="button" onClick="window.close();"value="Close" class="submitbutton" style="background-color:#FF5C33;">
|
||
|
|
||
|
</td>
|
||
|
|
||
|
</tr>
|
||
|
<?php
|
||
|
$sqlFirm = "select firm_id from bank_master";
|
||
|
$resultFirm = mysqli_query($conn,$sqlFirm);
|
||
|
$count = 0;
|
||
|
while($rowFirm = mysqli_fetch_array($resultFirm)){?>
|
||
|
<input type="hidden" id=FM<?php echo $count?> value=<?php echo $rowFirm['firm_id']?>>
|
||
|
<?php
|
||
|
$count++;
|
||
|
}
|
||
|
?>
|
||
|
<input type="hidden" id="COUNT" value=<?php echo $count?>>
|
||
|
|
||
|
</table>
|
||
|
|
||
|
|
||
|
|
||
|
</form>
|
||
|
<?php } else echo "<script>location.href='bank_list.php'</script>"; { ?>
|
||
|
|
||
|
<!-- <form name="f1" method="post" action="<?php echo $this_script?>">
|
||
|
|
||
|
|
||
|
|
||
|
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bdr_table">
|
||
|
|
||
|
<tr class="bg2">
|
||
|
|
||
|
<td colspan="9" align="center"><font color="maroon"><?php echo $msg?></font></td>
|
||
|
|
||
|
</tr>
|
||
|
|
||
|
<tr class="bg2">
|
||
|
|
||
|
<td align="left" ><strong>S.No.</strong></td>
|
||
|
|
||
|
<td align="center"><strong> Bank Name </strong></td>
|
||
|
|
||
|
<td align="center"><strong> Bank Address </strong></td>
|
||
|
|
||
|
<td align="center"><strong>Remarks</strong></td>
|
||
|
|
||
|
<td align="center"><strong>View</strong></td>
|
||
|
|
||
|
<td align="center"><strong>Edit</strong></td>
|
||
|
|
||
|
<td align="center"><strong>Delete</strong></td>
|
||
|
|
||
|
</tr>
|
||
|
|
||
|
<?php
|
||
|
|
||
|
$sql="SELECT * FROM bank_master ORDER BY bank_id desc";
|
||
|
|
||
|
$result = mysqli_query($conn,$sql);
|
||
|
|
||
|
$num_rows=@mysqli_num_rows($result);
|
||
|
|
||
|
$page=new Page();
|
||
|
|
||
|
$page->set_page_data($this_script,$num_rows,$records_per_page=100000,$scroll_num=0,$show_prev_next=true,$show_scroll_prev_next=true,$show_first_last=true);
|
||
|
|
||
|
$page->set_qry_string("");
|
||
|
|
||
|
$page_order_result=@mysqli_query($conn,$page->get_limit_query($sql));
|
||
|
|
||
|
$num=@mysqli_num_rows($page_order_result);
|
||
|
|
||
|
if($num>0)
|
||
|
|
||
|
{
|
||
|
|
||
|
$pageon=$_GET['page'];
|
||
|
|
||
|
$pageon=($pageon)*100000;
|
||
|
|
||
|
$count=$pageon+1;
|
||
|
|
||
|
while($row=@mysqli_fetch_array($page_order_result))
|
||
|
|
||
|
{
|
||
|
|
||
|
extract($row);
|
||
|
|
||
|
?>
|
||
|
|
||
|
<tr class="bdr_td">
|
||
|
|
||
|
<td align="left" class="bdr_td"><?php echo $count?></td>
|
||
|
|
||
|
<td align="center" class="jsptextoutput"> <?php echo stripslashes($Bank_name)?></td>
|
||
|
|
||
|
<td align="center" class="jsptextoutput"> <?php echo stripslashes($bank_address)?></td>
|
||
|
|
||
|
<td align="center" class="jsptextoutput"> <?php echo stripslashes($remarks )?></td>
|
||
|
|
||
|
<td align="center" class="bdr_td"> <a href="javascript:void(0);" onclick="javascript:sendpage('<?php echo $this_script?>?acn=view&bank_id=<?php echo $bank_id?>');"><img src='images/view.jpg' border="0" /></a></td>
|
||
|
|
||
|
<td align="center" class="bdr_td"> <a href="javascript:void(0);" onclick="javascript:sendpage('<?php echo $this_script?>?acn=update&bank_id=<?php echo $bank_id?>');"><img src='images/edit.png' border="0" /></a></td>
|
||
|
|
||
|
<?php
|
||
|
$sql_check_child="SELECT bank_id FROM bank_master WHERE bank_id NOT IN (SELECT bank_id FROM quotation_master) AND bank_id = '".$bank_id."'";
|
||
|
$res_check_child=@mysqli_query($conn,$sql_check_child);
|
||
|
$num=@mysqli_num_rows($res_check_child);
|
||
|
?>
|
||
|
<td align="center" class="bdr_td"> <?php if($num>0){ ?> <a href="javascript:void(0);" onclick="javascript:deleterecord('<?php echo $this_script?>?acn=delete&bank_id=<?php echo $bank_id?>');"><img src='images/drop.png' border="0" /></a><?php } ?></td>
|
||
|
|
||
|
</tr>
|
||
|
|
||
|
<?php
|
||
|
|
||
|
$count++;
|
||
|
|
||
|
} ?>
|
||
|
|
||
|
<tr class='bg2'><td colspan='9'><div style="margin-right:10px; ">Page <?php echo "<br>".$page->get_page_nav();?></div></td></tr>
|
||
|
|
||
|
<?php }
|
||
|
|
||
|
else
|
||
|
|
||
|
{
|
||
|
|
||
|
echo "<tr><td align='center' colspan='9' class='bdr_td'><strong>No Record Found</strong></td></tr>";
|
||
|
|
||
|
}
|
||
|
|
||
|
?>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<tr><td colspan="9" align="right">
|
||
|
<span>
|
||
|
<a href="pdf_bank_master.php" target="_blank">Print</a>
|
||
|
</span>
|
||
|
<input type="button" class="submitbutton" onclick="window.location.href='bank_master.php?acn=add'" value="Add New" class="submitbutton" style="background-color:#CCFF33;"></td></tr>
|
||
|
|
||
|
</table>
|
||
|
|
||
|
|
||
|
|
||
|
</form> -->
|
||
|
|
||
|
<?php } ?>
|
||
|
|
||
|
</center>
|
||
|
|
||
|
</fieldset>
|
||
|
|
||
|
</td>
|
||
|
|
||
|
</tr>
|
||
|
|
||
|
</table></td>
|
||
|
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<script>
|
||
|
var fieldArray = new Array(
|
||
|
new Array('Bank_name','bank_address'), new Array('Please enter bank name.','Please enter bank address.'));
|
||
|
|
||
|
function validateForm(){
|
||
|
|
||
|
return checkform('f1',fieldArray);
|
||
|
}
|
||
|
function checkFirm(){
|
||
|
//alert(Id);
|
||
|
var Id = document.getElementById('firm_id').value;
|
||
|
var count = document.getElementById('COUNT').value;
|
||
|
for(var i=0;i<count;i++){
|
||
|
var oldFirm = document.getElementById('FM'+ i).value;
|
||
|
if(Id==oldFirm){
|
||
|
alert('This Firm already have Bank Detail, Choose another');
|
||
|
document.getElementById("firm_id").focus();
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|