ok

Mini Shell

Direktori : /proc/thread-self/root/proc/self/root/home2/selectio/www/subamangala/admin/
Upload File :
Current File : //proc/thread-self/root/proc/self/root/home2/selectio/www/subamangala/admin/preference-set.php

    <?php  include "header.php";
 $ids=$_GET['id'];
$statement = $pdo->prepare("SELECT e.* FROM `preference` e INNER JOIN profiles ON e.Profileid=profiles.id INNER JOIN caste ON profiles.caste=caste.id where e.Profileid=".$ids);
$statement->execute();
$datas = $statement->fetchAll(PDO::FETCH_ASSOC);
$totalData = $statement->rowCount();


if(!empty($datas)){
    
    
    $caste_idss = explode(',', $datas[0]['Pref_Caste']);
    $star_idss = explode(',', $datas[0]['Pref_Star']);
    $thosam_idss = explode(',', $datas[0]['Pref_Dhosam']);
    $edu_idss = explode(',', $datas[0]['Pref_Edu']);
    $height_idss = explode(',', $datas[0]['Pref_Height']);
    $marriage_idss = explode(',', $datas[0]['Pref_Marriage']);
   
}else{
    return 0;
}


if($totalData>0){

?>
<div class="content-wrapper">
        <section class="content-header">
            <h1>Add Users</h1>
            <ol class="breadcrumb">
                <li><a href="index.php"><i class="fa fa-dashboard"></i> Home</a></li>
                <li class="active">Add Users</li>            
            </ol>
        </section>


        <div class="col-lg-12 alerts">
            <div id="custom-alerts" style="display:none;">
                <div class="alert alert-dismissable">
                    <div class="custom-msg"></div>
                </div>
            </div>
            
            <?php if ($error)  { ?>
            <div class="alert alert-danger alert-dismissable">
                <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                <h4><i class="icon fa fa-ban"></i> Error</h4>
                <?= $error; ?>
            </div>
            <?php $error=0;} if ($warning) { ?>
            <div class="alert alert-warning alert-dismissable">
                <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                <h4><i class="icon fa fa-warning"></i> Warning</h4>
                <?= $warning; ?>
            </div>
            <?php  $warning=0;} if ($message) { ?>
            <div class="alert alert-success alert-dismissable">
                <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                <h4>    <i class="icon fa fa-check"></i> Success</h4>
                <?= $message; ?>
            </div>
            <?php $message=0; } ?>
        </div>
        <div class="clearfix"></div>







<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box box-primary">
                <div class="box-header">
                    <h3 class="box-title">Please fill in the information below</h3>
                </div>
                <div class="box-body">
                    <div class="col-lg-12">

                        <form  enctype="multipart/form-data" method="post" id="preferance_add_update_form">
                                                                 
                        <div class="row">
                             <div class="col-md-3">
                                 <div class="form-group">
                                     
                                      <?php $statement2 = $pdo->prepare("SELECT * FROM `preference` where Profileid='".$_GET['id']."'");
                                            $statement2->execute();
                                            $preferance_result = $statement2->fetchAll(PDO::FETCH_ASSOC); 
                                            $pre_totalData = $statement2->rowCount();
                                            if($pre_totalData>0){ ?>
                                                <input type="hidden" name="insertstatus" value="Updatevalue"/>
                                            <?php }else{ ?>
                                            <input type="hidden" name="insertstatus" value="Addvalue"/>
                                           <?php } ?>
                                     
                                        <label class="required" for="role">ஜாதி</label>                                   
                                        <select name="caste[]" class="form-control select2" id="caste" required="required" multiple>
                                            <option value="">Select ஜாதி</option>
                                            <?php $statement = $pdo->prepare("SELECT * FROM `caste`");
                                            $statement->execute();
                                            $location_result = $statement->fetchAll(PDO::FETCH_ASSOC); 
                                            foreach ($location_result as $result) { ?>
                                               <option value="<?=$result['id']?>" <?php if(in_array($result['id'], $caste_idss)){ echo "selected";} ?>><?=$result['name']?></option>
                                          <?php  } ?>
                                         </select>
                                    </div> 
                             </div>
                             <div class="col-md-3">
                                 <div class="form-group">
                                        <label class="required" for="role">நட்சத்திரம்</label>                                   
                                        <select name="natchatram[]" class="form-control select2" id="natchatram" required="required" multiple>
                                            <option value="">Select நட்சத்திரம்</option>
                                             <?php $statement = $pdo->prepare("SELECT * FROM `natchatram`");
                                            $statement->execute();
                                            $location_result = $statement->fetchAll(PDO::FETCH_ASSOC); 
                                            foreach ($location_result as $result) { ?>
                                               <option value="<?=$result['id']?>" <?php if(in_array($result['id'], $star_idss)){ echo "selected";} ?>><?=$result['natchatram']?></option>
                                          <?php  } ?>
                                        </select>
                                    </div> 
                             </div>
                             <div class="col-md-3">
                                <div class="form-group">
                                    <label class="required" for="role">Min Year</label>
                                    <select name = "miny" id = "miny" class="form-control select2" style="width:100%" required="required">
                                        <option value=""></option>
                                        <?php
                                            $y = date("Y", strtotime("+8 HOURS"));
                                          for($year = 1947; $year <= 2029; $year++){ ?>
                                                <option value="<?=$year?>" <?php if($datas[0]['From_Year']==$year){ echo "selected";}?>><?=$year?></option>
                                                
                                         <?php   }
                                        ?>
                                    </select>
                                </div>
                            </div>
                            <div class="col-md-3">
                                
                                <div class="form-group">
                                    <label class="required" for="role">Max Year</label>
                                    <select name = "maxy" id = "maxy" class="form-control select2" style="width:100%" required="required">
                                        <option value=""></option>
                                        <?php
                                            $y = date("Y", strtotime("+8 HOURS"));
                                          for($year = 1947; $year <= 2029; $year++){ ?>
                                                <option value="<?=$year?>" <?php if($datas[0]['To_Year']==$year){ echo "selected";}?>><?=$year?></option>
                                         <?php   }
                                        ?>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-3">
                                 <div class="form-group">
                                        <label class="required" for="role">தோஷம்</label>                                   
                                        <select name="thosam[]" class="form-control select2" id="thosam" required="required" multiple>
                                           <!--  prf  -->
                                           
                                           <?php $pred='L,B,M'; ?>
                                           
                                            <option value="">Select தோஷம்</ooption>
                                           
                                           <option value="A" <?php if(in_array('A', $thosam_idss)){ echo "selected";} ?>>A</option>
                                           <option value="B" <?php if(in_array('B', $thosam_idss)){ echo "selected";} ?>>B</option>
                                           <option value="C" <?php if(in_array('C', $thosam_idss)){ echo "selected";} ?>>C</option>
                                           <option value="D" <?php if(in_array('D', $thosam_idss)){ echo "selected";} ?>>D</option>
                                           <option value="E" <?php if(in_array('E', $thosam_idss)){ echo "selected";} ?>>E</option>
                                           <option value="F" <?php if(in_array('F', $thosam_idss)){ echo "selected";} ?>>F</option>
                                        </select>
                                    </div> 
                             </div>
                             
                             <div class="col-md-3">
                                 <div class="form-group">
                                        <label class="required" for="role">உயரம் வகை </label>                                   
                                        <select name="height_cat[]" class="form-control select2" id="height_cat" required="required" multiple>
                                               <option value="">Select உயரம் வகை </ooption>
                                               <option value="1" <?php if(in_array('1', $height_idss)){ echo "selected";} ?>>உயரம் குறைவானவர்</option>
                                               <option value="2" <?php if(in_array('2', $height_idss)){ echo "selected";} ?>>சரியான உயரம்</option>
                                               <option value="3" <?php if(in_array('3', $height_idss)){ echo "selected";} ?>>மிகவும் உயரமானவர்</option>
                                        </select>
                                    </div> 
                             </div>
                             <div class="col-md-3">
                                 <div class="form-group">
                                        <label class="required" for="role">படிப்பு </label>                                   
                                        <select name="edu[]" class="form-control select2" id="edu" required="required" multiple>
                                            <?php $statement = $pdo->prepare("SELECT * FROM `profiles` where edu_cat!=''  GROUP BY edu_cat");
                                            $statement->execute();
                                            $location_result = $statement->fetchAll(PDO::FETCH_ASSOC); 
                                            foreach ($location_result as $result) { ?>
                                               <option value="<?=$result['edu_cat']?>" <?php if(in_array($result['edu_cat'], $edu_idss)){ echo "selected";} ?>><?=$result['edu_cat']?></option>
                                          <?php  } ?>
                                        </select>
                                    </div> 
                             </div>
                             <div class="col-md-3">
                                 <div class="form-group">
                                        <label class="required" for="role">மணமானவரா?</label>
                                        <select name="marriage[]" class="form-control select2" id="marriage" required="required" multiple>
                                            <option value="">Select மணமானவரா?</opti</ooption>
                                            <option value="first" <?php if(in_array('first', $marriage_idss)){ echo "selected";} ?>>முதல் மனம்</option>
                                            <option value="non-first" <?php if(in_array('non-first', $marriage_idss)){ echo "selected";} ?>>மறு மனம் </option>
                                        </select>
                                    </div> 
                             </div>
                        </div>
                        <div class="row">
                            
                            <div class="col-md-3">
                                 <div class="form-group">
                                        <label class="required" for="role">Starting Limit</label>                                  
                                        <div class="form-group">
                                            <input type="text" id="start_limit" name="start_limit" value="<?=$datas[0]['Pref_Limit']?>" class="form-control tip" required="required" />
                                        </div>
                                    </div> 
                             </div>
                            
                            
                             <div class="col-md-3">
                                 <div class="form-group">
                                        <label class="required" for="role">Limit</label>                                  
                                        <div class="form-group">
                                            <input type="text" id="limit" name="limit" value="<?=$datas[0]['Pref_Limit']?>" class="form-control tip" required="required" />
                                        </div>
                                    </div> 
                             </div>
                             
                             <div class="col-md-3">
                                 <div class="form-group">
                                        <label class="required" for="role">Days</label>                                   
                                        <div class="form-group">
                                            <input type="text" id="days" name="days" value="<?=$datas[0]['Pref_Days']?>" class="form-control tip" required="required" />
                                        </div>
                                    </div> 
                             </div>
                             <div class="col-md-3">
                                 <div class="form-group">
                                        <label class="required" for="role">Expired Date</label>                                   
                                        <div class="form-group">
                                            <input type="text" id="ser" name="ser" class="form-control tip"  value="<?=$datas[0]['Entry_Date']?>" required="required" readonly/>
                                        </div>
                                    </div> 
                             </div>
                             
                             
                             <div class="col-md-3">
                                 <input type='hidden' name='e_id' value=<?=$_GET['id']?>   />
                                 <div class="form-group">
                                        <label class="required" for="role">Login Status</label>
                                        <select name="login" class="form-control select2" id="login" required="required">
                                            <option value="Enable" <?php if($datas[0]['loginstatus']=='Enable'){ echo "selected";}?>>Enable</option>
                                            <option value="Disable" <?php if($datas[0]['loginstatus']=='Disable'){ echo "selected";}?>>Disable</option>
                                        </select>
                                    </div> 
                             </div>
                        </div>
                        <div class="row">
                             <div class="col-md-3">
                                 <div class="form-group">
                                        <label class="required" for="role">Limit Status</label>
                                        <select name="limit_sta" class="form-control select2" id="limit_sta" required="required">
                                            <option value="Manual" <?php if($datas[0]['Limit_Status']=='Manual'){ echo "selected";}?>>Manual</option>
                                            <option value="Automatic" <?php if($datas[0]['Limit_Status']=='Automatic'){ echo "selected";}?>>Automatic</option>
                                        </select>
                                    </div> 
                             </div>
                             <div class="col-md-3">
                                 <div class="form-group">
                                        <label class="required" for="role">Service Date</label>
                                        <input type="date" id="date" name="date" class="form-control tip" value="<?=$datas[0]['Service_Date']?>" required="required" />
                                         <input type="hidden" id="ids" name="ids" class="form-control tip" value="<?=$_GET['id']?>" required="required" />
                                    </div> 
                             </div>
                             <!--<div class="col-md-3">-->
                             <!--    <div class="form-group">-->
                             <!--           <label class="required" for="role">Upload Horoscope Image</label>-->
                             <!--           <input type="file" id="files" name="files[]" multiple  class="form-control tip" />-->
                             <!--   </div> -->
                                
                             <!--</div>-->
                             
                             <div class="row">
						    <div class="col-6 col-sm-6 col-md-6 col-lg-6">
						         <table style="width:100%;" id="plan_image_details">
					                <tr>
					                    <!--<th>Image Name</th>-->
					                    <!--<th>Alt Text</th>-->
					                    <th>Upload Image</th>
					                    <th>Action</th>
					                </tr>
					                <tr class="remove-rows">
					                    <!--<td><input type="text" class="form-control input-xl" name="image_name[]" placeholder="Enter Image Name" required></td>-->
					                    <!--<td><input type="text" class="form-control input-xl" name="image_alt_text[]" placeholder="Enter Alt Text" required></td>-->
					                    <td><input type="file" class="form-control input-xl" name="upload_image[]" required></td>
					                    <td class="text-center"><span id="add_new_plan_image" class="btn btn-warning btn-sm"><i class="fa fa-plus"></i></span></td>
					                </tr>
					            </table>
						    </div>
						</div>
						 
					        
					    
                             
                        </div>
                    
                        <div class="form-group" style="text-align:center;">
                            <input type="submit" name="add_user" value="Update Preferance"  class="btn btn-success" />
                        </form>
                        </div>

                    </div>
                        <div class="form-group" style="text-align:center;">
                            <a href="preference-set.php?id=<?=$_GET['id']?>"><button class="btn btn-primary" ><i class="fa fa-refresh"></i> Reset Form</button></a>
                            <a href="profiles-list.php"><button class="btn btn-warning" ><i class="fa fa-chevron-left"></i> Back to List</button></a>
                         </div>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
</section>
<?php } ?>

