%PDF- %PDF-
Direktori : /home/cargonizer/domains/cargonizer.com.tr/public_html/admin/ |
Current File : /home/cargonizer/domains/cargonizer.com.tr/public_html/admin/edit.php |
<?php if(!defined('BASE')) die(); $parent = (intval("0".$_GET['parent'])) ? $_GET['parent']:0; $type = clean($_GET['type']); $id = intval("0".$_GET['id']); $action = clean($_POST['action']); switch($action) { case 'save': $f = clean($_POST['f']); $link = clean($_POST['link']); $f['create_time'] = ($f['create_time']) ? strtotime($f['create_time']) : time(); $f['type'] = $type; if(!$f['status']) $f['status']='0'; if(!$f['main']) $f['main']='0'; $id = clean($_POST['id']); if(trim($link)) { if(is_numeric($link)) $f['links'] = '?s=page&id='.$link; else $f['links'] = '?s='.$link; } if($id) : insert2lang(LANG,'pages',$id,$f); echo message('Bilgiler başarı ile güncellenmiştir.','success'); else : $id = insertrecord(LANG,'pages',$f); echo message('Bilgiler başarı ile eklenmiştir.','success'); endif; break; case 'new' : $f = clean($_POST['f']); $link = clean($_POST['link']); $f['create_time'] = ($f['create_time']) ? strtotime($f['create_time']) : time(); $f['type'] = $type; if(!$f['status']) $f['status']='0'; if(!$f['main']) $f['main']='0'; if(trim($link)) { if(is_numeric($link)) $f['links'] = '?s=page&id='.$link; else $f['links'] = '?s='.$link; } $id = clean($_POST['id']); $id = insertrecord(LANG,'pages',$f); echo message('Bilgiler başarı ile eklenmiştir.','success'); break; case 'new_sub' : $f = clean($_POST['f']); $link = clean($_POST['link']); $f['create_time'] = ($f['create_time']) ? strtotime($f['create_time']) : time(); $f['type'] = $type; if(!$f['status']) $f['status']='0'; if(!$f['main']) $f['main']='0'; if(trim($link)) { if(is_numeric($link)) $f['links'] = '?s=page&id='.$link; else $f['links'] = '?s='.$link; } $id = clean($_POST['id']); $f['parent'] = $id; $id = insertrecord(LANG,'pages',$f); echo message('Bilgiler başarı ile eklenmiştir.','success'); break; } if($id) : $content = getTable('pages',"WHERE id='$id' && type='{$type}'",LANG); $parents = parentName($content['id'],LANG); endif; ?> <div class="row"> <div class="col-md-12"> <h3 class="page-title"> <?php echo $indexMenu[$type][0]; ?> Ekle / Düzenle </h3> <ul class="page-breadcrumb breadcrumb"> <li> <i class="fa fa-home"></i> <a href="index.php"> Anasayfa </a> <i class="fa fa-angle-right"></i> </li> <li> <a href="?s=pages&type=<?php echo $type; ?>&parent=0"> <?php echo $indexMenu[$type][1]; ?> </a> <i class="fa fa-angle-right"></i> </li> <?php if($parents) : foreach($parents as $pr) : ?> <li> <a href="?s=pages&type=<?php echo $type; ?>&parent=<?php echo $pr['id']; ?>"> <?php echo $pr['name']; ?> </a> <i class="fa fa-angle-right"></i> </li> <?php endforeach; else : if($id) : ?> <li> <a> <?php echo $content['name']; ?> </a> </li> <?php else : ?> <li> <a href="#"> <?php echo $indexMenu[$type][0]; ?> Ekle </a> </li> <?php endif; endif; ?> </ul> </div> </div> <div class="portlet box blue"> <div class="portlet-title">Yeni Ekle (<?php echo LANG; ?>)</div> <div class="portlet-body form"> <form class="form-horizontal" role="form" method="post" id="validate"> <div class="form-actions fluid" style="margin-top:0;"> <div class="col-md-offset-3 col-md-9"> <button class="btn blue" type="submit" name="action" value="new">Yeni</button> <button class="btn btn-warning" type="submit" name="action" value="new_sub">Yeni Alt Kategori</button> <button class="btn green" type="submit" name="action" value="save">Kaydet</button> <button class="btn default" type="button">İptal</button> </div> </div> <?php if($content) : echo '<input type="hidden" name="id" value="'.$content['id'].'" />'; $parent = $content['parent']; endif; ?> <div class="form-body"> <div class="form-group"> <label class="col-md-3 control-label">Başlık</label> <div class="col-md-9"> <input type="text" placeholder="İsim giriniz" class="form-control" name="f[name]" id="name" value="<?php echo $content['name']; ?>" required> </div> </div> <div class="form-group"> <label class="col-md-3 control-label">Anahtar Kelime (SEO Keywords)</label> <div class="col-md-9"> <input type="text" placeholder="Anahtar Kelime" class="form-control tags" name="f[keywords]" value="<?php echo $content['keywords']; ?>"> </div> </div> <div class="form-group"> <label class="col-md-3 control-label">SEO Açıklama (Description)</label> <div class="col-md-9"> <textarea rows="3" class="form-control" placeholder="Anahtar Kelime" name="f[description]" cols="30"><?php echo $content['description']; ?></textarea> </div> </div> <div class="form-group"> <label class="col-md-3 control-label">Tarih</label> <div class="col-md-9"> <input type="text" placeholder="g/a/y" placeholder="Anahtar Kelime" class="form-control" name="f[create_time]" id="create_time" value="<?php echo ($content['create_time']) ? date("d.m.Y",$content['create_time']):''; ?>"> </div> </div> <div class="form-group"> <label class="col-md-3 control-label"></label> <div class="col-md-9"> <!-- Ortam Ekleme --> <a class="btn default mdl" href="gallery.php?intence=shortdetail<?php if($content) echo '&id='.$content['id']; ?>" data-target="#ajaxs"><i class="fa fa-plus"></i> Ortam Ekle</a> </div> </div> <div class="form-group"> <label class="col-md-3 control-label">Kısa Açıklama</label> <div class="col-md-9"> <textarea rows="3" class="form-control ckeditor" name="f[shortdetail]" cols="30" id="shortdetail"><?php echo $content['shortdetail']; ?></textarea> </div> </div> <div class="form-group"> <label class="col-md-3 control-label"></label> <div class="col-md-9"> <!-- Ortam Ekleme --> <a class="btn default mdl" href="gallery.php?intence=detail<?php if($content) echo '&id='.$content['id']; ?>" data-target="#ajaxs"><i class="fa fa-plus"></i> Ortam Ekle</a> <!-- Şablon Oluşturma --> <a class="btn default mdl" href="template.php?intence=detail&op=create<?php if($content) echo '&id='.$content['id']; ?>" data-target="#ajaxs"><i class="fa fa-plus"></i> Şablon Oluştur</a> <!-- Şablon Ekle --> <a class="btn default mdl" href="template.php?intence=detail&op=add<?php if($content) echo '&id='.$content['id']; ?>" data-target="#ajaxs"><i class="fa fa-plus"></i> Şablon Ekle</a> </div> </div> <div class="form-group"> <label class="col-md-3 control-label">Detaylı Açıklama</label> <div class="col-md-9"> <textarea rows="3" class="ckeditor form-control" name="f[detail]" id="detail"><?php echo $content['detail']; ?></textarea> </div> </div> <?php if ($type === "pages" ){ ?> <div class="form-group"> <label class="col-md-3 control-label">Menu Tipi</label> <div class="col-md-9"> <select name="f[mtype]" class="form-control"> <option value="1" <?php if($content['mtype']==1) echo ' selected="selected"'; ?>>Alt Menü</option> <option value="0" <?php if($content['mtype']==0) echo ' selected="selected"'; ?>>Üst Menu</option> <option value="2" <?php if($content['mtype']==2) echo ' selected="selected"'; ?>>Boş</option> </select> </div> </div> <div class="form-group"> <label class="col-md-3 control-label">Açılır Menü Olsun mu?</label> <div class="col-md-9"> <select name="f[opened]" class="form-control"> <option value="1" <?php if($content['opened']==1) echo ' selected="selected"'; ?>>Evet</option> <option value="0" <?php if($content['opened']==0) echo ' selected="selected"'; ?>>Hayır</option> </select> </div> </div> <div class="form-group"> <label class="col-md-3 control-label">Link</label> <div class="col-md-9"> <input type="text" placeholder="URL giriniz" class="form-control" name="f[links]" id="links" value="<?php echo $content['links']; ?>" data-required="1"> </div> </div> <div class="form-group"> <label class="col-md-3 control-label"><span class="help-inline">Yada</span> Köprü Oluştur</label> <div class="col-md-9"> <select class="form-control" name="link" id="link"> <option value="0">Yok</option> <optgroup label="Sayfalar"> <option value="main">Anasayfa</option> <?php $record = getChilds('pages','pages',0,0); for ($i=0; $i<count($record); $i++) { echo '<option value="'.$record[$i][0].'"'; echo (in_array($record[$i][0],$current)) ? ' selected="selected"':''; echo '>'; for ($j=0;$j<$record[$i][2];$j++) echo ' |-- '; echo $record[$i][1]; echo '</option>'; } unset($record); ?> </optgroup> <optgroup label="Ürünler"> <option value="products">Ürünlerimiz</option> <?php $record = getChilds('pages','products',0,0); for ($i=0; $i<count($record); $i++) { echo '<option value="'.$record[$i][0].'"'; echo (in_array($record[$i][0],$current)) ? ' selected="selected"':''; echo '> |-- '; for ($j=0;$j<$record[$i][2];$j++) echo ' |-- '; echo $record[$i][1]; echo '</option>'; } unset($record); ?> </optgroup> <optgroup label="Haberler"> <option value="news">Haberlerimiz</option> <?php $record = getChilds('pages','news',0,0); for ($i=0; $i<count($record); $i++) { echo '<option value="'.$record[$i][0].'"'; echo (in_array($record[$i][0],$current)) ? ' selected="selected"':''; echo '> |-- '; for ($j=0;$j<$record[$i][2];$j++) echo ' |-- '; echo $record[$i][1]; echo '</option>'; } unset($record); ?> </optgroup> </select> </div> </div> <?php } ?> <div class="form-group"> <label class="col-md-3 control-label">Durumu</label> <div class="col-md-9"> <input type="checkbox" data-off-label="Pasif" data-on-label="Aktif" value="1" class="make-switch" name="f[status]" <?php if(!$content || $content['status']==1) echo 'checked="checked"';?>> </div> </div> <div class="form-group"> <label class="col-md-3 control-label">Üyelik Zorunlu?</label> <div class="col-md-9"> <input type="checkbox" data-off-label="Hayır" data-on-label="Evet" value="1" class="make-switch" name="f[przone]" <?php if($content['przone']==1) echo 'checked="checked"';?>> </div> </div> <!-- <div class="form-group"> <label class="col-md-3 control-label">Anasayfada Göster</label> <div class="col-md-9"> <input type="checkbox" data-off-label="Hayır" data-on-label="Evet" value="1" class="make-switch" name="f[main]" <?php if($content['main']==1) echo 'checked="checked"';?>> </div> </div> --> <div class="form-group"> <label class="col-md-3 control-label">Sıra</label> <div class="col-md-9"> <input type="text" class="form-control input-small" name="f[row]" value="<?php echo $content['row']; ?>"> </div> </div> </div> <div class="form-actions fluid"> <div class="col-md-offset-3 col-md-9"> <button class="btn blue" type="submit" name="action" value="new">Yeni</button> <button class="btn btn-warning" type="submit" name="action" value="new_sub">Yeni Alt Kategori</button> <button class="btn green" type="submit" name="action" value="save">Kaydet</button> <button class="btn default" type="button">İptal</button> <input type="hidden" name="f[parent]" value="<?php echo $parent; ?>" /> </div> </div> </form> </div> <div aria-hidden="true" role="basic" id="ajaxs" class="modal fade"> <div class="modal-dialog modal-full"> <div class="modal-content"> </div> </div> </div>