<?php
echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html dir='rtl' xmlns='http://www.w3.org/1999/xhtml' xml:lang='ar' lang='ar'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1256' />
<title>ترقية سكربت المكتبة الاسلامية</title>
<style type='text/css'>
<!--
* { margin: 0;        padding: 0; }

body {
        margin: 0; padding: 0;
        font: 12px Tahoma, Arial, Helvetica, sans-serif;
        color: #333;
        background-color: #FFF;
}

#wrap {
        margin: 0 auto;
        width: 770px;
}

/* links */
a {
        color: #003366;
        background-color: inherit;
        text-decoration: none;
}

a:hover {
        color: #CC0001;
}

.bar {
  margin: 0;
  padding: 10px;
  text-align: center;
  display: block;
  overflow: auto;
  background: #FAFAFA;
  border: 1px solid #f2f2f2;
  border-top: 4px solid #CC0000;
  border-bottom: 4px solid #CC0000;
  text-align:center;
}

.error {
  color: red;
}

.info {
  color: red;
}

.msg         {
        width:450px;
        border: 1px solid #FFD700;
        margin: 0 auto;
        padding: 5px;
        background: #FFFFDD;
        font: 12px Tahoma, Arial, Helvetica, sans-serif;
        text-align:center;
}


ul {
        margin: 0;
        padding: 10px;
}

ul li {
        margin: 0;
        padding: 5px;
}

ul li.ilmsg {
        color: red;
}
-->
</style>
</head>
<body>

<div id='wrap'>
<br />
<div class='bar'>ترقية سكربت المكتبة الاسلامية الشامله من الاصدار الخامس الى الاصدار السادس</div>
<br />";

include("includes/config.php");

function txt($table,$type) {
if($type==1){
$text = "<li>تمت ترقية الجدول ".$table." بنجاح</li>";
}else{
$text = "<li class='ilmsg'>لم تتم ترقية الجدول ".$table." بقاعدة البيانات ... هناك مشكلة ما</li>";
}
return $text;
}

function txti($table,$type) {
if($type==1){
$text = "<li>تمت إضافة البيانات في الجدول ".$table." بنجاح</li>";
}else{
$text = "<li class='ilmsg'>لم تتم إضافة البيانات في الجدول ".$table." هناك مشكلة ما ....</li>";
}
return $text;
}

if(isset($_GET['install']) && $_GET['install']==1){

}elseif(isset($_GET['install']) && $_GET['install']==2){

}else{
echo "<br /><br /><div class='msg'>
السلام عليكم ورحمة الله وبركاته<br /><br />
أخي الكريم شكرا لإختيارك سكربت المكتبة الإسلامية الشامله الاصدار السادس<br /><br /><br />
يجب ان تكتب معلومات قاعدة البيانات الخاصه بالمكتبة الشامله بملف includes/config.php<br /><br />
ثم<br /><br />
<a href='upgrade.php?install=1'>إبدء الترقية</a></div><br /><br />

<div class='msg'>
بيانات ملف الاتصال هي كالتالي<br /><br /><br />
<div style='text-align:left;' dir='ltr'>localhost : <span class='info'>".$localhost."</span><br />
username database : <span class='info'>".$userdb."</span><br />
password database : <span class='info'>".$passdb."</span><br />
name database : <span class='info'>".$database."</span></div>
</div>";
}



