Exemplo n.º 1
0
 function __construct($user = null)
 {
     global $_js_helper, $wp;
     $_js_helper->setState(true);
     $this->helper = $_js_helper;
     if (is_object($user)) {
         $this->user = $user;
     } else {
         $this->user = get_user_by('id', $user);
     }
     if (!$this->user) {
         $this->user = get_user_by('login', urldecode($user));
     }
     if ($this->user) {
         $this->prepareUser();
     }
     $table = new JS_Table('users');
     $table->add_column(array('field' => 'token', 'type' => 'VARCHAR(100)', 'null' => true));
     $table->render_table();
 }
Exemplo n.º 2
0
 function create_db_table()
 {
     $tables = array('jobs_relationships' => array(array('field' => 'id', 'type' => 'int(11)', 'null' => false, 'extra' => 'auto_increment', 'default' => null, 'key' => 'PRI'), array('field' => 'job_id', 'type' => 'int(11)', 'null' => false, 'extra' => null, 'default' => null, 'key' => null), array('field' => 'applicant_id', 'type' => 'int(11)', 'null' => false, 'extra' => null, 'default' => null, 'key' => null), array('field' => 'jobsboss_id', 'type' => 'int(11)', 'null' => true, 'extra' => null, 'default' => null, 'key' => null), array('field' => 'snap_date', 'type' => 'datetime', 'null' => false, 'extra' => null, 'default' => '0000-00-00 00:00:00', 'key' => null), array('field' => 'snap_status', 'type' => 'varchar(50)', 'null' => false, 'extra' => null, 'default' => 'pending', 'key' => null), array('field' => 'timesnap_id', 'type' => 'int(11)', 'null' => true, 'extra' => null, 'default' => null, 'key' => null)));
     foreach ($tables as $table_name => $columns) {
         $table_object = new JS_Table($table_name);
         foreach ($columns as $column) {
             $table_object->add_column($column);
             $table_object->render_table();
         }
     }
 }