Monday, 7 September 2015

Steps Tabs


CSS

.checkout-wrap {
    color: #444;
    margin: 40px auto;
    max-width: 1200px;
    position: relative;
}

ul.checkout-bar {
    direction: rtl;
}

    ul.checkout-bar liul.checkout-bar li a {
        color: #ccc;
        display: block;
        font-size: 14pt;
        font-weight: 600;
        position: relative;
        text-decoration:none;       
    }

        ul.checkout-bar li:before {
            background: #ddd;
            color: #fff;
            font-size: 14pt;
            font-weight: 600;
            line-height: 37px;
            text-align: center;
            position: absolute;
            left: 20px;
            height: 35px;
            width: 35px;
            border-radius: 50%;
            top: 4px;
            z-index: 20;
        }

        ul.checkout-bar li.active, ul.checkout-bar li.active a {
            color: #027ff4 !important;
            font-weight: bold;
        }

            ul.checkout-bar li.active:before {
                background: #027ff4 !important;
                z-index: 22;
            }

        ul.checkout-bar li.visited {
            background: #ECECEC;
            color: #92cf5c;
            z-index: 22;
        }

            ul.checkout-bar li.visited:before {
                background: #92cf5c;
                z-index: 22;
            }

        ul.checkout-bar li:nth-child(1):before {
            content: "1";
        }

        ul.checkout-bar li:nth-child(2):before {
            content: "2";
        }

        ul.checkout-bar li:nth-child(3):before {
            content: "3";
        }

        ul.checkout-bar li:nth-child(4):before {
            content: "4";
        }

        ul.checkout-bar li:nth-child(5):before {
            content: "5";
        }

        ul.checkout-bar li:nth-child(6):before {
            content: "6";
        }
        ul.checkout-bar li:nth-child(7):before {
            content: "7";
        }
@media all and (min-width: 800px) {
    .checkout-bar li:after {
        -webkit-animation: myanimation 3s 0;
        background-size: 35px 35px;
        background-color: #ddd;
        content: "";
        height: 5px;
        width: 103%;
        left: 0;
        position: absolute;
        top: -45px;
        z-index: 0;      
    }
    .checkout-bar li:last-child:after {       
        right: -5px;   
        width: 50%;  
    }
    .checkout-bar li:first-child:after {      
        right: 50%;    
        width: 50%
    }
    .checkout-bar li.active:after {      
        background-color: #027ff4 !important;       
        left: 0;      
    }

    .checkout-wrap {
        margin: 80px auto;
    }

    ul.checkout-bar:before {
        background-size: 35px 35px;
        content: " ";
        height: 4px;
        left: 0;
        position: absolute;
        width: 10%;
    }

    ul.checkout-bar li {
        display: inline-block;
        padding: 0;
        text-align: center;
        width: 16%;
    }

        ul.checkout-bar li:before {
            height: 40px;
            left: 40%;
            line-height: 40px;
            position: absolute;
            top: -65px;
            width: 40px;
            z-index: 17;
        }

        ul.checkout-bar li.visited {
            background: none;
        }

            ul.checkout-bar li.visited:after {
                background-size: 35px 35px;
                background-color: #92cf5c;
                content: "";
                height: 5px;
                left: 0;
                position: absolute;
                top: -45px;
                width: 103%;
                z-index: 17;
            }

        ul.checkout-bar li:first-child.visited:after {           
            right: 50%;  
            width: 52%;        
        }
        ul.checkout-bar li:last-child.visited:after {         
            right: -5px;          
            width: 52%;          
        }
}


JS:
function setActiveTab(tabIndx) {
        try {
            $(".checkout-bar").children("li").removeClass('active');
            $(".checkout-bar>li").eq(tabIndx).addClass('active');
            $("#multiView").children("div").hide();
            $('#Tab' + (tabIndx)).show();
        } catch (exc) { }
    }
    function setVisited(tabIndx) {
        try {
            $(".checkout-bar>li").eq(tabIndx).addClass('visited');
            $(".checkout-bar>li").eq(tabIndx).removeClass('active');
            $(".checkout-bar>li").eq((tabIndx + 1)).addClass('active');
            $("#multiView").children("div").hide();
            $('#Tab' + (tabIndx + 1)).show();
        } catch (exc) { }
    }

html:
<div class="checkout-wrap">
    <ul class="checkout-bar">
        <li class="visited">البيانات الشخصية</li>
        <li class="active">بيانات الثانوية</li>
        <li class="">الشهادات العلمية</li>
        <li class="">الإقامات في بلد الدراسة</li>
        <li class="">الوثائق المطلوبة</li>
        <li class="">متفرقات</li>
    </ul>

