 
<!-- TinyMCE -->
<script language="javascript" type="text/javascript" src="<?php echo base_url();?>editor/jscripts/tiny_mce/tiny_mce.js"></script>
	<script language="javascript" type="text/javascript" src="<?php echo base_url();?>editor/jscripts/general.js"></script>
	<script language="javascript" type="text/javascript">
		tinyMCE.init({
			//mode : "exact",
			mode : "textareas",

			//elements : "details_ar",
			theme : "advanced",
			plugins : "advimage,advlink,media,contextmenu",
			theme_advanced_buttons1_add_before : "newdocument,separator",
			theme_advanced_buttons1_add : "fontselect,fontsizeselect",
			theme_advanced_buttons2_add : "separator,forecolor,backcolor,liststyle",
			theme_advanced_buttons2_add_before: "cut,copy,separator,",
			theme_advanced_buttons3_add_before : "",
			theme_advanced_buttons3_add : "media",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			extended_valid_elements : "hr[class|width|size|noshade]",
			file_browser_callback : "ajaxfilemanager",
			paste_use_dialog : false,
			theme_advanced_resizing : true,
			theme_advanced_resize_horizontal : true,
			apply_source_formatting : true,
			force_br_newlines : true,
			force_p_newlines : false,	
			relative_urls : true
		});

		function ajaxfilemanager(field_name, url, type, win) {
			var ajaxfilemanagerurl = "../../../../jscripts/tiny_mce/plugins/ajaxfilemanager/ajaxfilemanager.php";
			switch (type) {
				case "image":
					break;
				case "media":
					break;
				case "flash": 
					break;
				case "file":
					break;
				default:
					return false;
			}
            tinyMCE.activeEditor.windowManager.open({
                url: "../../../../jscripts/tiny_mce/plugins/ajaxfilemanager/ajaxfilemanager.php",
                width: 782,
                height: 440,
                inline : "yes",
                close_previous : "no"
            },{
                window : win,
                input : field_name
            });
            
/*            return false;			
			var fileBrowserWindow = new Array();
			fileBrowserWindow["file"] = ajaxfilemanagerurl;
			fileBrowserWindow["title"] = "Ajax File Manager";
			fileBrowserWindow["width"] = "782";
			fileBrowserWindow["height"] = "440";
			fileBrowserWindow["close_previous"] = "no";
			tinyMCE.openWindow(fileBrowserWindow, {
			  window : win,
			  input : field_name,
			  resizable : "yes",
			  inline : "yes",
			  editor_id : tinyMCE.getWindowArg("editor_id")
			});
			
			return false;*/
		}
	</script>
<!-- /TinyMCE -->


 
 
 
 <link href="<?php echo base_url();?>template/tabs/tabs2/css/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="<?php echo base_url();?>template/tabs/tabs2/js/jquery.min.js"></script>
  <script src="<?php echo base_url();?>template/tabs/tabs2/js/jquery-ui.min.js"></script>
  
  <script>
  $(document).ready(function() {
    $("#tabs").tabs();
  });
  </script>




<?php
if($qry != false)
{
    foreach ($qry->result() as $row) :

    $id=$row->id;
    $name = $row->name;
    $name_ar =$row->name_ar;
    $short=$row->short;
    $shor_ar=$row->short_ar;
    $details=$row->details ;
	$details_ar=$row->details_ar;
    $pic=$row->pic;
    $cat=$row->cat;

    endforeach;

}


?>


  
    
    <div class="right_content">            
        
    <h2><?php echo $type?>-Edit Post
<?php foreach($lang->result() as $rs):?>
    <?php $lng=$rs->lang;?>
    <?php endforeach;?>
    <?php foreach($sett->result() as $rss):?>
    <?php endforeach;?>

     </h2> 
                    
                    
