| 39 | | error_reporting(E_ALL); |
| 40 | | define("APP_DEBUG",false); |
| 41 | | define("noStartup",true); |
| 42 | | include("../../../install/install_include.php"); |
| 43 | | include("../../../include/session.php"); |
| 44 | | |
| 45 | | $phpbmsSession = new phpbmsSession; |
| 46 | | $success = $phpbmsSession->loadDBSettings(false); |
| 47 | | include_once("include/db.php"); |
| 48 | | $db = new db(false); |
| 49 | | $db->stopOnError = false; |
| 50 | | $db->showError = false; |
| 51 | | $db->logError = false; |
| 52 | | |
| 53 | | if($success !== false){ |
| 54 | | |
| 55 | | if(!$db->connect()) |
| 56 | | $thereturn = "Could Not Establish Connection To MySQL Server: Check server, user name, and password."; |
| 57 | | else { |
| 58 | | if(!$db->selectSchema()) |
| 59 | | $thereturn = "Database (schema) ".MYSQL_DATABASE." could not be selected"; |
| 60 | | else { |
| 61 | | |
| 62 | | |
| 63 | | // ENTER YOUR MODULE NAME HERE |
| 64 | | $thereturn = "Recurring Invoice Installation\n"; |
| 65 | | $thereturn .= "______________________________\n"; |
| 66 | | |
| 67 | | //MAKE SURE THERE IS A createtables.sql FILE |
| 68 | | //which houses all your SQL create statements |
| 69 | | // for any tables you will create. |
| 70 | | $tempreturn = createTables($db,"createtables.sql"); |
| 71 | | |
| 72 | | if($tempreturn === true){ |
| 73 | | |
| 74 | | $thereturn.= "Done Creating Tables \n"; |
| 75 | | |
| 76 | | |
| 77 | | // NEXT, DEFINE AN ARRAY OF TABLE NAMES |
| 78 | | // for any tables that need initial data populated. (including existing tables) |
| 79 | | // for each table, make sure there |
| 80 | | // is a corresponding SQL file |
| 81 | | // with insert statements for all the records needing to be imported |
| 82 | | |
| 83 | | /* |
| 84 | | Need to add entries for tabledefs, tablecolumns, tablefindoptions, tableoptions, and |
| 85 | | tablesearchablefields |
| 86 | | */ |
| 87 | | $tables = array( |
| 88 | | "menu", |
| 89 | | "modules", |
| 90 | | "roles", |
| 91 | | "scheduler", |
| 92 | | "tabledefs", |
| 93 | | "tablecolumns", |
| 94 | | "tableoptions", |
| 95 | | "tablefindoptions", |
| 96 | | "tablesearchablefields", |
| 97 | | "tabs", |
| 98 | | "users", |
| 99 | | ); |
| 100 | | foreach($tables as $table){ |
| 101 | | |
| 102 | | $failure = false; |
| 103 | | $tempreturn = importData($db,$table); |
| 104 | | $thereturn .= $tempreturn; |
| 105 | | if(!strpos($tempreturn,"complete.") === false){ |
| 106 | | $failed = true; |
| 107 | | } |
| 108 | | |
| 109 | | }//end foreach |
| 110 | | |
| 111 | | |
| 112 | | //MAKE SURE TO set the done message for your module. |
| 113 | | if(!$failure){ |
| 114 | | $thereturn .= "______________________________________\n"; |
| 115 | | $thereturn .= "Done Installing Recurring Invoice Data\n"; |
| 116 | | } |
| 117 | | } else |
| 118 | | $thereturn = $tempreturn; |
| 119 | | } |
| 120 | | } |
| 121 | | } else |
| 122 | | $thereturn = "Could not access settings.php"; |
| 123 | | |
| 124 | | |
| 125 | | header('Content-Type: text/xml'); |
| 126 | | ?><?php echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'; ?> |
| 127 | | <response><?php echo $thereturn?></response> |
| | 39 | $theModule = new installModuleAjax($this->db, $this->phpbmsSession, "../modules/recurringinvoices/install/"); |
| | 40 | $theModule->tables = array( |
| | 41 | "menu", |
| | 42 | "modules", |
| | 43 | "roles", |
| | 44 | "scheduler", |
| | 45 | "tabledefs", |
| | 46 | "tablecolumns", |
| | 47 | "tableoptions", |
| | 48 | "tablefindoptions", |
| | 49 | "tablesearchablefields", |
| | 50 | "tabs", |
| | 51 | "users", |
| | 52 | ); |