</div>

<div id="multiView">

    <div id="Tab0" style="width: 100%; display: none;">


        <h1> Tab  0</h1>
        <div style="width: 94%; text-align: left">
            <button type="button" class="btn btn-primary" onclick="saveData(); setVisited(0)">التالي</button>
        </div>
    </div>

    <div id="Tab1" style="width: 100%;">
       
        <h1> Tab  1</h1>
        <div style="width: 94%; text-align: left">
            <button type="button" class="btn btn-primary" onclick="setActiveTab(0)">السابق</button>
            <button type="button" class="btn btn-primary " onclick="setVisited(1)">التالي</button>
        </div>
    </div>

    <div id="Tab2" style="width: 100%; display: none;">
        <h1> Tab  2</h1>
        <div style="width: 94%; text-align: left">
            <button type="button" class="btn btn-primary" onclick="setActiveTab(1)">السابق</button>
            <button type="button" class="btn btn-primary" onclick="setVisited(2)">التالي</button>
        </div>
    </div>

    <div id="Tab3" style="width: 100%; display: none;">
       
        <h1>Tab 3</h1>
        <div style="width: 94%; text-align: left">
            <button type="button" class="btn btn-primary" onclick="setActiveTab(2)">السابق</button>
            <button type="button" class="btn btn-primary" onclick="setVisited(3)">التالي</button>
        </div>
    </div>
    <div id="Tab4" style="width: 100%; display: none;">
        <h1>Tab 4</h1>
        <button type="button" class="btn btn-primary" onclick="setActiveTab(3)">السابق</button>
        <button type="button" class="btn btn-primary" onclick="setVisited(4)">التالي</button>
    </div>
    <div id="Tab5" style="width: 100%; display: none;">
        <h1>Tab 5</h1>
        <button type="button" class="btn btn-primary" onclick="setActiveTab(4)">السابق</button>
        <button type="button" class="btn btn-primary" onclick="setVisited(5)">انهاء</button>
    </div>
</div>

Saturday, 22 August 2015

Generate Random Colors in Javascript