&nbsp;&nbsp;
     
         <div class="form">
         <form action="<?php echo base_url();?>index.php/posts/save_edite_post/<?php echo $type?>/<?php echo $status?>/<?php echo $id?>" enctype="multipart/form-data" method="post" class="niceform">
         
  <div id="tabs" >
    <ul>
        <li><a href="#fragment-1"><span>English</span></a></li>
        <li><a href="#fragment-2"><span><?php echo iconv("windows-1256","utf-8","عربي")?></span></a></li>
       
    </ul>
    <div id="fragment-1">

		  <fieldset>
		  <?php if($rss->have_cats=='yes'):?>
                    <dl>
                        <dt><label for="email">Category:</label></dt>
                        <dd>
                         <select size="1" name="cats" id="">
                            <?php 
                               if($cats !=FALSE){
                               foreach($cats->result() as $c):
                               $cat_id=$c->id;
                               
                               ?>
                                <option <?php if($cat_id==$cat){echo 'selected="" ';}?>  value="<?php echo $c->id;?>"><?php echo $c->name;?></option>
                                
                                 <?php endforeach;
                                 }
                                 ?>
                              
                            </select>
</dd>
                    </dl>
                    <?php endif;?>
               <?php if($rss->have_name=='yes'):?>
                    <dl>
                        <dt><label for="email">Title:</label></dt>
                        <dd><input type="text" name="name" value="<?php echo $name;?>" id="" size="54" /></dd>
                    </dl>
                    <?php endif;?>
                    <?php if($rss->have_short=='yes'):?>
                    <dl>
                        <dt><label for="password">Summery:</label></dt>
                        <dd><textarea name="short" id="comments"  rows="5" cols="36"><?php echo $short;?></textarea></dd>
                    </dl>
                     <?php endif;?>
                     
                     <?php if($rss->have_details=='yes'):?>
                    <dl>
                        <dt><label for="gender">Details:</label></dt>
                       <dd>
                            <textarea name="details" id="comments" rows="5" cols="36" style="height: 449px; width: 402px"><?php echo $details;?></textarea>                            
                        </dd>
                    </dl>
                     <?php endif;?>
                    
                    <?php if($rss->have_pic=='yes'):?>
                    <dl>
                        <dt><label for="interests">Photo:</label></dt>
                        <dd>
                        <input name="pic2" value="value="<?php echo $pic;?>"" type="hidden" />
                           <input name="pic" type="file" />                           
                        </dd>
                    </dl>
                    <?php endif;?>
                    
                </fieldset>
		

	 </div>
    <div id="fragment-2">

	
				  <fieldset>
               <?php if($rss->have_name=='yes'):?>
                    <dl>
                        <dt><label for="email"><?php echo iconv("windows-1256","utf-8","العنوان")?>:</label></dt>
                        <dd><input type="text" name="name_ar" value="<?php echo $name_ar;?>" id="" size="54" /></dd>
                    </dl>
                    <?php endif;?>
                    <?php if($rss->have_short=='yes'):?>
                    <dl>
                        <dt><label for="password"><?php echo iconv("windows-1256","utf-8","نبذه")?>:</label></dt>
                        <dd><textarea name="short_ar" id="comments"  rows="5" cols="36"><?php echo $row->short_ar;?></textarea></dd>
                    </dl>
                     <?php endif;?>
                     
                     <?php if($rss->have_details=='yes'):?>
                    <dl>
                        <dt><label for="gender"><?php echo iconv("windows-1256","utf-8","التفاصيل")?>:</label></dt>
                       <dd >
                            <textarea name="details_ar" style="height: 449px; width: 402px"><?php echo $details_ar;?></textarea>                            
                        </dd>
                    </dl>
                     <?php endif;?>
                    
                    
                    
                </fieldset>
		
	 </div>
	
 </div>

         
         
              
                
              
                    <input type="submit" name="submit" id="submit" value="Submit" />
                     
         </form>
         </div>  
      
     
     </div><!-- end of right content-->
            
                    
  </div>