Current File : /home/inlingua/www/sensoriumpsychologists.com/backup/admin/search_franchies_payment.php
<?php 
include_once('include/include.script.php');
include_once('include/navigation.php');
include_once('../classes/config.php');
?>
<?php
$result=$query->select_order_desc('shristi_franchise_payments','franchise_id');
?>
<?php
$start=$_GET['start'];
$end=$_GET['end'];
$sql="SELECT * FROM `shristi_franchise_payments` where payment_date BETWEEN '$start' AND '$end'";
$result=$conn->query($sql);
?>
<?php
//multiple value
// Check if delete button active, start this 
	error_reporting(0);
		if(isset($_POST['delete'])){
	  	  $checkbox = $_POST['checkbox'];
			if($checkbox==""){
			echo "<script>alert('please select at list one id');</script>";	
			}else{
				for($i=0;$i<count($checkbox);$i++){
					$del_id = $checkbox[$i];
					$sql ="DELETE FROM shristi_franchise  WHERE franchise_id='$del_id'";
					$result = $conn->query($sql);
			}
			// if successful redirect to delete_multiple.php 
			if($result){
				echo "<meta http-equiv=\"refresh\" content=\"0;URL=list_franchise.php\">";
			}
		}
}
//multiple enable
		if(isset($_POST['enable'])){
	  		$checkbox = $_POST['checkbox'];
			if($checkbox==""){
			echo "<script>alert('please select at list one id');</script>";	
			}else{
				for($i=0;$i<count($checkbox);$i++){
				$status = $checkbox[$i];
				$sql = "UPDATE shristi_franchise  SET status='1' WHERE franchise_id='$status'";
				$result=$conn->query($sql);
			}
// if successful redirect to delete_multiple.php 
			if($result){
				echo "<meta http-equiv=\"refresh\" content=\"0;URL=list_franchise.php\">";
				}
			}
	}
//multiple Disable
if(isset($_POST['disable'])){
	$checkbox = $_POST['checkbox'];
		if($checkbox==""){
		echo "<script>alert('please select at list one id');</script>";	
		}else{
			for($i=0;$i<count($checkbox);$i++){
				$status = $checkbox[$i];
				$sql = "UPDATE shristi_franchise  SET status='0' WHERE franchise_id='$status'";
				$result =$conn->query($sql);
			 }

// if successful redirect to delete_multiple.php 
			if($result){
				echo "<meta http-equiv=\"refresh\" content=\"0;URL=list_franchise.php\">";
				}
			}
		}