<html5>
    <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
    <script type="text/javascript">
        var colorsList = new Array();
        function getRandomColor() {
            var letters = '0123456789ABCDEF'.split('');
            var color = '#';
            for (var i = 0; i < 6; i++) {
                color += letters[Math.floor(Math.random() * 16)];
            }
            return color;
        }
        function getRandomColorNotInList(colorsListToSkip) {
            do {
                color = getRandomColor();
            } while (jQuery.inArray(color, colorsListToSkip) != -1);
            return color;
        }

        $(document).ready(function () {
            for (i = 0; i < 1000; i++) {
                var color = getRandomColorNotInList(colorsList);
                colorsList.push(color);
            }
            colorsList.sort();
            var len = colorsList.length;
            console.info(" len = " + len);
            for (i = 0; i < len; i++) {
                $(document.body).append(''; width:200px; height:50px;  display:inline-block;">' + colorsList[i] + '
');               
            }
        });

    </script>

    <body>

    </body>

</html5>

Saturday, 1 August 2015

Oracle SQL cursor

declare cursor layersIDs is select TO_NUMBER(lay_id) as lay_id from layers order by lay_id; rec layersIDs%rowtype; begin for rec in layersIDs loop dbms_output.PUT_LINE (rec.lay_id); end loop; end;

Wednesday, 22 July 2015

IIS prevent sub application inherit parent web.config

Add all config sections between the following tag

<location path="."  allowOverride="false" inheritInChildApplications="false">

</location>

Except <configSections> and <runtime>


Example:
<location path="."  allowOverride="false" inheritInChildApplications="false">
<connectionStrings>
      <add name="SiteSqlServer" connectionString="Data Source=SQL;Initial Catalog=moheportal;User ID=mmmm;Password=pppp" providerName="System.Data.SqlClient" />
    </connectionStrings>
    <appSettings>


</location>

Friday, 10 July 2015

Clear SDE schema from unwanted Spatial Tables, Search in all fields in all oracle schemas

delete from column_registry
where OWNER in ('FLEET_V1','GIS_B','ATLAS_V1', 'GIS_V1', 'GIS','gis', 'GIS_CODING', 'GIS_TEST', 'GIS_C', 'gis_c', 'GIS_D', 'gis_d'  );

delete from column_registry
where OWNER ='GIS_V1' AND table_name = 'LT_STATIONS_GIS';
commit;

delete from GEOMETRY_COLUMNS
where F_TABLE_SCHEMA in ('FLEET_V1','GIS_B','ATLAS_V1', 'GIS_V1', 'GIS','gis', 'GIS_CODING', 'GIS_TEST', 'GIS_C', 'gis_c', 'GIS_D', 'gis_d'  );

delete from GEOMETRY_COLUMNS
where F_TABLE_SCHEMA ='GIS_V1' and f_table_name='LT_STATIONS_GIS';

delete from LAYERS
where OWNER in ('FLEET_V1','GIS_B','ATLAS_V1', 'GIS_V1', 'GIS','gis', 'GIS_CODING', 'GIS_TEST', 'GIS_C', 'gis_c', 'GIS_D', 'gis_d' );

delete from LAYERS
where OWNER ='GIS_V1' AND table_name = 'LT_STATIONS_GIS';

delete from GDB_ITEMS
where NAME like 'FLEET_V1%' or NAME like'GIS_B%' or NAME like'ATLAS_V1%' or  NAME like'GIS_V1%' or NAME like'GIS%' or NAME like'GIS_CODING%'
or NAME like'gis_c%' or NAME like'gis_d%' or NAME like'gis%' or NAME like'GIS_D%' ;

delete from GDB_ITEMS
where NAME ='GIS_V1.LT_STATIONS_GIS';

COMMIT;

DROP USER username CASCADE;


To search in all fields in oracle schemas 
DECLARE
  match_count integer;
  v_search_string varchar2(4000) := 'fff';
BEGIN  
  FOR t IN (SELECT owner, table_name, column_name FROM all_tab_columns) LOOP   
    EXECUTE IMMEDIATE    
      'SELECT COUNT(*) FROM '||t.owner || '.' || t.table_name||
      ' WHERE '||t.column_name||' = :1'   
       INTO match_count  
      USING v_search_string; 
    IF match_count > 0 THEN 
      dbms_output.put_line( t.owner || '.' || t.table_name ||' '||t.column_name||' '||match_count );
    END IF; 
  END LOOP;
END;

Wednesday, 8 July 2015

Clear SDE schema from tables of dropped schemas

delete from column_registry
where OWNER in ('FLEET_V1','GIS_B','ATLAS_V1', 'GIS_V1', 'GIS','gis', 'GIS_CODING', 'GIS_TEST', 'GIS_C', 'gis_c', 'GIS_D', 'gis_d'  );

delete from GEOMETRY_COLUMNS
where F_TABLE_SCHEMA in ('FLEET_V1','GIS_B','ATLAS_V1', 'GIS_V1', 'GIS','gis', 'GIS_CODING', 'GIS_TEST', 'GIS_C', 'gis_c', 'GIS_D', 'gis_d'  );

delete from LAYERS
where OWNER in ('FLEET_V1','GIS_B','ATLAS_V1', 'GIS_V1', 'GIS','gis', 'GIS_CODING', 'GIS_TEST', 'GIS_C', 'gis_c', 'GIS_D', 'gis_d' );

delete from GDB_ITEMS
where NAME like 'FLEET_V1%' or NAME like'GIS_B%' or NAME like'ATLAS_V1%' or  NAME like'GIS_V1%' or NAME like'GIS%' or NAME like'GIS_CODING%'
or NAME like'gis_c%' or NAME like'gis_d%' or NAME like'gis%' or NAME like'GIS_D%' ;

COMMIT;

DROP USER gis_d CASCADE;
DROP USER gis_c CASCADE;
DROP USER gis_test CASCADE;
DROP USER gis CASCADE;


DECLARE
  match_count integer;
  v_search_string varchar2(4000) := 'fff';
BEGIN  
  FOR t IN (SELECT owner, table_name, column_name FROM all_tab_columns) LOOP   
    EXECUTE IMMEDIATE    
      'SELECT COUNT(*) FROM '||t.owner || '.' || t.table_name||
      ' WHERE '||t.column_name||' = :1'   
       INTO match_count  
      USING v_search_string; 
    IF match_count > 0 THEN 
      dbms_output.put_line( t.owner || '.' || t.table_name ||' '||t.column_name||' '||match_count );
    END IF; 
  END LOOP;
END;

Saturday, 6 June 2015

How to get style from oracle mapviewer

Use the following to get an image of the style


http://url:port/mapviewer/omserver?w=13&h=19&sty=M.HE_SCHOOLS_GIS&ds=DataSourceName