Example #1
0
function migrateResourceplan($class)
{
    $ss = new Sqlite(null, "resourceplan");
    $r = $ss->getTable();
    if ($r) {
        return;
    }
    $sq = new Sqlite(null, 'clienttemplate');
    $cres = $sq->getTable();
    if ($class) {
        $nsq = new Sqlite(null, "{$class}template");
        $dres = $nsq->getTable();
        $total = lx_array_merge(array($cres, $dres));
    } else {
        $total = $cres;
    }
    foreach ($total as $t) {
        $string = $ss->createQueryStringAdd($t);
        $addstring = "insert into resourceplan {$string};";
        $ss->rawQuery($addstring);
    }
}