<?php
require_once('constants.php');
class General
{
	public function __construct()
	{
		
		?>
         
        <script language="javascript" src="js/index_sub.js?t=<?=time();?>" type="text/javascript">       
        </script>
        
        <?php
	}
	
	 
	public function showGeneralList()
	{
		//if(count($_SESSION['cat'])<=0)
			 
				/*echo '<PRE/>';
				print_r($_SESSION['cat']);
				echo '<PRE/>';*/
	
	?>
      
 

      <div class="am-mainpanel">
      <div class="am-pagebody">

        <div class="card pd-20 pd-sm-20">
          <h6 class="card-body-title"><?=TITLE_PAGE;?></h6>
           
		  
          <div class="mg-0  col-md-12 mg-b-10 search_options">	
          <form action="#" id="searching_arguments">
          		<input type="hidden" id="task" name="task" value="GeneralDetails">
                
                <div class="input-group col-md-10" > 
                 <label>Member Code : </label>&nbsp;<input type="text" name="searchtext" value="<?=$_REQUEST['m_id'];?>" id="searchtext" class="form-control">
                 
                 <label>Date From : </label>&nbsp; 
                      
                      
                      
  <span class="input-group-addon"><i class="icon ion-calendar tx-16 lh-0 op-6"></i></span>
  <input type="text" class="form-control fc-datepicker" placeholder="DD/MM/YYYY" name="s_date_from" id="s_date_from" value="<?=($_REQUEST['m_id']>0)?date("01-m-2016"):date("01-m-Y");?>">
  
   <label>Date To : </label>&nbsp; 
                      
                      
                      
  <span class="input-group-addon"><i class="icon ion-calendar tx-16 lh-0 op-6"></i></span>
  <input type="text" class="form-control fc-datepicker" placeholder="DD/MM/YYYY" name="s_date_to" id="s_date_to" value="<?=date("d-m-Y");?>">
  <label> </label>&nbsp; 
   <button type="button" onclick="GeneralDetails(1);" style="float:right; margin:0px;" class="dt-button buttons-pdf buttons-html5 btn-sm"><i class="fa fa-search mg-r-5"></i>Search</button>
</div>
                                                                    
                 
          		
          </form>
          </div>
          <div class="table-wrapper">
             
                     <div class="x_content" id="main_result_div">
                     <script language="javascript" type="text/javascript">GeneralDetails(1);</script>
					
					
                  </div>
             
          </div><!-- table-wrapper -->
        </div><!-- card -->

           
                     
    <?php
	}
	
	//Add 
		public function add_edit($data='',$extra='')
		{
			
			//echo $_SESSION['role_level'];
			
			
			 
			$data['id'] = $data['code'] = $data['code'];
			
			/*if($data['dob'])
				$data['dob'] = $data['dob'];
			else
				$data['dob'] = date("Y-m-d");
				*/
		?> 

            <div id="add_edit"  >
                <form   name="add_edit_form" id="add_edit_form" method="post" enctype="multipart/form-data" action='../ajaximage/ajaximage.php' data-parsley-validate >
               <div class="header_box"><?=($data['id']>0)?'Edit - ':'Add - ';?><?=TITLE_PAGE;?></div>
               <div class="body_box"> <?php if($data['id']>0) { 
				
				?>
                	<input type="hidden" name="task2" id="task2" value="update"  />
                    <input type="hidden" name="id" id="id" value="<?=$data['id'];?>"  />
                   
				   
                   
				   <?php }else{ 
				   
				   //$data['under'] = $extra['under'];
				  // $data['designation'] = $extra['designation'];
				   ?>
                   <input type="hidden"  name="task2" id="task2" value="Add"  />
                   <input type="hidden" name="id" id="id" value=""  />
                   <?php } ?>
                   
                 
              	
                
                    <div class="wd-300">
                      <div class="d-md-flex mg-b-30">
                        <div class="form-group mg-b-0">
                          <label>Customer Name: <span class="tx-danger">*</span></label>
                          <input type="text" name="name" class="form-control wd-200 wd-sm-250" placeholder="Enter Name" required>
                        </div><!-- form-group -->
                        <div class="form-group mg-b-0 mg-md-l-20 mg-t-20 mg-md-t-0">
                          <label>Mobile Number: <span class="tx-danger">*</span></label>
                          <input type="text" name="mobile" class="form-control wd-200 wd-sm-250" placeholder="Enter Mobile Number" required>
                        </div><!-- form-group -->
                      </div><!-- d-flex -->
                      <div class="d-md-flex mg-b-30">
                        <div class="form-group mg-b-0">
                          <label>Address Line 1: <span class="tx-danger">*</span></label>
                          <input type="text" name="address_line_1" class="form-control wd-200 wd-sm-250" placeholder="Enter Address Line 1" required>
                        </div><!-- form-group -->
                        <div class="form-group mg-b-0 mg-md-l-20 mg-t-20 mg-md-t-0">
                          <label>Address Line 2: <span class="tx-danger"></span></label>
                          <input type="text" name="address_line_2" class="form-control wd-200 wd-sm-250" placeholder="Enter Address Line 2(Optional)"  >
                        </div><!-- form-group -->
                      </div>
                      
                      <div class="d-md-flex mg-b-30">
                         <div  id="res"></div>
                      </div>
                       <div class="d-md-flex mg-b-30">
                        <button type="submit"  id="submit_66"  class="dt-button btn btn-primary btn-success btn-sm">Submit</button> 
                        
                        <button type="button" class="dt-button btn btn-default btn-success btn-sm" onclick="GeneralDetails(<?=$_SESSION['page'];?>)">Go Back</button>
                        </div>
                    </div>
           <!--
           		<button type="button" id="btnInsertPro" name="btnInsertPro" onclick="addNew_Key(this.form)">Save</button>
                <button type="button" id="as" name="as" onclick="GeneralDetails(<?=$_SESSION['page'];?>)" >Go Back</button>-->
            
            	</form>
            </div>
                
		 
        <?php
	}
	
}

?>
</div>