<?php include "footer.php"; ?>

<script language=JavaScript src="tamil/utf.js"> </SCRIPT>
<SCRIPT language=JavaScript src="tamil/tamil.js"></SCRIPT>
	<script>
			$(document).ready(function(){
				$('input,textarea').on('keydown',function(event){
					if(event.which==121){
						$(this).toggleClass('tamil');
						return false;
					}
					if($(this).hasClass('tamil')){
						toggleKBMode(event);
					}else{
						return true;
					}
				});
				$('input,textarea').on('keypress',function(event){
					if($(this).hasClass('tamil')){
						convertThis(event);
					}
				});
			});
		</script>


<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<style>
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: rgb(228, 228, 228);
    box-sizing: border-box;
    display: inline-block;
    margin-left: 5px;
    margin-top: 5px;
    position: relative;
    max-width: 100%;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space-collapse: collapse;
    text-wrap: nowrap;
    border-width: 1px;
    border-style: solid;
    border-color: rgb(170, 170, 170);
    border-image: initial;
    border-radius: 4px;
    padding: 0px 10px 0px 20px;
    overflow: hidden;
    color: black;
    font-weight: 800;
}
.select2-container--default .select2-selection--multiple {
    background-color: white;
    border: 1px solid #aaa;
    border-radius: 4px;
    cursor: text;
    height:100px;
    padding-bottom: 5px;
    padding-right: 5px;
    position: relative;
}

