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

<?php //echo "News add tpl"; exit; ?>
<script type="text/javascript" src="<?php echo GLOBAL_ADMIN_JS_PATH; ?>jquery/ui/minified/jquery.ui.mouse.min.js"></script>
<script type="text/javascript" src="<?php echo GLOBAL_ADMIN_JS_PATH; ?>jquery/ui/minified/jquery.ui.draggable.min.js"></script>
<script type="text/javascript" src="<?php echo GLOBAL_ADMIN_JS_PATH; ?>jquery/ui/minified/jquery.ui.dialog.min.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" />
<link type="text/css" href="<?php echo GLOBAL_ADMIN_JS_PATH; ?>jquery/themes/base/jquery.ui.dialog.css" rel="stylesheet" />
<script type="text/javascript" src="<?php echo GLOBAL_ADMIN_JS_PATH; ?>jquery/popup.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">
    function KeycheckAlphaNumeric(e)
    {
        var _dom = 0;
        _dom = document.all ? 3 : (document.getElementById ? 1 : (document.layers ? 2 : 0));
        if (document.all)
            e = window.event; // for IE
        var ch = '';
        var KeyID = '';
        //alert(_dom);
        if (_dom == 2) {                     // for NN4
            //alert(e.which);
            if (e.which > 0)
                ch = '(' + String.fromCharCode(e.which) + ')';
            KeyID = e.which;
        }
        else
        {
            if (_dom == 3) {                   // for IE
                KeyID = (window.event) ? event.keyCode : e.which;
            }
            else {                       // for Mozilla
                //alert('Mozilla:' + e.charCode);
                if (e.charCode > 0)
                    ch = '(' + String.fromCharCode(e.charCode) + ')';
                KeyID = e.charCode;
            }
        }

        if ((KeyID >= 31 && KeyID <= 44) || (KeyID >= 46 && KeyID <= 47) || (KeyID >= 58 && KeyID <= 64) || (KeyID >= 91 && KeyID <= 96) || (KeyID >= 123 && KeyID <= 126))
        {
            //alert("hello");
            return false;
        }
        return true;
    }


    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;
    hs.showCredits = false;


    // 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 copytext()
    {
        var abcd = CKEDITOR.instances.var_description.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.frmspecial.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.frmspecial.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.frmspecial.metadescription_left, 400);
    }

    function setserviceval()
    {
        var value1 = '<div class="top fl" style="height:45px;">';
//            value1+='<div class="icon fl" style="background: url(<?= SITE_PATH ?>front-media/images/packages-icon.png) no-repeat scroll 0 0 transparent; height: 54px;width: 144px;">&nbsp;</div>';
        value1 += '<div class="title01 fl" style="width:150px;">Receive $20 off - Hair Services</div>';
        value1 += '</div>';
        value1 += '<div class="middle fl" style="height:125px;padding-top:0px;margin-top:0px;">';
        value1 += '<div class="mtitle1 fl ttu cofy" style="min-height:50px">Revivify Specials</div>';
        value1 += '<div class="spacer5">&nbsp;</div>';
        value1 += '<div class="mtitle3 fl cofy">Hair Extensions</div>';
        value1 += '<div class="mtitle3 fl cofy">Chemical Services</div>';
        value1 += '<div class="mtitle3 fl cofy">Ear Candling</div>';
        value1 += '<div class="clear">&nbsp;</div>';
        value1 += '</div>';
//            value1+='<div class="bottom fl">';
//            value1+='<div class="price cofy">$110</div>';
        value1 += '</div>';
        CKEDITOR.instances.var_home_page_description.insertHtml(value1);
        CKEDITOR.instances.var_home_page_description.updateElement();
    }
    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 validate()
    {
        var alias = document.getElementById('var_alias').value;
        if (trim(document.getElementById('var_title').value) == "")
        {
            alert("Please enter title.");
            document.getElementById('var_title').focus();
            return false;
        }

        if (document.getElementById('hidvar_photo').value == '')
        {
            if (document.getElementById('var_image').value == '')
            {
                alert('Please upload image.');
                document.getElementById('var_image').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 (document.getElementById('var_pdffile').value != '')
        {
            var name = document.getElementById('var_pdffile').value;
            found = name.lastIndexOf('.') + 1;
            var ext = name.substr(found)
            if (!(ext == 'doc' || ext == 'docx' || ext == 'pdf')) {
                alert('Only .doc, .docx, .pdf file formats are supported.');
                document.getElementById('var_pdffile').focus();
                return false;
            }
        }

        if (CKEDITOR.instances.var_description.getData().length == 0)
        {
            alert('Please enter description.');
            CKEDITOR.instances.var_description.focus();
            return false;
        }

        if (document.getElementById('dt_startdate').value == "")
        {
            alert("Please enter special 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 (CKEDITOR.instances.var_home_page_description.getData().length!=0)
//            {
//                if(document.getElementById('hidvar_image').value == ""){
//                    if(document.getElementById('var_image').value == "" )
//                    {
//                        alert("please upload image");
//                        document.getElementById('var_image').focus();
//                        return false;
//                    }
//                }
//            }

        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("special") ?>', '<?= base64_encode($row['int_glcode']) ?>', '<?= base64_encode('int_glcode') ?>', "pages"))
        {

            return false;
        }



        if (document.getElementById('int_displayorder').value == "")
        {
            alert("Please enter display order.");
            document.getElementById('asignbannerdisplay').style.display = '';
            document.getElementById('int_displayorder').focus();
            return false;
        }
        if (document.getElementById('int_displayorder').value == 0)
        {
            alert("Please enter proper display order.");
            document.getElementById('asignbannerdisplay').style.display = '';
            document.getElementById('int_displayorder').focus();
            return false;
        }
        if (document.getElementById('int_displayorder').value < 0)
        {
            alert("Please enter proper display order.");
            expandcollapsepanel('asignbannerdisplay');
            document.getElementById('int_displayorder').focus();
            return false;
        }
        copytext();
        document.getElementById('h_save').value = 'T';
        return true;
    }


    function auto_alias() {
        if (trim(document.getElementById('var_title').value) != '' && document.getElementById('var_alias').value == '')
        {
            makeLowercase();
        }
    }


    function fun_del_pdf(id, file)
    {
        file = document.getElementById('hidvar_pdffile').value;
        $.ajax({
            type: "GET",
            url: "index.php?module=special&action=deletedocument&ajax=Y&sid=" + id + "&file=" + file,
            async: true,
            success: function (data) {
                if (parseInt(data) != 1)
                {
                    document.getElementById('divdelbro1').innerHTML = '';
                    document.getElementById('hidvar_pdffile').value = '';
                    alert('Document is deleted successfully');
                }
                else
                {
                }
            }
        });
    }
    function LimitAttach_Pdf(file, id)
    {
        var imgpath = document.getElementById(id).value;
        if (imgpath != "")
        {
            var arr1 = new Array;
            arr1 = imgpath.split("\\");
            var len = arr1.length;
            var img1 = arr1[len - 1];
            var filext = img1.substring(img1.lastIndexOf(".") + 1);
            // Checking Extension
            if (filext == "doc" || filext == "docx" || filext == "pdf" || filext == "ppt" || filext == "pptx")
            {
                return true;
            }

            else
            {
                document.getElementById(id).value = "";
                return false;
            }
        }
    }
    function makeLowercase(var_title, var_alias)
    {
        var str = trim(document.getElementById('var_title').value).toLowerCase();
        //alert(str);
        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 limitText(limitField, limitNum) {
        if (limitField.value.length > limitNum) {
            limitField.value = limitField.value.substring(0, limitNum);
        }
    }

    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 fun_del_brochure(id, file)
    {
        //            alert("test");
        $.ajax({
            type: "GET",
            url: "index.php?module=special&action=delbrochureimg&ajax=Y&sid=" + id + "&file=" + file,
            async: true,
            success: function (data) {
                if (parseInt(data) != 1)
                {
                    document.getElementById('divdelbro').innerHTML = '';
                    document.getElementById('hidvar_image').value = '';
                    alert('Images is deleted successfully');
                }
                else
                {
                }
            }
        });
    }
    function fun_del_brochure1(id, file)
    {
        //            alert("hello...");
        $.ajax({
            type: "GET",
            url: "index.php?module=special&action=delbrochureimg1&ajax=Y&ssid=" + id + "&file=" + file,
            async: true,
            success: function (data) {
                if (parseInt(data) != 1)
                {
                    document.getElementById('divdelbro1').innerHTML = '';
                    document.getElementById('hidvar_special_image').value = '';
                    alert('Images is deleted successfully');
                }
                else
                {
                }
            }
        });
    }



    function LimitAttach(file, id)
    {
        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;
    }

</script>
<div id="popupContact" class="dragme"  style="z-index:9999"></div>
<div id="backgroundPopup" style="z-index: 101;"></div>
<?php
if ($_REQUEST['action'] != '') {
    $action = ucwords($_REQUEST['action']);
}
if ($_REQUEST['mode'] == 'copy') {
    $action = 'Add';
}
?>
<div class="breadcrumbs">
    <a href="index.php">Home </a>&nbsp;>&nbsp; <a href="index.php?module=special<?php echo ($_REQUEST['specialcategory'] != '') ? '&specialcategory=' . $_REQUEST['specialcategory'] : ''; ?>">Manage Promotions</a>&nbsp; >&nbsp; <span class="current"><?= $action ?> Promotion</span>  
    <?php if ($_REQUEST['specialcategory'] != '') { ?>
        <span style="float:right; margin-right:15px; margin-top:-15px; "><a href="index.php?module=specialcategory"><img src="<?= GLOBAL_ADMIN_IMAGES_PATH ?>back-button-blue.gif"></a></span>
    <?php } ?>
</div>

<div class="add-new-user-title">

    <h2><img src="<?= GLOBAL_ADMIN_IMAGES_PATH ?>/add-new-user-icon.png"><?= $action ?> Promotion
        <?php
        if ($_REQUEST['action'] == 'edit') {
            $title = $specialObj->catnews($row['int_glcode']);
            echo "- " . $title;
        }
        ?>
    </h2>

</div>
<?= $messagebox ?>
<?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';
}

if ($_REQUEST['action'] == 'edit') {
    $sql = "UPDATE " . DB_PREFIX . "special SET chr_read='N' where int_glcode=" . $_REQUEST['eid'];
    $specialObj->configObj->glDbObj->query($sql);
}
?>

<form  name="frmspecial"  id="frmspecial" action="<?php echo $specialaction; ?>" method="post" onSubmit="return validate();" enctype="multipart/form-data" >
    <input name="hidvar_pdffile" type="hidden" id="hidvar_pdffile" value="<?= $row['var_pdffile']; ?>" />
    <input name="hidvar_filename" type="hidden" id="hidvar_filename" value="<?= $row['var_filename']; ?>" />
    <input name="hidvar_image" type="hidden" id="hidvar_image" value="<?= $row['var_image']; ?>" />
    <input name="hidvar_special_image" type="hidden" id="hidvar_special_image" value="<?= $row['var_special_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_photo" type="hidden" id="hidvar_photo" value="<?= $row['var_image']; ?>" /> 
    <div class="web-booking-main">
        <input type="hidden" name="old_displayorder" id="old_displayorder" value="<?= $row['int_displayorder'] ?>">
        <div class="grid-list-subtitle-bg" style="margin-top:10px; cursor:pointer" onClick="javascript:expandcollapsepanel('asignbanner');" >
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td align="left" valign="top" class="grid-td-left">Promotion Information</td>
                </tr>
            </table>
        </div>
        <div class="information-white-bg" id="asignbanner" >
            <div class="clear"></div>
            <div class="grid-list-inner-table-text">
                <table width="100%" border="0" cellspacing="3" cellpadding="3">
                    <tr>
                        <td align="left" valign="top" class="add-new-user-text"> Title: <span>(required)</span></td>
                        <td width="75%" align="left" valign="top">
                            <?php
                            if ($_REQUEST['mode'] == 'copy') {
                                $title = 'Copy of ' . $row['var_title'];
                            } else {
                                $title = $row['var_title'];
                            }
                            ?>
                            <input name="var_title" type="text" class="add-new-user-textarea" id="var_title" style="width: 350px; float: left;" value="<?= htmlspecialchars($title); ?>" maxlength="200" />
                        </td>
                    </tr>
                    <?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" onkeypress="return KeycheckAlphaNumeric(event);"  type="text" style="width:350px;"  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("special") ?>', '<?= 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 } ?>
                    <tr>
                        <td width="20%" align="left" valign="top" class="add-new-user-text">Upload Image: <span>(required)</span></td>
                        <td width="25%;" align="left" valign="middle">
                            <input name="var_image" id="var_image" type="file" >
                        </td>
                        <td width="50%"  align="left" valign="middle">
                            <div id="divdelbro" style="margin-left:-450px;">
                                <?php if ($row['var_image'] != "") { ?>
                                    <a href="javascript:;" onclick="fun_del_brochure(<?= $row['int_glcode'] ?>, '<?= $row['var_image']; ?>');">Delete</a>&nbsp;&nbsp;&nbsp;&nbsp;
                                    <a id="myimga" onClick="return hs.expand(this)" class="highslide" href="../upimages/special/images/thumb_<?= $row['var_image'] ?>" > <img src="../upimages/special/images/thumb_<?= $row['var_image'] ?>" alt="View" width="20" height="20" border="1" align="absmiddle" id="myimage" /> </a>
                                    <?php
                                } else {
                                    
                                }
                                ?>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td colspan="2"><span>(Width * Height)=(<?= SPECIAL_THUMB_WIDTH1 . 'px' ?> X <?= SPECIAL_THUMB_HEIGHT1 . 'px' ?>)</span>&nbsp;&nbsp;&nbsp;<span>(Only *.jpg, *.jpeg, *.png, *.gif and *.bmp Image Formats are supported)</span></td>
                    </tr>
                    <tr>
                        <td  align="left" valign="top" width="212" class="add-new-user-text">Upload File:</td>
                        <td width="856" align="left">
                            <table>
                                <tr>
                                    <td>


                                        <input name="var_pdffile" id="var_pdffile" type="file"  />
                                    </td>
                                    <td>
                                        <?php
                                        if ($row['var_pdffile'] != '') {
                                            $fileexntension = substr(strrchr($row['var_pdffile'], '.'), 1);

                                            $p = explode('.', $row['var_pdffile']);
                                            if ($fileexntension == 'doc' || $fileexntension == 'docx') {
                                                $t = 'WORD.png';
                                            } else if ($fileexntension == 'zip' || $fileexntension == 'rar') {
                                                $t = 'zip-icon.jpeg';
                                            } else if ($fileexntension == 'ppt' || $fileexntension == 'pptx') {
                                                $t = "ppt-icon.png";
                                            } else {
                                                $t = 'acrobate-readericon.png';
                                            }
                                            ?>
                                        <?php } ?>  
                                        <div style="float:left;" id="divdelbro1">
                                            <?php if ($row['var_pdffile'] != "") { ?>

                                                <a href="download.php?f=upimages/special/<?= $row['var_pdffile'] ?>&module=special"><img  height="16" width="16" src="<?= GLOBAL_ADMIN_IMAGES_PATH ?><?= $t ?>" style="vertical-align:middle;cursor:pointer;" alt="Download" /></a>
                                                <a href="javascript:;" onclick="fun_del_pdf(<?= $row['int_glcode'] ?>, '<?= $row['var_pdffile']; ?>');">Delete</a>&nbsp;&nbsp;&nbsp;&nbsp;
                                            <?php } else { ?>  &nbsp
                                            <?php } ?><span>(File type should be .doc, .docx, .pdf, .rar, .zip)</span>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
<!--                    <tr>
                        <td align="left" valign="top" class="add-new-user-text"> Special Title:</td>
                        <td width="75%" align="left" valign="top">
                          
                            <input name="var_special_title" type="text" class="add-new-user-textarea" id="var_special_title" style="width: 350px; float: left;" value="<?= htmlspecialchars($row['var_special_title']); ?>" maxlength="200" />
                        </td>
                    </tr>-->


                    <!--<tr>-->
                    <?php
//                        $select = "select * from  ecl_general_settings";
//                        $query = mysql_query($select);
//                        $value = mysql_fetch_array($query);
//                        $value['var_currencysymbol'];
                    ?>
                        <!--<td width="257" align="left" valign="top" class="add-new-user-text">Price(<?php // echo $value['var_currencysymbol'];  ?>):  </td>-->
<!--                        <td width="824" colspan="3" align="left" valign="top">
                            <input name="var_price" maxlength="10" type="text"  style="width: 350px;"  class="add-new-user-textarea" id="var_price" value="<? // =htmlspecialchars($row['var_price']);  ?>"  onkeypress="return isNumberKey(event)"  />
                        </td>
                    </tr>-->


                    </tr>
                    <tr>
                        <td  align="left" valign="top" width="25%" class="add-new-user-text" colspan="2">Description: <span>(required)</span> </td>
                    </tr>
                    <tr>
                        <!--<td  align="left" valign="top"colspan="3" width="" class="add-new-user-text" ><span style="cursor: pointer;height: 10px;" href="javascript:;" onclick="return  setserviceval('true');"><u>Default Service Format</u><br/><br/></span>--> 
                        <td align="left" valign="top"colspan="4" class="add-new-user-text">
                            <?php echo $configObj->glLibraryObj->load_ckeditor('var_description', $row['var_description']); ?> 
                        </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 special 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 != '0000-00-00') {
                                       echo $edate;
                                   }
                                   ?>"
                                   maxlength="20"  <?php
                                   if ($edate == '0000-00-00' || $edate == '0000/00/00' || $edate == '00/00/0000') {
                                       echo "style=display:none";
                                   } else {
                                       echo "style=display:''";
                                   }
                                   ?> />

                        </td>
                    </tr>

                    <!--******************************* New ****************-->

                    <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_homepagecaption" type="text" class="add-new-user-textarea" id="var_homepagecaption" style="width: 350px; float: left;" value="<?php echo $row['var_homepagecaption'] ?>" 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>
                            <!--<input name="var_homepagedescription" type="text" class="add-new-user-textarea" id="var_homepagedescription" style="width: 350px; float: left;" value="<?php echo $row['var_homepagedescription'] ?>" maxlength="200" />-->
                        </td>
                    </tr>

<!--                    <tr>
    <td  align="left" valign="top" width="25%" class="add-new-user-text" colspan="2">Home Page Description:  </td>
</tr>-->
<!--                    <tr>
    <td  align="left" valign="top"colspan="3" width="25%" class="add-new-user-text" >
    <td  align="left" valign="top"colspan="3" width="" class="add-new-user-text" ><span style="cursor: pointer;height: 10px;" href="javascript:;" onclick="return  setserviceval('true');"><u>Default Special Format</u><br/><br/></span> 
                    <?php echo $configObj->glLibraryObj->load_ckeditor('var_home_page_description', $row['var_home_page_description']); ?> 
    </td>
</tr>-->
                    <input name="h_save" type="hidden" id="h_save" value="T" />
                </table>
            </div>
        </div>
        <div class="clear"></div>
        <?php if ($configObj->glSessionObj->value('admin_id') == '1' || $configObj->glSessionObj->value('chr_user') == 'A' || (DISPLAY_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="var_metadescription" value="<?= $row['var_metadescription']; ?>" />
        <?php } ?>

        <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>
        </div>
        <?php
        if ($row['int_displayorder'] != '')
            $int_disporder = $row['int_displayorder'];
        else
            $int_disporder = '1';
        ?>
        <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="228" align="left" valign="top" class="add-new-user-text">Display Order: <span>(required)</span></td>
                        <td width="724" align="left" valign="top">
                            <input style="float :left; text-align: center; width: 88px;" name="int_displayorder" 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: 640px; height: 30px; top: 10px; left:10px;position: absolute ;"><?php echo "Spacials are usually ordered alphabetically, but you may choose to put a number in the display order fields to change the Special listing priority."; ?></div>
                            </div> 
                        </td>
                    </tr>
                    <tr>
                        <td height="30" width="22%" align="left" valign="middle" class="add-new-user-text">Publish: <span>(required)</span></td>
                        <td width="106" height="30" align="left" valign="middle" class="add-new-user-text2">
                            <table width="27%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="23%">
                                        <?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="24%"> <?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>
                                    <td 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>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <br />
        <?= $BottomSubmitButtons ?>
        <div class="clear"></div><br><br>
        <div class="add-new-user-button"></div>
    </div>
</form>

