public function createParent()
 {
     $input = Input::all();
     if (Input::hasFile('profilepic')) {
         $input['profilepic'] = $this->filestore(Input::file('profilepic'));
     }
     $input['dob'] = date('Y-m-d H:i:s', strtotime(Input::get('dob')));
     $input['collegeid'] = Session::get('user')->collegeid;
     $input['collegename'] = Admin::where('collegeid', '=', Session::get('user')->collegeid)->first()->collegename;
     //$input['collegeid']="dummy";
     //$input['collegename']="dummy";
     $user = new User();
     $user->email = $input['email'];
     $user->password = Hash::make($input['password']);
     $user->collegeid = $input['collegeid'];
     $user->flag = 3;
     $user->save();
     $input['loginid'] = $user->id;
     $removed = array('_token', 'password', 'cpassword');
     foreach ($removed as $k) {
         unset($input[$k]);
     }
     Parent::saveFormData($input);
     return $input;
 }
 function __construct()
 {
     Parent::__construct();
     Validator::extend('total', function ($attribute, $value, $parameters, $validator) {
         $value != 100 ? $check = false : ($check = true);
         return $check;
     });
 }
Example #3
0
 public function bRegisterUser($reg_email, $reg_fname, $reg_aname)
 {
     # get the connection
     $mysqli = Parent::connect();
     # get password generator
     $oPassword = Singleton::getInstance('Password');
     # get a random password
     $random_password = $oPassword->encryptPassword();
     # check if succeed otherwise try again
     if (!$random_password) {
         $random_password = $oPassword->randomPassword();
     }
     #lowercase email
     $slEmail = strtolower($reg_email);
     if ($sStmt = $mysqli->prepare("INSERT INTO `users`(`username`, `password`, `voornaam`, `achternaam`, `email`) VALUES (?,?,?,?,?)")) {
         # bind
         $sStmt->bind_param('sssss', $reg_fname, $random_password, $reg_fname, $reg_aname, $reg_email);
         # execute
         if ($sStmt->execute()) {
             User::sendRegistrationMail($reg_email, $random_password);
         } else {
             echo "een paar fouten";
         }
     }
 }
Example #4
0
 public function getFieldsInfoFromTemplate(Crawler $crawler, $bundle)
 {
     $collections = Parent::getFieldsInfoFromTemplate($crawler, $bundle);
     foreach ($collections as $index => $collection) {
         $collections[$index] = $this->addFieldTabTitle($index, $collection, $bundle);
     }
     return $collections;
 }
Example #5
0
 public function __construct($id, $link, $urlPath, $title)
 {
     Parent::__construct();
     $this->id = $id;
     $this->link = $link;
     $this->urlPath = $urlPath;
     $this->title = $title;
 }
 public function validateMembership($id)
 {
     $membership = Parent::where('membership_id', $id)->first();
     if ($membership) {
         return $membership;
     }
     return false;
 }
 public function validateCode($code)
 {
     $discount = Parent::where('code', $code)->first();
     if ($discount) {
         return $discount;
     }
     return false;
 }
Example #8
0
 public function __construct(array $properties = [], array $options = [])
 {
     Parent::__construct($properties, $options);
     $split_foreign = explode(':', $this->_properties['foreign_id']);
     if (sizeof($split_foreign) == 2) {
         $this->foreign_type = $split_foreign[0];
         $this->foreign_id = $split_foreign[1];
     }
 }
 /**
  * Constructor for story objects. Sets controller property.
  *
  * @since 0.1.0
  * @access public
  * @param object $post Story post object.
  * @param string $context Context, to allow for partial mapping.
  **/
 public function __construct($post, $context = '', $controller = null)
 {
     Parent::__construct($post, $controller);
     $this->controller->map_story_basics();
     if ('griditem' !== $context) {
         $this->controller->set_ordered_tag_list();
         $this->controller->map_full_story();
     }
 }
 /**
  * Constructor for Programme Round objects. If available, the constructor can use
  * a controller that's already there.
  *
  * @since 0.1.0
  * @access public
  * @param object $post Collaboration post object.
  * @param object $controller optional CollaborationController object.
  **/
 public function __construct($post, $context = '', $controller = null)
 {
     Parent::__construct($post);
     $this->controller->map_programme_round_basics();
     if ('griditem' === $context) {
         $this->controller->set_block_paragraph_text();
         $this->controller->set_cta_colour();
     }
 }
