<?php
require_once('constants.php');
class General
{
	public function __construct()
	{
		
		?>
         
        <script language="javascript" src="js/index_sub.js?t=<?=time();?>" type="text/javascript">       
        </script>
        <style>
		
		
		#datatable1 td {
			word-break: break-word;
			overflow:hidden;
			vertical-align: top;
			
		}
		</style>
        <?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-6" > 
                 <label>Search : </label>&nbsp;<input type="text" name="searchtext" id="searchtext" class="form-control">
                  
                 
                  
   <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">
					 //add_edit('0','main_result_div','');
					 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'];
			
			/*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="" >
                       
                     <div class="d-md-flex mg-b-30">
                        <div class="form-group mg-b-0">
                        	 
                             
                        </div>
                        
                         
                      </div>
                      <div   >  
                      
                       <div class="d-md-flex mg-b-30"  >
                        <div class="form-group mg-b-0">
                        	 <label>Sender ID : <span class="tx-danger">*</span></label>
                          	<select  name="<?=$name='sender_id';?>" id="<?=$name;?>" class="form-control wd-100 wd-sm-100"   required>
                            <option value="JSHINE" <?=($data[$name]=='JSHINE')?'selected="selected"':''?>>JSHINE</option>
                            <option value="WNBSKT" <?=($data[$name]=='WNBSKT')?'selected="selected"':''?>>WNBSKT</option>
                             </select>
                        </div>
                       
                        <div class="form-group mg-b-0 mg-md-l-20 mg-t-20 mg-md-t-0" >
                          
                          
                          <label>Schedule for date : <span class="tx-danger">*</span></label>
                           
                           <div class="input-group">
                        
                           <span class="input-group-addon"><i class="icon ion-calendar tx-16 lh-0 op-6"></i></span>
  <input readonly="readonly" type="text" class="form-control fc-datepicker form-control wd-200 wd-sm-250" placeholder="DD/MM/YYYY"  name="<?=$name='schudle_time';?>" id="<?=$name;?>" value="<?=date("d-m-Y",strtotime(clear_blank_date($data[$name])));?>">
                             
                             </div>
                            
                        </div>
                       <div class="form-group mg-b-0 mg-md-l-20 mg-t-20 mg-md-t-0">
                        	 
                        
                           
                         
                       
                          <label>Time : <span class="tx-danger">*</span></label>
                         	    <?php 
							$table = "gateway_settlement_time";	//$table = name of table
							$fields = "*";			//Fields = Fields of tables
							$matchField = "";		//$matchField = matching fields
							$code = "";				//$code = where $code
							$class = "form-control  form-control wd-100 wd-sm-100";			//$class = css classs 
							$sel = '';				//$sel = selected fields
							$function ="";			//$function = javascript function
							$id = "ttime";		//$id = id of select
							$displayName = "s_time";		//displayName = display name
							$value ="s_time_value";  			// $value = value of Select
							
							
							echo common_select($table,$fields,$matchField,$code,$class,$sel,$function,$id,$displayName,$value)
					?>
                        </div>
                    
                      
                     
                        
                        
                         
                      </div>
                       
 					      <div class="d-md-flex mg-b-30">
                        <div class="form-group mg-b-0">
                      	 
                        	 <label>Template : <span class="tx-danger"></span></label>
                    	   <?php $name='template';?>
                          
                            <textarea id="template" name="template"   class="form-control wd-200 wd-sm-450" rows="6"  >Dear [NAME] ([WBNO]), To win exciting prizes in the upcoming Reward Program for the June month along with monthly bonus. We would request you to kindly submit your payment against JShine product booking in Diamond Harvest Scheme.

A/c Name: JShine Souk Pvt. Ltd.

HDFC A/c No. 50200026076631 IFSC: HDFC0000035

Induslnd A/c No. 259855887770
IFSC: INDB0000432

Paytm: 9855187770

Last Date by Cash, Bank Transfer or Paytm 10th June 2018

For any query, feel free to call us at 0172-5053111 and 9855887770.
T and C applicable.
Kindly inform us if already paid.</textarea> <br />
[NAME], [ORDER_NO], [WBNO], [AMOUNT]
                        </div>
                        
                        
                        </div>
                       <div class="d-md-flex mg-b-30">
                        <div class="form-group mg-b-0">
                                 <label>To whom you want to Send SMS? : 
                                 <span class="tx-danger">*</span></label><br />

                                   <label><input type="radio" value="Status" name="send_sms_to" id="send_sms_to" > Based on Status</label>
                                   <label><input type="radio" value="ENO" name="send_sms_to" id="send_sms_to" > Based on ENO</label>
                                    
                          
                          </div>
                             
                        
                         
                        </div> 
                     	 <div class="d-md-flex  status_box" style="display:none;"  >
                        <div class="form-group mg-b-0 status_box" style="display:none;">
                                 <label>Select status? : 
                                 <span class="tx-danger">*</span></label><br />

                                <?php
									
									$s2 = "select * from booking_status where code>0";
									$r2 = mysql_query($s2);
									while($r4 = mysql_fetch_assoc($r2))
									{
										//$status_name[$r4['code']] = $r4['name'];
										?>
										<label><input type="checkbox"  <?=($r4['code']==2)?'checked="checked"':'';?> name="status[]" id="status" value="<?=$r4['code'];?>"  /> <?=$r4['name'];?></label>&nbsp;&nbsp;
										<?php 
									}
                                            
                                ?>
                          
                          </div>
                             
                        
                         
                        </div>
                        
                        <div class="d-md-flex  eno_box"  style="display:none;">
                        <div class="form-group mg-b-0 eno_box"  style="display:none;">
                                 <label>Select With/Without : 
                                 <span class="tx-danger">*</span></label><br />

                                 
								 <label><input type="checkbox" name="eno_status[]" id="eno_status" value="With ENO"  /> With ENO</label>&nbsp;&nbsp;
                                 <label><input type="checkbox" name="eno_status[]" id="eno_status" value="Without ENO"  /> Without ENO</label>&nbsp;&nbsp;
										 
                                            
                                 
                          
                          </div>
                             
                        
                         
                        </div>
                        <div class="mg-b-30">
                        </div>
                        <div class="d-md-flex">
                         	<div  id="res"></div>
                         </div>
                        
                        <div class="d-md-flex mg-b-30">
                        <div class="form-group mg-b-0">
                                 
                        
                         <div  id="res"></div>
                         
                      <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>  
                      
                      <!--<div class="d-md-flex mg-b-30">
                        <div class="form-group mg-b-0">
                        	 
                        
                           
                         
                       
                          <label>Status : <span class="tx-danger">*</span></label>
                         	   <?php 
							$table = " master_status";	//$table = name of table
							$fields = "*";			//Fields = Fields of tables
							$matchField = "";		//$matchField = matching fields
							$code = "";				//$code = where $code
							$class = "form-control selct wd-200 wd-sm-250";			//$class = css classs 
							$sel = $data['status'];				//$sel = selected fields
							$function ="";			//$function = javascript function
							$id = "status";		//$id = id of select
							$displayName = "name";		//displayName = display name
							$value ="code";  			// $value = value of Select
							$other =" required"; 
							
							echo common_select($table,$fields,$matchField,$code,$class,$sel,$function,$id,$displayName,$value,$other)
					?>
                        </div>
                      </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>
