<link type="text/css" href="<?php echo GLOBAL_ADMIN_JS_PATH; ?>jquery/themes/base/jquery.ui.datepicker.css" rel="stylesheet" />
<script type="text/javascript" src="<?php echo GLOBAL_ADMIN_JS_PATH; ?>jquery/ui/jquery.ui.datepicker.js"></script>
<script type="text/javascript" src="<?php echo GLOBAL_ADMIN_JS_PATH; ?>highslide/highslide-with-gallery.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo GLOBAL_ADMIN_JS_PATH; ?>highslide/highslide.css" />
<script type="text/javascript" src="<?php echo GLOBAL_ADMIN_JS_PATH; ?>powerpanel_alert.js"></script>
<?php
if (DEFAULT_DATEFORMAT == "%d/%m/%Y") {
    $date_special1 = "dd/mm/yy";
}
if (DEFAULT_DATEFORMAT == "%m/%d/%Y") {
    $date_special1 = "mm/dd/yy";
}
if (DEFAULT_DATEFORMAT == "%Y/%m/%d") {
    $date_special1 = "yy/mm/dd";
}
if (DEFAULT_DATEFORMAT == "%Y/%d/%m") {
    $date_special1 = "yy/dd/mm";
}
$startdatehidden = explode("-", $configObj->glLibraryObj->ConvertDateFormatinYMD($row['dt_startdate']));
$enddatehidden = explode("-", $configObj->glLibraryObj->ConvertDateFormatinYMD($row['dt_expiredate']));
?>

<script type="text/javascript">

    hs.graphicsDir = '<?php echo GLOBAL_ADMIN_JS_PATH; ?>highslide/graphics/';
    hs.align = 'center';
    hs.transitions = ['expand', 'crossfade'];
    hs.wrapperClassName = 'dark borderless floating-caption';
    hs.fadeInOut = true;
    hs.dimmingOpacity = .75;

    // Add the controlbar
    if (hs.addSlideshow) hs.addSlideshow({
        slideshowGroup: 'group1',
        interval: 5000,
        repeat: false,
        useControls: true,
        fixedControls: 'fit',
        overlayOptions: {
            opacity: .6,
            position: 'bottom center',
            hideOnMouseOut: true
        }
    });
</script>
<script type="text/javascript">
    $(function() {
        focus();	
        $('#dt_startdate').datepicker({
            changeMonth: true,
            changeYear: true,
            dateFormat:'<?php echo $date_special1; ?>',
            onSelect: function(selectedDate){
                var option = "minDate";
                var instance = $('#dt_expirydate').data("datepicker");
                var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
                $('#dt_expirydate').datepicker("option", option, date);
            }});

        
        $('#dt_expirydate').datepicker({
            changeMonth: true,
            changeYear: true,
            minDate:1,
            //dateFormat:'d/mm/yy'
            dateFormat:'<?php echo $date_special1; ?>',
            onSelect: function( selectedDate ) {
                $( "#dt_startdate" ).datepicker( "option", "maxDate", selectedDate );
            }
        });
    });

   
    function dateCompare(startDate,endDate,seprator)
    {
        switch("<?= DEFAULT_DATEFORMAT ?>")
        {
            case '%d/%m/%Y':
                year=2;
                month=1;
                date=0;
                break;
            case '%m/%d/%Y':
                year=2;
                month=0;
                date=1;
                break;
            case '%Y/%m/%d':
                year=0;
                month=1;
                date=2;
                break;
            case '%Y/%d/%m':
                year=0;
                month=2;
                date=1;
                break;
                
            }

            var Date_Start=startDate.split(seprator);        
            var Date1 = new Date(Date_Start[year],Date_Start[month],Date_Start[date]);
       
            var Date_End=endDate.split(seprator);                
            var Date2 = new Date(Date_End[year],Date_End[month],Date_End[date]);

            var compDate = Date2 - Date1;
            var days = Math.round(compDate/(1000*60*60*24));
        
            return days;
        }

       

     