Example #11
0
 public function canUploadMedias($ref, $ref_id)
 {
     if (method_exists('App\\Controller\\AppController', 'canUploadMedias')) {
         return Parent::canUploadMedias($ref, $ref_id);
         //return Parent::canUploadMedias($ref, $ref_id);
     } else {
         return false;
     }
 }
 public function initialize(array $parameters = array())
 {
     $parentInitialize = Parent::initialize($parameters);
     Braintree\Configuration::reset();
     Braintree\Configuration::environment($this->getTestMode());
     Braintree\Configuration::merchantId($this->getMerchantId());
     Braintree\Configuration::publicKey($this->getPublicKey());
     Braintree\Configuration::privateKey($this->getPrivateKey());
     return $parentInitialize;
 }
Example #13
0
 public function save(array $options = array())
 {
     if ($this->original_height === null || $this->original_width === null || $this->original_size === null) {
         $original_size = getimagesize($this->original_path);
         $this->original_width = $original_size[0];
         $this->original_height = $original_size[1];
         $this->original_size = filesize($this->original_path);
     }
     Parent::save($options);
 }
Example #14
0
 function recursiveRender()
 {
     $inv = $this->add('xepan\\commerce\\Model_SalesInvoice');
     $inv->setOrder('due_date', 'asc');
     $inv->addCondition('status', 'Due');
     $inv_count = $inv->count()->getOne();
     $this->view->template->trySet('count', $inv_count);
     $this->view->template->trySet('title', 'Unpaid Invoices');
     $this->view->template->trySet('icon-class', 'fa fa-shopping-cart');
     $this->view->js('click')->_selector('#' . $this->view->name)->univ()->frameURL("Unpaid Invoice", $this->api->url('xepan_commerce_salesinvoice', ['status' => 'Due']));
     return Parent::recursiveRender();
 }
Example #15
0
 function recursiveRender()
 {
     $customer = $this->add('xepan\\commerce\\Model_Customer');
     $customer->addExpression('online_unpaid_order')->set($customer->refSQL('QSPMaster')->addCondition('status', 'OnlineUnpaid')->count());
     $customer->addCondition('online_unpaid_order', '>', 0);
     $count = $customer->count()->getOne();
     $this->view->template->trySet('count', $count);
     $this->view->template->trySet('title', 'Online Unpaid Customers');
     $this->view->template->trySet('icon-class', 'fa fa-user');
     $this->view->js('click')->_selector('#' . $this->view->name)->univ()->frameURL("Online Unpaid Customers", $this->api->url($this->customer_v_page->getUrl()));
     return Parent::recursiveRender();
 }
 public function update(Request $request, $id)
 {
     $this->wish = Wish::find($id);
     $this->wish->fill($request->all());
     if (Input::hasFile('picture')) {
         File::delete(public_path('img/wishes/') . $this->wish->picture);
         $this->wish->picture = $this->uploadImage(Input::file('picture'));
     }
     $this->wish->url = Parent::addScheme($request->url);
     $this->wish->save();
     return redirect()->route('wishes.index');
 }