.select2-container--classic .select2-selection--multiple {
    display: flex;
}
</style>
<script>
$(document).ready(function(){
    bus_code();
});


$("#role").change(function () {
    bus_code();
});


function bus_code(){
    var role = $("#role").val();
       // Role (2=Agent, 3=Driver)
       if(role==2){
            $("#bus_code_section").hide();
        }else if(role==3){
            $("#bus_code_section").show();
        }else{
            $("#bus_code_section").hide(); 
        }
}
</script>
<script>  
$(document).ready(function(){
  upload_image();
});
function upload_image(){
	$image_crop = $('#image_demo').croppie({
    enableExif: true,
    viewport: {
      width:500,
      height:700,
      type:'square' //circle
    },
    boundary:{
      width:500,
      height:700
    }
  });

  $('#upload_image').on('change', function(){
       console.log('testing upload image file');
    var reader = new FileReader();
    reader.onload = function (event) {
      $image_crop.croppie('bind', {
        url: event.target.result
      }).then(function(){
        console.log('jQuery bind complete');
      });
    }
    reader.readAsDataURL(this.files[0]);
    $('#uploadimageModal').modal('show');
     console.log('testing upload image');
  });

  $('.crop_image').click(function(event){
    $image_crop.croppie('result', {
      type: 'canvas',
      size: 'viewport'
    }).then(function(response){
      $.ajax({
        url:"img-upload/upload.php",
        type: "POST",
        data:{"image": response},
        success:function(data)
        {
          $('#uploadimageModal').modal('hide');
          $('#uploaded_image').html(data);
        }
      });
    })
  });

}  
</script>