if(isset($_GET['install']) && $_GET['install']==1){

//##### START UPGRADE #####//

$mysqltext = "<ul>";

$insert_data_01 = mysql_query("
ALTER TABLE `admin` CHANGE `username` `username` VARCHAR( 250 )  DEFAULT NULL ,
CHANGE `password` `password` VARCHAR( 250 )  DEFAULT NULL ,
CHANGE `adminoruser` `adminoruser` INT( 11 ) NULL DEFAULT '0' ;
");
if(!$insert_data_01){
$mysqltext .= txt("admin",0);
$err = "no";
}else{
$mysqltext .= txt("admin",1);
}






$insert_data_02 = mysql_query("
UPDATE `admin` SET `adminoruser` = '1' WHERE `id` =1 ;
");
if(!$insert_data_02){
$mysqltext .= txt("admin",0);
$err = "no";
}else{
$mysqltext .= txt("admin",1);
}



$insert_data_03 = mysql_query("
ALTER TABLE `news_cat` ADD `keywords` TEXT NOT NULL ,
ADD `description` TEXT NOT NULL ,
ADD `active` INT NOT NULL DEFAULT '1',
ADD `sub` INT NOT NULL DEFAULT '0',
ADD `image` VARCHAR( 250 ) NOT NULL ,
ADD `text` TEXT NOT NULL ;
");
if(!$insert_data_03){
$mysqltext .= txt("news_cat",0);
$err = "no";
}else{
$mysqltext .= txt("news_cat",1);
}





$insert_data_04 = mysql_query("
ALTER TABLE `news` ADD `active` INT NOT NULL DEFAULT '1',
ADD `thumbs` VARCHAR( 250 ) NOT NULL ,
ADD `keywords` TEXT NOT NULL ;
");
if(!$insert_data_04){
$mysqltext .= txt("news",0);
$err = "no";
}else{
$mysqltext .= txt("news",1);
}



$insert_data_05 = mysql_query("
ALTER TABLE `telawat_cat` ADD `keywords` TEXT NOT NULL ,
ADD `description` TEXT NOT NULL ,
ADD `active` INT NOT NULL DEFAULT '1',
ADD `image` VARCHAR( 255 ) NOT NULL ;
");
if(!$insert_data_05){
$mysqltext .= txt("telawat_cat",0);
$err = "no";
}else{
$mysqltext .= txt("telawat_cat",1);
}




$insert_data_06 = mysql_query("
ALTER TABLE `telawat` ADD `active` INT NOT NULL DEFAULT '1';
");
if(!$insert_data_06){
$mysqltext .= txt("telawat",0);
$err = "no";
}else{
$mysqltext .= txt("telawat",1);
}





$insert_data_07 = mysql_query("
ALTER TABLE `mhadrat_cat` ADD `keywords` TEXT NOT NULL ,
ADD `description` TEXT NOT NULL ,
ADD `active` INT NOT NULL DEFAULT '1',
ADD `image` VARCHAR( 255 ) NOT NULL ;
");
if(!$insert_data_07){
$mysqltext .= txt("mhadrat_cat",0);
$err = "no";
}else{
$mysqltext .= txt("mhadrat_cat",1);
}





$insert_data_08 = mysql_query("
ALTER TABLE `mhadrat` ADD `metadescription` TEXT NOT NULL ,
ADD `active` INT NOT NULL DEFAULT '1',
ADD `urlother` VARCHAR( 255 ) NOT NULL,
ADD `metakeywords` TEXT NOT NULL ;
");
if(!$insert_data_08){
$mysqltext .= txt("mhadrat",0);
$err = "no";
}else{
$mysqltext .= txt("mhadrat",1);
}





$insert_data_09 = mysql_query("
ALTER TABLE `mhadrat` CHANGE `url` `url` TEXT  NOT NULL,
CHANGE `text` `text` TEXT  NOT NULL;
");
if(!$insert_data_09){
$mysqltext .= txt("mhadrat",0);
$err = "no";
}else{
$mysqltext .= txt("mhadrat",1);
}




$insert_data_10 = mysql_query("
ALTER TABLE `anasheed_cat` ADD `keywords` TEXT NOT NULL ,
ADD `description` TEXT NOT NULL ,
ADD `active` INT NOT NULL DEFAULT '1',
ADD `image` VARCHAR( 255 ) NOT NULL ;
");
if(!$insert_data_10){
$mysqltext .= txt("anasheed_cat",0);
$err = "no";
}else{
$mysqltext .= txt("anasheed_cat",1);
}








$insert_data_11 = mysql_query("
ALTER TABLE `anasheed` ADD `metadescription` TEXT NOT NULL ,
ADD `active` INT NOT NULL DEFAULT '1',
ADD `metakeywords` TEXT NOT NULL ;
");
if(!$insert_data_11){
$mysqltext .= txt("anasheed",0);
$err = "no";
}else{
$mysqltext .= txt("anasheed",1);
}




$insert_data_12 = mysql_query("
ALTER TABLE `book_cat` ADD `keywords` TEXT NOT NULL ,
ADD `active` INT NOT NULL DEFAULT '1';
");
if(!$insert_data_12){
$mysqltext .= txt("book_cat",0);
$err = "no";
}else{
$mysqltext .= txt("book_cat",1);
}

$insert_data_13 = mysql_query("
ALTER TABLE `book_all` CHANGE `downloads` `downloads` TEXT  NOT NULL;
");
if(!$insert_data_13){
$mysqltext .= txt("book_all",0);
$err = "no";
}else{
$mysqltext .= txt("book_all",1);
}





$insert_data_14 = mysql_query("
ALTER TABLE `book_all` ADD `metadescription` TEXT NOT NULL ,
ADD `metakeywords` TEXT NOT NULL ,
ADD `codes` TEXT NOT NULL ,
ADD `active` INT NOT NULL DEFAULT '1';
");
if(!$insert_data_14){
$mysqltext .= txt("book_all",0);
$err = "no";
}else{
$mysqltext .= txt("book_all",1);
}








$insert_data_15 = mysql_query("
ALTER TABLE `fatawa_cat` ADD `keywords` TEXT NOT NULL ,
ADD `description` TEXT NOT NULL ,
ADD `active` INT NOT NULL DEFAULT '1';
");
if(!$insert_data_15){
$mysqltext .= txt("fatawa_cat",0);
$err = "no";
}else{
$mysqltext .= txt("fatawa_cat",1);
}




$insert_data_16 = mysql_query("
ALTER TABLE `fatawa` ADD `title` VARCHAR( 255 ) NOT NULL ,
ADD `active` INT NOT NULL DEFAULT '1';
");
if(!$insert_data_16){
$mysqltext .= txt("fatawa",0);
$err = "no";
}else{
$mysqltext .= txt("fatawa",1);
}



$insert_data_17 = mysql_query("
ALTER TABLE `dlil_cat` ADD `keywords` TEXT NOT NULL ,
ADD `description` TEXT NOT NULL ,
ADD `active` INT NOT NULL DEFAULT '1';
");
if(!$insert_data_17){
$mysqltext .= txt("dlil_cat",0);
$err = "no";
}else{
$mysqltext .= txt("dlil_cat",1);
}



$insert_data_18 = mysql_query("
ALTER TABLE `islam_dlil` ADD `keywords` VARCHAR( 255 ) NOT NULL ;
");
if(!$insert_data_18){
$mysqltext .= txt("islam_dlil",0);
$err = "no";
}else{
$mysqltext .= txt("islam_dlil",1);
}




$insert_data_19 = mysql_query("
ALTER TABLE `flash_cat` ADD `keywords` TEXT NOT NULL ,
ADD `description` TEXT NOT NULL ,
ADD `active` INT NOT NULL DEFAULT '1',
ADD `image` VARCHAR( 255 ) NOT NULL ;
");
if(!$insert_data_19){
$mysqltext .= txt("flash_cat",0);
$err = "no";
}else{
$mysqltext .= txt("flash_cat",1);
}




$insert_data_20 = mysql_query("
ALTER TABLE `flash` ADD `metadescription` TEXT NOT NULL ,
ADD `metakeywords` TEXT NOT NULL ,
ADD `active` INT NOT NULL DEFAULT '1';
");
if(!$insert_data_20){
$mysqltext .= txt("flash",0);
$err = "no";
}else{
$mysqltext .= txt("flash",1);
}




$insert_data_21 = mysql_query("
ALTER TABLE `download_cat` ADD `keywords` TEXT NOT NULL ,
ADD `description` TEXT NOT NULL ,
ADD `active` INT NOT NULL DEFAULT '1',
ADD `image` VARCHAR( 255 ) NOT NULL ;
");
if(!$insert_data_21){
$mysqltext .= txt("download_cat",0);
$err = "no";
}else{
$mysqltext .= txt("download_cat",1);
}







$insert_data_22 = mysql_query("
ALTER TABLE `download` ADD `keywords` VARCHAR( 255 ) NOT NULL ,
ADD `active` INT NOT NULL DEFAULT '1';
");
if(!$insert_data_22){
$mysqltext .= txt("download",0);
$err = "no";
}else{
$mysqltext .= txt("download",1);
}



$insert_data_23 = mysql_query("
ALTER TABLE `story_cat` ADD `keywords` TEXT NOT NULL ,
ADD `description` TEXT NOT NULL ,
ADD `active` INT NOT NULL DEFAULT '1',
ADD `image` VARCHAR( 255 ) NOT NULL ;
");
if(!$insert_data_23){
$mysqltext .= txt("story_cat",0);
$err = "no";
}else{
$mysqltext .= txt("story_cat",1);
}




$insert_data_24 = mysql_query("
ALTER TABLE `story` ADD `keywords` TEXT NOT NULL ,
ADD `description` TEXT NOT NULL ,
ADD `active` INT NOT NULL DEFAULT '1' ;
");
if(!$insert_data_24){
$mysqltext .= txt("story",0);
$err = "no";
}else{
$mysqltext .= txt("story",1);
}




$insert_data_25 = mysql_query("
ALTER TABLE `signatures_cat` ADD `keywords` TEXT NOT NULL ,
ADD `description` TEXT NOT NULL ,
ADD `active` INT NOT NULL DEFAULT '1',
ADD `sub` INT NOT NULL DEFAULT '0',
ADD `image` VARCHAR( 255 ) NOT NULL ;
");
if(!$insert_data_25){
$mysqltext .= txt("signatures_cat",0);
$err = "no";
}else{
$mysqltext .= txt("signatures_cat",1);
}




$insert_data_26 = mysql_query("
ALTER TABLE `signatures` ADD `keywords` TEXT NOT NULL ,
ADD `description` TEXT NOT NULL ,
ADD `name` VARCHAR( 255 ) NOT NULL,
ADD `active` INT NOT NULL DEFAULT '1' ;
");
if(!$insert_data_26){
$mysqltext .= txt("signatures",0);
$err = "no";
}else{
$mysqltext .= txt("signatures",1);
}

$insert_data_27 = mysql_query("
CREATE TABLE `contries` (
  `id` int(11) NOT NULL auto_increment,
  `name_ar` varchar(255) default NULL,
  `name_en` varchar(255) default NULL,
  `flags` varchar(255) default NULL,
  `short` varchar(99) default NULL,
  `active` int(11) default '0',
  `orders` int(11) default '0',
  PRIMARY KEY  (`id`)
);
");
if(!$insert_data_27){
$mysqltext .= txt("contries",0);
$err = "no";
}else{
$mysqltext .= txt("contries",1);
}





$insert_data_28 = mysql_query("
ALTER TABLE `sjl_alzwar` ADD `countryid` INT NOT NULL DEFAULT '0';
");
if(!$insert_data_28){
$mysqltext .= txt("sjl_alzwar",0);
$err = "no";
}else{
$mysqltext .= txt("sjl_alzwar",1);
}

$insert_data_29 = mysql_query("
ALTER TABLE `links_my_site` ADD `active` INT NOT NULL DEFAULT '1',
ADD `urlm` VARCHAR( 250 ) NOT NULL ,
ADD `class` VARCHAR( 99 ) NOT NULL ,
ADD `target` INT NOT NULL DEFAULT '0';
");
if(!$insert_data_29){
$mysqltext .= txt("links_my_site",0);
$err = "no";
}else{
$mysqltext .= txt("links_my_site",1);
}




$insert_data_30 = mysql_query("
ALTER TABLE `ads` ADD `codex` TEXT NOT NULL ,
ADD `textbox` INT NOT NULL DEFAULT '1',
ADD `orders` INT NOT NULL DEFAULT '0';
");
if(!$insert_data_30){
$mysqltext .= txt("ads",0);
$err = "no";
}else{
$mysqltext .= txt("ads",1);
}



$insert_data_31 = mysql_query("
ALTER TABLE `pages` ADD `active` INT NOT NULL DEFAULT '1',
ADD `m1` VARCHAR( 250 ) NOT NULL ,
ADD `m2` VARCHAR( 250 ) NOT NULL ,
ADD `addmenu` INT NOT NULL DEFAULT '0',
ADD `url` VARCHAR( 250 ) NOT NULL ,
ADD `urlactive` INT NOT NULL DEFAULT '0',
ADD `url_trteeb` INT NOT NULL DEFAULT '0' ,
ADD `target` INT NOT NULL DEFAULT '0',
ADD `folderpages` VARCHAR( 250 ) NOT NULL ;
");
if(!$insert_data_31){
$mysqltext .= txt("pages",0);
$err = "no";
}else{
$mysqltext .= txt("pages",1);
}



$insert_data_32 = mysql_query("
ALTER TABLE `blocks` ADD `codeblock` VARCHAR( 99 ) NOT NULL ,
ADD `textbox` INT NOT NULL DEFAULT '1';
");
if(!$insert_data_32){
$mysqltext .= txt("blocks",0);
$err = "no";
}else{
$mysqltext .= txt("blocks",1);
}




$insert_data_33 = mysql_query("
CREATE TABLE `youtubecat` (
  `id` int(11) NOT NULL auto_increment,
  `name_cat` varchar(250) default NULL,
  `image` varchar(250) default NULL,
  `keywords` text,
  `description` text,
  `active` int(11) default '0',
  `order_cat` int(11) default '0',
  `sub` int(11) default '0',
  PRIMARY KEY  (`id`)
);
");
if(!$insert_data_33){
$mysqltext .= txt("youtubecat",0);
$err = "no";
}else{
$mysqltext .= txt("youtubecat",1);
}

$insert_data_34 = mysql_query("
CREATE TABLE `youtube` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(250) default NULL,
  `image` varchar(250) default NULL,
  `code` varchar(250) default NULL,
  `keywords` text,
  `description` text,
  `active` int(11) default '0',
  `size` int(11) default '0',
  `border` int(11) default '0',
  `related` int(11) default '0',
  `color` int(11) default '0',
  `vis` int(11) default '0',
  `orders` int(11) default '0',
  `cat` int(11) default '0',
  `date` varchar(50) default NULL,
  PRIMARY KEY  (`id`)
);
");
if(!$insert_data_34){
$mysqltext .= txt("youtube",0);
$err = "no";
}else{
$mysqltext .= txt("youtube",1);
}

$insert_data_35 = mysql_query("
ALTER TABLE `opitions` ADD `activeguestbook` INT NOT NULL DEFAULT '1',
ADD `youtube_catsloop` INT NOT NULL DEFAULT '3',
ADD `youtube_vidloop` INT NOT NULL DEFAULT '2',
ADD `youtube_limit` INT NOT NULL DEFAULT '12',
ADD `youtube_catsmenu` INT NOT NULL DEFAULT '10',
ADD `keywords` TEXT NOT NULL ,
ADD `description` TEXT NOT NULL ,
ADD `foldernews` VARCHAR( 250 ) NOT NULL ,
ADD `folderquran` VARCHAR( 250 ) NOT NULL ,
ADD `foldersound` VARCHAR( 250 ) NOT NULL ,
ADD `folderfatawa` VARCHAR( 250 ) NOT NULL ,
ADD `folderbook` VARCHAR( 250 ) NOT NULL ,
ADD `folderanashed` VARCHAR( 250 ) NOT NULL ,
ADD `foldersignatures` VARCHAR( 250 ) NOT NULL ,
ADD `folderlinks` VARCHAR( 250 ) NOT NULL ,
ADD `folderstory` VARCHAR( 250 ) NOT NULL ,
ADD `folderdownload` VARCHAR( 250 ) NOT NULL ,
ADD `folderflash` VARCHAR( 250 ) NOT NULL ,
ADD `foldergeustbook` VARCHAR( 250 ) NOT NULL ,
ADD `folderyoutube` VARCHAR( 250 ) NOT NULL ,
ADD `foldervideo` VARCHAR( 250 ) NOT NULL ,
ADD `foldertext` VARCHAR( 250 ) NOT NULL ,
ADD `limit_video` INT NOT NULL DEFAULT '15',
ADD `limit_text` INT NOT NULL DEFAULT '15',
ADD `limitmenu_video` INT NOT NULL DEFAULT '10',
ADD `limitmenu_text` INT NOT NULL DEFAULT '10',
ADD `video_catsloop` INT NOT NULL DEFAULT '3',
ADD `text_catsloop` INT NOT NULL DEFAULT '3',
ADD `story_catsloop` INT NOT NULL DEFAULT '3',
ADD `limitmenu_story` INT NOT NULL DEFAULT '10',
ADD `limit_story` INT NOT NULL DEFAULT '15',
ADD `download_catsloop` INT NOT NULL DEFAULT '3',
ADD `limitmenu_download` INT NOT NULL DEFAULT '10',
ADD `limit_download` INT NOT NULL DEFAULT '15',
ADD `limitmenu_news` INT NOT NULL DEFAULT '10',
ADD `limitmenu_fatawa` INT NOT NULL DEFAULT '10',
ADD `limitmenu_book` INT NOT NULL DEFAULT '10',
ADD `limitmenu_flash` INT NOT NULL DEFAULT '10',
ADD `limitmenu_links` INT NOT NULL DEFAULT '10',
ADD `limitmenu_signatures` INT NOT NULL DEFAULT '10',
ADD `d1` VARCHAR( 250 ) NOT NULL ,
ADD `d2` VARCHAR( 250 ) NOT NULL ,
ADD `d3` VARCHAR( 250 ) NOT NULL ,
ADD `d4` VARCHAR( 250 ) NOT NULL ,
ADD `d5` VARCHAR( 250 ) NOT NULL ,
ADD `d6` VARCHAR( 250 ) NOT NULL ,
ADD `d7` VARCHAR( 250 ) NOT NULL ,
ADD `d8` VARCHAR( 250 ) NOT NULL ,
ADD `d9` VARCHAR( 250 ) NOT NULL ,
ADD `d10` VARCHAR( 250 ) NOT NULL ,
ADD `d11` VARCHAR( 250 ) NOT NULL ,
ADD `d12` VARCHAR( 250 ) NOT NULL ,
ADD `d13` VARCHAR( 250 ) NOT NULL ,
ADD `d14` VARCHAR( 250 ) NOT NULL ,
ADD `d15` VARCHAR( 250 ) NOT NULL ,
ADD `k1` VARCHAR( 250 ) NOT NULL ,
ADD `k2` VARCHAR( 250 ) NOT NULL ,
ADD `k3` VARCHAR( 250 ) NOT NULL ,
ADD `k4` VARCHAR( 250 ) NOT NULL ,
ADD `k5` VARCHAR( 250 ) NOT NULL ,
ADD `k6` VARCHAR( 250 ) NOT NULL ,
ADD `k7` VARCHAR( 250 ) NOT NULL ,
ADD `k8` VARCHAR( 250 ) NOT NULL ,
ADD `k9` VARCHAR( 250 ) NOT NULL ,
ADD `k10` VARCHAR( 250 ) NOT NULL ,
ADD `k11` VARCHAR( 250 ) NOT NULL ,
ADD `k12` VARCHAR( 250 ) NOT NULL ,
ADD `k13` VARCHAR( 250 ) NOT NULL ,
ADD `k14` VARCHAR( 250 ) NOT NULL ,
ADD `k15` VARCHAR( 250 ) NOT NULL ,
ADD `allowcomment_news` INT NOT NULL DEFAULT '1',
ADD `allowshowcomment_news` INT NOT NULL DEFAULT '1',
ADD `activecomment` INT NOT NULL DEFAULT '1',
ADD `limitcomments` INT NOT NULL DEFAULT '20';
");
if(!$insert_data_35){
$mysqltext .= txt("opitions",0);
$err = "no";
}else{
$mysqltext .= txt("opitions",1);
}



$insert_data_36 = mysql_query("
CREATE TABLE `xcounter` (
  `today` int(11) NOT NULL default '0',
  `thismonth` int(11) NOT NULL default '0',
  `thisyear` int(11) NOT NULL default '0',
  `dateline` int(11) NOT NULL default '0',
  `total` int(11) NOT NULL default '0'
);
");
if(!$insert_data_36){
$mysqltext .= txt("xcounter",0);
$err = "no";
}else{
$mysqltext .= txt("xcounter",1);
}

$insert_data_37 = mysql_query("
CREATE TABLE `xip` (
  `time_in` int(11) NOT NULL default '0',
  `userip` varchar(15) NOT NULL default '0',
  `time_out` int(11) NOT NULL default '0'
);
");
if(!$insert_data_37){
$mysqltext .= txt("xip",0);
$err = "no";
}else{
$mysqltext .= txt("xip",1);
}

$insert_data_38 = mysql_query("
CREATE TABLE `stats` (
  `id` int(11) NOT NULL auto_increment,
  `ip` varchar(250) default NULL,
  `refere` text,
  `counter` int(11) default '1',
  `date` varchar(30) default NULL,
  PRIMARY KEY  (`id`)
);
");
if(!$insert_data_38){
$mysqltext .= txt("stats",0);
$err = "no";
}else{
$mysqltext .= txt("stats",1);
}

$insert_data_39 = mysql_query("
CREATE TABLE `search` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(250) default NULL,
  `counter` int(11) default '1',
  `date` varchar(30) default NULL,
  PRIMARY KEY  (`id`)
) ;
");
if(!$insert_data_39){
$mysqltext .= txt("search",0);
$err = "no";
}else{
$mysqltext .= txt("search",1);
}






$insert_data_40 = mysql_query("
CREATE TABLE `swfobject` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(250) default NULL,
  `pathalbum` varchar(250) default NULL,
  `widthalbum` int(11) default '630',
  `heightalbum` int(11) default '500',
  `active` int(11) default '1',
  `date` varchar(50) default NULL,
  `placealbum` int(11) default '0',
  PRIMARY KEY  (`id`)
);
");
if(!$insert_data_40){
$mysqltext .= txt("swfobject",0);
$err = "no";
}else{
$mysqltext .= txt("swfobject",1);
}



$insert_data_41 = mysql_query("
CREATE TABLE `videocategory` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(250) default NULL,
  `image` varchar(250) default NULL,
  `order_cat` int(11) default '0',
  `active` int(11) default '1',
  PRIMARY KEY  (`id`)
);
");
if(!$insert_data_41){
$mysqltext .= txt("videocategory",0);
$err = "no";
}else{
$mysqltext .= txt("videocategory",1);
}



$insert_data_42 = mysql_query("
CREATE TABLE `videocontent` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(250) default NULL,
  `url` varchar(250) default NULL,
  `textcode` text,
  `selectcode` int(11) default '0',
  `cat` int(11) default '0',
  `active` int(11) default '1',
  `date` varchar(50) default NULL,
  `visitor` int(11) default '0',
  `vdownload` int(11) default '0',
  PRIMARY KEY  (`id`)
);
");
if(!$insert_data_42){
$mysqltext .= txt("videocontent",0);
$err = "no";
}else{
$mysqltext .= txt("videocontent",1);
}



$insert_data_43 = mysql_query("
CREATE TABLE `maillist` (
  `id` int(11) NOT NULL auto_increment,
  `email` varchar(250) NOT NULL default '',
  `active` int(11) default '0',
  `date` varchar(50) NOT NULL default '',
  `ip` varchar(250) NOT NULL default '',
  `type` int(11) default '0',
  PRIMARY KEY  (`id`)
);
");
if(!$insert_data_43){
$mysqltext .= txt("maillist",0);
$err = "no";
}else{
$mysqltext .= txt("maillist",1);
}



$insert_data_44 = mysql_query("
CREATE TABLE `comment` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(250) default NULL,
  `email` varchar(250) default NULL,
  `country` int(11) default '0',
  `text` text,
  `active` int(11) default '1',
  `date` varchar(50) default NULL,
  `ip` varchar(99) default NULL,
  `idt` int(11) default '0',
  `cat` int(11) default '0',
  PRIMARY KEY  (`id`)
);
");
if(!$insert_data_44){
$mysqltext .= txt("comment",0);
$err = "no";
}else{
$mysqltext .= txt("comment",1);
}



$insert_data_45 = mysql_query("
CREATE TABLE `user` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(250) default NULL,
  `email` varchar(250) default NULL,
  `phone` varchar(250) default NULL,
  `username` varchar(250) default NULL,
  `password` varchar(250) default NULL,
  `active` int(11) default '0',
  `g1` int(11) default '0',
  `g2` int(11) default '0',
  `g3` int(11) default '0',
  `g4` int(11) default '0',
  `g5` int(11) default '0',
  `g6` int(11) default '0',
  `g7` int(11) default '0',
  `g8` int(11) default '0',
  `g9` int(11) default '0',
  `g10` int(11) default '0',
  `g11` int(11) default '0',
  `g12` int(11) default '0',
  `g13` int(11) default '0',
  `g14` int(11) default '0',
  `g15` int(11) default '0',
  `g16` int(11) default '0',
  `g17` int(11) default '0',
  `g18` int(11) default '0',
  `g19` int(11) default '0',
  `g20` int(11) default '0',
  `g21` int(11) default '0',
  PRIMARY KEY  (`id`)
) ;
");
if(!$insert_data_45){
$mysqltext .= txt("user",0);
$err = "no";
}else{
$mysqltext .= txt("user",1);
}



$insert_data_451 = mysql_query("
CREATE TABLE `text` (
  `id` int(10) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  `url` varchar(255) NOT NULL,
  `text` longtext,
  `cat` int(11) default '0',
  `vis` int(11) default '0',
  `date` varchar(50) NOT NULL,
  `keywords` text NOT NULL,
  `description` text NOT NULL,
  `active` int(11) NOT NULL default '1',
  PRIMARY KEY  (`id`)
) ;
");
if(!$insert_data_451){
$mysqltext .= txt("text",0);
$err = "no";
}else{
$mysqltext .= txt("text",1);
}


$insert_data_452 = mysql_query("
CREATE TABLE `text_cat` (
  `id` int(10) NOT NULL auto_increment,
  `name_cat` varchar(255) NOT NULL,
  `order_cat` int(11) default '0',
  `sub` int(11) default '0',
  `keywords` text NOT NULL,
  `description` text NOT NULL,
  `active` int(11) NOT NULL default '1',
  `image` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`)
) ;
");
if(!$insert_data_452){
$mysqltext .= txt("text_cat",0);
$err = "no";
}else{
$mysqltext .= txt("text_cat",1);
}

$insert_data_453 = mysql_query("
UPDATE `opitions` SET `folder` = 'templates/islam15' WHERE `id` =1 ;
");
if(!$insert_data_453){
$mysqltext .= txt("opitions",0);
$err = "no";
}else{
$mysqltext .= txt("opitions",1);
}

//##### END UPGRADE #####//

$mysqltext .= "</ul>";


echo $mysqltext;

if($err != "no"){
echo "<br /><br /><div class='msg'>تمت الترقية بنجاح ... شكرا لإستخدامك سكربت المكتبة الاسلامية الشامله الاصدار السادس<br /><br />
اختر وجهتك<br /><a href='index.php'>للرئيسية</a> - <a href='admincp/index.php'>لوحة التحكم</a><br /><br /><br />
<br /><br />
ليس هناك شروط لاستخدام السكربت إلا أن لايتم استخدام السكربت في شيء محرم وأنا بريء ممن يستخدم السكربت في اغراض غير شرعيه والله حسيبه<br /><br />

والله ولي التوفيق
</div><br /><br />";
}else{
echo "<br /><br /><div class='msg'>
هناك مشكلة في الترقية ... يرجى نسخ الرسالة الموجوده بالصفحة وإرسالها لصفحة الدعم الفني من هنا<br />
<a target='_blank' href='http://www.nwahy.com/box'>http://www.nwahy.com/box</a><br />
</div><br /><br />";
}

}



echo "<br /><br />
<p style='text-align:center;'>Powered by : Islamec magazine V6 <a href='http://www.nwahy.com/'>nwahy</a>, <a href='http://www.bwady.com/'>bwady</a></p>
</div>
</body>
</html>";
?>