</script>
<script type="text/javascript">
    function validate()
    {
        

        if(trim(document.getElementById('var_title').value)== "")
        {
            alert("Please enter package type title.");
            document.getElementById('var_title').value= "";            
            document.getElementById('var_title').focus();
            return false;
        }
       
        if(checksame_title(document.getElementById('var_title').value)>0)
        {
                
            alert("This category is already exist.");
            document.getElementById('var_title').focus();
            return false;
        }
       
        //------------------------------alias-----------------------------------            
         if(trim(document.getElementById('var_alias').value) != "")
        {

            var str=document.getElementById('var_alias').value;

            var RE=/ /i;

            if (str.match(RE)==' ')
            {
                alert("Alias is not valid. Please remove space.");
                return false;
            }
        }
        
        if(document.getElementById('var_alias').value=="")
        {
            makeLowercase('var_title','var_alias');
        }
            
            
        var text1=document.getElementById('var_alias').value;
        var len1=text1.length;
        if(len1 == 1)
        {
            alert("Alias should be greater then  one character.");
            document.getElementById('var_alias').focus();
            return false;
        }
        
        if(!checkingAlias('var_alias','<?= base64_encode("packagetype") ?>','<?= base64_encode($row['int_glcode']) ?>','<?= base64_encode('int_glcode') ?>',"pages"))
        {
            return false;
        } 
//        alert(frmlink.var_home_page_description.value);           
         if(document.getElementById('dt_startdate').value == "")
            {
                alert("Please enter package type start date.");
                document.getElementById('dt_startdate').focus();
                return false;
            }
            if(document.getElementById('dt_startdate').value != "" && ($("#dt_expirydate").val()=='' ))
            {
                alert("Please select end date.");
                document.getElementById('dt_expirydate').focus();
                return false;
            }
        if(document.getElementById('var_logo').value != "")
        {
            if(!LimitAttach(document.getElementById('var_logo').value ))
            {
                alert("Only .bmp, .gif, .jpg, .jpeg, .png Image formats are supported.");
                document.getElementById('var_logo').focus();
                return false;
            }
        }  
        
//        if(document.getElementById('var_image').value != "")
//        {
//            if(!LimitAttach(document.getElementById('var_image').value ))
//            {
//                alert("Only .bmp, .gif, .jpg, .jpeg, .png Image formats are supported.");
//                document.getElementById('var_image').focus();
//                return false;
//            }
//        } 
        
        if (CKEDITOR.instances.var_home_page_description.getData().length!=0)
        {
            if(document.getElementById('hidvar_photo1').value == ""){
                if(document.getElementById('var_home_thumb').value == "" )
                {
                    alert("please upload image");
                    document.getElementById('var_home_thumb').focus();
                    return false;
                }
            }
        }
        if(chkObject('int_displayorder') && document.getElementById('int_displayorder').value == "")
        {
            alert("Please enter display order.");
            document.getElementById('int_displayorder').focus();
            return false;
        }   
        if(document.getElementById('int_displayorder').value == "" || document.getElementById('int_displayorder').value==0)
        {
            alert("Please enter proper display order.");
            document.getElementById('asignbannerdisplay').style.display='';
            document.getElementById('int_displayorder').focus();
            return false;
        }
        copytext();
        document.getElementById('h_save').value ='T';
        return true;
    }
    
    
    function setserviceval()
        {
            var value1 ='<div class="top fl">';
            value1+='<div class="icon fl" style="background: url(<?= SITE_PATH ?>front-media/images/heart-icon.png) no-repeat scroll 0 0 transparent; height: 54px;width: 144px;">&nbsp;</div>';
            value1+='<div class="title01 fr">Bridal Package</div>';
            value1+='<div class="clear">&nbsp;</div>';
            value1+='</div>';
            value1+='<div class="middle fl">';
            value1+='<div class="mtitle3 fl cofy">French Manicure</div>';
            value1+='<div class="mtitle3 fl cofy">Brow Shape</div>';
            value1+='<div class="mtitle3 fl cofy">Wash &amp; Blow Dry</div>';
            value1+='<div class="mtitle3 fl cofy">Special Up-Do</div>';
            value1+='<div class="mtitle3 fl cofy">Make-Up</div>';
            value1+='<div class="clear">&nbsp;</div>';
            value1+='</div>';
            value1+='<div class="bottom fl">';
            value1+='<div class="price cofy">$280</div>';
            value1+='</div>';
            CKEDITOR.instances.var_home_page_description.insertHtml(value1);
            CKEDITOR.instances.var_home_page_description.updateElement();
        }
        
        
    function checksame_title(title)
    {
        var heid = $('#hid_eid').val();
        $.ajax({
            type: "GET",
            url:  "index.php" ,
            data: "module=packagetype&ajax=Y&action=sametitle&id="+heid+"&title="+title,
            async: false,
            success: function(data)
            {
                if(data>0)
                    categoryexist = 1;
                else 
                    categoryexist = 0;
               
            }
            
        });
        return categoryexist;
    }
    
    function makeLowercase1()
    {
        var str= trim(document.getElementById('var_title').value).toLowerCase();

        var temp = new String(str);
        temp =  temp.replace(/[^a-z A-Z 0-9 \-]+/g,'');

        var strlength = temp.length;
        for(i=0; i < strlength; i++)
        {
            var alias=temp.split(' ').join('-');
        }
        document.getElementById('var_alias').value = alias;
    }

    function valButton(btn) {
        var cnt = -1;
        for (var i=btn.length-1; i > -1; i--) {
            if (btn[i].checked) {cnt = i; i = -1;}
        }
        if (cnt > -1) return btn[cnt].value;
        else return null;
    }
    function makeLowercase()
    {
        //var str= document.getElementById('var_title').value.toLowerCase();
        if(typeof var_title=="undefined")
        {
            var_name="var_title";
        }
        if(typeof var_alias=="undefined")
        {
            var_alias="var_alias";
        }
        var str="";
        
        if($("#var_alias").val().length == 0){           
            str= document.getElementById('var_title').value.toLowerCase();
        }else{
            str=$("#var_alias").val().toLowerCase();
        }
        var temp = new String(str);
        temp =  temp.replace(/[^a-z A-Z 0-9 \-]+/g,'');
        var strlength = temp.length;
        for(var i=0; i < strlength; i++)
        {
            var str1 = temp.split(' ').join('-');
            var alias=str1.split('.').join('');
        }
        document.getElementById('var_alias').value = alias;
        
    }

    function chkObject (theVal)
    {
        if (document.getElementById(theVal) != null)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    
    function auto_alias(){
        if(document.getElementById('var_title').value != '' && document.getElementById('var_alias').value == '')
        {
            makeLowercase();
        }
    }
        
    function makeLowercase (var_title,var_alias)
    {
        if(typeof var_title=="undefined")
        {
            var_title="var_title";
        }
        if(typeof var_alias=="undefined")
        {
            var_alias="var_alias";
        }
        var str="";
        if($("#"+var_alias).val().length == 0)
            str= document.getElementById(var_title).value.toLowerCase();

        else
            sstr=$("#"+var_alias).val()
        str= str.toLowerCase();
        // alert(str);
        var temp = new String(str);
        temp =  temp.replace(/[^a-z A-Z 0-9 \-]+/g,'');
        temp=trim(temp);

        var strlength = temp.length;
        for(i=0;i<strlength;i++)
        {
            var alias = temp.split(' ').join('-');
        }

        document.getElementById(var_alias).value = alias;
    }
        
    function limitText(limitField, limitNum) {
        if (limitField.value.length > limitNum) {
            limitField.value = limitField.value.substring(0, limitNum);
        }
    }
        
    function copytext()
    {
        var abcd=CKEDITOR.instances.text_fulltext.getData();
        
        var def=abcd.replace(/<a(\s[^>]*)?>.*?<\/a>/ig,"")
        var abc = def.replace(/^(\s*)|(\s*)$/g, '').replace(/\s+/g, ' ');
        var maintext=trim(removeHTMLTags(abc));
        //        var maintext=trim(removeHTMLTags(CKEDITOR.instances.text_fulltext.getData()));
      
        if(trim(document.getElementById('var_metatitle').value)=="")
        {
            document.getElementById('var_metatitle').value=trim(document.getElementById('var_title').value).substr(0, 64);
        }
        CountLeft2(document.getElementById('var_metatitle'),document.frmlink.metatitle_left,200);
        if(trim(document.getElementById('var_metakeyword').value)=="")
        {
            document.getElementById('var_metakeyword').value=maintext.substr(0, 180);
        }
        CountLeft2(document.getElementById('var_metakeyword'),document.frmlink.metakeyword_left,400);
        if(trim(document.getElementById('var_metadescription').value)=="")
        {
            document.getElementById('var_metadescription').value=maintext.substr(0, 180);
        }
        CountLeft2(document.getElementById('var_metadescription'),document.frmlink.metadescription_left,400);
    }
    function CountLeft2(field, count, max) 
    {
        // if the length of the string in the input field is greater than the max value, trim it
       
        if (field.value.length > max)
        {
            field.value = field.value.substring(0, max);
        }
        else
        {
            count.value=max - field.value.length;
        }
    }
    
    function LimitAttach(file,id)
    {
        //alert(file);
        allowSubmit = false;
        if (!file) return false;

        var extArray = new Array(".jpg",".jpeg",".png",".bmp",".gif");

        while (file.indexOf("\\") != -1)
            file = file.slice(file.indexOf("\\") + 1);
        ext = file.slice(file.lastIndexOf(".")).toLowerCase();
        for (var i = 0; i < extArray.length; i++) {
            if (extArray[i] == ext) { allowSubmit = true; break; }
        }
        if (allowSubmit) return true;
        else
            return false;
    }
    
    function fun_del_image1()
    {
        document.getElementById('divdelbro1').innerHTML='';
        document.getElementById('hidvar_photo1').value='';
        alert('Image is deleted successfully.');
    }
    function fun_del_image2()
    {
        document.getElementById('divdelbro2').innerHTML='';
        document.getElementById('hidvar_photo1').value='';
        alert('Image is deleted successfully.');
    }
    
      function fun_del_image3()
    {
        document.getElementById('divdelbro4').innerHTML='';
        document.getElementById('hidvar_photo4').value='';
        alert('Image is deleted successfully.');
    }
    function fun_del_image()
    {
        document.getElementById('divdelbro').innerHTML='';
        document.getElementById('hidvar_photo').value='';
        alert('Image is deleted successfully.');
    }
    function checkdatediscription1()
    {
        if(document.getElementById('desc2').style.display =='none' || (document.getElementById('var_general_info').value= ""))
        {
            document.getElementById('desc2').style.display='';
        }
        else
        {
            document.getElementById('desc2').style.display='none';
        }
    }
    
    function checkdatediscription()
    {
        if(document.getElementById('desc_hd').style.display =='none' || (document.getElementById('var_home_page_description').value= ""))
        {
            document.getElementById('desc_hd').style.display='';
        }
        else
        {
            document.getElementById('desc_hd').style.display='none';
        }
    }
    
    function checkdate_discription()
    {
        if(document.getElementById('var_home_desc').style.display =='none' || (document.getElementById('text_fulltext').value= ""))
        {
            document.getElementById('var_home_desc').style.display='';
        }
        else
        {
            document.getElementById('var_home_desc').style.display='none';
        }
    }
</script>

<?php if ($_REQUEST['action'] != '') $action = ucwords($_REQUEST['action']); ?>
<div class="breadcrumbs"><a href="index.php">Home </a>&nbsp;>&nbsp; <a href="index.php?module=packagetype">Manage Package Types</a>&nbsp; >&nbsp; <span class="current"><?= $action ?>  Package Type</span>  </div>
<div class="add-new-user-title">
    <h2><img alt="add-new-listing" src="<?= GLOBAL_ADMIN_IMAGES_PATH ?>/add-new-user-icon.png"><?= $action ?> Package Type
        <?php
        if ($_REQUEST['action'] == 'edit') {
            $title = $ppackagetypeObj->catnews($row['int_glcode']);
            echo "- " . $title;
        }
        ?>
    </h2>
</div>
<?= $messagebox ?>
<form  name="frmlink"  id="frmlink" action="<?php echo $frmlink; ?>" method="post"  onSubmit="return validate();" enctype="multipart/form-data" >
    <input type="hidden" name="fk_modules" id="fk_modules" value="<?php echo $fk_modules ?>">
    <input name="hidvar_photo" type="hidden" id="hidvar_photo" value="<?= $row['var_image']; ?>" />
    <input type="hidden" name="startdateY" id="startdateY" value="<?= $startdatehidden[0] ?>">
    <input type="hidden" name="startdateM" id="startdateM" value="<?= $startdatehidden[1] ?>">
    <input type="hidden" name="startdateD" id="startdateD" value="<?= $startdatehidden[2] ?>">

    <input type="hidden" name="enddateY" id="enddateY" value="<?= $enddatehidden[0] ?>">
    <input type="hidden" name="enddateM" id="enddateM" value="<?= $enddatehidden[1] ?>">
    <input type="hidden" name="enddateD" id="enddateD" value="<?= $enddatehidden[2] ?>">
    <input type="hidden" name="dateformat" id="dateformat" value="<?= $date_special1 ?>">
    <input name="hidvar_photo1" type="hidden" id="hidvar_photo1" value="<?= $row['var_home_thumb']; ?>" />  
    <input name="hidvar_photo2" type="hidden" id="hidvar_photo2" value="<?= $row['var_logo']; ?>" />
    <input name="hidvar_photo4" type="hidden" id="hidvar_photo4" value="<?= $row['var_icon']; ?>" />  
    <input name="hidvar_photos" type="hidden" id="hidvar_photos" value="<?= $row['var_image']; ?>" />
    <input type="hidden" name="old_displayorder" id="old_displayorder" value="<?= $row['int_displayorder'] ?>">
    <input type="hidden" id="h_save" name="h_save" value="F" />
    <?php
    if ($row['int_displayorder'] != '') {
        $int_disporder = $row['int_displayorder'];
    } else {
        $int_disporder = '1';
    }
    if ($row['chr_publish'] != '') {
        $hidden_chr_publish = $row['chr_publish'];
    } else {
        $hidden_chr_publish = 'Y';
    }
    ?>
    <div class="web-booking-main">
        <div class="grid-list-subtitle-bg" style="margin-top:10px; cursor:pointer" onClick="javascript:expandcollapsepanel('asignbanner1');" >
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td align="left" valign="top" class="grid-td-left">Package Type Information</td>
                </tr>
            </table>
        </div>
        <div class="information-white-bg" id="asignbanner1" >
            <div class="clear"></div>
            <div class="grid-list-inner-table-text">
                <table width="100%" border="0" cellspacing="3" cellpadding="3" >
                    <tr>
                        <td width="270" align="left" valign="top" class="add-new-user-text">Package Type Title: <span>(required)</span> </td>
                        <td width="856" colspan="3" align="left"  valign="top">                   
                            <input type="hidden" name="hid_eid" id="hid_eid" value="<?php echo $row['int_glcode']; ?>">
                            <input name="var_title" type="text"  class="add-new-user-textarea" id="var_title" value="<?= htmlspecialchars_decode($row['var_title']) ?>"  maxlength="255" style="width:362px;"   />
                        </td>
                    </tr>
                    <!-------------------------------------------------------alias--------------------------------->                    
                    <?php if (DISPLAY_ALIAS == 'Y') { ?>
                        <tr>
                            <td  align="left" valign="top" class="add-new-user-text">Alias: <span>(auto)</span>  </td>
                            <td  width="75%" align="left" valign="top">
                                <table>
                                    <tr>
                                        <td>
                                            <input name="var_alias" type="text" style="width:362px;"  onblur="auto_alias();"  class="add-new-user-textarea fl" id="var_alias" value="<?= $row['var_alias']; ?>" maxlength="100"  />

                                            <div class="fl contact-comment-new position-relative mgl5 mgt5">
                                                <span class="help-icon1"></span>
                                                <div class="contact-hint fl" style="width: 390px; height:90px;  float: left;"><?php echo GLOBAL_ALIAS_NOTE; ?></div>
                                            </div>
                                        </td>
                                        <td>
                                            <a herf="javascript:;" onclick="checkingAlias('var_alias','<?= base64_encode("service_category") ?>','<?= base64_encode($row['int_glcode']) ?>','<?= base64_encode('int_glcode') ?>','pages');">Check Alias</a>
                                        </td>
                                        <td>
                                            <div id="aliasmsg" ></div>
                                        </td>
                                    </tr>
                                </table>
                            </td>

                        </tr>
                    <?php } else { ?>
                        <input name="var_alias" type="hidden" class="add-new-user-textarea" id="var_alias" value="<?= $row['var_alias']; ?>" maxlength="255"  />
                    <?php } ?> 
                    <!-----------Image---------------->
                    
                    <tr>
                        <td width="16%" align="left" valign="top" class="add-new-user-text"> Image: </td>
                        <td width="60%" align="left" valign="top" >
                            <input type="file" name="var_logo" id="var_logo"  style="float: left" width="10px"/>

                            <div  id="divdelbro2" style="float: left">&nbsp;
                                <?php
                                $imagename = $row['var_logo'];
                                $imagepath = '../upimages/package/logo/';
                                $image = $imagepath . "thumb_" . $imagename;
                                if ($imagename != "") {
                                    if (file_exists($image)) {
                                        ?>
                                        <a onClick="return hs.expand(this);"  style="text-decoration:none;" href="<?php echo "../upimages/package/logo/thumb_" . trim($row['var_logo']) ?>"><img  src="../upimages/package/logo/thumb_<?= $row['var_logo'] ?>" alt="View" width="30" height="30" border="0" align="absmiddle" id="myimage" />&nbsp;</a>
                                        <a href="javascript:;" onclick="return fun_del_image2();">&nbsp;Delete</a>
                                    <?php } else { ?> &nbsp;
                                    <?php }
                                } else {
                                    ?>
    <!--                                <span class="fl mgt5 mgl10">(Only .bmp, .gif, .jpg, .jpeg, .png Image Formats are supported.)</span>-->
                            <?php } ?>
                            </div>
                           <span class="fl mgt5 mgl10"> &nbsp;(Required Size : 
                            <?PHP echo '(' . PACKAGE_LOGO_WIDTH . 'px ' ?>  x  <?php echo '' . PACKAGE_LOGO_HEIGHT . 'px' . ')' ?>)</span>
                        </td>
                    </tr>
                    
                    
                    
                   
                    
                    <tr>
                        <td width="16%" align="left" valign="top" class="add-new-user-text"></td>
                        <td width="60%" align="left" valign="top" >
                            <span class="fl mgt5 mgl10">(Only .bmp, .gif, .jpg, .jpeg, .png Image Formats are supported.)</span>
                        </td>
                    </tr>
                    
                      <tr>
                        <td align="left" valign="top" class="add-new-user-text"> Home Page Caption: </td>
                        <td width="75%" align="left" valign="top">
                            <input name="var_homeCaption" type="text" class="add-new-user-textarea" id="var_homeCaption" style="width: 350px; float: left;" value="<?php echo $row['var_homeCaption'] ?>" maxlength="200" />
                        </td>
                    </tr>
                    <tr>
                        <td align="left" valign="top" class="add-new-user-text"> Home Page Title: </td>
                        <td width="75%" align="left" valign="top">
                            <input name="var_homepagetitle" type="text" class="add-new-user-textarea" id="var_homepagetitle" style="width: 350px; float: left;" value="<?php echo $row['var_homepagetitle'] ?>" maxlength="200" />
                        </td>
                    </tr>
 
                    <tr>
                        <td align="left" valign="top" class="add-new-user-text"> Home Page Description: </td>
                        <td width="75%" align="left" valign="top">
                            
                            <textarea id="var_short_description" name="var_homepagedescription" class="textarea2" maxlength="500" style="width:350px;" 
                                      onKeyDown="CountLeft(this.form.var_homepagedescription,this.form.description_left,500);"
                                      onKeyUp="CountLeft(this.form.var_homepagedescription,this.form.description_left,500);"><?= trim($row['var_homepagedescription']) ?></textarea>
                                <input disabled="disabled" type="text" name="description_left" value="<?= (500 - strlen($row['var_homepagedescription'])) ?>" class="add-new-user-textarea" style="width:35px;"/><span valign="bottom" style="color:#000000;"> characters left</span>
                           
                        </td></tr>
                                        
                                        
                    <tr>
                        <td width="16%" align="left" valign="top" class="add-new-user-text"> Icon: </td>
                        <td width="60%" align="left" valign="top" >
                            <input type="file" name="var_icon" id="var_icon"  style="float: left" width="10px"/>

                            <div  id="divdelbro4" style="float: left">&nbsp;
                                <?php
                                $imagename = $row['var_icon'];
                                $imagepath = '../upimages/package/icon/';
                                $image = $imagepath . $imagename;
                                if ($imagename != "") {
                                    if (file_exists($image)) {
                                        ?>
                                        <a onClick="return hs.expand(this);"  style="text-decoration:none;" href="<?php echo "../upimages/package/icon/" . trim($row['var_icon']) ?>"><img  src="../upimages/package/icon/<?= $row['var_icon'] ?>" alt="View" width="30" height="30" border="0" align="absmiddle" id="myimage" />&nbsp;</a>
                                        <a href="javascript:;" onclick="return fun_del_image3();">&nbsp;Delete</a>
                                    <?php } else { ?> &nbsp;
                                    <?php }
                                } else {
                                    ?>
    <!--                                <span class="fl mgt5 mgl10">(Only .bmp, .gif, .jpg, .jpeg, .png Image Formats are supported.)</span>-->
                            <?php } ?>
                            </div>
                           <span class="fl mgt5 mgl10"> &nbsp;(Required Size : 
                            <?PHP echo '(' . 54 . 'px ' ?>  x  <?php echo '' . 64 . 'px' . ')' ?>)</span>
                        </td>
                    </tr>
       <?php /*             
                    <!--------------------------------------->
                     
                    <!--pagebanner-->
<!--                    <tr>
                        <td width="16%" align="left" valign="top" class="add-new-user-text"> Page Banner: </td>
                        <td width="60%" align="left" valign="top" >
                            <input type="file" name="var_image" id="var_image"  style="float: left" width="10px"/>

                            <div  id="divdelbro" style="float: left">&nbsp;
                                <?php
                                $imagename = $row['var_image'];
                                $imagepath = '../upimages/pagephoto/images/';
                                $image = $imagepath . "thumb_" . $imagename;
                                if ($imagename != "") {
                                    if (file_exists($image)) {
                                        ?>
                                        <a onClick="return hs.expand(this);"  style="text-decoration:none;" href="<?php echo "../upimages/pagephoto/images/thumb_" . trim($row['var_image']) ?>"><img  src="../upimages/pagephoto/images/thumb_<?= $row['var_image'] ?>" alt="View" width="30" height="30" border="0" align="absmiddle" id="myimage" />&nbsp;</a>
                                        <a href="javascript:;" onclick="return fun_del_image();">&nbsp;Delete</a>
                                    <?php } else { ?> &nbsp;
                                    <?php }
                                } else {
                                    ?>
                                    <span class="fl mgt5 mgl10">(Only .bmp, .gif, .jpg, .jpeg, .png Image Formats are supported.)</span>
                            <?php } ?>
                            </div>
                            <span class="fl mgt5 mgl10"> &nbsp;(Required Size : <?php
                            if ($_REQUEST['fk_recid'] == 1) {
                                echo '(' . HOME_BANNER_WIDTH . 'px '
                                ?>  x  <?php echo HOME_BANNER_HEIGHT . 'px' . ')'; ?> <?php
                            } else {
                                echo '(' . INNERBANNER_WIDTH . 'px '
                                ?>  x  <?php echo '' . INNERBANNER_HEIGHT . 'px' . ')' ?><?php } ?>)</span>
                        </td>
                    </tr>-->
<!--                    <tr>
                        <td width="16%" align="left" valign="top" class="add-new-user-text"></td>
                        <td width="60%" align="left" valign="top" >
                            <span class="fl mgt5 mgl10">(Only .bmp, .gif, .jpg, .jpeg, .png Image Formats are supported.)</span>
                        </td>
                    </tr>--> */?>
                    <!---------------------->
                    <tr>
                        <td  align="left" valign="top" class="add-new-user-text"><div class="fl">Description:</div>
                            <div class=" contact-comment-new position-relative mgl5 fl">
                                <span class="help-icon1"></span>
                                <div class="contact-hint fl" style="width: 800px; height: 30px;"><?php echo GLOBAL_DESCRIPTION_NOTE; ?></div>
                            </div>                              
                        </td>
                        <?php 
                        if ($row['text_fulltext'] != '') {
                            $id_desc = 'checked = "checked"';                                
                        } else {                                
                            $id_desc='';
                        }
                        
                        if ($row['text_fulltext'] != '') {
                            $style_desc = 'style="display:;"';
                        } else {
                            $style_desc = 'style="display:none;"';
                        }
                        ?>
                        <td>
                            <input style="float: left" type="checkbox" id="var_desc" name="var_desc" <?php echo $id_desc; ?> value="Y" onclick="checkdate_discription()">
                        </td>
                    </tr>
                        <tr id="var_home_desc" <?php echo $style_desc; ?>>
                        <td  align="left" valign="top" class="add-new-user-text" colspan="4">
                            <?php echo $configObj->glLibraryObj->load_ckeditor('text_fulltext', $row['text_fulltext']); ?>
                        </td>
                    </tr>
                                <?php
                           
                    if ($row['dt_startdate'] != '') {
                        $date = $row['dt_startdate'];
                    } else {
                        $str = str_replace('%', '', DEFAULT_DATEFORMAT);
                        $date = DATE($str);
                    }
                    ?>
                    <tr>
                        
                        <td width="" align="left" valign="top" width="25%" class="add-new-user-text">Start Date: <span>(required)</span></td>
                        <td  align="left" colspan="1" valign="top">
                            <input name="dt_startdate" type="text" class="date-textarea fl" id="dt_startdate" value="<?= $date; ?>" maxlength="20"  readonly />
                            <div class="fl contact-comment-new position-relative mgl5 mgt5">
                                <span class="help-icon1"></span>
                                <div class="contact-hint fl" style="width: 400px; height: 15px;"><?php echo "This is the date when the package type will be displayed on the site." ?></div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td width="21%" align="left" valign="top" class="add-new-user-text">End Date: <span>(required)</span></td>
                        <td  align="left" valign="middle" nowrap="nowrap">

                            <input name="dt_expirydate" type="text" class="date-textarea" id="dt_expirydate"
                                   value="<?php
                    $edate = $row['dt_expiredate'];
                    if ($edate != '') {
                        echo $edate;
                    }
                    else {
                        $str = str_replace('%', '', DEFAULT_DATEFORMAT);
                        echo $edate1 = DATE($str);
                    }
                    ?>"
                                   maxlength="20"  <?php
                                   if ($edate == '0000-00-00' || $edate == '0000/00/00' || $edate == '00/00/0000') {
                                       echo "style=display:";
                                   } else {
                                       echo "style=display:''";
                                   }
                    ?> />

                        </td>
                    </tr>
                

                    <tr>
                        <td width="270" align="left" valign="top" class="add-new-user-text">Display Package Type:  </td>
                        <td width="" colspan="3" align="left"  valign="top">                   
                            <input name="package_type" style="margin :5px;" type="radio" <?= ($row["package_type"] == 'S' ? 'checked' : 'checked') ?>  id="package_type" value="S"/>Single Record Listing
                            <input name="package_type" style="margin :5px;"  type="radio"  <?= ($row["package_type"] == 'D' ? 'checked' : '') ?> id="package_type" value="D"/>Double Record Listing
                        </td>
                    </tr>
                    <tr>
                        <td width="16%" align="left" valign="top" class="add-new-user-text">Home Page Thumb: </td>
                        <td width="60%" align="left" valign="top" >
                            <input type="file" name="var_home_thumb" id="var_home_thumb" class="mgl15" style="float: left" width="10px"/>

                            <div  id="divdelbro1" style="float: left">&nbsp;
                                <?php
                                $imagename = $row['var_home_thumb'];
                                $imagepath = '../upimages/package/home_thumb/';
                                $image = $imagepath . "thumb_" . $imagename;
                                if ($imagename != "") {
                                    if (file_exists($image)) {
                                        ?>
                                        <a onClick="return hs.expand(this);"  style="text-decoration:none;" href="<?php echo "../upimages/package/home_thumb/thumb_" . trim($row['var_home_thumb']) ?>"><img  src="../upimages/package/home_thumb/thumb_<?= $row['var_home_thumb'] ?>" alt="View" width="30" height="30" border="0" align="absmiddle" id="myimage" />&nbsp;</a>
                                        <a href="javascript:;" onclick="return fun_del_image1();">&nbsp;Delete</a>
                                    <?php } else { ?> &nbsp;
                                    <?php }
                                } else {
                                    ?>
                            <?php } ?>
                            </div>
                            <span class="fl mgt5 mgl10"> &nbsp;(Required Size : 
                            <?PHP echo '(' . PACKAGE_HOME_THUMB_WIDTH . 'px ' ?>  x  <?php echo '' . PACKAGE_HOME_THUMB_HEIGHT . 'px' . ')' ?>)</span>
                        </td>
                    </tr>
                    <tr>
                        <td width="16%" align="left" valign="top" class="add-new-user-text"></td>
                        <td width="60%" align="left" valign="top" >
                            <span class="fl mgt5 mgl10">(Only .bmp, .gif, .jpg, .jpeg, .png Image Formats are supported.)</span>
                        </td>
                    </tr>
<!--                    <tr>
                        <td  align="left" valign="top" class="add-new-user-text"><div class="fl">Home Page Description:</div>

                            <div class=" contact-comment-new position-relative mgl5 fl">
                                <span class="help-icon1"></span>
                                <div class="contact-hint fl" style="width: 800px; height: 30px;"><?php echo GLOBAL_DESCRIPTION_NOTE; ?></div>
                            </div>                              
                        </td>
                        <?php
//                        if ($row['var_home_page_description'] != '') {
//                            $id_hd = 'checked = "checked"';                                
//                            ?>
                            <?php
//                        } else {                                
//                            $id_hd='';
//                        }
//                        if ($row['var_home_page_description'] != '') {
//                            $style_hd = 'style="display:;"';
//                        } else {
//                            $style_hd = 'style="display:none;"';
//                        }
                        ?>
                        <td>
                            <input style="float: left" type="checkbox" id="var_hd_info" name="var_hd_info" <?php echo $id_hd; ?> value="Y" onclick="checkdatediscription()">
                        </td>
                    </tr>-->
<!--                    <tr id="desc_hd" <?php echo $style_hd; ?>>
                        <td  align="left" valign="top"colspan="4" width="" class="add-new-user-text" ><span style="cursor: pointer;height: 10px;" href="javascript:;" onclick="return  setserviceval('true');"><u>Default Package Format</u><br/><br/></span> 
                            <?php echo $configObj->glLibraryObj->load_ckeditor('var_home_page_description', $row['var_home_page_description']); ?>
                        </td>
                    </tr>-->
                    <tr>
                        <td  align="left" valign="top" class="add-new-user-text"><div class="fl">General Information</div>
                            <div class=" contact-comment-new position-relative mgl5 fl">
                                <span class="help-icon1"></span>
                                <div class="contact-hint fl" style="width: 800px; height: 30px;">
                                    <?php echo GLOBAL_DESCRIPTION_NOTE; ?>
                                </div>
                            </div>                              
                        </td>
                        <?php
                        if ($row['var_general_info'] != '') {
                            $id_h = 'checked = "checked"';                                
                            ?>
                            <?php
                        } else {                                
                            $id_h='';
                        }
                        
                        if ($row['var_general_info'] != '') {
                            $style1 = 'style="display:;"';
                        } else {
                            $style1 = 'style="display:none;"';
                        }
                        
                        if(!empty($row['var_general_info'])) {
                            $general_info = $row['var_general_info'];
                        } else {
                            $general_info = "Prices are subject to change without notice.";
                        }
                        ?>
                        <td>
                            <input style="float: left" type="checkbox" id="var_h_info" name="var_h_info" <?php echo $id_h; ?> value="Y" onclick="checkdatediscription1()">
                        </td>
                    </tr>
                    <tr id="desc2" <?= $style1 ?>>
                        <td  align="left" valign="top"colspan="4" width="" class="add-new-user-text" >
                            <?php echo $configObj->glLibraryObj->load_ckeditor('var_general_info', $general_info); ?>
                        </td>
                    </tr>
                    <input name="h_save" type="hidden" id="h_save" value="T" />
                </table>
            </div>
        </div>

    </div>
    <!--------------------------------------seo information--------------------->
<?php // if ($configObj->glSessionObj->value('admin_id') == '1' || DISPLAY_ALL_SEO == 'Y') { ?>
        <div class="grid-list-subtitle-bg" style="margin-top:10px; cursor:pointer;" onClick="javascript:expandcollapsepanel('asignbannerseo');" >
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td align="left" valign="top" class="grid-td-left">SEO Information</td>
                </tr>
            </table>
        </div>
        <div class="information-white-bg" id="asignbannerseo" style="display:none;">
            <div class="clear"></div>
            <div class="grid-list-inner-table-text">
        <?php echo $configObj->glLibraryObj->seo_textdetails($row['var_metatitle'], $row['var_metakeyword'], $row['var_metadescription']); ?>
            </div>
        </div>
        <div class="clear"></div>
    <?php // } //else { ?>
<!--        <input name="var_metatitle" type="hidden"  id="var_metatitle" value="<?//= $row['var_metatitle']; ?>"  />
        <input name="var_metakeyword" type="hidden"  id="var_metakeyword" value="<?//= $row['var_metakeyword']; ?>" />
        <input type="hidden"  id="var_metadescription" name="<?//= $row['var_metadescription']; ?>" />-->
<?php // } ?>
</div>
<!--------------------------------seo end---------------------------------            -->          
<div class="clear"></div>
<div class="grid-list-subtitle-bg" style="margin-top:10px; cursor:pointer" onClick="javascript:expandcollapsepanel('asignbannerdisplay');" >
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td align="left" valign="top" class="grid-td-left">Display Information</td>
        </tr>
    </table>
    <?php
    if ($row['int_displayorder'] != '')
        $int_disporder = $row['int_displayorder'];
    else
        $int_disporder = '1';
    ?>
</div>
<div class="information-white-bg" id="asignbannerdisplay" style="display:none;">
    <div class="clear"></div>
    <div class="grid-list-inner-table-text">
        <table width="100%" border="0" cellspacing="3" cellpadding="3">
            <tr>
                <td width="215" align="left" valign="top" class="add-new-user-text">Display Order: <span>(required)</span></td>
                <td colspan="2" align="left" valign="top">
                    <input name="int_displayorder" style="float: left; width: 50px; text-align: center;" type="text" class="date-textarea" id="int_displayorder" value="<?= $int_disporder; ?>" maxlength="3" onkeypress="return KeycheckOnlyNumeric(event);" />
                    <div class=" contact-comment-new position-relative mgt5 mgl10 fl" >
                        <span class="help-icon1"></span>
                        <div class="contact-hint fl" style="width: 700px; height: 30px;"><?php echo 'Package type are usually ordered alphabetically, but you may choose to put a number in the display order fields to change the page listing priority.'; ?></div>
                    </div> 
                </td>
            </tr>

            <tr>
                <td height="30" width="255" align="left" valign="top" class="add-new-user-text">Display: <span>(required)</span></td>
                <td width="106" height="30" align="left" valign="middle" class="add-new-user-text2">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="48%">
                                <?php if ($row['chr_publish'] == 'Y') { ?>
                                    <input type="radio" name="chr_publish" id="chr_publishY" value="Y" checked="checked" class="form-rediobutton " />
                                <?php } else { ?>
                                    <input type="radio" name="chr_publish" id="chr_publishY" value="Y"  checked="checked" class="form-rediobutton "/><?php } ?>
                                    <a href="javascript:" onClick="if(document.getElementById('chr_publishY').checked!=true) document.getElementById('chr_publishY').checked=true;" style="text-decoration:none;">Yes</a>
                            </td>
                            <td width="52%"> <?php if ($row['chr_publish'] == 'N') { ?>
                                <input name="chr_publish" type="radio" class="form-rediobutton " checked="checked" id="chr_publishN" value="N"    />
                                <?php } else { ?>
                                <input name="chr_publish" type="radio" class="form-rediobutton " id="chr_publishN" value="N"  /><?php } ?>
                                <a href="javascript:" onClick="if(document.getElementById('chr_publishN').checked!=true) document.getElementById('chr_publishN').checked=true;" style="text-decoration:none;">No</a>
                            </td>
                        </tr>
                        <input name="int_displayorder" type="hidden"  id="int_displayorder" value="<?= $int_disporder; ?>"   />
                        <input name="chr_publish" type="hidden"  id="chr_publish" value="Y"  />
                    </table>
                </td>
                <td width="864" align="left" valign="middle" class="add-new-user-text2"><img width="16" height="16" src="<?= GLOBAL_ADMIN_IMAGES_PATH ?>help.png" onmouseover="showDiv(event,'dvhlpvarwebsite')" onmouseout="hidediv('dvhlpvarwebsite');" alt="">
                    <div id="dvhlpvarwebsite" style=" z-index:99999; position: absolute;background-color: #d5ecfa;width: 400px;height:35px;padding: 10px;color:#0b336a;border: #95d0f2 2px solid;display: none;font-family:Tahoma, Arial, Verdana;font-size:13px;font-weight:bold;">Note : Please select 'Yes' if you want to display / activate this record. Otherwise please select 'NO'. </div></td>
            </tr>
        </table>
    </div>
</div>
<br />
<?= $BottomSubmitButtons ?>
<div class="clear"></div>
<div class="add-new-user-button"></div>
</div>
</form>

