 
<!-- 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 -->


 
 
 



<?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;

}


?>
<?php foreach($lang->result() as $rs):?>
    <?php $lng=$rs->lang;?>
    <?php endforeach;?>
    <?php foreach($sett->result() as $rss):?>
    <?php endforeach;?>



   <div id="mws-container" class="clearfix">
            <div class="container">
            
            
            
         <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="mws-form">

   <div class="mws-panel grid_4" style="width:98%">
                    <div class="mws-tabs">

                        <ul>
                            <li><a href="#tab-1">English</a></li>
                            <li><a href="#tab-2"><?php echo iconv("windows-1256","utf-8","عربي")?></a></li>
                           
                        </ul>
                        
                        <div id="tab-1">
                            <p> 
                            <div class="mws-form-inline">
                            
                    		  <?php if($rss->have_cats=='yes'){?>

                    			<div class="mws-form-row">
                    				<label>Category</label>
                    				<div class="mws-form-item small">
                    				
                    				

			                           <select name="cats" >
			                           <option  value="">Select</option>
			                            <?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>
                    				</div>
                    			</div>
                    			<?php }?>
               <?php if($rss->have_name=='yes'){?>
                    			<div class="mws-form-row">
                    				<label>Site Name (ar)</label>
                    				<div class="mws-form-item small">
                    					<input type="text" name="name" value="<?php echo $name;?>"  class="mws-textinput" />         
                    								</div>
                    			</div>
                    	   <?php }?>
               <?php if($rss->have_short=='yes'){?>

                    			<div class="mws-form-row">
                    				<label>Summary</label>
                    				<div class="mws-form-item small">
                    					<input type="text" name="short" value="<?php echo $short;?>"  class="mws-textinput" />        
                    					            				</div>
                    			</div>
                    			<?php }?>
                    		     <?php if($rss->have_details=='yes'){?>
                    			<div class="mws-form-row">
                    				<label>Details</label>
                    				<div class="mws-form-item small">
                    					 <textarea name="details" cols="36" style="height: 450px"><?php echo $details;?></textarea></div>
                    			</div>
                    			 <?php }?>
               <?php if($rss->have_pic=='yes'){?>
                    			<div class="mws-form-row">
                    				<label>Picture</label>
                    				<div class="mws-form-item larg">
                    			   <input name="pic2" value="<?php echo $pic;?>" type="hidden" />
                    				<input type="file"  name="pic" class="mws-textinput" />
                    			</div>
                    	                 			
                    			
                    			
                    		</div>
<?php }?>
           </div>                 
                            </p>
                        </div>
                        
                        <div id="tab-2">
                           
                           <p> 
                            <div class="mws-form-inline">
                            
                    		 
               <?php if($rss->have_name=='yes'){?>
                    			<div class="mws-form-row">
                    				<label>Site Name (ar)</label>
                    				<div class="mws-form-item small">
                    					<input type="text" name="name_ar" value="<?php echo $name;?>"  class="mws-textinput" />         
                    								</div>
                    			</div>
                    	   <?php }?>
               <?php if($rss->have_short=='yes'){?>

                    			<div class="mws-form-row">
                    				<label>Summary</label>
                    				<div class="mws-form-item small">
                    					<input type="text" name="short_ar" value="<?php echo $short;?>"  class="mws-textinput" />        
                    					            				</div>
                    			</div>
                    			<?php }?>
                    		     <?php if($rss->have_details=='yes'){?>
                    			<div class="mws-form-row">
                    				<label>Details</label>
                    				<div class="mws-form-item small">
                    					 <textarea name="details_ar" id="comments" cols="36" style="height: 450px"><?php echo $details_ar;?></textarea></div>
                    			</div>
                    			 <?php }?>
              
           </div>
                           
                           </p>
                        </div>
                        
                       
                     <div class="mws-button-row">
                    		
                    			<input type="submit" value="Submit" class="mws-button orange" />
                    			
                    		</div>
                </div></div>
               

                </form>
                
                
                


  
  </div>