Example #17
0
 function recursiveRender()
 {
     $odr = $this->add('xepan\\commerce\\Model_SalesOrder');
     $odr->setOrder('due_date', 'asc');
     $odr->addCondition('status', 'OnlineUnpaid');
     $odr_count = $odr->count()->getOne();
     $this->view->template->trySet('count', $odr_count);
     $this->view->template->trySet('title', 'Online Unpaid Orders');
     $this->view->template->trySet('icon-class', 'fa fa-shopping-cart');
     $this->view->js('click')->_selector('#' . $this->view->name)->univ()->frameURL("Unpaid Orders", $this->api->url('xepan_commerce_salesorder', ['status' => 'OnlineUnpaid']));
     return Parent::recursiveRender();
 }
Example #18
0
 function recursiveRender()
 {
     $so = $this->add('xepan\\commerce\\Model_SalesOrder');
     $so->setOrder('created_at', 'desc');
     if (isset($this->report->start_date)) {
         $so->addCondition('created_at', '>', $this->report->start_date);
     }
     if (isset($this->report->end_date)) {
         $so->addCondition('created_at', '<', $this->app->nextDate($this->report->end_date));
     }
     $this->grid->setModel($so);
     $this->grid->template->trySet('heading', 'Due Orders');
     $this->grid->addPaginator('5');
     return Parent::recursiveRender();
 }
Example #19
0
 public function get_no_parents()
 {
     // fetch pages without parents
     $this->db->select('id, title');
     $this->db->where('parent_id', 0);
     $pages = Parent::get();
     // Return key => value pair array
     $array = array(0 => 'No Parent');
     if (count($pages)) {
         foreach ($pages as $page) {
             $array[$page->id] = $page->title;
         }
     }
     return $array;
 }
Example #20
0
 public static function isAppAuthorizedTo($provider)
 {
     if (!Parent::isConnectedWith($provider)) {
         return false;
     }
     try {
         $adapter = Self::getAdapter($provider);
         $adapter->getUserProfile();
     } catch (Exception $e) {
         if ($e->getCode() == 5) {
             return false;
         }
         throw $e;
     }
     return true;
 }
Example #21
0
 function recursiveRender()
 {
     $inv = $this->add('xepan\\commerce\\Model_SalesInvoice');
     $inv->setOrder('due_date', 'asc');
     $inv->addCondition('status', 'Due');
     if (isset($this->report->start_date)) {
         $inv->addCondition('created_at', '>', $this->report->start_date);
     }
     if (isset($this->report->end_date)) {
         $inv->addCondition('created_at', '<', $this->app->nextDate($this->report->end_date));
     }
     $this->grid->setModel($inv);
     $this->grid->template->trySet('heading', 'Due Invoices');
     $this->grid->addPaginator(5);
     return Parent::recursiveRender();
 }
Example #22
0
 function recursiveRender()
 {
     $start_date = $this->report->start_date;
     $end_date = $this->app->nextDate($this->report->end_date);
     $salesinvoice_m = $this->add('xepan\\commerce\\Model_SalesInvoice');
     $salesinvoice_m->setOrder('created_at', 'desc');
     $salesinvoice_m->addExpression('monthyear')->set('DATE_FORMAT(created_at,"%M %Y")');
     $salesinvoice_m->addExpression('count', 'count(*)');
     $salesinvoice_m->_dsql()->group('monthyear');
     if ($this->report->start_date) {
         $salesinvoice_m->addCondition('created_at', '>=', $start_date);
     }
     if ($this->report->end_date) {
         $salesinvoice_m->addCondition('created_at', '<=', $end_date);
     }
     $this->grid->setModel($salesinvoice_m);
     $this->grid->addPaginator('5');
     $this->grid->js('click')->_selector('.xepan-invoice-count')->univ()->frameURL('Invoice', [$this->api->url('xepan_commerce_salesinvoice'), 'from_date' => $start_date, 'to_date' => $end_date, 'monthyear' => $this->js()->_selectorThis()->closest('[data-id]')->data('id')]);
     return Parent::recursiveRender();
 }
