
<div class="pcoded-main-container">
    <div class="pcoded-content">
        <!-- [ breadcrumb ] start -->
        <div class="page-header">
            <div class="page-block">
                <div class="row align-items-center">
                    <div class="col-md-12">
                        <div class="page-header-title">
                            <h5 class="m-b-10">İşler</h5>
                        </div>
                        <ul class="breadcrumb">
                            <li class="breadcrumb-item"><a href="<?php echo site_url('anasayfa');?>"><i class="feather icon-home"></i></a></li>
                            <li class="breadcrumb-item"><a href="#">İş Düzenle</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <!-- [ breadcrumb ] end -->
        <!-- [ Main Content ] start -->
      
                     
                  
 <div class="row justify-content-center">
            <!-- liveline-section start -->
    <div class="col-sm-12">
			 <div class="card">
							<div class="card-header">
								<h5>İş Düzenle</h5>
							</div>
							<div class="card-body">
           
				 


			<form enctype="multipart/form-data"  id="islerform"  action="<?php echo site_url('isler/edit/'.$isler['id']);?>" method="POST">
          	<div class="box-body">
          	<div class="row clearfix">
					<div class="col-md-4">
						<label for="musteri" class="control-label">Müşteri</label>
						<div class="form-group">
						
							<select name="musteri" class="form-control" data-plugin="select2" data-live-search="true">
								<option value="">Müşteri Seçiniz</option>
								<?php 
								foreach($all_musteri as $musteri)
								{
									$selected = ($musteri['id'] == $isler['musteri']) ? ' selected="selected"' : "";

									echo '<option value="'.$musteri['id'].'" '.$selected.'>'.$musteri['ad'].'</option>';
								} 
								?>
							</select>
						</div>
					</div>
					<div class="col-md-4">
						<label for="yapan" class="control-label">Çalışan</label>
						<div class="form-group">
							<select name="yapan" class="form-control" data-plugin="select2" data-live-search="true">
								<option value="">Havuz</option>
								<?php 
								foreach($all_calisan as $calisan)
								{
									if ($calisan['tur']!=1)
									{
									$selected = ($calisan['id'] == $isler['yapan']) ? ' selected="selected"' : "";

									echo '<option value="'.$calisan['id'].'" '.$selected.'>'.$calisan['ad'].'</option>';
									}
								} 
								?>
							</select>
						</div>
					</div>
					<div class="col-md-4">
						<label for="istur" class="control-label">İş Türü</label>
						<div class="form-group">
							<select name="istur" class="form-control" data-plugin="select2">
								<option value="">İş Türü Seçiniz</option>
								<?php 
								foreach($all_calisantur as $calisantur)
								{
									if ($calisantur['id']!=1)
									{
									$selected = ($calisantur['id'] == $isler['istur']) ? ' selected="selected"' : "";

									echo '<option value="'.$calisantur['id'].'" '.$selected.'>'.$calisantur['brans'].'</option>';
									}
								} 
								?>
							</select>
						</div>
					</div>
					<div class="col-md-12">
						<label for="aciklama" class="control-label">Açıklama</label>
						<div class="form-group">
						
							<textarea name="aciklama" class="form-control" rows="5" style="width:100%" ><?php echo ($this->input->post('aciklama') ? $this->input->post('aciklama') : $isler['aciklama']); ?></textarea>
							
						</div>
					</div>
					<div class="col-md-4">
						<label for="fiyat" class="control-label">Fiyat</label>
						<div class="form-group">
							<input type="text" class="form-control" name="fiyat" value="<?php echo ($this->input->post('fiyat') ? $this->input->post('fiyat') : $isler['fiyat']); ?>" data-plugin="TouchSpin"
                    data-min="-1000000000" data-max="1000000000" data-stepinterval="50"
                    data-maxboostedstep="10000000" data-prefix="TL" value="750" />
						</div>
					</div>
					
							
					<div class="col-md-4">
						<label for="acil" class="control-label">Acil</label>
						<div class="form-group">
							<select name="acil" class="form-control" data-plugin="select2">
								<option value="1" <?php if ($isler['acil']==1)	{echo ' selected="selected"'; }; ?>>Çok Acil</option>
								<option value="2" <?php if ($isler['acil']==2)	{echo ' selected="selected"'; }; ?>>Acil</option>
								<option value="3" <?php if ($isler['acil']==3)	{echo ' selected="selected"'; }; ?>>Normal</option>
								<option value="4" <?php if ($isler['acil']==4)	{echo ' selected="selected"'; }; ?>>Yavaş</option>
								
							</select>
						</div>
					</div>
					
					<div class="col-md-4">
						<label for="onay" class="control-label">Durumu</label>
						<div class="form-group">
							<select name="onay" class="form-control" data-plugin="select2">
								<option value="0" <?php if ($isler['onay']==0)	{echo ' selected="selected"'; }; ?>>Yeni</option>
								<option value="1" <?php if ($isler['onay']==1)	{echo ' selected="selected"'; }; ?>>Yapılıyor</option>
								<option value="2" <?php if ($isler['onay']==2)	{echo ' selected="selected"'; }; ?>>Revizeli</option>
								<option value="3" <?php if ($isler['onay']==3)	{echo ' selected="selected"'; }; ?>>Onaylandı</option>
								<option value="4" <?php if ($isler['onay']==4)	{echo ' selected="selected"'; }; ?>>İptal</option>
								
							</select>
						</div>
					</div>
				
								<input type="hidden" name="dosyagiden" value="00" id="dosyagiden" />
								
						<div class="col-md-12">
							<button type="submit" class="btn btn-success ">
								<i class="fa fa-check"></i> Kaydet
							</button>
							</div>
											
						
				</div>
			</div>
          	
            <?php echo form_close(); ?>
      
			</br>
			</br>
			<div class="row ">
				<div class="col-md-12">
				
			  <form method="post" action="<?php echo site_url('isler/dropyukle');?>" enctype="multipart/form-data" class="dropzone" id="myAwesomeDropzone">
				</form>
				 <br>
				<button type="button" class="btn btn-info" id="submit_dropzone_form">Yükle</button>
	  
				 </div>
			</div>
				</br>
				<?php 

								if($isler['dosyagiden']!="")

								{


									$ekleyen=isimogren('yapan',$isler['ekleyen']);
										?>

				<div class="card">
                    <div class="card-header">
                        <h5>Mevcut Dosyalar:</h5>
                    </div>
                    <div class="card-body task-attachment">
                        <ul class="media-list p-0">
					<?php	
					$dosya=$isler['dosyagiden'];
					
					$dosyalar=json_decode($dosya);

		
					
					foreach($dosyalar as $d){ 
					
					//Dosya Türlerine Göre Stil
					if(strstr($d, "jpg") || strstr($d, "png")|| strstr($d, "jpeg")){$dosyatur="fa-file-image";
					}else if(strstr($d, "avi") || strstr($d, "mov")|| strstr($d, "mp4")){$dosyatur="fa-file-movie";
					}else if(strstr($d, "pdf")){$dosyatur="fa-file-pdf";
					}else{$dosyatur="fa-file";};

					?>
					
						<li class="media d-flex m-b-15">
                                <div class="m-r-20 file-attach">
                                    <i class="far <?php echo $dosyatur; ?> f-28 text-muted"></i>
                                </div>
                                <div class="media-body">
                                    <a href="#!" class="m-b-5 d-block text-secondary">
									<?php echo $d; ?></a>
                                    <div class="text-muted">
                                        <small>
										Boyut :<?php
										$dosyaurl='uploads/'. $d;
										$dosyabyte=filesize("$dosyaurl");
										echo formatBytes($dosyabyte);?>
										</small>
                                        <small>
                                           Ekleyen <a href="#!" class="text-secondary"><?php echo $ekleyen; ?></a>
                                        </small>
                                    </div>
                                </div>
                                <div class="float-right text-muted">
								   <a href="<?php echo site_url('uploads/'. $d); ?>" data-lightbox="image-1" > <i class="fas fa-eye f-18"></i></a>
                                   <a href="<?php echo site_url('uploads/'. $d); ?>" download > <i class="fas fa-download f-18"></i></a>
                                   <a href="#" data-target="#sil<?php echo md5($d); ?>" data-toggle="modal" " > <i class="fas fa-trash-alt f-18"></i></a>
								
								<div class="modal fade modal-primary" id="sil<?php echo md5($d); ?>" aria-hidden="true" role="dialog" tabindex="-1">
									<div class="modal-dialog">
									  <div class="modal-content modal-simple modal-center">
										<div class="modal-header">
										  <h5 class="modal-title">Dosyayı  Silmek İstediğinize Emin misiniz ?</h5>
										</div>
										<div class="modal-body">
										<center>
											</br>
										<?php if(strstr($d, "jpg") || strstr($d, "png")){ 	?>
										<img src="<?php echo site_url('uploads/'. $d); ?>" width="500px" ><br>
										<?php }?>
										 <?php echo $d; ?>
										 </br>
										 </center>
										</div>
										<div class="modal-footer">
										  <button type="button" class="btn btn-default btn-pure" data-dismiss="modal">Kapat</button>
										  <a href="<?php echo site_url('isler/gidendosyasil/'.$isler['id'].'/'.$d); ?>" class="btn btn-success btn-sm waves-effect waves-classic"><span class="fa fa-trash"></span> Sil</a>
										</div>
									  </div>
									</div>
								  </div>

								</div>
                         </li>
						 
			

					<?php  } 	?>
					
			       </ul>
                    </div>
               </div>
		<?php  }else{

				echo "Dosya Yüklenmemiş";		 

				}	?>
				

	 </div>
           </div>

		 
            </div>
            </div>
            </div>
            </div>

  