?>
<div id="main">
			<div class="container-fluid">
				<div class="page-header">
					<div class="pull-left">
						<h1>Franchise payment List</h1>
					</div>
					<div class="pull-right">
						<ul class="stats">
							<li class='lightred'>
								<i class="icon-calendar"></i>
								<div class="details">
									<span class="big">February 22, 2013</span>
									<span>Wednesday, 13:56</span>
								</div>
							</li>
						</ul>
					</div>
				</div>
				<div class="breadcrumbs">
					<ul>
						<li>
							<a href="home.php">Home</a>
							<i class="icon-angle-right"></i>
						</li>
						<li>
							<a href="">Franchise payment List</a>
							<i class="icon-angle-right"></i>
						</li>
					</ul>
					<div class="close-bread">
						<a href="#">
							<i class="icon-remove"></i>
						</a>
					</div>
				</div>
                <div class="row-fluid">
               <div class="span4"></div>
					<div class="span12">
						<form action="search_franchies_payment.php"  class='form-horizontal form-column form-bordered'>
									<div class="span4">
										<div class="control-group">
											<label for="textfield" class="control-label">From</label>
											<div class="controls">
							<input type="text" name="start" id="textfield99" class="input-medium datepick" placeholder="YYYY/DD/MM" data-rule-required="true" value="<?php echo $start?>">
											</div>
										</div>
									</div>
									<div class="span5">
										<div class="control-group">
											<label for="textfield" class="control-label">To</label>
											<div class="controls">
							<input type="text" name="end" id="textfield9" class="input-medium datepick" placeholder="YYYY/DD/MM" data-rule-required="true" value="<?php echo $end;?>">
                                                <button type="submit" class="btn btn-primary">Search</button>
											</div>
										</div>
                                     </div>
								</form>
					</div>
				</div>
				<div class="row-fluid">
					<div class="span12">
						<div class="box box-bordered">
							<div class="box-title">
								<h3>
									<i class="icon-table"></i>
									Franchise payment List
								</h3>
							</div>
                            
             <form method="post" enctype="multipart/form-data">
							<div class="box-content nopadding">
                            <table class="table table-hover table-nomargin dataTable dataTable-tools table-bordered">
									<thead>
										<tr>
								<th class='with-checkbox'><input type="checkbox" name="check_all" id="check_all"></th>
											<th>Name</th>
                                            <th>Code</th>
                                            <th>Email</th>
                                            <th>Oder ID</th>
                                            <th>Payment Mode</th>
                                            <th>Amount</th>
                                            <th>status</th>                                            
                                            <th>Reg Date</th>
                                            <th>Expired Date</th>
                                            <th class='hidden-350'>Status</th>
										    <th class='hidden-480'>Options</th>
										</tr>
									</thead>
									<tbody>
             <?php 
			 	while($row=$result->fetch_assoc()){
				$result11=$query->select_where('shristi_franchise','franchise_id',$row['franchise_id']);
				$row1=$result11->fetch_assoc();
			 ?>       
										<tr>
								<td class="with-checkbox">
								<input type="checkbox" name="checkbox[]" value="<?php echo $row['franchise_id'];?>">												   </td>
                                 <td><?php echo $row1['name'];?></td>
                                 <td align="center"><?php echo $row1['code'];?></td>
                                 <td><?php echo $row1['email'];?></td>
                                 <td><?php echo $row['order_no'];?></td>
                                 <td><?php echo $row['payment_mode'];
								 if($row['payment_mode']=='DD'){ echo "<br><hr>"; echo $row['dd'];;}
								 ?>
                                 </td>
                                 <td><?php echo $row['amount'];?></td>
                                 <td><?php echo $row['status'];?></td>
                                 <td><?php echo $row1['created_at'];?></td>
                                 <td><?php echo $row1['expired_date'];?></td>
                                 <td class='hidden-350'>
			<?php
			if($row1['status']==1){echo "<span class='label label-satgreen'>Active</span>";}
			if($row1['status']==0){echo "<span 	class='label label-lightred'>Inactive</span>";}
			?></td>
							<td class='hidden-480'>
                                            <a href="view_franchise_detail.php?id=<?php echo $row['franchise_id'];?>" class="btn" rel="tooltip" title="" data-original-title="View"><i class="icon-search"></i></a>
                                            <a href="franchise_account.php?id=<?php echo $row['franchise_id'];?>" class="btn" rel="tooltip" title="" data-original-title="View paymnet information"><i class="icon-remove"></i></a></td>
										</tr>
									<?php } ?>					
									</tbody>
								</table>
							</div>
                             <!--<i class="icon-remove"><input type="submit" name="delete" value="Delete" class="btn btn-danger" onclick="return confirm('sure to delete !');">  </i>-->
                            <i class="icon-ok"><input type="submit" name="enable" value="Active" class="btn btn-info delet" onclick="return confirm('sure to Active !');"></i>
                           <i class=" icon-off"> <input type="submit" name="disable" value="Inactive" class="btn btn-warning delet" onclick="return confirm('sure to Inactive !');"></i>
                        </div>
                        </form>
					</div>
				</div>
			</div>
		</div>
	</div>
<?php include_once('include/footer.php');?>
<script>
$(".datepick").datepicker({dateFormat:'yy-mm-dd'});
</script>