Example #23
0
 public function __get($key)
 {
     $value = Parent::__get($key);
     if ($value === null) {
         // No lowest-level setting?
         if ($this->optionable_type == 'App\\Models\\SiteComponents\\Location') {
             // Load the default settings
             $className = class_name($this);
             return $className::doesntHave('optionable');
         } else {
             if ($this->optionable_type == 'App\\User') {
                 // Load the Location settings
                 $camelClass = camel_case(class_name($this));
                 return $this->optionable->location()->first()->{$camelClass}->{$key};
             } else {
                 // Load the User settings
                 $camelClass = camel_case(class_name($this));
                 return $this->optionable->user()->first()->{$camelClass}->{$key};
             }
         }
     }
     return $value;
 }
Example #24
0
 public function __construct(array $properties = [], array $options = [])
 {
     Parent::__construct($properties, $options);
     if ($this->activities) {
         $this->_properties['first_user_id'] = $this->activities[0]['first_user_id'];
         $this->_properties['second_user_id'] = $this->activities[0]['second_user_id'];
         $this->_properties['type'] = $this->activities[0]['type'] . '-aggregated';
         $this->_properties['time'] = $this->activities[0]['time'];
         $this->_properties['first_user_record'] = [0, 0, 0];
         $this->_properties['second_user_record'] = [0, 0, 0];
         $this->_properties['has_scored'] = false;
         //both currently dependent on generateCharts being called, no good
         $this->_properties['has_no_scored'] = false;
         usort($this->activities, function ($a, $b) {
             return strtotime($a['time']) - strtotime($b['time']);
         });
         foreach ($this->activities as $key => $activity) {
             $this->activities[$key] = new FeedItem($this->activities[$key]);
         }
         //set first user id/name/imagee
         //set second user id/name/image
         //in aggregated feeditem
     }
 }
 public function __construct()
 {
     Parent::__construct();
 }
Example #26
0
 /**
  * Constructor.
  *
  * @param string $appId
  * @param string $appSecret
  * @param string $format    'json', 'xml' or 'simple_xml'
  */
 public function __construct($appId, $appSecret, $format = 'json')
 {
     Parent::__construct($appId, $appSecret, $format = 'json');
 }
Example #27
0
 public function __construct($router)
 {
     $this->_model_object = new TestModel();
     Parent::__construct($router);
 }
 public function __construct(Router $router)
 {
     Parent::__construct($router);
     $this->_validate_route();
 }
Example #29
0
 public function generateHeritageJson($query, $sexe)
 {
     $results = Parent::getSelect($query)->fetchAll(PDO::FETCH_ASSOC);
     $sexs = explode(",", $sexe);
     $collection = array();
     foreach ($sexs as $sex) {
         $collection[$sex] = array();
     }
     // $collection = array("man" => array(), "woman" => array());
     if (!empty($results)) {
         foreach ($results as $row) {
             $sex = $row['sex'];
             $age = $row['age'];
             $country = $row['country'];
             $size = $row['num'];
             if (array_key_exists($age, $collection[$sex])) {
                 $collection[$sex][$age][$country] = $size;
             } else {
                 $addCouSize = array($country => $size);
                 $collection[$sex][$age] = $addCouSize;
             }
         }
         // create the heritage Json
         $data = '{"name":"data", "children":[';
         if ($collection) {
             foreach ($collection as $sex => $sex_value) {
                 $data = $data . '{"name":"' . $sex . '","children":[';
                 foreach ($sex_value as $age => $age_value) {
                     $data = $data . '{"name":"' . $age . '","children":[';
                     foreach ($age_value as $country => $country_value) {
                         $data = $data . '{"name":"' . $country . '","size":' . $country_value . '},';
                     }
                     $data = substr($data, 0, -1) . ']},';
                 }
                 $data = substr($data, 0, -1) . ']},';
             }
             $data = substr($data, 0, -1) . ']}';
             echo json_encode($data);
         }
     } else {
         echo null;
     }
 }
Example #30
0
 /**
  * Remove the specified parent from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Parent::destroy($id);
     return Redirect::route('parents.index');
 }