[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: all_active_card.php
<?php include 'header.php' ; $show=new Oops($db); ?> <script type="text/javascript"> function send(){ if(window.confirm("Do You Really Want To Delete The Data??")){ return true; } else return false; } jQuery(document).ready(function($) { $('a[rel*=facebox]').facebox({ loadingImage : 'src/loading.gif', closeImage : 'src/closelabel.png' }) }) </script> <!-- Navbar --> <!-- End Navbar --> <div id="page-wrapper"> <div class="main-page"> <div class="tables"> <h3 class="title1">All Visiting Cards->Payment Done & Active</h3> <div class="panel-body widget-shadow"> <table class="table table-hover table-striped" id='example'> <thead> <th>ID</th> <th>Registration Date</th> <th>Expiry Date</th> <th>Client ID</th> <th>Card ID/Company Name</th> <th>Contact Person/Email / Phone</th> <th>URL/QR CODE</th> <th>Payment Status</th> <th>Status</th> <th>Delete</th> </thead> <tbody> <?php $up="update visit_card set status='EXPIRED' where date_of_expiry<='".date('Y-m-d')."' and renewal_date=''"; $st=$con->prepare($up); $st->execute(); $count=1; $sr='visit_card'; $sq="select visit_card.qr_code,visit_card.id,visit_card.status,visit_card.amount,visit_card.payment_status,client.client_id,client.company_name,client.phone1 as client_phone,visit_card.created_at,visit_card.card_id,visit_card.phone1 as v_phone,visit_card.company_name as vcompany,visit_card.contact_person1 as v_name,visit_card.email as v_email, visit_card.phone1 as v_phone,visit_card.directory_name,visit_card.date_of_expiry,visit_card.date_of_expiry from visit_card left join client on client.client_id=visit_card.client_id where visit_card.payment_status='DONE' and visit_card.status='ACTIVE' order by visit_card.id desc"; $stmt=$con->prepare($sq); $stmt->execute(); $num = $stmt->rowCount(); if($num>0){ while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){ extract($row); $id=$row['id']; $status=$row['status']=='ACTIVE'?"":"style='background-color:#f29b9b'"; echo "<tr $status> <td>$count</td> <td>".date('d-m-Y',strtotime($row['created_at']))."</td> <td><b><font color='red'>".date('d-m-Y',strtotime($row['date_of_expiry']))."</font></b></td> <td>".$row['client_id']."<br>".$row['company_name']."<br>".$row['client_phone']."</td> <td>".$row['card_id']."<br>".$row['vcompany']."</td> <td>".$row['v_name']."<br>".$row['v_email']."<br>".$row['v_phone']."</td> <td><a href='$link_url/cards/".$row['directory_name']."' target='_blank'>Show</a> <a href='".$link_url."/".$row['qr_code']."' target='_blank'> <img src='".$link_url."/".$row['qr_code']."' width='100px'></a></td> </td> "; ?> <div class="modal fade" id="myModal<?=$count?>" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <form method="post"> <div class="modal-header"> <h4 class="modal-title">Payment Details</h4> <button type="button" class="close" data-dismiss="modal">×</button> </div> <div class="modal-body" id=""> <label>Amount</label> <input type="text" name="amt<?=$count?>" required class="form-control"> <input type="hidden" id="bid<?=$count?>" value="<?=$id?>" name="bid<?=$count?>"> </div> <div class="modal-footer"> <input type="submit" name="sub<?=$count?>" value="Update Now" class="btn btn-success"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </form> <?php $submit="sub".$count; //$prev="prev".$count; //$qty="qty".$count; //$pid="p_id".$count; $reason="amt".$count; $id="bid".$count; if(isset($_POST[$submit])){ $sq="update visit_card set amount='".$_POST[$reason]."',payment_status='DONE',renewal_date='".date('Y-m-d',strtotime('+1 year'))."',date_of_expiry='".date('Y-m-d',strtotime('+1 year'))."' where id='".$_POST[$id]."'"; $stmt_r=$con->prepare($sq); if( $stmt_r->execute()){ echo "<script>swal('Payment status updated');window.location.href='".$SERVER['REQUEST_URI']."'</script>"; } } ?> </div> </div> </div> <td> <script> function status(Value){ //alert(Value); var st="#status"+Value; var id_txt="#id"+Value; var status=$(st).val(); var id=$(id_txt).val(); var table='<?php echo $sr ?>'; if(status=='DONE'){ $("#myModal"+Value).modal(); $("#bid<?=$count?>").val(id); return false; }else{ $.ajax({ type: "POST", url: "ajax_check.php", // Name of the php files data: "status="+status+"&id="+id+"&table="+table, async: false, global: false, beforeSend: function(){ /* Show image container */ $("#loader").show(); }, success: function(result) { $( "#basic-datatables" ).load( "all_card.php #example" ); //window.location.reload(); $("#loader").hide(); //table.ajax.reload(); } }); } } </script> <?php $interests = array('PENDING','DONE'); ?> <select name="status" onchange="status(<?=$count;?>)" id="status<?=$count;?>"> <?php foreach( $interests as $interest ): ?> <option value="<?php echo $interest ?>"<?php if( $interest==$row['payment_status']): ?> selected="selected"<?php endif; ?>><?php echo $interest ?></option> <?php endforeach; ?> </select> <input type="hidden" id="id<?=$count?>" value="<?=$row['id']?>" > <br> <small><?php if($row['payment_status']=='DONE') echo "Amt Paid:".$row['amount'];?></small> </td> <td><b> <script> function status_active(Value){ //alert(Value); var st="#status_active"+Value; var id_txt="#id"+Value; var status=$(st).val(); var id=$(id_txt).val(); var table='<?php echo $sr ?>'; $.ajax({ type: "POST", url: "ajax_check.php", // Name of the php files data: "status_active="+status+"&id="+id+"&table="+table, async: false, global: false, beforeSend: function(){ /* Show image container */ $("#loader").show(); }, success: function(result) { // $( "#basic-datatables" ).load( "all_card.php #example" ); window.location.reload(); $("#loader").hide(); //table.ajax.reload(); } }); } </script> <?php $interests = array('ACTIVE','EXPIRED'); ?> <select name="status_active" onchange="status_active(<?=$count;?>)" id="status_active<?=$count;?>"> <?php foreach( $interests as $interest ): ?> <option value="<?php echo $interest ?>"<?php if( $interest==$row['status']): ?> selected="selected"<?php endif; ?>><?php echo $interest ?></option> <?php endforeach; ?> </select> </b></td> <?php echo" <td> <a href='delete.php?id=$id&table=$sr&url=".$_SERVER['REQUEST_URI']."' class='label label-danger' onclick='return send();'>Delete</a> </td> </tr>"; ++$count; } } ?> </tbody> </table> <form method="post" action="export_file/export1.php"> <input type="submit" name="export" class="btn btn-success" value="Download & Export to Excel" /> </form> </div> </div> </div> </div> <?php include 'footer.php' ?>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 677.64 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619