<!--   Preference Update Ajax Starts Here   -->

<script>
    $('#preferance_add_update_form').on('submit', function(e){
      //  console.log("Click And Form Working");
                e.preventDefault();
                var formData = new FormData(this);
                formData.append('type', 'create_update_preferance');
                            $.ajax({
                            url: 'apis/preferance-create-update-api.php',
                            type: 'post',
                            dataType: 'json',
                            data: formData,
                            cache: false,
                            contentType: false,
                            processData: false,
                            enctype: 'multipart/form-data',
                            success: function (response) {
                                if(response['status']==200){
                                     alert(response['message']);
                                     window.location.href="http://fmsbilling.xyz/subamangala/register.php";
                                     $('#preferance_add_update_form').trigger("reset");
                                    
                                }else{
                                    alert(response['message']);
                                   
                                }
                                
                               
                            }
                        });
                
    });
</script>

<!--   Preference Update Ajax Ends Here   -->

<script>
     
     $(document).on('click', '.remove_plan_image', function() {
        $(this).closest('.remove-rows').remove();
    });
     
     $('#add_new_plan_image').on('click', function() {
        html = '<tr class="remove-rows"><td hidden><input type="hidden" class="form-control input-xl" name="image_name[]" placeholder="Enter Image Name" required></td><td hidden><input type="hidden" class="form-control input-xl" name="image_alt_text[]" placeholder="Enter Alt Text" required></td><td><input type="file" class="form-control input-xl" name="upload_image[]" required></td><td class="text-center"><button class="btn btn-danger btn-sm remove_plan_image"><i class="fa fa-trash-o"></i></button></td></tr>';
        $('#plan_image_details').append(html);
    });
    
   
</script>

Zerion Mini Shell 1.0